SAP Note 209846 - Use of SY-TCODE in delivery processing

Component : Delivery Processing - Inbound Delivery

Solution : https://service.sap.com/sap/support/notes/209846 (SAP Service marketplace login required)

Summary :
The SAP Note addresses a common issue where the system field SY-TCODE does not update when toggling between display and change modes in the delivery dialog (VL02N, VL03N, and others). This can lead to malfunctions in user exits that rely on SY-TCODE. The resolution involves substituting SY-TCODE with T180-TRTYP, which accurately reflects the delivery's processing mode (Creation, Change, Display). For specific scenarios involving batch or online processing, it also recommends considering the V50AGL-SAMMELGANG flag for accurate transaction handling. This solution is applicable to both old and new delivery dialogs and various SAP delivery processes.

Key words :
prerequisites system field sy-tcode, additional key words vl02n, programmed source code depending, field sy-tcode, field t180-trtyp, v50agl-sammelgang flag, t180-trtyp = 'h', v50agl-sammelgang = 'x', v50agl-sammelgang = space, mentioned advice works

Related Notes :

832383Condition values incorrect at header level
524154User exits apparently not run in include MV50AFZ1
415716User exits in delivery processing
335277VL10: VA03 instead of VA02 in display of orders