3

I have a problem where not all of the rows of my table control are being displayed in ABAP 740 SP13.

For example, I have a table with these two rows:

Values of LT_TRANSFER_CONFIRM_TC

This is the state of the table where this code is executed:

CALL SCREEN 0300 STARTING AT 10 5
                 ENDING AT 85 16.

This goes immediately into my Process Before Output code:

*----------------------------------------------------------------------*
*                        PROCESS BEFORE OUTPUT                         *
*----------------------------------------------------------------------*
PROCESS BEFORE OUTPUT.
  MODULE status_0300.
  LOOP AT lt_transfer_confirm_tc
         INTO ls_transfer_confirm_tc
         WITH CONTROL tc_transfer_confirm
         CURSOR tc_transfer_confirm-current_line.
    MODULE tc_transfer_confirm_get_lines.
  ENDLOOP.

where status_0300 is:

MODULE status_0300 OUTPUT.
  SET PF-STATUS 'STATUS_0300'.
  " Confirm Material Number Count
  SET TITLEBAR 'T05'.
ENDMODULE.

and is tc_transfer_confirm_get_lines:

MODULE tc_transfer_confirm_get_lines OUTPUT.
  g_tc_transfer_confirm_lines = sy-loopc.
ENDMODULE.

At the end of the first iteration of the loop in my PBO, the ls_transfer_confirm_tc value matches with the first row of the lt_transfer_confirm_tc table, tc_transfer_confirm-current_line is 1, and g_tc_transfer_confirm_lines (in tc_transfer_confirm_get_lines) is set to 10.

The second iteration of the loop never processes. The cursor hops from ENDLOOP (from the first iteration) to the line saying CURSOR tc_transfer_confirm-current_line. (as it is the end of the LOOP statement), and finally to ENDLOOP without stopping on the MODULE tc_transfer_confirm_get_lines line. At the end of this loop, ls_transfer_confirm_tc is initial, tc_transfer_confirm-current_line is still 1, and g_tc_transfer_confirm_lines is still 10. All the while, the lt_transfer_confirm_tc table still has two rows in it as shown in the image at the top of this question.

At this point, the screen is displayed as follows:

Table Control displayed by SCREEN 0300

I'm not sure why this loop doesn't process the second row of my table, and therefore doesn't display it on the screen.

Thanks.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
gkubed
  • 1,849
  • 3
  • 32
  • 45

1 Answers1

2

The problem was that I was never setting the value of tc_transfer_confirm-lines, so that the value was always 1.

The following code runs successfully:

*----------------------------------------------------------------------*
*                        PROCESS BEFORE OUTPUT                         *
*----------------------------------------------------------------------*
PROCESS BEFORE OUTPUT.
  MODULE status_0300.
  MODULE tc_trnsfr_cnfrm_change_tc_attr.
  LOOP AT lt_transfer_confirm_tc
         INTO ls_transfer_confirm_tc
         WITH CONTROL tc_transfer_confirm
         CURSOR tc_transfer_confirm-current_line.
    MODULE tc_transfer_confirm_get_lines.
  ENDLOOP.

With the new module tc_trnsfr_cnfrm_change_tc_attr:

*&SPWIZARD: OUTPUT MODULE FOR TC 'TC_TRANSFER_CONFIRM'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
MODULE tc_trnsfr_cnfrm_change_tc_attr OUTPUT.
  DESCRIBE TABLE lt_transfer_confirm_tc LINES tc_transfer_confirm-lines.
ENDMODULE.
gkubed
  • 1,849
  • 3
  • 32
  • 45