on 11-08-2008 7:41 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.