Application Development 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: 

How to create a step loop control in a screen

dany_charbonneau
Explorer
0 Kudos

Hi,

Basically, what I need to do is to create a fully dynamic screen. I want to send the structure name and the fiednames and the function will create a screen will all the required fields.

I explored many possibilities and the best one seems to be using the step loop control in a screen. I know, this is really old technology but I do not care as long as this work great !

I saw that the function group MASSFREESELECTIONS is doing it, this look pretty simple, fast and fully dynamic...

My only problem is that I'm not able to create a step loop control in a standard screen.... is it an obsolete function that was removed from the control list ?

Thanks

Dany

Message was edited by:

Dany Charbonneau

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Working with Step Loops

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 point

4 REPLIES 4

Former Member
0 Kudos

Working with Step Loops

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 point

Former Member
0 Kudos

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 <b>DEMO_DYNPRO_STEP_LOOP</b>

hope u can get some idea about table control & step loop in this line.

http://www.sapfans.com/sapfans/repos/comelite.htm

Check this link,

http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm

<b>Reward points</b>

Regards

dany_charbonneau
Explorer
0 Kudos

Edit ® Grouping ® Steploop ® Define.

exactly What I was looking for ! rewarding points right now !

thanks

Former Member
0 Kudos

Hi

The TABLE CONTROL is based on the tecnology of the STEP-LOOP, so the way to manage it it's the same.

It's different the way to design in the screen:

A): Insert all fields in the screen in order to create the base line of the step-loop

B): Group all fields by right button of the mouse

C): Go to Elaborate->Groupping->Steploop->Define (perhaps some name are wrong, but my gui is in Italian, so I don't know if my translation is right).

After desgning the step loop you need to insert the statament LOOP/ENDLOOP in PBO and PAI just like if it was a table control.

Max