Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

VT01 Extension - Add custom fields

Former Member
0 Kudos

Dear Friends,

Following is the requirement:

A) Would like to add around 10 new custom fields to shipment header (VTTK)

B) Then would like to have these fields available for editing in VT01 & VT02. Also for display mode in VT03.

C) Preferably would like to add an additional tab "Additional Data B" like the existing tab "Additional Data" in the "General Data" section.

What I have already tried:

1) looking for BADI's that could help - none available to achieve this

2) looking for screen exits, customer functions - none available to achieve this

3) EEWB: This matches the requirement but, unfortunately works only for CRM objects and not for shipment

Do you know of any solution that could help to acheive this result?

Thanks,

Hitesh

13 REPLIES 13

Former Member
0 Kudos

Hi

You can use the exit <b>V56USVDP</b> EXIT_SAPLV56U_004, anyway see the enhancement (trx CMOD) beginning V56*

<b>Reward points</b>

Regards

0 Kudos

Hi,

Thanks for the quick reply. Unfortunately, this does not help.

We are already using this userexit in our project to do some custom checks and processing.

The main open question is how to display/edit the new custom fields on VT01 - 03 without making SAP modification?

Thanks,

Hitesh

0 Kudos

Hi,

I am also going through the same delimma, if there is any BADI or something similar already available to add a new tab. Could you please help to share, if you found a solution for this problem...

Thanks in Advance,

Ravindra

Former Member
0 Kudos

Hi,

try using the function exit EXIT_SAPMV56A_004 for adding new tabs and editting the custom fields.

Reward points!!!!!!!!

Sample code for exit..

data: l_ta_control like line of c_ta_control.

field-symbols <cua> like line of c_cua_control.

  • Add the new status button to the main shipment screen.

read table c_cua_control assigning <cua>

with key progname = 'SAPMV56A'

dynpro = '1020'

trtyp = '*'.

  • Create a function module and copy the status standard *program of standard program to the function module. Then add *the additional tabs required in the new status.

  • This will be the status for both extra screens

if sy-subrc = 0.

<cua>-statprog = 'SAPLZ_FUEL_VOUCHER'.

<cua>-status = 'TRA_MAIN'.

<cua>-title = 'TRA_OVERVIEW'.

endif.

  • Set the form to perform when the user selects the new button using

  • the custom status above. Move the appropriate settings to the

  • C_TA_CONTROL table.

  • Extra payment screen

clear l_ta_control.

move 'SAPMV56A' to l_ta_control-progname. "current program

move '1020' to l_ta_control-dynpro. "current dynpro

move '*' to l_ta_control-trtyp. "current trans. type

move 'T' to l_ta_control-kopgr. "scr. seq. hdr. grp

move c_fcode_cust to l_ta_control-fcode. "current fcode

move 'F' to l_ta_control-call_mode. "call mode

move 'SAPMV56A' to l_ta_control-next_progname."next program

*ove ' ' to l_ta_control-next_dynpro. "next dynpro

move 'ZZ_GET_DETAILS' to l_ta_control-next_form. "form to call in include MV56AFZY

*move 'MM_RSTR' to l_ta_control-next_fcode. "next fcode

insert l_ta_control into table c_ta_control.

0 Kudos

Hi SOURABH,

Just used this and works fine. Not exactly the best type of exits SAP has come up with, but it works non the less. Only concern is upgrades and the copied status becoming outdated.

Also couldnt find how to add extra tabs, but implemented the screen as a modal dialog from which the extra fields are editable.

Cant give you points sice I didn't log this, but thanks anyway

0 Kudos

Hi Sourab,

i too have the same requirement. Could you pls explain me where to create the function module. what to copy to that function module.

0 Kudos

HI,

Please provide more details below. I want to add a tab with fields.

Former Member
0 Kudos

Hi Gerald,

Currently i have a requirement to add tab strip in VT01N, can you help me on this matter since from your reply to this thread, you have successfully implemented EXIT_SAPMV56A_004.

Thanks.

0 Kudos

Hi CarMey,

Sorry missed your question last year, but just had another query about this. So for the benefit of other consultants:

First of all, this is not an ideal sollution, but having tried everything else, we settled for this solution. The user-exit EXIT_SAPMV56A_004 (enhancement MV56AINI) allows you to set a custom pf-status. In other words, by copying the standard status for VT01n you can add buttons to the screen while retaining all current standard functionality. By using exit EXIT_SAPMV56A_001 (enhancement V56AFCCH), I then called a 'Z' function module which displays a dialog screen which contained all my extra fields (standard ABAP) when this extra button is pressed.

