on 04-24-2009 10:47 AM
Hi all,
I am using a web service to call a RFC function module into my web dynpro component.When I create a new service then a new custom controller will created and in this controller a method is created for FM.
Now my query is, when I run the WD application, FM will retun a table at my end and I want to use it at view level.
I declared a global table in Component controller attribute and want to fill that table when I execute service. when I use wd_this-><Table name> (at custom controller level, in method for FM) then it shows me that this table is not exist.
Please suggest how to fetch table's value.
Thanks
Sanket sethi
You can't use WD_THIS to access the Component Controller from custom controllers or views. WD_THIS refers to the local object (the custom contorller or the view). Use the WD_COMP_CONTROLLER object instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jung,
Yes I know that wd_this-> represents the local declarations. I also check WD_COMP_CONTROLLER
in the method in custom controller but it does not recognised by the system.
I also use if_componentcontroller but it also did not work.
Suggest how to fetch data into Global table into componentcontroller or in View level.
Thanks
Sanket sethi
Please be specific as to what you mean by "it does not recognised by the system". Is the WD_COMP_CONTROLLER object itself not recognized or the internal table that you added as an attirbute to the object? If it is the second case, make sure you have have fully activated the component controller. Only on activation does the underlying class get generated and make your added objects visible.
Yes now I am able to get the WD_COMP_CONTROLLER by adding it into custom controller. But now I am facing another issue, the table which I declare in component controller attribute is not recognised by system.It shows it as unknown. Here is the code which I used to get this:
loop at WD_COMP_CONTROLLER->T_HIRE.
endloop.
The message comes out Field T_HIRE is unknown. How to get this table on custom controller.
Also If I want to use it on view level then what will I use instead of WD_COMP_CONTROLLER.
Please suggest.
>The message comes out Field T_HIRE is unknown.
Sounds like you haven't activated the Component Controller yet.
>Also If I want to use it on view level then what will I use instead of WD_COMP_CONTROLLER.
You should have WD_COMP_CONTROLLER as an attribute on the View level as well.
Also depending upon how the data is used, consider putting it in the Component Controller Context and do mapping of that Context to other Views/Controllers.
I activated the component controller already but after that I am still facing this issue. This issue is my high priorty.
Also for View level, actually if I am modify the view at run time then I am using Service call method in modify view.Then how will I get the View on custom controller level.
Please suggest.
Did you mark that attribute as Public in the Component Controller?
>Also for View level, actually if I am modify the view at run time then I am using Service call method in modify view.Then how will I get the View on custom controller level.
I have no idea what you are describing. Do you want to try to access the view object from the custom controller? That is absolutely not allowed. If you need to share data between the two - it should be int the component controller and cross mapped.
You don't check REF TO unless you want it to be treated as a data reference. Active it and make the attributes public - that is all there should be to it. It is working in my system. Have you doubled clicked on the Associated Type of the WD_COMP_CONTROLLER in the attributes view of the Custom Controller. That should show you in a new code window what all is exposed by your Component Controller object.
Yes when I double click on componentcontroller it shows the controller in seperate window. But the table which I declared into componentcontroller attribute is not accesable in custom controller and checked it as Public.
I activated the component controller again but I don't know why I am facing this issue.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.