cancel
Showing results for 
Search instead for 
Did you mean: 

Display Message in WD Application

Former Member
0 Kudos

Hello Everyone,

I am a bit new to WD ABAP. So, please bare with me if I am asking very fundamental questions. My requirement is as follows:-

After executing a BAPI in WD Application, I want to show the return messages of the BAPI in very nice manner. For Eg:- If the BAPI returns the message type as "S" i.e Success and a Message text as "Document posted successfully: BKPFF 060000015610002009 ". I want to show all the information in a message area with a Green bullet. If it return an error message I want to show all the information, but with a red bullet at the starting of the line.

Is this possible? If it is possible, could anyone explain me with a step by step procedure of how to acheive this. I would greatly appreciate your help.

Regards,

Gopal Yarlagadda.

Edited by: Gopal on Sep 3, 2009 11:31 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I assume that, the messages are retunrd from a BAPI .

DATA: es_message type bapret2 or any strcutre of your type or message manager messages table type.

(Refer IF_WD_MESSAGE_MANAGER).

loop at lt_msg into ls_msg.
    MESSAGE ID 'DEMO' TYPE 'E' NUMBER '139'
    WITH liv_id INTO es_messages-message.
    es_messages-id         = 'DEMO'. "Mesage class
    es_messages-type       = 'E'.
    es_messages-number     = '139'.
    es_messages-message_v1 = liv_id.
 or
if ls_msg-type eq 'E'.
lv_str = "Success ful'.
endif.
es_message-id = ls_msg-id.
es_message-message = lv_str.

endif.

Maintain the messages in the Se91.

By defalut as per the message type the framwork handles

the Icon.

But if you want some specific icon to be displayed then you

need have your own table that shows these meesages with custom icons.

Regards,

Lekha.

Edited by: Lekha on Sep 3, 2009 3:17 PM

Former Member
0 Kudos

Hi Lekha,

Thanks for your reply. I am still working on my previous application that we were discussing till yesterday. Now, my problem is regarding displaying message returned by the BAPI as shown in the following screenshot.

http://i28.tinypic.com/2wf7eqh.jpg

My scenario is, after each row in the table of my application, BAPI_ACC_DOCUMENT_POST bapi will be executed. But, as you can see in the screenshot, the return table is only displaying the return message of the BAPI executed for the last line of the table.

I want to display the BAPI return messages everytime the BAPI is executed.

I hope you understand my issue. Please let me know if you need more clarification. I greatly appreciate your help.

Regards,

Gopal Yarlagadda.

Former Member
0 Kudos

Hi,

After you get the messages in a table. Loop at them use the FM FORMAT_MESSAGE to get the message and pass the same to the

message manger instance to show the error/succsss.

Former Member
0 Kudos

Hi Lekha,

As I said previously, I am new to ABAP and it is a bit hard to understand the ABAP terminology. Could you please give me the code for the method you explained . I would appreciate your help.

Regards,

Gopal.

Former Member
0 Kudos
  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

lo_api_controller ?= wd_this->wd_get_api( ).

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager.

loop at lr_documents into ls_documents.

call function 'bapi_execute'...that returns the messages

loop at lt_retun into ls_return.

lv_str = ls_return-message.

  • report message

CALL METHOD lo_message_manager->report_error_message

EXPORTING

message_text = lv_str

attribute_name = 'ACCOUNT'.

endloop.

endloop.

Can you paste your looping code where you are calling the method etc...so that I can modify it.

Former Member
0 Kudos

Hi Lekha,

Thanks a lot for your help. What is the "attribute_name = 'ACCOUNT' " that I should give in my case?

Regards,

Gopal.

Former Member
0 Kudos

Hi,

Check the interface if_wd_message_manager.

Sorry, for REPORT_ERROR_MESSAGE there is no ATTRIBUTE parameter. This will only show the error.

If you want to highlight some specific cell where error has occured then you need to use

REPORT_ATTRIBUTE_ERROR_MESSAGE. This later method, yuo can pass the attribute name (the errored cell/column name) and the elment reference.

Former Member
0 Kudos

Hi Lekha,

Does this code only return error messages. What if the BAPI returns a Success message?

Regards,

Gopal.

Former Member
0 Kudos

Use REPORT_SUCCESS Check this online help [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/6c/7aae42cd7fb611e10000000a155106/content.htm] But dont you want to display the messages in your 2nd table below ? You screenshot shows the error being displayed in the table below. hence this Question. Radhika

Answers (2)

Answers (2)

Former Member
0 Kudos

CHECK out this thread :

I hope it helps.

Former Member
0 Kudos

This link will help you

Best regards,

Rohit