Application Development and Automation 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: 
Read only

How to supress pop-up while executing bapi

Former Member
0 Likes
9,344

Dear Experts,

While executing bapi for updating delivery some standard pop-up is blocking the screen and the code written below the Bapi is not getting executed because unless an user interaction is done the control is not going to the next code.

Please let me know how to supress these standard pop-ups and how to handle these messages by using this Bapi.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

sanjaybit
Explorer
5,825

Dear Nihar,

Pls check the SCN blog post. Suppressing unwanted SAP GUI screens from BAPI/... | SCN

You can also check the another way of suppressing the messages detailed in the post. Suppress Messages in BAPI | SCN

Another trick ABAP - Suppressing BAPI Messages - Paper Street Enterprises

Thanks,

Sanjay

Dear Experts,

While executing bapi for updating delivery some standard pop-up is blocking the screen and the code written below the Bapi is not getting executed because unless an user interaction is done the control is not going to the next code.

Please let me know how to supress these standard pop-ups and how to handle these messages by using this Bapi.

Thanks in advance

10 REPLIES 10
Read only

sanjaybit
Explorer
5,826

Dear Nihar,

Pls check the SCN blog post. Suppressing unwanted SAP GUI screens from BAPI/... | SCN

You can also check the another way of suppressing the messages detailed in the post. Suppress Messages in BAPI | SCN

Another trick ABAP - Suppressing BAPI Messages - Paper Street Enterprises

Thanks,

Sanjay

Read only

0 Likes
5,825

To sum up these posts:

Either this popup is a standard message popup (statement MESSAGE of TYPE 'I', 'W',or 'E'), then you may call the function module by intercepting the special classic exception "ERROR_MESSAGE", which will get rid of popups for message type 'I' or 'W' (and messages 'E' will be intercepted).

Otherwise, for other types of screens, as Thomas Jung used to say, "BAPIs are supposed to be safe to call without dynpro." and "I would encourage you to open an OSS problem with SAP when you find something like this"

As a workaround, if the symtom happens while you're executing the BAPI in dialog, but it works in background, then the BAPI has been written to allow 2 behaviors, one with SAP GUI, one without SAP GUI, then you may run the BAPI in background. In case the BAPI is called from a non-ABAP program, then an RFC connection may be started with dialog mode off.

Read only

Former Member
0 Likes
5,825

Hi Sandra,

Thanks for your response.

If I will create a copy of the standard Bapi and implement the error_message exception will it work?

The problem here is that copying the Bapi will not copy the enhancements used.

Thanks

Read only

Former Member
0 Likes
5,825

Dear Sanjay,

I checked in the system and found that active x control is already set.

Is there any other options?

Thanks for your valuable input.

Read only

0 Likes
5,825

Hi Nihar,

Try to use exception ERROR_MESSAGE in your bapi call as follow and check:

CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'

     EXPORTING

          I_BAPI_VIEW     = BAPI_VIEW

     TABLES

          SALES_DOCUMENTS = SALES_DOCUMENTS

           .....................................................................

     EXCEPTIONS

          ERROR_MESSAGE   = 1.

Read only

0 Likes
5,825

In fact, I've read the threads mentioned by Sanjay Kumar, and saw that their contents was not so explicit/not all correct, it's why I posted what I considered was correct. You can see I'm not talking about a copy of the standard BAPI. If the popup is a standard message (MESSAGE TYPE 'I'), do handle the error_message exception of the standard BAPI, as Pranay Patel suggests. For more information, please read the ABAP documentation of this special exception.

.

Read only

Former Member
0 Likes
5,825

Dear Pranay,

Do I need to create a copy of the standard bapi and then add the exception in the custom code ?

Or if I write the syntax "exceptions" as per you said after the bapi call will it work ?

Thanks

Read only

0 Likes
5,825

No need to create a copy, just try writing the exceptions after bapi call.

Read only

0 Likes
5,825

Isn't it faster to try first, before asking?

Read only

Former Member
0 Likes
5,825

<sighs heavily>