‎2011 Dec 19 2:25 PM
Hi,
I'm making a small application that has to run in the background every 10 minutes. It has to release locked sales orders. I'm calling the function module SD_ORDER_CREDIT_RELEASE. This call results in dialog boxes being prompted with warnings. I don't want the system to show these.
Any ideas?
Thanks
‎2011 Dec 20 6:21 AM
Hi Zhou,
Not sure but you can try catching exceptions below.
CALL FUNCTION 'SD_ORDER_CREDIT_RELEASE'
EXPORTING
vbeln = vbeln
EXCEPTIONS
error_message = 4.
Thanks,
Pawan Gore
‎2011 Dec 20 7:08 AM
Hi Zhou,
For this you don't Maintain SY-SUBRC Statements in your program,Then You will not get Any warning or Error messages and in function module uncomment exceptions portion and errors also.
warm regards,
PavanKumar.G
‎2011 Dec 20 8:13 AM
Hi Zhou,
>
> For this you don't Maintain SY-SUBRC Statements in your program,Then You will not get Any warning or Error messages and in function module uncomment exceptions portion and errors also.
>
> warm regards,
> PavanKumar.G
Unhandled exceptions? incoming ST22 !!!
Messages can be triggered inside a function without raising an exception. Not handling the exceptions won't magically prevent those messages from being triggered.
‎2011 Dec 20 7:31 AM
Thank you both,
I already had exceptions part uncommented and I also tried leaving out the SY-SUBRC check after calling the FM. I'm still getting the message though. I think the message might be written by a function module which is called by function module 'SD_ORDER_CREDIT_RELEASE'. The message I am getting after unlocking the order is: 'Schedule line date does not correspond to requested delivery date! If necessary, adept the route'. Anyhow, when processing in the background the dialog boxes don't show so that's ok. But users may also choose to run the tool manually. The system displays this box 3 times for each unlocked sales order so it quickly becomes a bunch of dialog boxes.
‎2011 Dec 20 2:01 PM
Hi,
the function call should be made without dialog.
So in your ABAP you should:
1) set the mode "no-dialog" using the function modules DIALOG_SET_NO_DIALOG
2) call the function module 'SD_ORDER_CREDIT_RELEASE:
3) reset mode " no-dialog " DIALOG_SET_WITH_DIALOG
Look how the SAP standard works in the include program LERP_SLS_CREDBLOCKDOCF01, form routine OKCODE_FREIGABE.
Regards,
Andrea
‎2011 Dec 20 8:19 AM
That's what I thought, but still worth a try. Any idea on what will do the magic?
‎2011 Dec 20 11:52 AM
Hi Zhou,
Did you try what Pawan said?
Messages of type S, I and W can be suppressed in this manner.
-- Aniruddha
‎2011 Dec 20 1:24 PM
‎2011 Dec 20 2:28 PM
I did as you said but the dialog box still appears. But it might not be a problem turns out so I'm going to close the thread as unanswered. Thank you all for your feedback.
Edited by: Zhou Tsui on Dec 20, 2011 3:29 PM