The most Important thing I missed in this video since I can't edit this video now: that we are calculating lv_max_booking/max_booking_suppl_id two time:- For the first time using the read entities statement, we read the data from the transactional buffer for this travel for all bookings ( in transactional buffer always have DB data + additional data which the user creates during this session) . The second time from importing parameter entities this will be useful in the case of the draft scenario as of now you can ignore what will be explained in the draft.
Hi, I'm following your playlist and today I could implement the early numbering logic. Thanks for your explanation. I don't understand in which case the second reduce would be useful, there is always just one record in the entities table. Could you maybe explain in which case would have another entries there? Could I simulate this situation? Thanks for your nice job.
Hi Ram, we are using nested loop here will it cause any performance issue or is there any parallel cursor technique available to control this scenario.
I will entire application code working on it . please find this code: - DATA: max_booking_suppl_id TYPE /dmo/booking_supplement_id . READ ENTITIES OF yi_travel_tech_m IN LOCAL MODE ENTITY yi_booking_tech_m BY \_Bookingsuppl FROM CORRESPONDING #( entities ) LINK DATA(booking_supplements). " Loop over all unique tky (TravelID + BookingID) LOOP AT entities ASSIGNING FIELD-SYMBOL() GROUP BY -%tky. " Get highest bookingsupplement_id from bookings belonging to booking max_booking_suppl_id = REDUCE #( INIT max = CONV /dmo/booking_supplement_id( '0' ) FOR booksuppl IN booking_supplements USING KEY entity WHERE ( source-TravelId = -TravelId AND source-BookingId = -BookingId ) NEXT max = COND /dmo/booking_supplement_id( WHEN booksuppl-target-BookingSupplementId > max THEN booksuppl-target-BookingSupplementId ELSE max ) ). " Get highest assigned bookingsupplement_id from incoming entities max_booking_suppl_id = REDUCE #( INIT max = max_booking_suppl_id FOR entity IN entities USING KEY entity WHERE ( TravelId = -TravelId AND BookingId = -BookingId ) FOR target IN entity-%target NEXT max = COND /dmo/booking_supplement_id( WHEN target-BookingSupplementId > max THEN target-BookingSupplementId ELSE max ) ). " Loop over all entries in entities with the same TravelID and BookingID LOOP AT entities ASSIGNING FIELD-SYMBOL() USING KEY entity WHERE TravelId = -TravelId AND BookingId = -BookingId. " Assign new booking_supplement-ids LOOP AT -%target ASSIGNING FIELD-SYMBOL(). APPEND CORRESPONDING #( ) TO mapped-yi_booksuppl_tech_m ASSIGNING FIELD-SYMBOL(). IF -BookingSupplementId IS INITIAL. max_booking_suppl_id += 1 . -BookingSupplementId = max_booking_suppl_id . ENDIF. ENDLOOP. ENDLOOP. ENDLOOP.
The most Important thing I missed in this video since I can't edit this video now: that we are calculating lv_max_booking/max_booking_suppl_id two time:-
For the first time using the read entities statement, we read the data from the transactional buffer for this travel for all bookings ( in transactional buffer always have DB data + additional data which the user creates during this session) .
The second time from importing parameter entities this will be useful in the case of the draft scenario as of now you can ignore what will be explained in the draft.
Hi I am getting one weird issue, when i am selecting customer ID from F4 help, it is not getting populated on screen
Thanks. I am getting benefitted from these videos. Any week if I miss these, I just bookmark then, and come back later to learn concepts. 🙏
Glad you like them!
Hi, I'm following your playlist and today I could implement the early numbering logic. Thanks for your explanation. I don't understand in which case the second reduce would be useful, there is always just one record in the entities table. Could you maybe explain in which case would have another entries there? Could I simulate this situation? Thanks for your nice job.
In Draft Scenario .
Thank you
Hi Ram, we are using nested loop here will it cause any performance issue or is there any parallel cursor technique available to control this scenario.
I am using index to loop further it will not take time
Thank you for another video, could you add the bookingsupplement code link?
I will entire application code working on it . please find this code: -
DATA: max_booking_suppl_id TYPE /dmo/booking_supplement_id .
READ ENTITIES OF yi_travel_tech_m IN LOCAL MODE
ENTITY yi_booking_tech_m BY \_Bookingsuppl
FROM CORRESPONDING #( entities )
LINK DATA(booking_supplements).
" Loop over all unique tky (TravelID + BookingID)
LOOP AT entities ASSIGNING FIELD-SYMBOL() GROUP BY -%tky.
" Get highest bookingsupplement_id from bookings belonging to booking
max_booking_suppl_id = REDUCE #( INIT max = CONV /dmo/booking_supplement_id( '0' )
FOR booksuppl IN booking_supplements USING KEY entity
WHERE ( source-TravelId = -TravelId
AND source-BookingId = -BookingId )
NEXT max = COND /dmo/booking_supplement_id( WHEN booksuppl-target-BookingSupplementId > max
THEN booksuppl-target-BookingSupplementId
ELSE max )
).
" Get highest assigned bookingsupplement_id from incoming entities
max_booking_suppl_id = REDUCE #( INIT max = max_booking_suppl_id
FOR entity IN entities USING KEY entity
WHERE ( TravelId = -TravelId
AND BookingId = -BookingId )
FOR target IN entity-%target
NEXT max = COND /dmo/booking_supplement_id( WHEN target-BookingSupplementId > max
THEN target-BookingSupplementId
ELSE max )
).
" Loop over all entries in entities with the same TravelID and BookingID
LOOP AT entities ASSIGNING FIELD-SYMBOL() USING KEY entity WHERE TravelId = -TravelId
AND BookingId = -BookingId.
" Assign new booking_supplement-ids
LOOP AT -%target ASSIGNING FIELD-SYMBOL().
APPEND CORRESPONDING #( ) TO mapped-yi_booksuppl_tech_m ASSIGNING FIELD-SYMBOL().
IF -BookingSupplementId IS INITIAL.
max_booking_suppl_id += 1 .
-BookingSupplementId = max_booking_suppl_id .
ENDIF.
ENDLOOP.
ENDLOOP.
ENDLOOP.
Thanks for the nice tutorial . Can we get the code file ?
github.com/ramniwas04/MANAGED-RAP-SAP-TECHNOMANIAC