2010 Feb 15 1:51 PM
Hi Experts,
I have a small issue in the internal table logic. For the below data showing the structure of my internal table. Depends on data the internal table records will increase or decrease.
Currently my problem is i want to add Copyright Fee's (KSCHL= ZCFP) NETWR value and i want to display in one row.
For example the below data having 2 different material number, for 1st it should be 38 + 4.43 = 42.43. And the second material having 138 + 4.4 = 142.4.
VBELN ARKTX MATNR NETWR KSCHL GR_KZWI1
9014000000 PRINTER (G T644N P3 EMEA ENG4 20G2091 891.3 291.76
9014000000 Copyright Fee 38 ZCFP 1291.76
9014000000 Tax Jur Code Level 1 167.27 ZTR1 1291.76
9014000000 Ausgangssteuer 836.33 ZTXD 1291.76
9014000000 Copyright Fee 4.43 ZCFP 1291.76
9014000000 Tax Jur Code Level 1 19.48 ZTR1 1291.76
Ausgangssteuer 97.41 ZTXD 91.76
9014000001 PRINTER (G T644N P3 EMEA ENG4 20G2091 891.3 291.76
9014000001 Copyright Fee 138 ZCFP 1291.76
9014000001 Tax Jur Code Level 1 167.27 ZTR1 1291.76
9014000001 Ausgangssteuer 836.33 ZTXD 1291.76
9014000001 Copyright Fee 4.4 ZCFP 1291.76
9014000001 Tax Jur Code Level 1 19.48 ZTR1 1291.76
Ausgangssteuer 97.41 ZTXD 91.76
How i made a logic for this.??
Mohana
2010 Feb 15 3:21 PM
Hi
i want to display in one row
Can u calculate manually and highlight the result how it should be.
Hi
i want to display in one row
Can u calculate manually and highlight the result how it should be.
2010 Feb 15 2:00 PM
Hi,
Make sure your internal table is in the below order of fields:
VBELN KSCHL MATNR NETWR ARKTX GR_KZWI1
Now after fetching the data, Loop at the internal table, for each record, do the below.
LOOP at Itab
V_SUM = V_SUM + itab-netwr
at end of MATNR
move the sum to another internal table
Endat.
Endloop.
Regards
Shiva
2010 Feb 15 2:00 PM
Hi,
Make sure your internal table is in the below order of fields:
VBELN KSCHL MATNR NETWR ARKTX GR_KZWI1
Now after fetching the data, Loop at the internal table, for each record, do the below.
LOOP at Itab
V_SUM = V_SUM + itab-netwr
at end of MATNR
move the sum to another internal table
Endat.
Endloop.
Regards
Shiva
2010 Feb 15 2:02 PM
2010 Feb 15 2:04 PM
hi,
Try this.
Assumptions
itab1 - actual data
itab2 - holds final data ( with added values )
wa1 - work area.
wa2 - holds copyright row with added values.
total - holds added values for a vbeln
total = 0.
flag = 0.
loop at itab1 into wa1.
at new vbeln.
if total ne 0.
wa2-NETWR = total.
append wa2 to itab2.
endif.
total = 0.
endat.
if wa1-ARKTX ne 'Copyright Fee'.
append wa1 into itab2.
else.
total = total + wa1-NETWR.
wa2 = wa1.
endif.
endloop.
Hope, this logic helps u.
Regards,
Bhavesh Solanki.
2010 Feb 15 3:21 PM
Hi
i want to display in one row
Can u calculate manually and highlight the result how it should be.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |