cancel
Showing results for 
Search instead for 
Did you mean: 

capturing error messages from po bapi and displaying in dialog box

0 Kudos

Hi Everybody.,

I am new to Webdynpro Abap . I had a requirement to create a purchase order Webdynpro . I used the BAPI 'BAPI_PO_CREATE1' . How can i display the error messages from Return tab of the BAPI and display as a dialog box to the user .

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi sivakumar

u have to creat a massage class and

declair it like

REPORT ZDTK_FI_CRDB NO STANDARD PAGE HEADING

LINE-COUNT 65(5)

LINE-SIZE 80

MESSAGE-ID ZTAR_FI

.

and u can display the error massages where u need like

*IF SY-SUBRC 0.

*MESSAGE E002.

*LEAVE LIST-PROCESSING.

*ENDIF.

Regards,

Former Member
0 Kudos

sivakumar,

you can write a method like this

method display_message .

data l_message type string.

if message is initial.

move returnmessage-message to l_message.

else.

move message to l_message.

endif.

case messagetype.

when 'E'.

  • report message

call method wd_this->lo_message_manager->report_error_message

exporting

message_text = l_message.

when 'S'.

  • report message

call method wd_this->lo_message_manager->report_success

exporting

message_text = l_message.

when 'W'.

  • report warning

call method wd_this->lo_message_manager->report_warning

exporting

message_text = l_message.

when others.

endcase.

endmethod.

that has message of type string and messagetype of type char1 ,returnmessage of type bapiret2

call this method like

display_message( exporting

message = l_message

messagetype = 'S' ).

data l_message type string value 'error'.

Thanks

Bala Duvvuri

0 Kudos

Hi bala.,

thank u for ur information . i have one more query on this.. i have an internal table which contains a lot of error, warning and status messages, how can i display all of then at a time in a diolog box similar to me21n transaction error display. kindly guide me on this..

Regards.,

S.sivakumar

Former Member
0 Kudos

Hi Sivakumar,

Create a view with a table to display all the error messages. Call the view as a popup in a separate window.

Ranganathan.