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: 

code for user exit for craeting a batch number

Former Member
0 Kudos

Hi Gurus,

Im new to this pls let me know the code for the user exit for batch number.

the require ment is this...............

USER EXIT: EXIT_SAPLV01Z_002

Case 1:

Select mtart, matkl, from mara where mara-matnr = aufnr-matnr.

if mara-mtart = ‘HALB’ or mara-matkl = ‘MHN’.

AFPO-CHARG = Field length is of 10 chars. “First 3 letters of matnr” + current year+serial numbering.

For example if mara-matnr = HGN001,

AFPO-CHARG = “HGN0600001”

Here “HGN” is first 3 letters of mara-matnr,

“06” current year

“00001” serial number.

Case 2:

select mtart, matkl, from mara where mara-matnr = aufnr-matnr.

If mara-matnr = ‘FERT’ or mara-matkl = ‘FHN’.

Select CHARG from table RSEB where BWART = ‘261’ and RSEB-MATKL = ‘MHN’ .

Then AFPO-CHARG will equals this CHARG.

regards,

srini

1 REPLY 1

Former Member
0 Kudos

hi Srini ,

nothing wrong in this Code , just pass this data(charg) to <b>new_charg</b> field.

regards

Prabhu