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: 

CJ02 Error

Former Member
0 Kudos


Hello All,

I want capture error message which are displayed in ALV grid Pop-Ups in an internal table using BDC. Any method available for that. Also is there any FM available to upload settlement rule in CJ02. I have used one FM "K_SRULE_SAVE_UTASK" but this FM does not have any validations or checks before creating entries in table COBRB. Any other to upload the settlement rule.?

1 REPLY 1

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

In BDC.

DATA:    it_msg      TYPE TABLE OF bdcmsgcoll.

         

     CALL TRANSACTION 'XK01' USING it_bdcdata

                              MODE  'N'

                              UPDATE 'A'

                              MESSAGES INTO it_msg.

  IF sy-subrc <> 0.

       LOOP AT it_msg INTO wa_msg.

         CALL FUNCTION 'FORMAT_MESSAGE'

           EXPORTING

             id        = wa_msg-msgid

             lang      = sy-langu

             no        = wa_msg-msgnr

             v1        = wa_msg-msgv1

             v2        = wa_msg-msgv2

             v3        = wa_msg-msgv3

             v4        = wa_msg-msgv4

           IMPORTING

             msg       = v_text

           EXCEPTIONS

             not_found = 1

             OTHERS    = 2.

         .

         IF sy-subrc = 0.

           wa_error-index = v_count.

           wa_error-lifnr = <wa>-lifnr.

           wa_error-name1 = <wa>-name1.

           wa_error-text  = v_text.

           APPEND wa_error TO it_error.

           CLEAR wa_error.

         ENDIF.

       ENDLOOP.

     ENDIF.

    

Hope it helpful,

Regards,

Venkat.