Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore dialog boxes from function module.

former_member306787
Active Participant
0 Kudos
2,011

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

9 REPLIES 9

former_member320332
Contributor
0 Kudos
303

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

Former Member
0 Kudos
303

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

0 Kudos
303

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.

former_member306787
Active Participant
0 Kudos
303

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.

303

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

former_member306787
Active Participant
0 Kudos
303

That's what I thought, but still worth a try. Any idea on what will do the magic?

Former Member
0 Kudos
303

Hi Zhou,

Did you try what Pawan said?

Messages of type S, I and W can be suppressed in this manner.

-- Aniruddha

former_member306787
Active Participant
0 Kudos
303

Yes I have, it doesn't seem to be a message of that kind.

former_member306787
Active Participant
0 Kudos
303

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