cancel
Showing results for 
Search instead for 
Did you mean: 

Loop in smartforms

Former Member
0 Kudos

hi all,

i have to print a table in smartforms,

in the loop i have to use

AT NEW ebeln.

print somthing.

ENDAT.

How to print using AT new . endat in smartforms

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yogash,

It is possible to print data of internal table in smatforms as you asked.

it is very simple click the loop / table node in your smartform and click the DATA tab

in this screen there one table control Sort criteria

inthis table control give the filed name of the internal table like EBELN

And select the check box in "event in sort begin" column.

then it will create on event at new statement in internal table.

regrads,

Jagadeesh T.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Yogesh,

You can check this wiki as a reference her in this wiki the condition is for whenever a new CARRID will come then it triggers a new-page. It is like

at new carrid .

new-page.

endat.

and in program line we transfer the carrid value to a local variable.

You can check it and instead of a new-page you can print the value what you want

[Page Break in Smartforms]

Regards

Sarves

Former Member
0 Kudos

the link page break in smartforms is not correct, please give the link again

Former Member
0 Kudos

Hi Yogesh,

Sorry, check the link.

[Page Break in Smartforms|https://wiki.sdn.sap.com/wiki/display/ABAP/PageBreakin+SMARTFORMS]

Regards

Sarves

Former Member
0 Kudos

Hello,

In smartforms you dont have event for at new for loop.

One thing you can do is,

1. Declare internal table with the same fields as you require and with additional field flag.

2. In the program lines you can write the following code

LOOP ITAB.

at new.

ITAB-flag = 'X'.

MODIFY itab tarnsporting flag.

endat.

ENDLOOP.

3.While printing place condition ITAB-FLAG = 'X'.

So when itab-flag = 'X' the printing will happen.

Hope this will serve your purpose.

Regards,

alex_m
Active Contributor
0 Kudos

Try like this,

Create a program line inside the table loop and use AT NEW commant, here you set the flag and if the flag is set then print the text what ever you want.

In Text element condition check if only the flag is 'X'.