on 09-03-2009 10:31 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.