Hello community and staff,
please have a look at the following problem:
I have a BRFplus function that i call from ABAP. This function recieves a Z-structure as input. The mentioned Z-struc. has several fields of type CURR and one field of type CUKY. Some of the CURR-fields are includes from other structures (blue fields in SE11).
So far i was calling the BRFplus functions from my ABAP code in the deprecated way (according to BRFplus Basics - How to call a function, with ->get_process_context ... ->set_value ... ->process ... ->get_value). It was slow, but it worked right.
Now, in order to improve the performance i tried to call BRFplus via the workbench-generated code, as suggested by Christian Lechner in the link above. The folowing thing happens:
- the Z-struc. fields of type CURR that are not includes are correctly converted into FDT_S_AMOUNT fields. The resulting FDT_S_AMOUNT fields have the value and the currency (from CUKY) filled.
- the Z-struc. fields of type CURR that are includes are not correctly converted into FDT_S_AMOUNT fields. The resulting FDT_S_AMOUNT fields have the value but they are missing the currency - its just empty.
Without the currency getting set right BRFplus fails on performing the compares on amounts and returns incorrect results (without any kind of warning).
Additionaly i have tried to call BRFplus via the workbench-generated function block. Here the execution got aborted by "cx_fdt_processing" exception in the method move_currency_to_ext at the code part with the following comment:
* check whether the same reference field has a different currency
* than the previous amount field with same reference field
I appreciate any comments and suggestions - especialy such that help me to get the better performance of the workbench-generated call together with the correct execution of the old call 😊
Message was edited by: Andreas Adler