cancel
Showing results for 
Search instead for 
Did you mean: 

what will be the result of this statement

Former Member
0 Kudos

Hi experts

Plz tell me the result of these statements, i know the syntax:

IF lo_nd_lt_pfo IS INITIAL.

WD_COMP_CONTROLLER->gv_text = wd_assist->if_wd_component_assistance~get_text( key = '049' ).

CALL METHOD WD_COMP_CONTROLLER->gv_message_manager->REPORT_ERROR_MESSAGE

EXPORTING

MESSAGE_TEXT = WD_COMP_CONTROLLER->gv_text

VIEW = 'VIEW_MAIN'.

EXIT.

Why are we passing values to an interface over here.?What will be the output if node is initial?

Thanks in advance

Gaurav kaneria

Edited by: GauravKaneria on Jul 4, 2011 11:28 AM

Accepted Solutions (1)

Accepted Solutions (1)

Aisurya
Participant
0 Kudos

Hi Gaurav ,

You have declared gv_text and gv_message_manager in the Component controller in Attributes section,for raising an error message when the node is initial.

Regards

Aisurya

Answers (4)

Answers (4)

former_member389677
Active Participant
0 Kudos

Hi Gaurav,

The given code is used for validating lo_nd_lt_pfo. If lo_nd_lt_pfo is initial the it will report an error message .

The method in interface if_wd_component_assistance get_text will read the text corresponding to 049.

CALL METHOD WD_COMP_CONTROLLER->gv_message_manager->REPORT_ERROR_MESSAGE will display error message text.for ; key 049.

For more information : http://wiki.sdn.sap.com/wiki/display/WDABAP/AssistanceclassfunctionalityinWDA

saravanan_narayanan
Active Contributor
0 Kudos

if_wd_component_assistance~get_text is an interface method implemented in CL_WD_COMPONENT_ASSISTANCE class. And your assistance class (WD_ASSIST object of assistance class) with default inherit the CL_WD_COMPONENT_ASSISTANCE class..

so by passing key ('049') to if_wd_component_assistance~get_text method, you will get the corresponding text of the text element ('049').

hope this clarifies the behavior of get text.

Former Member
0 Kudos

Hi,

If node is initial, you are raising error message.

You are using assistance class. you are raising messages in Component controller. so that stement

WD_COMP_CONTROLLER . Hope you understand.

Cheers,

Kris.

Former Member
0 Kudos

Hi,

This statement basically checks if a particular node is initial or note in case the node is initial we are getting a text based on text value from text repository and generating a error message.

If node is initial and we try to read any elemnts from node its gives us the short dump. So may be to avoid the dump here we generate the message.

Thanks

Pradeep