cancel
Showing results for 
Search instead for 
Did you mean: 

control break statement in smartforms

Former Member
0 Kudos

In my final internal table I have data like this

customer-material-amount

00000001-000034-125.00

00000001-000035-200.00

00000001-000023-130.00

00000002-000045-160.00

00000002-000060-190.00

00000003-000034-125.00

00000003-000060-190.00

00000003-000045-160.00

I want to see using control break statement in outpu as

Customerwise in smartforms using table.

here For 1st customer I have 3 material

for 2 nd customer i have 2 material and

so on like below

cutomer -00000001

000034-125.00

000035-200.00

000023-130.00

cutomer -00000002

000045-160.00

000060-190.00

cutomer -00000003

000034-125.00

000060-190.00

00000003-000045-160.00

Can anybody suggest me how to do it

Thanks

kumar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Pass the internal table from driver program to Smartform or fetch the data in smartform itself. Then use Table option, there go to Event tab there you would find 'SORT BEGIN'. Check this and provide the field name here as 'Customer number'. Then you would get your expected result.

Hope you understand....

Thanks,

Phani Diwakar.

Former Member
0 Kudos

Hi,

First sort the internal table by Customer. and then try like this, declare a flag variable. While loop the final internal table set this flag variable to 'X' for every new customer using at new command else clear that flag variable. While writing internal table variables in the output check this flag variable for 'X', if it is X then only write the customer variable in the output along with other variables else write all the remaining variables. like,

sort <itab> by <customer number>.

Loop at <itab> into <work area>.

At new <itab-customer>.

wv_flag1 = 'X'.

endat.

if wv_flag1 is not initial.

wv_flag = 'X'.

clear wv_flag1.

else.

clear wv_flag.

endif.

endloop.

Now use that wv_flag for writing records in the output.

if wv_flag is not initial.

write all the fields of the itab including customer.

else.

write all the fields of the itab excluding customer.

endif.

Hope this will give you some idea.

Regards,

Aswini.

Former Member
0 Kudos

use control break statement in driver program itself....

loop at itab.

at new customer.

move customer to itab-customer.

endat.

move matnr to itab-matnr.

append ifinal...

clear itab

endloop.

pass ifinal in f.m of smartforms

Former Member
0 Kudos

I My doubt was not to fill the internam table.

I want how to display into smartforms customerwise.

If u know it please tell...

Thanks

kumar