cancel
Showing results for 
Search instead for 
Did you mean: 

Handling amount type fields in ALV

Former Member
0 Kudos

Hi!

Let's see what I mean, with a short sample, I will print out to screen with ABAP 15000 HUF:

DATA:

ls_amount LIKE bseg-wrbtr,

ls_currency LIKE bkpf-waers.

MOVE 150 TO ls_amount.

MOVE 'HUF' TO ls_currency.

WRITE:/ ls_amount CURRENCY ls_currency.

Unfortunately HUF is stored in the SAP amount fields divided by 100, so the amount of 150 means 15000 if the currency is HUF.

I would like to do the same thing in the ABAP WebDynpro ALV, because at the moment, my amount type columns does contain the 150 value, instead of the 15000 (so the SB stored value, instead of the correct ones).

How can I set a field's currency field, to display the correct values in ABAP WebDynpro ALV?

Thank you

Tamá

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Tamas,

you need to write either supply function to modify the amount value when the currency is HUF (Amount = amount*100) or modify the amount value before it binds to context node.

Regards,

Vasundhara

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Tamas,

> you need to write either supply function to modify the amount value when the currency is HUF (Amount = amount*100) or modify the amount value before it binds to context node.

> Regards,

> Vasundhara

You souldn't have to do either of these things. The amount field output should format automatically like a write statement does as long as there is a connection to the currency field. You need to make sure that the structure you are using to definine the context (and use a structure based definition - not direct attribute assignment) is a DDic structure that has the currency/amount filed definition defined. Also make sure that the context contains both the currency and amount fields and they are both populated.

If you can't use a DDic structure with proper assignment of the currency field, then you can set it manually using the method SET_ATTRIBUTE_REFERENCE_FIELD of the IF_WD_CONTEXT_NODE_INFO object.

Here is a help link that describes the currency situation in Web Dynpro:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/frameset.htm

Answers (0)