Hello,
In va02/01(uses SAPMV45A) I have created a new button which fills up profit center for all inserted rows using the first row. My problem here is that it only fills up the ones actually seen on the screen. So I debugged a little and found out that at screen 4900 it loops with control TCTRL_U_ERF_AUFTRAG. But it only loops as many times as many rows are seen on the screen. So say, I can see 9 items, but there's 30. Then it only fills up that 9 rows, because my module is inside the loop at PAI, after the button is pressed.
Ok, I hacked it a little bit so that the top_line would equal current_line + 1. In that way I put the same module in PBO and fill another 9 rows, which gives me a total of 18 rows (2 times the rows I can see on my screen).
I can fill up the fields in xvbap, which then show me the fields on screen, but they are not actually filled.
Soo.. at screen 4900 my code goes:
LOOP WITH CONTROL TCTRL_U_ERF_AUFTRAG.
MODULE VBAP_UNTERLEGEN.
*{ INSERT
MODULE ZFCODE_FILL.
*} INSERT
....
ENDLOOP.
Here is MODULE ZFCODE_FILL.
if fcode = 'FILL' and not vbap-posnr is initial.
data: prctr type prctr.
read table xvbap index 1.
prctr = xvbap-prctr.
if vbap-prctr is initial.
vbap-prctr = prctr.
endif.
LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'VBAP-PRCTR'.
SCREEN-REQUEST = 1.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
TCTRL_U_ERF_AUFTRAG-TOP_LINE = TCTRL_U_ERF_AUFTRAG-CURRENT_LINE + 1. (for PAI module)
endif.
How can I loop TCTRL_U_ERF_AUFTRAG so that all rows are looped not only the ones actually shown on screen?