on 07-14-2008 9:56 AM
Hi All,
I was trying to implement supply function for practice. I copied this code below from the tutorial and this doesnt work.
I have made a VBAK and VBAP table display, its not a sflight display. Please tell me how do I modify this code so that it works for my scenario. What is happening is it says Object IF_COMPONENTCONTROLLER doesnot exist and I dont know what is Elements_Bookings. Can some one explain where are the classes and object given belowin the code are coming from. I am lost ......
tried double kliking on if_componentcontroller but its not happening.
method GET_SUPPLY .
data: Itab_Bookings type If_COMPONENTCONTROLLER=>Elements_Bookings,
I found out another interface whos name is IG_COMPONENTCONTROLLER. But this IG_...... interface do not have a method name elements_bookings.
This is wrf to my question posted above about trying to implement supply function with the help of tutorial no. 4 available on the internet. Please help.
method GET_BOOKINGS . data: Itab_Bookings type IF_COMPONENTCONTROLLER=>Elements_Bookings, Stru_Bookings like line of Itab_Bookings, Stru_FlightList type if_componentcontroller=>Element_FLIGHT_LIST. parent_element->get_static_attributes( importing static_attributes = Stru_FlightList ). Itab_bookings = CL_WDABAP_FLIGHT_MODEL=>GET_BOOKINGS( CARRID = Stru_FlightList-airlineid CONNID = Stru_FlightList-connectid FLDATE = Stru_FlightList-flightdate ). node->bind_table( Itab_bookings ). endmethod.
Thaks,
Anu.
Hi Anu,
data: Itab_Bookings type If_COMPONENTCONTROLLER=>Elements_Bookings
Here Elements_Bookings nothing but Bookings is the context name.
If ur Context name is header_items,
Then
Itab type If_COMPONENTCONTROLLER=>Elements_header_items.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The answer was too good. However I am still facing some problem, incse if you can make any guess that would be helpful.
this is my code:-
method GET_SUPPLY .
data: Itab_Bookings type If_COMPONENTCONTROLLER=>Elements_supply,
Stru_Bookings like line of Itab_Bookings,
Stru_FlightList type if_componentcontroller=>Element_VBAK_NODE.
parent_element->get_static_attributes( importing static_attributes = Stru_FlightList ).
Itab_bookings = CL_WDABAP_FLIGHT_MODEL=>GET_SUPPLY
( VBELN = Stru_FlightList-VBELN ERNAM = Stru_FlightList-ERNAM
VKBUR = Stru_FlightList-VKBUR ).
node->bind_table( Itab_bookings ).
endmethod.
Here it gives an error saying
"IG_COMPONENTCONTROLLER-" expected, not "IF_COMPONENTCONTROLLER=>ELEMENT
Now if I change if_controller to ig_controller it would again give another error saying:-
*The type "ELEMENTS_SUPPLY" is unknown. *
Can anyone help. The name of the parent node is node_vbak and supply function node is suuply and the method name here is get_supply.
Rgds,
Anu.
Thanks to all,
Anupma Chandra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anu
you are making VBAK and VBAP table display.
follow the steps:
go to context and create a context Node VBAK from dictionary VBAK
cardinality : 0..n
SupplyFunction : GET_VBAK
create context node VBAP directly under VBAK from dictionary VBAP
cardinality : 0..n
SupplyFunction: GET_VBAP
go to methods Tab, you find two supply functions : GET_VBAK( to fill VBAK) and GET_VBAP( to fill VBAP)
place the code :
method GET_VBAP.
data: Itab_vbap type wd_this=>Elements_vbap,
Stru_vbap like line of Itab_vbap,
Stru_vbak type wd_this=>Element_vbak.
parent_element->get_static_attributes( importing static_attributes = Stru_vbak ).
select * from vbap into table itab_vbap where vbeln = stru_vbak-vbeln.
node->bind_table( Itab_bookings ).
endmethod.
I hope it is clear now
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
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.