Skip to Content
0

BRF+ formula convert quantity

Nov 08, 2017 at 01:19 PM

101

avatar image

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

function.jpg (156.9 kB)
formula.jpg (117.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Christian Lechner
Nov 08, 2017 at 08:55 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded