Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

step loops

Former Member
0 Likes
1,170

Hi

I want code about step loops. Here in PBO which code should be and what is the code of PAI.

please give answer as early as possible.

thankyou

3 REPLIES 3
Read only

Former Member
0 Likes
666

hi,

Refer to this program DEMO_DYNPRO_STEP_LOOP

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbacac35c111d1829f0000e829fbfe/content.htm

Regards

Kiran Sure

Read only

Former Member
0 Likes
666

Hello,

I suggest you to read the following: [http://help.sap.com/saphelp_47x200/helpdata/en/d1/801c13454211d189710000e8322d00/frameset.htm].

Regards,

Read only

Former Member
0 Likes
666

hi

STEP LOOPS

Step Loops are type of screen table . Step loops are repeated blocks of field in a screen. Each block contains one or more fields and these blocks are repeated. Step loops aren’t like actual table. You can scroll vertically but not horizontally. Three steps are associated with creation of step loops:

• Creation of step loops on screen, which includes declaring fields on the screen and then defining the step, loops for these fields.

• Passing data to the step loop is exactly similar to the passing of data to table controls.

• In step loop, you don’t need to define the step loop as such in the module pool program but the cursor needs to be defined in the program.

Types of Step Loops

• Static – Static Step Loop (SSL) have fixed size that cannot be changed during the runtime. If user resizes the window, the size of the static step loop is not changed.

• Dynamic – Dynamic Step Loop (DSL) is variable in size. When the user resizes the window, the system increases or decreases the number of the step loop blocks.

You can have only one dynamic step loop and can have as many static loops in your transaction.

Programming with the Static and dynamic step loop is exactly same. For the system or for the user it doesn’t make any difference whether it is static or dynamic step loop. Only attribute, which you fix during designing of the step loop, is type attribute for step loop F for fixed i.e static and V for variable i.e. dynamic.

Writing code for Step Loop in the flow logic.

PBO.

Loop at itab cursor cl.

Module set.

Endloop.

PAI.

Loop at itab.

Endloop.

Empty loop is must for both table control and step loop

LOOP AT statement for step loops and Table controls is similar. Loop At statement transfers the data to screen table. You need to have the Module to assign the values for the screen table.

In module pool program you need to define the cursor.

Date: CL TYPE i.

Cursor parameter tells which line of step loop display should start.

“Module Set” in module pool program assigns the values to step loop fields, which is similar to table controls.

Refer to this program DEMO_DYNPRO_STEP_LOOP

Check with this link

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbacac35c111d1829f0000e829fbfe/content.htm

*************************************************************8888

see this link for more help.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbacac35c111d1829f0000e829fbfe/content.htm

see this code.

PROGRAM ZBHSTEPLOOP.

DATA:OKCODE1 LIKE SY-UCOMM,

OKCODE2 LIKE SY-UCOMM.

TABLES:LFA1,EKKO.

*DATA LIFNR LIKE LFA1-LIFNR.

DATA:BEGIN OF ITAB OCCURS 0,

MANDT LIKE EKKO-MANDT,

EBELN LIKE EKKO-EBELN,

ERNAM LIKE EKKO-ERNAM,

END OF ITAB.

DATA TOPLINE TYPE I VALUE 1.

MODULE USER_COMMAND_1000 INPUT.

CASE OKCODE1.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'NEXT'.

SET SCREEN 1001.

SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

LIFNR = LFA1-LIFNR.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

MODULE

USER_COMMAND_1001 INPUT.

CASE OKCODE2.

WHEN 'BACK'.

SET SCREEN 1000.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TIT1'.

ENDMODULE. " STATUS_1000 OUTPUT

MODULE STATUS_1001 OUTPUT.

SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TIT2'.

ENDMODULE. " STATUS_1001 OUTPUT

MODULE MOVE_DATA OUTPUT.

EKKO-MANDT = ITAB-MANDT.

EKKO-EBELN = ITAB-EBELN.

EKKO-ERNAM = ITAB-ERNAM.

ENDMODULE. " MOVE_DATA OUTPUT

FLOW LOGIC:

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

LOOP AT ITAB CURSOR TOPLINE.

MODULE MOVE_DATA.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

LOOP AT ITAB.

ENDLOOP.

************************************************************

STEP LOOP

The STEP LOOP are the predecessor of TABLE CONTROL they are used to

display tabular data on the screen.They are repeated sequence of blocks of screen element.In a step loop number of screen elements

are combined together to form a loop block.There are 2 types of step loops

1)fFxed Size 2)Variable Size..

In a fixed size loop the number of loop blocks shown in the screen is fixed,while in case of variable size step loop the number of blocks will change dynamically

according to the size of the screen.There could be only one variable step loop per screen and unlimited fixed size step loops per screen.

A step loop can extend more than one line on the screen(see Table Control).A vertical scroll bar is automatically created to show step loops on he screen.

Step loops have no name. We use LOOP ...ENDLOOP to program step loops in a screen in both PBO and PAI.

Since the number of loop blocks in variable step loops can change the number of loop blocks at any moment is placed by the system in system field SY-LOOPC

and the current step loop pass number is placed in system field SY-STEPL .

Loop Type attribute is used to specify the type of step loop and Loop Count attribute is used to specify the number of step loop blocks that will be displayed on the screen at a time.

Step Loop Screen Creation

We create step loop in the screen painter(SE51). First we define the screen elements that will be part of the step loop on the screen ,they may extend to more than one line.Select all the elements as one group.Goto Edit menu and select Grouping>Step Loop>Define.

To define a step loop as variable or fixed.goto Edit>Grouping>Step Loops-->Fix or Variable.

To edit the Step Loop click on the border of the block and goto

Edit>Grouping>Step Loop here we can use define/undefine(delete)variable fix options.

Once created we have to program step loops through screen key word LOOP...ENDLOOP in PBO and PAI as these events are used to transfer back and forth the data from the ABAP program.

STEP LOOP Coding

We use two flavours of LOOP ... ENDLOOP in screen flow logic to program the step loops.We have to program both in PBO and PAI so that transfer of data can take place between screen and abap program.

1) LOOP

MODULE fill_data

ENDLOOP.

here in PBO a module should be called that will transfer the data to the

screen fields. In PAI the module call is not required only the empty LOOP..ENDLOOP will do or we can call a module to write the data to an internal table.In this method there is no automatic scrolling we have to program it in ABAP.

2) LOOP AT int_table INTO wa CURSOR line_numberFROM n1 TO n2

ENDLOOP.

Here in PBO a module call is not required to fill the step loop screen fields as the data is copied to the workare wa and from there to screen fields in step loop automatically. INTO wa is not required if we use the int_table declared with a header line.

In PAI the addition AT int_table is also required for automatic scrolling.

The parameter CURSOR line_number which is of TYPE I is used to specify

the that will be the first to be displayed,it is filled in the ABAP program.

NOTE:

1) It is preferable to use TABLE CONTROL instead of STEP LOOPS.

2) It is preferable to use LOOP AT int_table instead of plain LOOP..ENDLOOP.

Check this SAP help document for step loops.

http://help.sap.com/saphelp_nw04/helpdata/en/d1/801c13454211d189710000e8322d00/content.htm

****************************************************

Regards

Vasu