Step-loops in Module Pool Programming


4. Flow-logic for Step-loops

Once the processing for the records to be displayed is done, then in the flow logic of the screen 0100 which we have designed we need to include the code shown below:

It’s important to note that the LOOP must exist for every step loop, both in the PBO and the PAI processing block. During the loops, the contents of the step loop are transported back and forth between identically-named fields of the ABAP program and the screen. Note that step loop fields defined with Dictionary reference must be defined in the ABAP program, as before, with TABLES as interface work areas. The order the step loops are processed in the individual loops of the flow logic depends on the step loop order on the screen. The order on the screen depends primarily on the lines and secondarily on the rows. The system fields SY-STPL and SY-LOOPC are also filled within the loops.

In the PBO module we have looped the cursor C from N1 to N2 since we want to display on screen only as many as rows as many number of records are there to be present on the screen. Thus if there are only 2 records then N1 = 1 and N2 =2; so that 2 step loops appear on the screen. This would ensure dynamicity of the step-loops.

The table structure for the records to be displayed in step-loops would be as follows:

a.     The module ‘STATUS_0100’ would contain the PF status and PF Title to be maintained in the screen.

            In the PF status needs to be activated for function keys “BACK”, “PGUP” and “PGDN” so that these buttons on the keyboard can be used and so also on the Radio-frequency (RF) application handset.

b.    The module ‘PGUP_DOWN’ contains the logic for navigation from one page to another depending on the number of records to be displayed.

This would basically contain the logic to hide/show the buttons for page up and down depending on the records which overflow on the page. For example, on first page the button for page up would be hidden and on last page the button for page down would be hidden.

c.     The module ‘TRANSP_ITAB_OUT’ contains the logic to transfer the contents of the internal table into the step-loop screen elements during PBO processing.

d.    The module ‘TRANSP_ITAB_IN’ contains the logic to transfer the contents from internal table into the step-loop screen elements during PAI processing.

e.     The module ‘USER_COMMAND_0100’ would help to handle the navigation and processing at the click on the buttons Page Up and Page Down. Please see source code extract for further details for handling the button clicks.

6. Source Code

Click here for the ABAP code that needs to be implemented. The screen 0100 needs to be designed as shown in section 3 above prior to activation of the program.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image