Professional Documents
Culture Documents
Contents:
Introduction to internationalization Online Text Repository Message handling
Internationalization
The process by which language specific text is detached from the program code that uses it is known as Internationalization. This allows the same program to operate in multiple languages without needing different versions of the code for each language.
Use the WD code wizard to select the proper OTR text and generate the coding.
data: ... ... OTR_text
type string.
OTR_text = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'SOTR_VOCABULARY_BASIC/MATERIAL_MASTER' ). ... ... * set single attribute Elem_Lable_Text->set_Attribute( exporting Name = `TF_LABLE_3` Value = OTR_TEXT ).
A comonent assistence class can be associated to every WD component Attribute wd_Assist is available in every controller of the component for accessing texts with method get_text
Handling of Message
The handling of messages can be controlled in the WD application
Messages NOT listed in the message area box - Messages are listed in a sequence
Note: feature released with SP1
Categories of Messages
Arbitrary text can be used as a message text ABAP OO exceptions can be used Reuse of existing T100 message ID, No.
Text
EXCEPTION
ATTRIBUTE
Parameter
T100
Example * report message CALL METHOD l_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE EXPORTING MESSAGE_TEXT = '&V2 is not a valid date' ELEMENT = Elem_Flights ATTRIBUTE_NAME = 'FLDATE' PARAMS = lt_messages.
Kind of Messages
Text
REPORT_ATTRIBUTE_ERROR_MESSAGE Reports a WD Exception for a Context Attribute
REPORT_SUCCESS
REPORT_WARNING REPORT_ERROR_MESSAGE REPORT_FATAL_ERROR_MESSAGE
EXCEPTION
REPORT_ATTRIBUTE_EXCEPTION REPORT_EXCEPTION REPORT_FATAL_EXCEPTION Reports a WD Exception for a Context Attribute Reports a Web Dynpro Exception (May Return) Reports a Fatal Web Dynpro Message
T100
REPORT_T100_MESSAGE REPORT_ATTRIBUTE_T100_MESSAGE Reports a Message Using a T100 Entry Reports a WD Exception for a Context Attribute
Create a message
Use the WD code wizard to create the required coding to report a message.
* 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 * report message CALL METHOD l_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE EXPORTING MESSAGE_TEXT = 'REPORT_ATTRIBUTE_ERROR_MESSAGE' ELEMENT = Elem_Flights ATTRIBUTE_NAME = 'CITYFROM'.
SAP AG 2005, Title of Presentation / Speaker Name / #
Use the WD code wizard to create the required coding to report a T100 message.
* 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 * report message CALL METHOD l_message_manager->REPORT_T100_MESSAGE EXPORTING MSGID = 'E1' MSGNO = '360' MSGTY = 'S' P1 = ' -> REPORT_T100_MESSAGE'.
SAP AG 2005, Title of Presentation / Speaker Name / #
Only a view controller has these hook methods. The method WDDOBEFOREACTION before an action performed, can be used for data validation.
You should now be able to: Understand ABAP WD support for Online Text Repository Report messages to the user using the IF_WD_MESSAGE_MANAGER interface