cancel
Showing results for 
Search instead for 
Did you mean: 

Procedure-Call and amount as returning or exporting parameter

andreashorn
Explorer
0 Kudos

Hi,

I created a class with a static method which exports an amout field of type IF_FDT_TYPES=>ELEMENT_AMOUNT but it is not possible to map this parameter to the result data object "amount" because there is not entry in the dropdown field to choose from. It is a bit strange that number and currency are display separately. I only can assigned number to "amount" but this is not what I need because the currency is required as well.

Any hint would be appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Andreas,

handling currecnies is something very special in BRFplus. The type IF_FDT_TYPES=>ELEMENT_AMOUNT is indeed a structure representing an amount (consisting of a number and a currency code):

In case you want to assign an amount to this data object in BRFplus your data object has to have similar structure namely consisting of an amount field corresponding to the number and a currency field (ABAP a data element belonging to the domain WAERS which is mapped to the element of type text length 5 in BRFplus). Mapping of your simple element to the structure is not possible.

It depends on your BRFplus context how you can proceed:

  • If you have defined your context without data binding pointing to the BRFplus element type amount you cannot access the currency field. In this case I would recommend to create an identical structure as the IF_FDT_TYPES=>ELEMENT_AMOUNT structure in your context and do the mapping.
  • If your context data object is created via DDIC binding to a data element of type CURR and is elementary you definitly have to switch to a structure that also contains the value of the amount as well as the currency itself.
    The same holds for structures containing CURR fields. If the currency is part of the structure you are able to do the mapping using the two corresponding fields of your structure, if not (structure only references the currency field from another structure or table) you have to define a new structure that contains both fields

Best regards

Christian

andreashorn
Explorer
0 Kudos

Hi Christian,

thanks for your quick response but my problem is a bit different. I implemented a static method which exports an value (parameter FDT_AMOUNT) of type if_fdt_types=>element_amount. My understanding based on your explanation is that it should be possible to map such parameters to brfplus fields of type amount. This is my method signature:

The parameter "FDT_AMOUNT" I want to map as a result data object "amount" of a procedure call in BRFplus. This is how my procedure call looks like:

if I try to create an assignment for this parameter then the result data object "amount" is not offered. Moreover, if I create an extra context variable of type "amount" this is not offered or selectable as well.

best regards

Andreas

0 Kudos

Hi Andreas,

ok now I got it .. hopefully 🙂

When you do your procedure call you have to expand the structure (as BRFplus internally the element is represented by a structure). Then you select your amount data object of the BRFplus for the mapping to the field "Number" of the amount structure using the move-type "Move Value". Then you select the same data object for the field currency and use the move type "Move Currency/Unit"

This way the data should be moved correctly

BR

Christian

0 Kudos

Hi Andreas,

is your problem now solved?

BR

Christian