05-31-2011 9:31 AM
Hi all,
i've created an ALV with Field catalog called ( Credit Amounts)... it contains the totals of amounts per a period of time. anyway, the number is too big so i want to divid the result on 1 million. is there any option on the fieldcat to do so? like when using DO_SUM to get the sum... but here i want a division.... how to do that?
Thanks,
05-31-2011 10:21 AM
You may use method [get_subtotal|http://help.sap.com/saphelp_bw/helpdata/en/9e/2c7b38180fee45e10000009b38f8cf/frameset.htm] then change each collection (total level 1, subtotal level 2 etc) accordingly (i.e. dividing each amount by 1 mln). For classical ALV the first you need to switch to its OO representation by getting its object reference -> refer [Classical ALV:change subtotal|http://help-abap.blogspot.com/2008/09/classical-alv-change-subtotal.html]
Regards
Marcin
05-31-2011 11:07 AM
Thank you for replying,
I'm using OOPS ALV and only this field i want it to be divided by million..
this is the code i'm using
CASE fieldcat-fieldname.
WHEN 'CREDIT_USED' .
fieldcat-seltext_l = 'Credit Used Amount in Million'.
fieldcat-outputlen = '20.
fieldcat-just = 'R'.
fieldcat-edit_mask = '==DEC5'.
there is no any subtotals i can use for field catalogs...
05-31-2011 11:31 AM
Well, you can use conversion exit function, which would convert display of this amount (i.e. its division by 1mln). Anyhow this doesn't affect field in the table itself. It will internally keep the original value, but will only display it different. Use your EDIT_MASK field
fieldcat-edit_mask = '==DIVM'.
Now create FMs CONVERSION_EXIT_DIVM_OUTPUT and CONVERSION_EXIT_DIVM_INPUT and convert your data accordingly.
More on this [Conversion exit|http://help.sap.com/saphelp_40b/helpdata/fr/cf/21ee19446011d189700000e8322d00/content.htm]
Regards
Marcin
06-04-2011 8:55 AM