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: 

ISSUE with ABAP error handling in call transaction

bala_krishna007
Participant
0 Kudos

Hello,

I have a custom program developed which is an GRID DISPLAY output  where some of the custom fields are editable and when we press save at the output there is a BDC called which calls  ME22 and does some update .

I am using call transaction and collecting the error messages into an internal table of type BDCMSGCOLL . Now I  want to dispaly the error messages  and I am using format_message function module to display the error details.

But neither the write statement or FORMAT_MESSAGE is displaying the out put.

Please suggest how can I show the error messages and note that after grid display output I am dispalying error messages.

Thanks,

Balu

1 ACCEPTED SOLUTION

Ashg1402
Contributor
0 Kudos

Hi,

BDCMSGCOLL is a structure.

Put a Loop in the table ( where msgty eq 'E' ) which you created with type bdcmsgcoll and inside it call function 'FORMAT_MESSAGE'.

You need to pass the proper values. Like -

  

call function 'FORMAT_MESSAGE'

   exporting

     id              = <table>-msgid

     lang            = sy-langu

     no              = <table>-msgnr

     v1              = <table>-msgv1

     v2              = <table>-msgv2

     v3              = <table>-msgv3

     v4              = <table>-msgv4

   importing

     msg             = v_msg                    " Collect the message in this field

   exceptions

     not_found       = 1

     others          = 2.

For more help refer to this link.

http://scn.sap.com/thread/267454

2 REPLIES 2

Ashg1402
Contributor
0 Kudos

Hi,

BDCMSGCOLL is a structure.

Put a Loop in the table ( where msgty eq 'E' ) which you created with type bdcmsgcoll and inside it call function 'FORMAT_MESSAGE'.

You need to pass the proper values. Like -

  

call function 'FORMAT_MESSAGE'

   exporting

     id              = <table>-msgid

     lang            = sy-langu

     no              = <table>-msgnr

     v1              = <table>-msgv1

     v2              = <table>-msgv2

     v3              = <table>-msgv3

     v4              = <table>-msgv4

   importing

     msg             = v_msg                    " Collect the message in this field

   exceptions

     not_found       = 1

     others          = 2.

For more help refer to this link.

http://scn.sap.com/thread/267454

0 Kudos

Hi Ashish,

Thanks for your message .

I had used the format_message with appropriate parameters.

I solved it my self using REUSE_ALV_LIST_DISPLAY.

Thanks,

Balu