Reputation: 6859
Is there a function module or BAPI or method that nicely performs a material/material ledger consistency check for a given material?
I am aware of report SAPRCKMU
which would be very hard to use inside my own program.
I am also aware of and using function module CKML_F_CKML1_PRICES_GET
which performs a consistency check.
When this function module finds an inconsistency, it calls MESSAGE E
... which means I lose control in my program. This is the core problem that I have.
So I am searching a way to check consistency before I call CKML_F_CKML1_PRICES_GET
in a way that gives me a return parameter with the error message without calling MESSAGE E
....
Upvotes: 1
Views: 986
Reputation: 6859
I found a solution that works very well:
add the line error_message = 99
to the function module call:
CALL FUNCTION 'CKML_F_CKML1_PRICES_GET'
....
EXCEPTIONS
...
error_message = 99
others = 98.
Now the program doesn't interrupt the control flow when the function module itself uses MESSAGE E...
instead of RAISE ...
.
Whenever MESSAGE E...
is called inside, it is converted into SY-SUBRC = 99
and the error-fields in SY-...
are also set.
Upvotes: 2