Using tables in smartforms

+ -

In the below lesson, you will be able to learn using tables in smartforms using tables element.

Go to T-code SMARTFORM, provide name ZSAPN_TABLE and click on create.

Using tables in smartforms

Click on global definitions, add a structure under types tab.

Using tables in smartforms

Click on global data and add parameters as below.

Using tables in smartforms

Go to initialization tab, add output parameter as IT_MARA and add below code get materials.

Using tables in smartforms

Expand page, right click on main window -> create -> table.

Using tables in smartforms

Whenever we create a table, header, main area, footer for the table will be created automatically.

Now we need to draw columns, we know smartforms is a GUI designer, we need to design table columns, to create table columns go to table tab, click on pencil icon and draw five vertical lines( no of lines = internal table fields).

Using tables in smartforms

Click on details to specify size of column.

Using tables in smartforms

Specify sizes as below.

Using tables in smartforms

Go main view, output options and specify width, height as below.

Using tables in smartforms

Right click on header -> create -> table line

Using tables in smartforms

Select line type from drop down.

Using tables in smartforms

Right click on each cell, create -> text to create column headers.

Using tables in smartforms

Go to general attributes tab and provide text as Material No.

Similarly create column header texts for all cells as below.

Industry Sector

Material Type

Material Group

Base Unit of measure

Double click on main area, create -> table line.

Using tables in smartforms

Select a table line  %LTYPE1 from drop down.

Using tables in smartforms

Click on insert icon, a popup will come and provide variable as &wa_mara-matnr&, enter.

Using tables in smartforms

Similarly create text for all cells and insert respective variables as below.

&wa_mara-mbrsh&

&wa_mara-mtart&

&wa_mara-matkl&

&wa_mara-meins&

Double click on table, go to tab data and loop internal table as below.

Using tables in smartforms

Save, activate and execute (F8).

Learner Questions


No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

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


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →