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: 

Error coming on screen during FM WS_DELIVERY_UPDATE

Former Member
0 Kudos
2,717

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

10 REPLIES 10

Former Member
0 Kudos
412

Add exception error_message = 1.

This will not display the message.

0 Kudos
412

Add this exception and check!

0 Kudos
412

Did you use this?

Former Member
0 Kudos
412

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.


0 Kudos
412

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

Former Member
0 Kudos
412

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.

0 Kudos
412

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...

Former Member
0 Kudos
412

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.

0 Kudos
412

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...

0 Kudos
412

hello abapers..

could you please help  me out of it..

Please let me know your suggestion