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: 

Serial No in BAPI_GOODSMVT_CREATE

Former Member
0 Kudos

Hi All,

I m developing a Y transaction for GR using Barcode. For that I m using a BAPI 'BAPI_GOODSMVT_CREATE' to post the data.

Our requirement for serialized material is to maintain serial nos manually.

In BAPI, for Serialized material, I maintain a flag 'SERIALNO_AUTO_NUMBERASSIGNMENT'.

If i set 'X' for this flag it autogenerates the Serial Nos. and if i set 'SPACE' it gives me error message while posting the document that 'Maintain serial nos for serialized material', eventhough i have maintained the serial nos.

Can anybody guide me to use this flag?? It will be very helpful to me.

Thanks & Regards,

Sagar Vadher

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sagar,

See there are 2 internal tables in BAPI.

first is mandatory and sec is optional.

If you put flag ( for Automatic process ) then you don't need to maintain the sec internal table, system automatically genrates ( You can also maintained in SPRO ).

But if you put space, then you need to provide the serial number through sec internal table.

GOODSMVT_ITEM

GOODSMVT_SERIALNUMBER -- 2 fields

MATDOC_ITM Item in material document

SERIALNO Serial number

Reg,

Arpit

11 REPLIES 11

Former Member
0 Kudos

Hi Sagar,

See there are 2 internal tables in BAPI.

first is mandatory and sec is optional.

If you put flag ( for Automatic process ) then you don't need to maintain the sec internal table, system automatically genrates ( You can also maintained in SPRO ).

But if you put space, then you need to provide the serial number through sec internal table.

GOODSMVT_ITEM

GOODSMVT_SERIALNUMBER -- 2 fields

MATDOC_ITM Item in material document

SERIALNO Serial number

Reg,

Arpit

0 Kudos

Hi Arpit,

Can u tell me which flag i have to put as space, XSAUT or SERIALNO_AUTO_NUMBERASSIGNMENT.

Thanks & Regards,

Sagar

0 Kudos

Hi Sagar,

your article is assigned to a serial number profile. In this profile it's defined if:

- serial numbers are used at all

- serial number is optional / mandatory

- automatic number creation is allowed

So maybe no automatic creation is allowed. Isn't XSAUT dataelement of SERIALNO_AUTO_NUMBERASSIGNMENT? -> That is just one field of table GOODSMVT_ITEM and should be space, when you fill table GOODSMVT_SERIALNUMBER. If you can set 'X' - this depends on customizing.

Regards,

Christian

0 Kudos

Hi Critstian,

I checked the Serial No profile of Materials which i used. In these profiles serial no flag is obligatory means no automatic, no optional. I hope i have explained properly. Now can you tell me what should be the flag?

Thanks & Regards,

Sagar

0 Kudos

Hi,

with X you would trigger automatic serial number creation -> not allowed.

Then you should use space and fill table GOODSMVT_SERIALNUMBER. Maybe here is your problem. Field MATDOC_ITM has to run from 0001 to 000n for your items in GOODSMVT_ITEM. If you have 5 pieces for first article in GOODSMVT_ITEM, then you have to fill

0001 1234

0001 1235

0001 1236

0001 1237

0001 1238

in GOODSMVT_SERIALNUMBER (with leading zeros for serials?).

Regards,

Christian

0 Kudos

Hi Cristian,

I use 10 quantities for GR out of 10 quantities from PO and i fill up the GOODSMVT_SERIALNUMBER with below values.

and SERIALNO_AUTO_NUMBERASSIGNMENT is SPACE.

MATDOC_ITM SERIALNO

0010 000000000000000001

0010 000000000000000002

0010 000000000000000003

0010 000000000000000004

0010 000000000000000005

0010 000000000000000006

0010 000000000000000007

0010 000000000000000008

0010 000000000000000009

0010 000000000000000010

Still it gives me error message

'Maintain serial numbers for total quantity'.

Thanks & Regards,

Sagar Vadher

0 Kudos

0001 <> 0010 !!

0 Kudos

Hi Christian,

what does this 0001 mean?? At my side i m using the line index of purchase order that is EBELP and value is 0010. Can you explain me in detail???

Thanks & Regards,

Sagar

0 Kudos

But the goods receipt table is just analyzing number of the line, not the document positions. Try to use sy-tabix instead of ebelp.

Don't ask me why, but it works.

0 Kudos

Let me try and i will get back to you within short time.

0 Kudos

Hi Christian,

Thanks a lot for your help. What you have suggested, works fine. For that i m rewarding you the points.

Thanks Again

Regards,

Sagar Vadher