cancel
Showing results for 
Search instead for 
Did you mean: 

Help regarding if_component controller interface ...

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Anu

Whats your context node .Is it Booking or Supply.

If its Booking then

data: Itab_Bookings type If_COMPONENTCONTROLLER=>Elements_supply,

should be replaced with

data: Itab_Bookings type If_COMPONENTCONTROLLER=>Elements_booking,

Regrads

Naresh

Former Member
0 Kudos

My context is supply .... Please provide an answer.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks to all,

Anupma Chandra.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please Do Not double post your questions. You asked this exact same question just a few days ago:

abhimanyu_lagishetti7
Active Contributor
0 Kudos

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