I am a newbie to dynpro. From whatever programs i have written till now i have observed that whenever we call functions like GET_ATTRIBUTES or SET_ATTRIBUTES in the following way
1) X -> GET_ATTRIBUTE
......................................
2) CALL METHOD X->SET_ATTRIBUTE
..................................
Now in place of X , if i write the NODE variable name (of type IF_WD_CONTEXT_NODE) or ELEMENT TYPE( by using GET_ELEMENT for a node) it works for both of them.
So what is the difference between the two and which is better to use.I understand that node contains an element which refers to the attributes but in this example I am not able to figure out the difference
THANKS
Request clarification before answering.
I guess you are clear with get and set and you are asking the difference between their use with a element and node.
1. Using with element..
when you use get or set attribute with the element then the values for that element you can get and set.
see a node has many element and attribute value for all the elements will be different.
now when you use get_attribute you give parameteres as name of the attribute and value.
so you can see it as one collection of elements and directly you are taking some values from some specific element.
same is the case of set _element.
2. using with the node
then both these mehtods set and get will have one more parameter called index.
by giving the index you can specify which element you want to fetch.
if you donot give any value for the index , lead selection will be used by default.
-
so in a way both are same you are fetching the value of an attribute only but by using node you specifly which element by using the parameter index.
let me know if you still have doubt on this.
thanks
sarbjeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.