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 number in sales order creation

Former Member
0 Kudos

HI all,

please help to me........

My requirement a add the serial number BAPI sales order.

problem is their no serial number in bapi structure.

How to add serial number crate a salesorder bapi.

serial number is RIPW0-SERNR.

Thanks & Regards,

SReddy.

4 REPLIES 4

former_member212653
Active Contributor
0 Kudos

Serial number is not stored in Sales data tables like VBAP, VBAK ets. so where do you want to store serial numbers?

You have to extend the sales tables ti include the serial number field and then pass the value through BAPI.

Former Member
0 Kudos

we normally use

SERNR_ADD_TO_AU

to add serial number to Sales Orders.

Check if this works in your scenario.

Former Member
0 Kudos

Hi ,

Please do check this BAPI_SALESORDER_CREATEFROMDAT2 where you find this field SERNR as BOM explosion number in ORDER_ITEMS_IN structure of BAPI.

Thanks

Sudharshan

Former Member
0 Kudos

hi,

refer to this link

http://help.sap.com/saphelp_nw04/helpdata/EN/3e/0e1089c24611d1ad09080009b0fb56/content.htm

refer to this code...

Also if you set the * CONVERT_PARVW_AUART = 'X' parameter to 'X' you can use sold to party as SP and ship to party as SH.

REPORT ZEX_BAPISALESORDCRT .

--


Data Declaration--

Data: st_BAPISDHEAD like BAPISDHEAD, " Sales Order Header Data

ta_BAPIITEMIN like BAPIITEMIN occurs 0 with header line, " Ln item

ta_BAPIPARTNR like BAPIPARTNR occurs 0 with header line, " Partner

d_BAPIRETURN1 like BAPIRETURN1, " Bapi return msg

d_vbeln like bapivbeln-VBELN. " Sales Order Number

  • Move the data to create sales order in the repective parameters------*

move: 'TA' to st_BAPISDHEAD-DOC_TYPE, " Sales document type

'15493' to st_BAPISDHEAD-PURCH_NO_C,

'00010' to ta_BAPIITEMIN-ITM_NUMBER,

'Y-351' to ta_BAPIITEMIN-MATERIAL,

'1100' to ta_BAPIITEMIN-PLANT,

'1' to ta_BAPIITEMIN-REQ_QTY,

'AG' to ta_BAPIPARTNR-PARTN_ROLE, " Sold to Party

'0000007777' to ta_BAPIPARTNR-PARTN_NUMB.

  • Append the internal tables-------------------------------------------*

append ta_BAPIPARTNR.

clear ta_BAPIPARTNR.

append ta_BAPIITEMIN.

clear ta_BAPIITEMIN.

  • Move ship to party---------------------------------------------------*

move: 'RG' to ta_BAPIPARTNR-PARTN_ROLE, " Ship to party

'0000007777' to ta_BAPIPARTNR-PARTN_NUMB.

  • Append the internal tables-------------------------------------------*

append ta_BAPIPARTNR.

clear ta_BAPIPARTNR.

  • Call the Bapi to create the sales order

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'

EXPORTING

ORDER_HEADER_IN = st_BAPISDHEAD

  • WITHOUT_COMMIT = ' '

  • CONVERT_PARVW_AUART = ' '

IMPORTING

SALESDOCUMENT = d_vbeln

  • SOLD_TO_PARTY =

  • SHIP_TO_PARTY =

  • BILLING_PARTY =

RETURN = d_BAPIRETURN1

TABLES

ORDER_ITEMS_IN = ta_BAPIITEMIN

ORDER_PARTNERS = ta_BAPIPARTNR

  • ORDER_ITEMS_OUT =

  • ORDER_CFGS_REF =

  • ORDER_CFGS_INST =

  • ORDER_CFGS_PART_OF =

  • ORDER_CFGS_VALUE =

  • ORDER_CCARD =

  • ORDER_CFGS_BLOB =

  • ORDER_SCHEDULE_EX =

.

if d_vbeln <> space.

write: 'Sales order No. ', d_vbeln.

endif.