2012 Nov 16 11:47 AM
Hi All,
I have to access the protected method of the class in a badi . The class name is CL_WDR_CONTEXT_NODE_VAL and the protected attribute is TABLE_REF.
In the badi i have to get the TABLE _REF attribute value. I could not access from badi because its a protected method.
Please give some suggestions to resolve this.
Thanks,
Pradeep.
2012 Nov 16 3:09 PM
Hello Pradeep,
You should use the public method IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE to return the table values. If this does not suffice and you need the nodes, you could look at other public methods such as IF_WD_CONTEXT_NODE~GET_CHILD_NODES.
Hope this helps.
Thanks,
Venkat.
Message was edited by: Venkat Gowrishankar
Hi All,
I have to access the protected method of the class in a badi . The class name is CL_WDR_CONTEXT_NODE_VAL and the protected attribute is TABLE_REF.
In the badi i have to get the TABLE _REF attribute value. I could not access from badi because its a protected method.
Please give some suggestions to resolve this.
Thanks,
Pradeep.
2012 Nov 16 12:54 PM
You souldn´t want this
But: If the attribute is protected on your system you could inherit the class and access it there.
But on my system the attribute is private. So this does not work.
Regards,
Stefan
2012 Nov 16 1:18 PM
Hi Stefan,
Yes i need that attribute in my badi . And also i have tried to inherit from super class and when i was trying to create its throwing me an error as "Super class has CREATE PRIVATE property so you cannot inherit ".
is there any way in trying by FRIENDS???
2012 Nov 16 2:23 PM
Hi,
oh yes, I didn´t look for instantiation type.
The point with friends is that the SAP-Class must define her friends and it would be a modification.
I don´t see a possibility without modification / enhancement.
Regards,
Stefan
2012 Nov 16 3:09 PM
Hello Pradeep,
You should use the public method IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE to return the table values. If this does not suffice and you need the nodes, you could look at other public methods such as IF_WD_CONTEXT_NODE~GET_CHILD_NODES.
Hope this helps.
Thanks,
Venkat.
Message was edited by: Venkat Gowrishankar
2012 Nov 19 2:03 PM
Hi venkat,
Actually i have used the method GET_CHILD_NODE only .
Here LO_NODE is a context node
CL_WDR_CONTEXT_NODE_VAL is class
TABLE_REF is a protected attribue and it has 2 entries as shown above. i need to access these 2 values.
Hope you understand.
2012 Nov 19 4:14 PM
Hello Pradeep,
You should not access the value of the node directly via its attributes , you should use the methods in the interface IF_WD_CONTEXT_NODE. If you need to return the values for all elements in the node, you should use the method - GET_STATIC_ATTRIBUTES_TABLE ( This would return the values in a table for all the elements in the node - Maybe the table in the screenshot you attached!). You could also loop through each element in the Node and use the method GET_STATIC_ATTRIBUTES or use GET_ATTRIBUTE of interface IF_WD_CONTEXT_ELEMENT to retrieve for a specific attribute.
http://scn.sap.com/docs/DOC-2213 - This doc explains the context and the access methods.
Hope this helps.
Thanks,
Venkat.
2012 Nov 19 5:47 PM
Hi ,
Please check this in SE24 and let me know.
CLASS : CL_WDR_CONTEXT_NODE_VAL
ATTRIBUTE : TABLE_REF
2012 Nov 19 9:29 PM
Hi,
I checked it and please let me know what i need to Know .
Before asking me to check,
Have you tried calling the method which I had mentioned?, Did it not meet your requirement?. Have you looked into the code of the method 'GET_STATIC_ATTRIBUTES_TABLE'.
Have you done a where used list for that attribute?.
BTW, the attribute is Private in my system.
Thanks,
Venkat.
2012 Nov 20 11:54 AM
Hi Venkat,
Its works fine.. You rock!!!! Thanks a lot. But how we have to find out the correct method ??
2012 Nov 20 1:44 PM
Hello Pradeep,
If you work with Web dynpro ABAP contexts, you would have never posed the question .
If you had gone through the document which I had attached above, you would have got a clearer picture of how the WD4A context works and how to use the methods to retrieve the values. A general rule is that when an attribute is private or protected, always look for a public method that would be able to return that value- If there is no method, then it was never intended to be used outside of the class. Do a where used list for the attribute and see how that attribute is affected in the class and see if there is a public method which would help you to return the value.
I hope this helps.
Thanks,
Venkat.
2012 Nov 20 5:08 PM
2012 Nov 28 12:31 PM
Hi venkat ,
Do you have any idea about the POWL auto refresh ???
2012 Nov 28 6:35 PM
Hello Pradeep,
I have not worked with POWL and hence I cannot advice you on it . But from a purely conceptual view, I think you could investigate POWL config transactions ( Ex:POWL_COCKPIT,POWL_QUERY etc..) to configure the Auto refresh functionality for a particular Query.
I am sorry , but this is the best I could do .
Thanks,
Venkat.
2012 Nov 28 6:42 PM