2012 May 28 7:44 AM
Hello all,
I have a query regarding FM WS_DELIVERY_UPDATE. I am using FM WS_DELIVERY_UPDATE in my report but problem is during packing, an error is coming on screen and execution stops there only but i want to capture these error on table IPROT of FM WS_DELIVERY_UPDATE.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
vbkok_wa = lwa_vbkok
synchron = gc_true
commit = gc_true
delivery = pi_vbeln
update_picking = gc_true
if_no_generic_system_service = gc_true
TABLES
prot = li_prot
verko_tab = li_verko1
verpo_tab = li_verpo1.
Error : "packing material is not correct " is coming on screen
How should i handle this ? I want to display these error on my report output
Thanks in advance.
Sachin Mahesh Gupta
2012 May 28 7:57 AM
Add exception error_message = 1.
This will not display the message.
2012 May 28 9:34 AM
2012 May 28 4:06 PM
2012 May 28 7:58 AM
Hi Sachin,
use TRY .
ENDTRY.
Refer below code
DATA: exception_info TYPE REF TO if_os_exception_info,
bcs_exception TYPE REF TO cx_bcs,
cx_root TYPE REF TO cx_root.
TRY.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
vbkok_wa = lwa_vbkok
synchron = gc_true
commit = gc_true
delivery = pi_vbeln
update_picking = gc_true
if_no_generic_system_service = gc_true
TABLES
prot = li_prot
verko_tab = li_verko1
verpo_tab = li_verpo1.
**--------catch exception
CATCH cx_bcs INTO bcs_exception.
CALL METHOD bcs_exception->get_text
* EXPORTING
* preserve_newlines =
RECEIVING
result = error_text.
CATCH cx_root INTO cx_root.
CALL METHOD cx_root->get_text
* EXPORTING
* preserve_newlines =
RECEIVING
result = error_text.
now append the error into internal table and display it .
ENDTRY.
Regards,
Ashwath.
2012 May 28 9:22 AM
Hi Ashwath,
Thanks for your reply.
But its not working for me.
Actually In FM there is no exceptions parameter.. how do this FM catch these exception?
Thanks
Sachin Mahesh Gupta
2012 May 28 8:02 AM
Also, if you set the parameter IF_ERROR_MESSAGE_SEND_0 to space, it will not raise error message and stop the program. The default value is 'X' for this parameter. Change it to space.
2012 May 28 9:29 AM
Hi Shambu,
Thanks for your reply.
But as u suggested to pass IF_ERROR_MESSAGE_SEND_0 as space is not working for me...
error is coming on screen only...
2012 May 28 9:56 AM
Hi Sachin,
Did u try the above code?
It does not required exception in FM. CX_ROOT catch if there is any type of exception.
Regards,
Ashwath.
2012 May 28 10:28 AM
yes Ashwath, I have tried this above code that you have given.. but it is not working for me .. the error is coming on screen only...
2012 May 28 3:37 PM
hello abapers..
could you please help me out of it..
Please let me know your suggestion