For whom did I wrote this class?
If you have not been able to attend week 4 of the openSAP course and you do not have to time to type all the code yourself.
Another target group might be those participants whose RAP business object in week 4 does not work as expected.
What do you have to do?
- Create two new packages
- ZRAP_#### within ZLOCAL
- ZRAP_TRAVEL_U_#### as a sub package of ZRAP_####
- Create a class zcl_generate_week4_#### within the package ZRAP_TRAVEL_####
- Replace the source code of the template with the source code that you can find on our github repository
- Replace all occurrences of #### with an own unique number or unique combination of numbers and characters (for example 5678)
(You will find #### in line 1, 13, 14 and 45)
- Run the class as a console application using F9
Result
The class does the following:
- It creates all objects that have been created in week 4 beside the behavior implementation classes.
What is left to do
- Open the behavior definition and click on the names of the behavior implementation classes and use the quick fix to generate both classes as described in step 4 and step 6 of my script:Create behavior implementation class for travel
Create behavior implementation class for booking
- Change the code in the behavior implementation class for Travel zbp_i_rap_travel_u_#### and Booking zbp_i_rap_booking_u_####.This is necessary since in the script I named the control structures zsrap_travel_x_#### and zbp_i_rap_booking_#### whereas the generator also adds a '_u' into the name of the control structures.
So the two lines of code that have to be changed should now read as follows in zbp_i_rap_booking_u_####
legacy_entity_x-_intx = CORRESPONDING zsrap_booking_x_u_####( <entity> MAPPING FROM ENTITY ).
and in zbp_i_rap_travel_u_####
legacy_entity_x-_intx = CORRESPONDING zsrap_travel_x_u_####( <entity> MAPPING FROM ENTITY ).
- Add the following statement to your service definition
expose /DMO/I_Airport as Airport;
- Activate the service binding