Skip to Content
avatar image
Former Member

Handling amount type fields in ALV

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á

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 01, 2010 at 08:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • >

      > 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