Skip to Content
avatar image
Former Member

capturing error messages from po bapi and displaying in dialog box

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 .

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 10, 2008 at 01:06 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 14, 2008 at 05:22 AM

    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,

    Add comment
    10|10000 characters needed characters exceeded