Application Development and Automation 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: 
Read only

add z fields to vbak - saving problem

Former Member
0 Likes
2,237

hey ,

searched sdn forums and the web and didnt got the solution :

I am inserting an input/output field in sales order header data 'additional data b'.

i add the following code in user exitS :

USEREXIT_MOVE_FIELD_TO_VBAK , USEREXIT_SAVE_DOCUMENT :

VBAK-ZFIELD = SCREEN_STRUCURE-ZFIELD .

IN USEREXIT_SAVE_DOCUMENT_PREPARE :

    • I ADDED SOME CHECKS **

The field isn't saving in vbak .

maybe im passing it to vbak from the rong strcture ( SCREEN_STRUCURE = mycomp_vbak_add_data that

is the only one avalible in this user exit ) ?

what other structures available in this user exit or what additinal code i have to add ?

Best Regards

ASA

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,643

Dear

I think u have added this field at append structure .

From there u want to pass your field .

There is many userexit are present .other than MV45AFZZ need to search only which is best suits your requirment .

Extensive debug and ur problem will solve it not found Please revert .

8 REPLIES 8
Read only

brad_bohn
Active Contributor
0 Likes
1,643

Why did you name your screen field differently than your VBAK field? The value transfer is automatic if the names are the same. Don't use USEREXIT_SAVE_DOCUMENT for the VB* fields - see the documentation.

Read only

Former Member
0 Likes
1,643

In the additional data B screen you have direct access to VBAK structure. So if you added an append to VBAK with field ZZ_FIELD01, you just need to add an input field to additional data B screen and name it VBAK-ZZFIELD01. This will automatically transfer the value and save it to the DB when you save the order.

One other thing, if you want to change data that is upposed to be saved to the DB you need to do this in the SAVE_DOCUMENT_PREPARE exit, because after that (and before the DOCUMENT_SAVE exit) the data is passed into update task, so any changes in the SAVE_PREPARE exit will not be saved to the DB.

Hope that helps,

Michael

Read only

Former Member
0 Likes
1,644

Dear

I think u have added this field at append structure .

From there u want to pass your field .

There is many userexit are present .other than MV45AFZZ need to search only which is best suits your requirment .

Extensive debug and ur problem will solve it not found Please revert .

Read only

0 Likes
1,643

hello and thanks to all ,

i did add this field at append structure ( " SCREEN_STRUCTURE " is the append structure that i add in to ) .

is there any other userexits that i have to update and with what special code ?

thanks in advance

ASA

Read only

0 Likes
1,643

There's no special code required unless you need to validate the value or change the screen attributes of the field dynamically. Use the user exits in MV45AFZZ for this or the flow logic for the Additional Data B screen. I don't know what 'SCREEN_STRUCTURE' refers to for Additional Data B modifications - the standard (first proposed) append struture for VBAK is ZAVBAK and that's what should be used here even in ERP 6.0. Make sure that you adjust any BAPI calls and structures accordingly to populate the field being added.

Read only

0 Likes
1,643

hey,

i validate the field in userexit_prepare_to_save .

i dont remember ( i am not at work ) the name of the append structure so i wrote 'SCREEN_STRUCTURE' ,

it may be ZAVBAK but any way the value of the field dosnt save to vbak .

any ideas ?

Read only

0 Likes
1,643

Then your screen field and VBAK field do not have the same name...

Read only

0 Likes
1,643

go to se80 and add your field on the screen 4021