The other exits in here is just transaction control which checks if data has changed and saves the extra data, all controlled from the same function group. This retains the data entered on the screen in the global fields of the function group.

Here is some extracts of the sourcecode in the exits used:

EXIT_SAPMV56A_004:

&----


*& Include ZXV56U40

&----


data: l_ta_control like line of c_ta_control.

field-symbols <cua> like line of c_cua_control.

  • Set a custom status which includes the button required to navigate

  • to the Extra data screen. This status will dynamically be called

  • from the program control and is a copy of the standard status of the

  • screen 1020

read table c_cua_control assigning <cua>

with key progname = 'SAPMV56A'

dynpro = '1020'

trtyp = '*'.

if sy-subrc = 0.

<cua>-statprog = 'SAPLZ_PLES_SHIPMENT'.

<cua>-status = 'ZTRA_MAIN'.

endif.

  • Set the form to perform when the user selects the new button using

  • the custom status above. Move the appropriate settings to the

  • C_TA_CONTROL table.

  • Extra data screen

clear l_ta_control.

move 'SAPMV56A' to l_ta_control-progname. "current program

move '1020' to l_ta_control-dynpro. "current dynpro

move '*' to l_ta_control-trtyp. "current trans. type

move 'T' to l_ta_control-kopgr. "scr. seq. hdr. grp

move 'EXTRA' to l_ta_control-fcode. "current fcode

move 'F' to l_ta_control-call_mode. "call mode

move 'SAPLZ_PLESSEY_SHIPMENT' to l_ta_control-next_progname."next program

*move '9000' to l_ta_control-next_dynpro. "next dynpro

move 'EDIT_EXTRA_SCREEN' to l_ta_control-next_form. "form to call in include MV56AFZY

*move 'MM_RSTR' to l_ta_control-next_fcode. "next fcode

insert l_ta_control into table c_ta_control.

EXIT_SAPMV56A_001:

  • Description : User exit EXIT_SAPMV56A_001 (Enhancement V56AFCCH) *

  • The normal purpose of this exit is to check if a *

  • particular function code may be executed (see doc) *

  • In this case it is used to initialise/read extra data*

  • pertaining to the shipment that is processed in a *

  • custom screen. *

check i_fcode eq 'EXTRA'.

call function 'Z_PLES_SPMNT_DATA_SET'

exporting

in_tknum = i_xvttk_wa-tknum.

EXIT_SAPLV56U_001:

  • Title : ZXV56U09 (exit EXIT_SAPLV56U_001 enh V56UCHCH) *

  • Description : Check if changes have been made to extra shipment *

  • data. *

data: l_change_indicator.

call function 'Z_PLES_SPMNT_DATA_CHANGED'

importing

has_changed = l_change_indicator.

if not l_change_indicator is initial.

raise data_changed.

endif.

EXIT_SAPLV56U_001:

  • Title : ZXV56U09 (exit EXIT_SAPLV56U_001 enh V56UCHCH) *

  • Description : save changes that been made to extra shipment *

  • data. *

loop at i_xvttk.

call function 'Z_PLES_SPMNT_DATA_SAVE'

exporting

in_tknum = i_xvttk-tknum

.

endloop.

0 Kudos

Hello Gerald,

I was wondering how you created program 'SAPLZ_PLES_SHIPMENT' and program 'SAPLZ_PLESSEY_SHIPMENT'. With this name I am assuming that you created by copy, but I donu2019t know from witch program. I am trying to implement your code example but I donu2019t know how you created those programs that have the ZSTATUS GUI. Can you help me with this issue?

Thanks in advance,

Best regards,

Tiago

Edited by: Tiago Magalhães on Jul 7, 2009 1:16 PM

0 Kudos

Hi,

When you create function modules, these programs will be generate.

Regards

0 Kudos

What do you write in the function module that you create? SAPLZ_PLES_SHIPMENT is the prgram generated by that function module. But what to you write in it??

Have a nice day,

Bogdan

0 Kudos

Gerald,

Can you explain me the following code lines that you provide as an example:

move 'SAPLZ_PLESSEY_SHIPMENT' to l_ta_control-next_progname."next program
*move '9000' to l_ta_control-next_dynpro. "next dynpro
move 'EDIT_EXTRA_SCREEN' to l_ta_control-next_form. "form to call in include MV56AFZY
*move 'MM_RSTR' to l_ta_control-next_fcode. "next fcode

SAPLZ_PLESSEY_SHIPMENT - what does the FM corresponding to this program?

9000 Screen - where do you create this screen ?

EDIT_EXTRA_SCREEN form - where do you create it and what contains ?

Fcode MM_RSTR - What is the role of this next fcode ?

Please help me !