Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

How to add a custom field in VA01 (Sales Order Item)

$
0
0

Dear all,

 

My requirement was to add a custom field in sales order item (VA01) that could be able to store Unique Product ID into it.

Please follow the following steps to get your destination.

 

 

Step 1: Create a structure, mind it the structure must contain the field name starting with ZZ as shown below.

1.JPG

Step 2: Append that structure to VBAP table, because this table contains the Sales Order Item Data.

2.JPG

Step 3: Open program  SAPMV45A  from SE80 and go to screen 8459 and change the layout by adding your required

Custom fields as shown below.

3.JPG

 

Do not write any codes in the PBO and PAI of this screen.

 

Step 4: Open the program SAPMV45A  from SE38 and open the INCLUDE MV45AFZZ. And write the following codes.

 

(a) **** Use this section to modify the custom table created by you, if required.

FORM USEREXIT_SAVE_DOCUMENT.
*** Write your own requirement here, if you want to store data in your Ztable.

ENDFORM.

 

(b) ****  Use this section to prepare the line item before document is saved…*

FORM USEREXIT_SAVE_DOCUMENT_PREPARE.

DATA: zzprodid type XVBAP-ZZPRODID.

CLEAR: zzprodid.LOOP AT XVBAP WHERE updkz = 'I'.
   zzprodid = zzprodid + 1.
   XVBAP
-ZZPRODID = zzprodid.
  
MODIFY XVBAP.
ENDLOOP.

ENDFORM.

 

 

Thanks

D.Satpathy


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>