Using loops in SMARTFORMS

Using loops in smartforms, loops in smartforms

+ -

Sometimes, we may need to use loops in smart forms to display data, below is the example of using loop s to display data.

Go to T-code SMARTFORMS, provide name as ZSAPN_LOOPS and click on create.

using Loops  in smartforms

Double click on global definitions, go to types tab and add below code.

types: BEGIN OF ty_mara,
       matnr type mara-matnr,
       mtart type mara-mtart,
       meins type mara-meins,  
       end of ty_mara.

using Loops  in smartforms

Go to global data tab and create table and work area.

using Loops  in smartforms

Go to initialization tab and add below code to get material details.

select * FROM mara
  into CORRESPONDING FIELDS OF TABLE it_mara
  UP TO 50 ROWS. 

using Loops  in smartforms

Double click on main window, right click -> create -> flow logic -> loop.

using Loops  in smartforms

Add internal table IT_MARA and work area WA_MARA as looping parameters.

using Loops  in smartforms

Right click on loop, create -> text.

using Loops  in smartforms

Click on insert icon and insert work area fields.

using Loops  in smartforms

Similarly insert all work area fields.

Save, activate and execute (F8).

It will go to function module, execute.

Again execute and provide OutputDevice as LP01, print preview.

using Loops  in smartforms

Please Sign in to ask a question

Was this lesson helpful to you? Yes No 42 People out of 44 think this lesson helpful


Lesson Navigation

←Previous Chapter
Next Lesson → Batch Data Communication