cancel
Showing results for 
Search instead for 
Did you mean: 

Help for getting the error table from BAPI - RETURN Tbale - Error

Former Member
0 Kudos

Hi,

I am using assign class with method (Inside Method I have used Function Module to Cretae Equipment) to create equipment in sap from webdynpro.after creation I am getting return messages in RETURN Table. How to show to users the entire information of RETURN Table data if error or any .

Kindly help.

Thanks in advance.

Dav

Accepted Solutions (0)

Answers (3)

Answers (3)

Phalani2
Participant
0 Kudos

Hi Dav,

I understood your problem. to achieve this

1. Create a context node( ex : node_return_table) with the type of return internal table.

2. use bind_table method to pass the data from your internal table (it_return_table) to your context node (node_return_table), now you have the data in your context node.

3. In the layout insert one table and bind that table with your context data. if run your application you 'l be get your return table data in this table.

Hope this will solve your requirement, if not please do reply me.

Phalani M

Former Member
0 Kudos

Hi Friend,

This code might help you to achieve your requirement.

*Get message manager

DATA: L_CURRENT_CONTROLLER TYPE REF TO IF_WD_CONTROLLER,

L_MESSAGE_MANAGER TYPE REF TO IF_WD_MESSAGE_MANAGER.

L_CURRENT_CONTROLLER ?= WD_THIS->WD_GET_API( ).

CALL METHOD L_CURRENT_CONTROLLER->GET_MESSAGE_MANAGER

RECEIVING

MESSAGE_MANAGER = L_MESSAGE_MANAGER.

DATA: V_MESSAGE_TEXT TYPE STRING.

*When Sales Order is created commit the data

IF NOT V_SALES_DOC IS INITIAL.

CONCATENATE 'Sales Document' V_SALES_DOC 'has been created.' INTO V_MESSAGE_TEXT SEPARATED BY SPACE.

  • Report Success message

CALL METHOD L_MESSAGE_MANAGER->REPORT_SUCCESS

EXPORTING

MESSAGE_TEXT = V_MESSAGE_TEXT.

ELSE.

V_MESSAGE_TEXT = 'Error Creating Sales Order'.

*Report Error message

CALL METHOD L_MESSAGE_MANAGER->REPORT_ERROR_MESSAGE

EXPORTING

MESSAGE_TEXT = V_MESSAGE_TEXT.

Reward points if helpful.

Thanks,

Kranthi

Former Member
0 Kudos

Hi,

You can use the below code to display error in webdynpro

data: l_current_controller type ref to if_wd_controller,

l_message_manager type ref to if_wd_message_manager.

l_current_controller ?= wd_this->wd_get_api( ).

l_message_manager = l_current_controller->get_message_manager( ).

l_message_manager->report_t100_message(

exporting

msgid = return-msgid

msgno = return-msgno

msgty = return-msgty

).

Regards,

Shruthi

Former Member
0 Kudos

Hi,

Thanks for the reply. In my return table more than one record will come may be 3 or 4. how to show all the rows to the user. Is it any provision to show all the messages.

Thanks,

dav

Former Member
0 Kudos

Hi,

You will have to show each message individually within a loop. OR, concatenate all the messages together in a loop and then show the error message.

Regards

Wenonah

Former Member
0 Kudos

Hi,

Just loop at the BAPIRET table and diplay the messaes. All the messages are displayed one below the other in the message area. This will solve your issue.

Shruthi