cancel
Showing results for 
Search instead for 
Did you mean: 

BRF+ formula convert quantity

former_member396312
Discoverer
0 Kudos

Hi Folks,
I am currently facing the following issue and I haven't any clue how to solve it.

The requirement is to create a formula in BRF+ to calculate a quantity value.

The formula looks like this (seems pretty easy):
( RUECK-ISM01 / AUFT_OPER-VGW01 ) / ( AUFT_OPER-BMSCH ).
All fields are DDIC-Type QUAN 10 with decimals 2.
RUECK and AUFT_OPER are importing-structures and related to a DDIC-structure.
The returning-parameter is QUAN 10 with decimals 2 and related to a DDIC data-element.

The result quantity should always have unit "pieces".

My formula Expression Looks like this:

I implemented the Expression in different ways but I always get exception (see Pic) or a Syntax error.

I am wondering where my mistake is? How do I create the formula properly?
I would be really greatful for any help.

Many thanks in advance

Best regards

Juergen

Accepted Solutions (0)

Answers (1)

Answers (1)

christianlechne
Active Contributor
0 Kudos

Hi Jürgen,

according to your simulation trace, there seems to be a problem with the unit of a quantity: an ISO code that is used here is either not valid at all or it is not customized. The GET_UNIT and SET_UNIT formula functions do not check the validity, the check is performed in the CONVERT_QUANTITY.

How to debug: You have to check which parameter causes the problem, so you should reduce the formula to one conversion at a time (makes no sense for your use case, just for the sake of debugging). Alternatively, you can generate the BRFplus function and debug the generated ABAP code when you execute the function call.

In addition, you should check if a valid ISO code is used via table T006 field MSEHI.

In general, is the explicit GET/SET of the unit necessary?

Best regards,

Christian

P.S. You should not use function mode, I would go for event mode in order to be future proof although this might seem like a bit of an overhead for your scenario