cancel
Showing results for 
Search instead for 
Did you mean: 

Doubts in ABAP WebDynpro

Former Member
0 Kudos

Hi Experts,

I am new to ABAP WebDynpro and self-learning going through SDN stuff and other online-help. Please provide me

your kind explanation on below doubts.

1. When do we use GET_ATTRIBUTE and GET_STATIC_ATTRIBUTE

2. How to read the index of a particular selected row in table?

3. How do you change position of a particulr node dynamically?

4. Is it possible to execute a component without a window?

5. Is it possible to run a VIEW without embeding into a window in Webdynpro application?

6. How to read the content entered in PARAMTER and SELECT-OPTION elements in ABAP Webdynpro? Can anybody pass code how to read entries?

I mean GET_ATTRIBUTE or GET_STATIC_ATTRIBUTES is used for reading attribute value.

7. Is it possible to fix the Message window position? Show at the bottom of a screen? Please provide some code for this.

8. Is it possible to change the color of a laber attached to a attribute dynamically? For example somefield is mandatory but you forgot to enter and press on u2018Continueu2019 then program should show that elementu2019s lable with redcolor text. Please provide me example code.

Thanks in advance for the support and useful explanation!

Regards,

Meera.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member206441
Contributor
0 Kudos

Hi

Refer the answers inline

1) When do we use GET_ATTRIBUTE and GET_STATIC_ATTRIBUTE

GET_ATTRIBUTE

Method to get the values of a context attribute.

The prerequisite for this method is that the application knows the data type of the attribute.

The value of the given attribute is copied to the export parameter. To do this the export parameter must have a data type to which a value can be written.

GET_STATIC_ATTRIBUTES

This method copies the static attributes to the transferred variable. If the structure is not identical, a move-correspondingis performed, which is not as efficient as a direct move, but is still useful in many cases.

Static attributes are those that either have been declared or that belong to the structure with which the node was declared.

2) How to read the index of a particular selected row in table?

data: lr_element type ref to if_wd_context_element,

lv_index type i.

lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

lv_index = lr_element->get_index( ).

3) How do you change position of a particulr node dynamically?

Explain Bit deeply

4) Is it possible to execute a component without a window?

No it is not possible, actually the component view can be viewed by embedding it to the window

5) Is it possible to run a VIEW without embeding into a window in Webdynpro application?

No it is not possible, without window you cant run the view

6) Is it possible to run a VIEW without embeding into a window in Webdynpro application?

DATA LO_ND_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_NODE.

DATA LO_EL_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.

DATA LS_MAIN_NODE TYPE WD_THIS->ELEMENT_MAIN_NODE.

DATA LV_INP_VALUE LIKE LS_MAIN_NODE-INP_VALUE.

  • navigate from <CONTEXT> to <MAIN_NODE> via lead selection

LO_ND_MAIN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = 'MAIN_NODE' ).

  • get element via lead selection

LO_EL_MAIN_NODE = LO_ND_MAIN_NODE->GET_ELEMENT( ).

  • get single attribute

LO_EL_MAIN_NODE->GET_ATTRIBUTE(

EXPORTING

NAME = `INPUT_VALUE`

IMPORTING

VALUE = LV_INP_VALUE ).

7) Is it possible to fix the Message window position? Show at the bottom of a screen?

Yes it is possible to show the messages by using the message area UI element in the needed position

8. Is it possible to change the color of a laber attached to a attribute dynamically? For example somefield is mandatory but you forgot to enter and press on u2018Continueu2019 then program should show that elementu2019s lable with redcolor text.

Im working onit and let you know after i complete.

Regards

Arun.P

Former Member
0 Kudos

Hi Arun,

Thanks alot for the effort and replies in detail. It helped me to understand nature of program flow.

Q.9. Is it possible to hide UI Elements above to a particular UI Element in the UI Element Hierarchy?

For Example Screen looks like below:

Sales Organization: _______________

Country: _______________

Open Items(Invoice)

Closed Items(Invoice) Display

< this area is table with fields Invoice number, amount , and other details >

" Here Open Items and Closed Items are radio buttions grouped. By default 'Open Items' is selected.

When I select second option 'Closed Items', is it possible to replace user input option from 'Country' with Customer Number

?

Regards,

Shaik.

former_member206441
Contributor
0 Kudos

Hi,

Find the answers inline.

Q.9. Is it possible to hide UI Elements above to a particular UI Element in the UI Element Hierarchy?

Yes it is possible to do that. you have to create a attribute and bind the attribute of type wdui_visiblity with the values of '01' to dispaly and '02' to hide it.

Bind the attribute with value '01' to the field country. set the arrtibute of the arrribute to '02' when u select the second radio button, thats it.

Regards

Arun.P

Former Member
0 Kudos

Hi,

Please go through the link below for most of your answers.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a282c952-0801-0010-1eb5-87953e036...

For other answers, please search the forum. Or you may also try this SDN wiki, it is a nice place to get most of the answers.

https://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproABAP+Home

Regards,

Edited by: Mohammed Majaz Shaikh on Dec 23, 2010 6:50 AM