Application Development and Automation 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: 
Read only

Create Sales Order With Reference to Billing Document Using BAPI_SALESORDER

alejandro_lpez
Contributor
0 Likes
6,525

Hi,

How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?

Thanks in advance,

Alejandro.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,862

normally salesorder is created with reference to sales order...it can't be created referring to a billing document as billing document is done for a sales order and the data of billing document will be entirely different to that os sales order...May be u can get th refference sales order of a billing document and use it to create another sales order.

Hi,

How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?

Thanks in advance,

Alejandro.

5 REPLIES 5
Read only

Former Member
0 Likes
2,863

normally salesorder is created with reference to sales order...it can't be created referring to a billing document as billing document is done for a sales order and the data of billing document will be entirely different to that os sales order...May be u can get th refference sales order of a billing document and use it to create another sales order.

Read only

0 Likes
2,862

Hi,

Normally a billing doc is created after a sales order-->delivery.

U can create a sales order w.r.t a Contract or another sales order.

In your case, its possible only for sales Returns.

pass billing doc number to ORDER_HEADER_IN-REF_DOC in BAPI_SALESORDER_CREATEFROMDAT2.

Message was edited by:

JITHENDRA CHADICHAL

null

Read only

alejandro_lpez
Contributor
0 Likes
2,862

Somebody has an example code?

Read only

0 Likes
2,862

Hey Alejandro,

are you trying to create a return order for the invoice if so you can use BAPI_CUSTOMERRETURN_CREATE.

Thanks

Deep

Read only

Former Member
0 Likes
2,862

I have to create sales order with reference to existing billing document. I have tried to following bapis.

1. BAPI_SALESORDER_CREATEed

I have successfully created document with following details.

-->ORDER_HEADER_IN:

DOC_TYPE = ZRK

SALES_ORG = 3000

DISTR_CHAN = 00

DIVISION = 00

ORD_REASON = 100

SD_DOC_CAT = L

CURRENCY = EUR

REF_DOC = 100000028

REF_DOC_CA = M

-->ORDER_ITEMS_IN:

ITM_NUMBER = 000010

MATERIAL = 701791

TARGET_QTY = 0000000001000

CURRENCY = EUR

REF_DOC = 100000028

REF_DOC_CA = M

-->ORDER_PARTNERS:

PARTN_ROLE = SP

PARTN_NUMB = W12001

COUNTRY = NL

by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in ORDER_ITEMS_IN

COND_TYPE = PNET

COND_VALUE = 14,56

COND_D_UNT = PC.

folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.

is it something related to configuration problem?

2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2

I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.

Unpermitted combination of business object BUS2032 and sales doc. category L.