cancel
Showing results for 
Search instead for 
Did you mean: 

VT04 - sort by itinerary from VL52

mihailo_sundic
Active Contributor
0 Kudos

Hello,

I'm trying to configure a VT04 variant so that my deliveries are sorted by itinerary in a shipment.

I have defined itinerary in VL51 transaction code, and by that itinerary, I need to sort the deliveries
in a shipment during creation in VT04.

I also need them to show in that order in VT02 t-code.


The problem is that I can't see the itinerary in the sort fields to be chosen in VT04.

I can choose Route Schedule field for the sorting, but it doesn't work like the itinerary.


VL52
- screen:

VT04 variant:

Grouping and sorting:



Data and Options:

Please advise how to accomplish the required sorting option,
if there's no standard way to sort by itinerary then maybe through a user exit...?


Thanks you and regards.

Accepted Solutions (1)

Accepted Solutions (1)

mihailo_sundic
Active Contributor
0 Kudos

I have found a user exit EXIT_SAPLV56M_002, and include ZXV56U27, which can be used to write code
to populate i_vtrlk structure. This structure later gets copied into vtrlk, and then you can use it in VT04
for custom sorting.

If someone's interested in code here goes:

if sy-tcode EQ 'VT04'.
   tables: vark, valw, vawk.
   data: zitin like vark-ausl_reih.
   data: zwa_i_vtrlk like line of i_vtrlk.
   loop at i_vtrlk into zwa_i_vtrlk.
     select single ausl_reih from vark into zitin where vark~kunwe EQ zwa_i_vtrlk-kunnr and vark~vstel EQ zwa_i_vtrlk-vstel and vark~aulwe EQ zwa_i_vtrlk-aulwe.
     zwa_i_vtrlk-usr01_vblb = zitin.
     modify i_vtrlk from zwa_i_vtrlk transporting usr01_vblb.
   endloop.
   sort i_vtrlk by usr01_vblb ascending.
endif.
I fill the Data1 field, vtrlk-usr01_vblb with itinerary and use it to sort the deliveries in shipment.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

I am not sure if you can directly use the Itinerary (TPRFO) of the shipment, but there are few fields reserved for future use. These may be activated by User exit or so.

Regards.

mihailo_sundic
Active Contributor
0 Kudos

Anyone else has an idea how to accomplish this?
Or maybe details about the user exit and usage of the Data 1 field...