on 02-19-2008 6:39 PM
Hi Experts,
Reference:SAP Webdynpro for ABAP SAP Material for Participant exercise 7.
In the exercise 7 - Binding Internal Tables to Context Nodes
I am using as per the exercise following code in METHOD 'flighttab_fill' of component controller
---
CALL METHOD cl_net310_flightmodel=>read_flights
EXPORTING
i_carrid = stru_flightinfo-carrid
i_connid = stru_flightinfo-connid
IMPORTING
e_flights = it_flighttab.
---
I have not created cl_net310_flightmodel in my exercise.It was not given in the exercise too.
While activation of the component i am getting error
The Type cl_net310_flightmodel=>read_flights is unknown.
Can you please advice if you know anything.
Thanks and Regards,
Viswanath
Did not checked but it is useful answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Follow the steps for creation of Class and the method in the excercise,
1) CREATE ZIT_FLIGHTTAB(AN INTERNAL TABLE) IN SE11 UNDER DATA TYPE->TABLE TYPE.
2) GIVE LINE TYPE AS SFLIGHT. SAVE,CHECK AND ACTIVATE THE INTERNAL TABLE.
3) CREATE GLOBAL CLASS ZNET_NET310_FLIGHTMODEL_## USING TRANSACTION CODE SE24.
4) IN THE ATTRIBUTES TAB, ENTER AS FOLLOWS,
ATTRIBUTE LEVEL VISIBILITY TYPING ASSOCIATED TYPE
TY_FLIGHTS STATIC ATTRIBUTE PUBLIC TYPE SFLIGHT
ZIT_OUTTAB STATIC ATTRIBUTE PUBLIC TYPE TY_FLIGHTS
5) IN THE METHODS TAB, ENTER AS FOLLOWS,
METHOD LEVEL VISIBILITY DESCRIPTION
READ_FLIGHTS STATIC METHOD PUBLIC READ FLIGHT DATA
6) CLICK ON PARAMETERS, ENTER AS FOLLOWS,
PARAMETER TYPE TYPING METHOD ASSOCIATED TYPE
I_CARRID IMPORTING TYPE SFLIGHT-CARRID
I_CONNID IMPORTING TYPE SFLIGHT-CONNID
E_FLIGHTS EXPORTING TYPE ZIT_FLIGHTTAB
7) DOUBLE CLICK ON METHOD:READ_FLIGHTS AND ENTER FOLLOWING SORCE CODE IN BETWEEN METHOD AND ENDMETHOD.
SELECT * FROM SFLIGHT INTO TABLE ZIT_OUTTAB WHERE CARRID = I_CARRID AND CONNID = I_CONNID.
E_FLIGHTS] = ZIT_OUTTAB[.
😎 SAVE CHECK AND ACTIVATE CLASS.
NOTE :
PLEASE FOLLOW SAME STEPS FOR OTHER METHODS THAT COMES IN FOLLOWING EXCERCISE IN SAME CLASS i.e ZCL_NET310_FLIGHTMODEL_##.
In next few tutorials you will need to create more methods. Follow steps to add new methods as and when required.
Regards,
Achyut
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Thanks for your detailed reoly.
I am getting one more problem while doing example of populating Booking info to the Bookings table by selecting one of the row in the flight table.I could not see bookings data even though empty bookings table is displayed in the Display view after selecting a row in the 1st table.
The code in the Supply Function Bookings_Read is
method BOOKINGS_READ .
data:
Stru_flight type IF_COMPONENTCONTROLLER=>Element_Flight_info,
Itab_Booking type IF_COMPONENTCONTROLLER=>Elements_Bookingtab.
* Get Parent Element
CALL METHOD parent_element->get_static_attributes
IMPORTING
STATIC_ATTRIBUTES = Stru_flight.
* read bookings
select * from sbook
into corresponding fields of table Itab_Booking
where carrid = Stru_flight-carrid
and connid = Stru_flight-connid
and fldate = Stru_flight-fldate.
* bind all the elements
Node->Bind_Table(
New_Items = Itab_Booking
Set_Initial_Elements = Abap_False ).
endmethod.
Waiting for your valuable suggestion.
Do you have any alternatives for this to display bookings table.
Many Thanks In Advance.
Viswanath
Hi,
In our systems we will not be having the class mentioned in SAP training.
Either you can create a class OR
short cut is just write select queries so as to populte the it_flighttab and skip the portion of class code in your program.
It will serve the purpose.
Regds,
Akshay
Edited by: Akshay Bhagwat on Feb 20, 2008 10:43 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply.
I tried with
Select * from sbook into table .... where carrid = stru_flightinfo-carrid and connid = stru_flightinfo-connid and....
and also with
Select <column list> from sbook into table .... where carrid = stru_flightinfo-carrid and connid = stru_flightinfo-connid and....
but nothing is populated to 2nd table.
Regards,
Viswanath
Hi,
You need to check if the said class is available in your system. Else, create a z-class and use that instead. Implement your own method to read flights, which would be nothing but reading from SFLIGHT for the given carrid and connid.
Regards,
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply.
I tried with
Select * from sbook into table .... where carrid = stru_flightinfo-carrid and connid = stru_flightinfo-connid and....
and also with
Select <column list> from sbook into table .... where carrid = stru_flightinfo-carrid and connid = stru_flightinfo-connid and....
but nothing is populated to 2nd table.
Regards,
Viswanath
User | Count |
---|---|
76 | |
10 | |
8 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.