cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase order based on Sales order

Former Member
0 Kudos

Hi,

I try to create Purchase order based on Sales order.

The error message :

"Base document card and target document card do not match"

My code:

oPurOrder.Lines.BaseEntry=oSalesOrder.DocEntry

oPurOrder.Lines.BaseLine=oSalesOrder.Lines.Linenum

oPurOrder.Lines.BaseType=17

Could you help me please ?

Tks.

Laetitia

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Laetitia,

AFAIK this wasn´t possible on 2004. Dont really know if it has been fixed on 2005.

I will not suggest you to try to update the database once the Purchase Order is created, using SBO_SP_TransactionNotification, becouse SAP doesn´t allow it.

A couple of related issue could be found on the link bellow:

Regards,

Ibai Peñ

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You are right Ibai. I misread the base document. Sorry.

Laetitia, as said by Ibai, what you are trying to do is not possible using SDK.

-M

Former Member
0 Kudos

Does anyone knows when (which SP, PL) this will be possible?

Former Member
0 Kudos

Hi,

Looking at your code I will check how you fill the fields in the oPurOrder object because the code you copied is only for the document lines and the error refers to the document itself (maybe you forgot to assign the cardcode property).

If you are basing the document, a good and reliable method is to export the base to a xml file and load the target using this file. This way you garantee that all the info of the document is copied. After that you could use your code to update the info you want to change the same way you pasted it in your post.

Hope it helps,

-M

Former Member
0 Kudos

Hi Marco Antonio,

The problem is that the BP code doesn´t match between the base document(SO) and the target document(PO). It can´t match becouse in the sales order is a customer and in the purchase order is a supplier.

Again, the real problem is that we are not allowed to do this using the SDK.

Regards,

Ibai Peñ