I've created an SQ01 query with the intention of returning order schedule lines that have an open quantity based off of the Delivered Quantity (MENGE - GLMNG), this has been configured in a local calculated field. SAP ERP calculates this field in Table MEPO1320, field name OBMNG, and can be seen in the Delivery Schedule tab in ME23N, however OBMNG calculates open quantity from the GR quantity, which doesn't meet the requirements of what this query is intended for.

I have named my calculated field ZOBMNG, I am using this field as one of the selection criteria, returning all values not equal to 0 (all open schedule lines).

My issue is, if there is no quantity delivered, SAP ERP leaves the GLMNG field as a null value, and I am finding it difficult with the basic logic available within the 'complex calculation' area to avoid a runtime error.

It is important to note that I need to know where there is a null value, as the null value represents a 0 delivered quantity.

I broke it down into two steps, the first looks if the delivered quantity is greater than 0, if so, subtract GLMNG (delivered quantity) from MENGE (schedule quantity):

  • Condition: GLMNG > 0
  • Formula: MENGE - GLMNG

I have run this independently and it does return partially delivered schedule lines. I haven't been successful through various methods to return 0 otherwise.

What I've tried, all have ended up as runtime errors:

  1. Condition: GLMNG = 0

    Formula: MENGE (Looking to just return the schedule line qty if there is 0 delivered)

    No second condition or formula, just MENGE in the otherwise section

  2. Multiplying & dividing GLMNG by 0 & 1 and using DIV/MOD both together and separately - all to try return 0.

  3. Creating a second calculated field to define GLMNG as a text or numerical value of 0 and calling up this second calculated field in the first calculated field.

Is it possible to achieve what I need? Please also note I am not authorised to write code within the applicable section in SQ02.

1

There are 1 answers

0
Zack Cain On

I don't think it's achievable with this logic to avoid a runtime error unless you can edit the code in SQ02.

Please also note I am not authorised to write code within the applicable section in SQ02.

This is a problem.