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 loop

Former Member
0 Likes
2,321

anybody can give me simple example about step loop in screen painter.

tks in advanced !

5 REPLIES 5
Read only

Former Member
0 Likes
1,313

Hi,

Step loops are considerably less flexible than their replacement, table controls.

Step Loops

You can group screen elements together into a step loop. A step loop is a repeated series of loop blocks. A loop block consists of one or more loop lines of graphical screen elements. You can define a loop block as fixed or variable.

In a fixed loop, the lower limit of the loop area always remains as originally defined. For a variable loop, the number of repetitions is adjusted dynamically in the screen program to suit the size of the current window. In order to be able to react to the variable loop size, the system always places the current number of loop blocks in the system field SY-LOOPC. If the screen includes several loop blocks, you can define only one of these as variable.

When you execute a screen with several loop blocks, the online processor runs through this "screen table" line by line.

Do not use the steploop method to format lists. Use a report program instead.

The step loop procedures in the alphanumeric display are different. For further information, see Creating and Editing Steploops in Alphanumeric Mode.

Creating a Steploop

Open a screen in the layout editor.

In one or more lines, create the elements you want to repeat.

Select all the elements on the desired line(s) as a group.

Choose Edit ® Grouping ® Steploop ® Define.

Your element lines now make up a single steploop block. The block includes the original elements with their attributes and a predefined number of repetition blocks. Each repetition contains a copy of the first block without attributes. The repetition blocks are consecutively numbered, so that you can establish a reference to a particular line.

Editing a Step Loop

To edit a loop block as a complete unit, click on the loop's border handles. By choosing Edit ® Grouping ® Steploop, you can manipulate the block using functions such as Define, Variable or Fix, or Undefine.

To remove an element from a block, click on the element and choose Delete. If you delete all the elements, the block is deleted as well.

To dissolve a loop block, select it and choose Edit ® Steploop ® Undefine. The individual elements then become normal screen elements again.

To define a steploop as fixed or variable, select a steploop and choose Edit ® Grouping ® Steploop ® Fix or Variable. Recall that a variable loop is adjusted dynamically with the screen size and a fixed loop is not.

rewards points

Regards,

Naresh

Read only

ak_upadhyay
Contributor
0 Likes
1,313

Hi,

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_number][FROM 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.

Reward points if useful....

Regards

AK

Read only

Former Member
0 Likes
1,313

check this link for step loop

http://sap.niraj.tripod.com/id28.html

Read only

Former Member
0 Likes
1,313

Hi,

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

Cheers,

vasavi.

Read only

Former Member
0 Likes
1,313

Hi,

I have done an object using step-loop. Hope it will be useful.

loop at itab with control tc cursor tc-current_line.

field itab-boeno module disable.

endloop.

module disable output.

if sy-stepl <> 1.

loop at screen.

if screen-name = 'ITAB-BOENO' or

screen-name = 'ITAB-BOEDATE'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

endmodule. " disable OUTPUT

Regards,

Sanki.