on 2024 Aug 14 3:28 AM
Hello Experts,
In Custom Fields Fiori app under Custom Logic, I implemented "Sales Item Check" BADI under Business Context Sales: Sales Document Item.
Purpose was to validate some Custom fields from Additional Data A tab on the Sales Order in the BADI in method CHECK_FIELDS
The way to raise an error message in this BADI method is to fill messages parameter table like below
append value #( messagetype = 'E' messagetext = 'Value missing for field YY1_FIELD_SDI.' ) to messages.
Now the issue I am facing is, even if the Error is corrected on the Item, the message in the log still remains. We can only append new message in the messages table of the BADI method but there is nothing in the documentation about how to remove an existing error message from the log
How, can we remove the message from the log once we find the error is resolved?
Best regards
Thank you for your question, @sri_vishnu.
the code you shared shows you appended the error message table.
In the same way you probably have an "if condition then append error to error table" you would now need to remove that message when the condition is not met:
LOOP AT messages WHERE messagetext = 'Value missing for field YY1_FIELD_SDI.'.
DELETE messages INDEX sy-tabix.
ENDLOOP.
If that solves your problem, please mark this question as resolved. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andreas,
Thank you for taking time and responding, really appreciate it!
I already tried, what you suggested but it doesn't work
The thing is that the messages table parameter in Sales Document Item Check BADI method CHECK_FIELDS, that triggers for each item as soon as it is changed, always comes empty when the method is triggered (even if there are already messages in the Sales Order -> Log). So there is no error message to delete from it.
So this messages table parameter, in Sales Document Item Check BADI method CHECK_FIELDS, only allows inserting a message into the message log but there is no way to delete it
Second issue is that these error messages DON'T stop the Sales Order from getting saved as well!
On the other hand the messages table parameter in Sales Document Item Check Before Save BADI method, that triggers when Save button is pressed, clears the log automatically if we don't raise any error message and only shows error log, if we append an error message. It also stops the Sales Order from getting saved if we append error into messages table parameter
I believe this (not being able to clear errors and saving order even if there is an error in Sales Document Item Check BADI) is a product issue, you can replicate from your side
I will raise a note to SAP development team
Best regards,
Vishnu T
User | Count |
---|---|
73 | |
10 | |
9 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.