04-28-2021 9:00 PM
We have a requirement to add 10 new fields to the shipment processing transactions (VT01N, VT02N, & VT03N). They will all be header level attributes that will be included as part of table VTTK. It appears SMOD enhancement MV56AINI (function module exit EXIT_SAPMV56A_004) may be the only way that SAP has provided for this kind of enhancement to the shipment maintenance transactions.
I have reviewed the suggested approach supplied via our community pages (https://answers.sap.com/questions/2695020/vt01-extension---add-custom-fields.html), and do not have a clear understanding of how best to proceed. It seems as though the solution outlined is missing some critical details. Can anyone provide a link to more detailed information with regards to how to implement MV56AINI?
Kind Regards
11-21-2021 2:50 PM
Hello Bert and all... I am sorry I failed to see your question earlier. There is a lot to my solution, and I am omitting a fair amount for the sake of brevity. What I am providing below is what I feel to be minimally required in order to create a viable enhancement. If you have additional questions, please feel free to inquire, and I will do my best to get back to you as quickly as possible.
First I created a function group (example - ZCUSTOM_FG) to hold my custom screen, as well as the flow logic. Here I also maintained a GUI status and Title for my custom screen. Additionally, I created a copy of the title and status (TRA_OVERVIEW and TRA_MAIN) from SAPMV56 1020. The copy of TRA_MAIN was necessary so that I could add a custom push button (and function code) to the 'Application Toolbar'. This push button will appear on the Shipment Document Overview screen. The reason for a copy of the title was to add an additional text so the user knows they are seeing an enhanced version of the SAP delivered overview screen.
Next in SAP customer-exit 'EXIT_SAPMV56A_004' (Include ZXV56U40) I did two things...
1) Re-point Overview Screen to Enhanced GUI Status / Title
READ table C_CUA_CONTROL
assigning field-symbol(<ZCUA>)
with key PROGRNAME = 'SAPMV56A'
DYNPRO = '1020'
TRTYP = '*'.
if sy-subrc = 0.
<ZCUA>-STATPROG = 'SAPLZCUSTOM_FG'.
<ZCUA>-STATUS = 'TRA_MAIN'.
<ZCUA>-TITLE = 'TRA_OVERVIEW'.
unassign <ZCUA>.
"Add my copy of SAP's title, and GUI status, along with my screen #
clear LS_CUA_CONTROL.
LS_CUA_CONTROL-PROGNAME = 'SAPMV56A'.
LS_CUA_CONTROL-DYNPRO = '9000'.
LS_CUA_CONTROL-TRTYP = '*'.
LS_CUA_CONTROL-KOPGR = 'T'.
LS_CUA_CONTROL-STATPROG = 'SAPLZCUSTOM_FG'.
LS_CUA_CONTROL-STATUS = 'STATUS_9000'.
LS_CUA_CONTROL-TITLE = 'TITLE_9000'.
read table C_CUA_CONTROL
with key PROGNAME = LS_CUA_CONTROL-PROGNAME
DYNPRO = LS_CUA_CONTROL-DYNPRO
TRTYP = LS_CUA_CONTROL-TRTYP
KOPGR = LS_CUA_CONTROL-KOPGR
transporting no fields.
if SY-SUBRC = 4.
insert LS_CUA_CONTROL into C_CUA_CONTROL index SY-TABIX.
elseif SY-SUBRC = 8.
append LS_CUA_CONTROL to C_CUA_CONTROL.
endif.
endif.
2) "Add call to subroutine 'ZCUSTOM_ROUTINE' when function code ZCUSTOM_FCODE is triggered. This FORM 'ZCUSTOM_ROUTINE'... ENDFORM subroutine will contain the logic that calls my custom screen from SAP include user-exit MV56AFZY.
clear LS_TA_CONTROL.
move:
'SAPMV56A' to LS_TA_CONTROL-PROGNAME, "Current Program
'1020' to LS_TA_CONTROL-DYNPRO, "Current Screen
'*' to LS_TA_CONTROL-TRTYP, "Current Transaction Type
'T' to LS_TA_CONTROL-KOPGR, "Screen Sequence Header Group
'ZCUSTOM_FCODE' to LS_TA_CONTROL-FCODE, "Current Function Code
'F' to LS_TA_CONTROL-CALL_MODE, "Call Mode - F = Process form routine with subsequent F-code
'SAPMV56A' to LS_TA_CONTROL-NEXT_PROGNAME, "Next Program
' ' to LS_TA_CONTROL-NEXT_DYNPRO, "Next Screen
'ZCUSTOM_ROUTINE' to LS_TA_CONTROL-NEXT_FORM, "Subroutine to be called in Include 'MV56AFZY'
'MM_RSTR' to LS_TA_CONTROL-NEXT_FCODE. "Next Function Code
insert LS_TA_CONTROL into table C_TA_CONTROL.
Regarding FORM ZCUSTOM_ROUTINE:
I use the value of T180-TRTYP to determine the mode I call my screen (create/update/display). The function I created that ultimately calls my custom screen and flow logic passes back resulting changes made by the user. My solution updates extended fields of the shipment header (VTTK). So I need to decide whether any changes were made for those fields. If yes, then I update SAP internal tables XVTTK and YVTTK (new and old entries) accordingly.
3. Finally, I implemented BADI_LE_SHIPMENT for some specific requirements we had prior to saving the shipment to the database.
I hope this is helpful for you or others.
Be well... KM
09-16-2021 11:28 AM
Hey Kyle,
Did you figure out how to achieve this? I have a similar request.
Thanks,
Bert
11-21-2021 2:50 PM
Hello Bert and all... I am sorry I failed to see your question earlier. There is a lot to my solution, and I am omitting a fair amount for the sake of brevity. What I am providing below is what I feel to be minimally required in order to create a viable enhancement. If you have additional questions, please feel free to inquire, and I will do my best to get back to you as quickly as possible.
First I created a function group (example - ZCUSTOM_FG) to hold my custom screen, as well as the flow logic. Here I also maintained a GUI status and Title for my custom screen. Additionally, I created a copy of the title and status (TRA_OVERVIEW and TRA_MAIN) from SAPMV56 1020. The copy of TRA_MAIN was necessary so that I could add a custom push button (and function code) to the 'Application Toolbar'. This push button will appear on the Shipment Document Overview screen. The reason for a copy of the title was to add an additional text so the user knows they are seeing an enhanced version of the SAP delivered overview screen.
Next in SAP customer-exit 'EXIT_SAPMV56A_004' (Include ZXV56U40) I did two things...
1) Re-point Overview Screen to Enhanced GUI Status / Title
READ table C_CUA_CONTROL
assigning field-symbol(<ZCUA>)
with key PROGRNAME = 'SAPMV56A'
DYNPRO = '1020'
TRTYP = '*'.
if sy-subrc = 0.
<ZCUA>-STATPROG = 'SAPLZCUSTOM_FG'.
<ZCUA>-STATUS = 'TRA_MAIN'.
<ZCUA>-TITLE = 'TRA_OVERVIEW'.
unassign <ZCUA>.
"Add my copy of SAP's title, and GUI status, along with my screen #
clear LS_CUA_CONTROL.
LS_CUA_CONTROL-PROGNAME = 'SAPMV56A'.
LS_CUA_CONTROL-DYNPRO = '9000'.
LS_CUA_CONTROL-TRTYP = '*'.
LS_CUA_CONTROL-KOPGR = 'T'.
LS_CUA_CONTROL-STATPROG = 'SAPLZCUSTOM_FG'.
LS_CUA_CONTROL-STATUS = 'STATUS_9000'.
LS_CUA_CONTROL-TITLE = 'TITLE_9000'.
read table C_CUA_CONTROL
with key PROGNAME = LS_CUA_CONTROL-PROGNAME
DYNPRO = LS_CUA_CONTROL-DYNPRO
TRTYP = LS_CUA_CONTROL-TRTYP
KOPGR = LS_CUA_CONTROL-KOPGR
transporting no fields.
if SY-SUBRC = 4.
insert LS_CUA_CONTROL into C_CUA_CONTROL index SY-TABIX.
elseif SY-SUBRC = 8.
append LS_CUA_CONTROL to C_CUA_CONTROL.
endif.
endif.
2) "Add call to subroutine 'ZCUSTOM_ROUTINE' when function code ZCUSTOM_FCODE is triggered. This FORM 'ZCUSTOM_ROUTINE'... ENDFORM subroutine will contain the logic that calls my custom screen from SAP include user-exit MV56AFZY.
clear LS_TA_CONTROL.
move:
'SAPMV56A' to LS_TA_CONTROL-PROGNAME, "Current Program
'1020' to LS_TA_CONTROL-DYNPRO, "Current Screen
'*' to LS_TA_CONTROL-TRTYP, "Current Transaction Type
'T' to LS_TA_CONTROL-KOPGR, "Screen Sequence Header Group
'ZCUSTOM_FCODE' to LS_TA_CONTROL-FCODE, "Current Function Code
'F' to LS_TA_CONTROL-CALL_MODE, "Call Mode - F = Process form routine with subsequent F-code
'SAPMV56A' to LS_TA_CONTROL-NEXT_PROGNAME, "Next Program
' ' to LS_TA_CONTROL-NEXT_DYNPRO, "Next Screen
'ZCUSTOM_ROUTINE' to LS_TA_CONTROL-NEXT_FORM, "Subroutine to be called in Include 'MV56AFZY'
'MM_RSTR' to LS_TA_CONTROL-NEXT_FCODE. "Next Function Code
insert LS_TA_CONTROL into table C_TA_CONTROL.
Regarding FORM ZCUSTOM_ROUTINE:
I use the value of T180-TRTYP to determine the mode I call my screen (create/update/display). The function I created that ultimately calls my custom screen and flow logic passes back resulting changes made by the user. My solution updates extended fields of the shipment header (VTTK). So I need to decide whether any changes were made for those fields. If yes, then I update SAP internal tables XVTTK and YVTTK (new and old entries) accordingly.
3. Finally, I implemented BADI_LE_SHIPMENT for some specific requirements we had prior to saving the shipment to the database.
I hope this is helpful for you or others.
Be well... KM
03-29-2023 2:42 PM
In the link above, there is a code with a solution based on Kyle's answer(additional info to alvarogarrido@hotmail.com)
12-30-2021 5:14 PM
Hi Kyle,
Quick question, on your function, how did you call your screen.
I had been able to add additional functionalities to these transactions but now I already create an append structure on VTTK and I'm updating the extra fields but the transaction always showed me "No changes were made...." and the transaction it is not saving the changes on the custom fields I created.
Any input will be great,
Happy holidays,
01-06-2022 7:57 PM
Hello Virgilio,
I'm not sure I mentioned it earlier, but I created a function module to contain my custom screen processes. With that in mind...
If you implemented something like what I described in my post from Nov 21, 2021, search my post for 'ZCUSTOM_ROUTINE'. You will notice that I maintain control table C_TA_CONTROL with the subroutine 'ZCUSTOM_ROUTINE'. This ensures my custom subroutine will be executed when a user presses my custom push button. This routine must be coded in SAP exit include MV56AFZY. Inside my subroutine, I call my custom function module (that issues statement CALL SCREEN to my custom screen). I am passing the existing state of my VTTK record and a few other attributes. I am also returning the VTTK record with any changes made by the user while in my custom screen. I compare the existing and new VTTK records to identify whether a change occurred. If yes, (from inside my subroutine in include MV56AFZY) I do something like...
"Update XVTTK (New VTTK)
read table XVTTK assigning <XVTTK> index 1.
if <XVTTK> is assigned.
if <XVTTK>-UPDKZ is initial.
<XVTTK>-UPDKZ = 'U'.
endif.
"Update custom VTTK attribute values
move-corresponding LS_CI_VTTK_NEW to <XVTTK>. "LS_CI_VTTK_NEW is typed as my append structure for VTTK
"Update YVTTK (Old VTTK)
read table YVTTK assigning <YVTTK> index 1.
if <YVTTK> is assigned.
<YVTTK>-UPDKZ = <XVTTK>-UPDKZ.
else.
move-corresponding <XVTTK> to YVTTK.
"Reset the Old custom VTTK attribute values
move-corresponding LS_CI_VTTK_OLD to YVTTK.
YVTTK-UPDKZ = <XVTTK>-UPDKZ.
append YVTTK.
endif.
endif.
I hope this helps. Please let me know if I can be of further assistance.
Gratefully,
Kyle M
03-30-2023 2:53 PM
Try with BADI_LE_SHIPMENT
Also try in the below routines
MV56AINI Initialization of transaction control for transportation
V56AFCCH Shipment processing: Check function code allowed
V56AGTAR User Exit for Filtering Shipping Unit Calculation
V56ARCHV Customer-spec. checks for archiving shipments
V56ATKTX Change the number of lines for text input in shipment
V56BMOD Transportation processing: Field modification
V56DISTZ Shipment Processing: Determine Distance
V56FCOPY Shipment processing: Copy delivery data
V56FSTAT Shipment processing: Activities when setting a status
V56L0001 Status of Shipments for a Delivery
V56LDELI Read Delivery Data for Shipment Processing
V56LOCID Shipment Processing: Determine Location Identification
V56MVT04 Extensions for Collective Processing of Shipments
V56SLDET Shipment processing: Leg determination
V56TDLIF Filter Delivery Items for Shipment
V56UCHCH Shipment processing: Check whether changes were made
V56UCHCO Check shipments are complete
V56UDLUP Obsolete as of 4.6C: Delivery Update on Delivery Routines
V56UNUMB Shipment number allocation
V56USTAT User-individual definition of transportation planning status
V56USVDO Update new objects for transport
V56USVDP Preparation for updating new objects for transport?
04-27-2023 4:42 AM
VT03N is a transaction code in SAP LE application with the description — Display Shipment.
How do I add custom fields in VA01?Add A New Field in VA01 Header