Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_Fischer
Product and Topic Expert
Product and Topic Expert
805

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?



  1. Create two new packages

    • ZRAP_#### within ZLOCAL

    • ZRAP_TRAVEL_U_#### as a sub package of ZRAP_#### 



  2. Create a class zcl_generate_week4_#### within the package ZRAP_TRAVEL_####

     

  3. Replace the source code of the template with the source code that you can find on our github repository

  4. 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)



  5. Run the class as a console application using F9


 

Result


The class does the following:

  1. It creates all objects that have been created in week 4 beside the behavior implementation classes.


What is left to do



  1. 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

  2. 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 ).​


  3. Add the following statement to your service definition
    expose /DMO/I_Airport as Airport;​


  4. Activate the service binding

5 Comments