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: 

copying fields from KNA1 to VBAK

Former Member
0 Kudos

Hi all!

Will anybody please explain me the functionality in the following link :

http://help.sap.com/saphelp_46c/helpdata/en/72/23ee347a34d111a4620060b03c3b0e/frameset.htm

What i want to know is that under the heading :

Case 1: Copy sold-to party field (KNA1) -> sales document header (VBAK)

*The field exists in KNA1 and can be copied to the sold-to party view KUAGV and to VBAK. The name is the same. *

The field does not exist in KNA1 or VBAK. You must create it there. Note that new data elements and new field names must begin with the letters "ZZ". The names are not the same.

Here there is a reference of names to be identical.Can anybody explain me the the names it is referring to.Since based on this there is a different methods to be followed.

Points will be rewarded

Thanks in advance

Praneeth

3 REPLIES 3

Former Member
0 Kudos

Hi

If your Z-fields have the same name, the system should be copy the data from KNA1 to VBAK by MOVE-CORRESPONDING statament.

The fields has to be copied has to be added in KUAGV, so you need to enhance the structure KNA1, KUAGVZ and VBAK inserting your new fields.

If in all structure the fields are the same name, the system transfer automatically the data from KNA1 to KUAGV (I think using MOVE-CORRESPONDING statament) and then you need only to implement an user-exit (USEREXIT_MOVE_FIELD_TO_VBAK) to transfer the data to VBAK.

If the name are different you need to transfer the data from KNA1 to KUAGV by your self using the exit V05EA1AG (see the include V05EA1AG).

The name of customer fields should begin with ZZ by SAP convention.

Max

0 Kudos

Hi max!

I have to add the following fields ZZKVGR6,ZZKVGR7 to VBAK from KNVV.I will add these to structure KUAGVZ which will reflect in KNVV trhrough view KUAGV and then i will implement the user exit USEREXIT_MOVE_FIELD_TO_VBAK for assigning of values.

In my understanding the fields will be same in the structure and the table then i think i can go for the userexit USEREXIT_MOVE_FIELD_TO_VBAK for transfer of data.

I don't have the logic of different field names here.Please advise if i am right.

regards

Kumar

0 Kudos

Hi

Because the abap code to transfer the data from KNA1 to KUAGV uses MOVE-CORRESPONDING statament and the abap code to transfer the data from KUAGV to VBAK doesn't use that statament, but every fields is filled one by one.

Infact:

- INCLUDE V05EA1AG:

MOVE-CORRESPONDING LKNA1 TO KUAGVZ.

MOVE-CORRESPONDING KUAGVZ TO KUAGV.

So the data of the fields with the same name are automatically transferd from LKNA1 to KUAGVZ and then

KUAGVZ to KUAGV.

Here you don't need to add new code, but if your fields have different name, you have to write some abap code:

MOVE-CORRESPONDING LKNA1 TO KUAGVZ.

KUAGVZ-Z... = LKNA1-Z...

........................

MOVE-CORRESPONDING KUAGVZ TO KUAGV.

- Include MV45AF0A_AG_AUF_HINWEIS_PRUEFE: here the fields of KUAGV are transfered to VBAK.

If you see this code, you can note MOVE-CORRESPONDING isn't used, so if you add new fields they aren't automatically filled (although they have the same name).

So you need a new abap code to fill VBAK.

I think this is logic because the system tries to avoid to fill wrong fields in the document.

Max