on 05-15-2009 10:19 AM
Hi guys,
I am working on invoice smartform where I am displaying the materials in a sorted order. My requirement is if there are more than one same materials , it should display only once and their quantity and total should be added and displayed once as well. Please advice how can I achieve this.
Thanks in advance,
chintu gupta
Edited by: Chintu Gupta on May 15, 2009 11:19 AM
Hi,
After getting the data to Smartform, in intializtion we can write the code. in the loop use control break events to sum the quantity.
eg:
sort itab by matnr.
LOOP AT itab.
quantity = quantity + lv_sum.
at end of matnr.
append itab to itab1.
clear : quantity, sum, itab, itab1.
endat.
endloop.
Rgds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks. answer rewarded
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this one with SUM Control Break Statement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try like this
LOOP AT i_vbrp INTO wa_vbrp.
wrk_vbrp-vbeln = wa_vbrp-vbeln.
wrk_vbrp-fkimg = wa_vbrp-fkimg.
wrk_vbrp-netwr = wa_vbrp-netwr.
wrk_vbrp-arktx = wa_vbrp-arktx.
wrk_vbrp-vgbel = wa_vbrp-vgbel.
wrk_vbrp-matnr = wa_vbrp-matnr.
COLLECT wrk_vbrp INTO it_vbrp.
ENDLOOP.
Here it_vbrp and i_vbrp are having same structre.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can use collect statement also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
logic provided by PAVAN can be placed in driver pgm too,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.