2009 Oct 07 3:32 PM
i have two tables vbap, vbak. in the report i have to print vbeln, netwr from vbap table & waerk from vbak table.
now for every change in the currency a subtotal will be printed.
e.g. suppose i have 15 rows in the list. there are 6 dem(currency), 5 usd (currency), 4 euro (currency).
the summation of 6 dem's will be printed, 5 usd's will be printed, 4 euro's will be printed. how this can be achieved?
thanx..
2009 Oct 07 7:30 PM
if you are directly relating the field definition as their data elements then vbeln would be char10, netwr is a curency and waerk is currency key(char type).
so
create you final table as:
types: begin of gty_final,
vbeln type vbak-vbeln,
netwr type vbap-netwr,
waerk type vbak-waerk,
end of gty_final.
loop at gt_vbap into gs_vbap.
clear : gs_vbak.
read table gt_vbak into gs_vbak with key vbeln = gs_vbap-vbeln.
if sy-subrc = 0.
gs_final-vbeln = gs_vbap-vbeln.
gs_final-netwr = gs_vbap-netwr.
gs_final-waerk = gs_vbak-waerk.
COLLECT gs_final into gt_final.
endif.
endloop.
i have two tables vbap, vbak. in the report i have to print vbeln, netwr from vbap table & waerk from vbak table.
now for every change in the currency a subtotal will be printed.
e.g. suppose i have 15 rows in the list. there are 6 dem(currency), 5 usd (currency), 4 euro (currency).
the summation of 6 dem's will be printed, 5 usd's will be printed, 4 euro's will be printed. how this can be achieved?
thanx..
2009 Oct 07 3:39 PM
Define like this.
fieldcatalog-fieldname = 'NETWR'.
fieldcatalog-seltext_l = 'TRANSACTION CURRRENCY'.
fieldcatalog-cfieldname = 'WAERS'. --> this willl give you currencywise subtotal
fieldcatalog-do_sum = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
2009 Oct 07 6:59 PM
thanks gautham,
but i want to achieve it through interactive reporting not ALV. again thank you for your answer.
i know it will be achieved through control statements in internal table but fail to achieve that.
2009 Oct 07 7:30 PM
if you are directly relating the field definition as their data elements then vbeln would be char10, netwr is a curency and waerk is currency key(char type).
so
create you final table as:
types: begin of gty_final,
vbeln type vbak-vbeln,
netwr type vbap-netwr,
waerk type vbak-waerk,
end of gty_final.
loop at gt_vbap into gs_vbap.
clear : gs_vbak.
read table gt_vbak into gs_vbak with key vbeln = gs_vbap-vbeln.
if sy-subrc = 0.
gs_final-vbeln = gs_vbap-vbeln.
gs_final-netwr = gs_vbap-netwr.
gs_final-waerk = gs_vbak-waerk.
COLLECT gs_final into gt_final.
endif.
endloop.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |