09-03-2013 1:36 PM
Hi All,
We have a requirement where we need to fetch the quotation details and pass it to Java via RFC. we are using BAPISDORDER_GETDETAILEDLIST to fetch details. However, when the sold to party is marked for deletion, while executing the BAPI throws a information message that "Business partner XXXX is marked for deletion". This is resulting in a dump when called from Java via RFC because there is no screen to display such messages.
can some one please tell how to handle such scenarios where the Standard code throws messages, and we are calling that standard code in RFC?
Thanks,
Santhosh.
09-03-2013 1:45 PM
Dear Santosh,
In this case you need to write a wrapper RFC function ZBAPISDORDER_GETDETAILEDLIST,
in which you call this BAPI - BAPISDORDER_GETDETAILEDLIST again.
Before returning the return values, check the messages, and make your return value appropriate to your java requirement
Regards,
Venkat
09-03-2013 1:44 PM
You could make your own bapi as a wrapper to this BAPI and catch the message.
Neal
09-03-2013 1:48 PM
Thank you Neal for the quick reply. But in the standard code its written as "MESSAGE I191 WITH GT_PARTNERS_MARKED_FOR_DEL-BPARNR. " in the function module "VIEW_KURGV". there is no exception associated with that information message, and more over its in the standard function module. Please suggest how can we handle this with a wrapper because BAPISDORDER_GETDETAILEDLIST doesn't have any Exceptions associated with it.
Thank you ,
Santhosh.
09-03-2013 1:45 PM
Dear Santosh,
In this case you need to write a wrapper RFC function ZBAPISDORDER_GETDETAILEDLIST,
in which you call this BAPI - BAPISDORDER_GETDETAILEDLIST again.
Before returning the return values, check the messages, and make your return value appropriate to your java requirement
Regards,
Venkat
09-03-2013 1:57 PM
Thanks Venkat for the response.
yes i have a wrapper in place which internally calls the BAPISDORDER_GETDETAILEDLIST . But when i execute the wrapper function module, even then the processing halts with a pop up information message. Once the user click 'Enter' or the 'Tick Mark' on the information message it continues with the processing and returns the values.
Now, we we need to avoid that information message since thats causing a dump when called from JAVA from wrapper RFC.
09-03-2013 2:22 PM
Hi Santhosh,
Inside the wrapper function, when you are calling the BAPI,
Try to use the exception ERROR_MESSAGE as follows.
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
EXPORTING
I_BAPI_VIEW = BAPI_VIEW
TABLES
SALES_DOCUMENTS = SALES_DOCUMENTS
.....................................................................
EXCEPTIONS
ERROR_MESSAGE = 1.
09-03-2013 2:46 PM
Thanks venkat . It woks. It doesnt dump now. But the information message is lost.is there any exception we can catch? as in using TRY .. CATCH block? if so, can you please tell the exception to catch ? i tried with CX_ROOT and nothing is being captured.
* Call the BAPI.
TRY.
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
EXPORTING
i_bapi_view = ls_bapi_view
i_memory_read = 'A'
TABLES
sales_documents = gt_sales_document
order_headers_out = gt_order_headers
order_items_out = gt_order_items
order_business_out = gt_business_out
order_partners_out = gt_partners_out
order_address_out = gt_address_out
order_conditions_out = gt_order_conditions
order_textheaders_out = gt_header_texts
order_textlines_out = gt_item_texts
EXCEPTIONS
error_message = 1.
CATCH cx_root INTO o_ref.
BREAK-POINT.
ENDTRY.
Thanks,
Santhosh.
09-04-2013 10:04 AM
Hmm..
Check the value of sy-subrc after the function call..
At this break point, check is there any global variable name like return..
Regards,
Venkat
09-04-2013 10:16 AM
I would suggest you to add a RETURN parameter to your ZBAPI, and if ERROR_MESSAGE is raised map the received message to the BAPIRET2 structure (use a FM like BALW_BAPIRETURN_GET2) and add it to table RETURN.
Regards,
Raymond
09-04-2013 10:17 AM
Santhosh,
You can also try in this way...
if sy-subrc ne 0.
call function 'MESSAGE_TEXT_BUILD'
exporting
msgid = sy-msgid "Messg class
msgnr = sy-msgno "Messg No.
msgv1 =
msgv2 =
msgv3 =
msgv4 =
importing
message_text_output = sapmessage.
endif.
09-04-2013 10:33 AM
Check this Note 1054781 - Information messages during BAPI processing
DATA : S_RETURN TYPE BAPIRET2 ,
PAR1 LIKE BAPISDPART-KUNNR.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
TYPE = 'I' " S Success, E Error, W Warning, I Info, A Abort Message Type
CL = SY-MSGID " like 'VP' Message Class
NUMBER = SY-MSGNO " '191' Message Number
PAR1 = PAR1 " Variable#1 like Business partner
IMPORTING
RETURN = S_RETURN.
SAP Community Network Wiki - Sample Custom FM Using "BALW_BAPIRETURN_GET2" ...
Regard's
Smruti
09-04-2013 4:14 PM
Venkat,
the Sy-subrc will be 0. And also the Msgid doesnt correspond to the one in the pop up. I presume its because there are many other messages after that which will affect SY-MSGID .
Thanks,
Santhosh.
09-05-2013 6:04 PM
Hi,
Is there a way by which we can suppress pop ups which have been included in a custom user exit. These are pop ups are generated using "COPO_POPUP_TO_DISPLAY_TEXTLIST" and wait for user action ? These problems are creating a problem when the standard BAPI_CUSTOMERQUOTATION_CHANGE is being called for changing the quotation.
Please help.
Thank you,
Santhosh.