‎2011 May 19 5:15 PM
Hi,
I need create salesorder with reference quotation and i follow this example [ thread|; , but after i added ref_doc and ref_doc_ca in header and ref_doc,ref_doc_it and ref_doc_ca in items , BAPI gave the error "There is no type of position (T184 ZSCN TEXT)", then add the key sd consultant for the type of position in SPRO-> commercial-> sales-> Sales Documents
-> sales document position-> assign types of position.
After the change, I did another test with the BAPI and request to enter the material and generates the order with incomplete data, however when viewing the order is not added the quantity and price conditions of the quotation referenced, then add this information and also schedules and generates all properly.
But is not that when referring to a document, in this case to quotation, quotation data must be added to this document as if it were done manually (VA01)?
I welcome your comments and possible solutions.
Code:
BAPISDHD1-DOC_TYPE = 'ZSCN'.
BAPISDHD1-SALES_ORG = 'S020'.
BAPISDHD1-DISTR_CHAN = 'NA'.
BAPISDHD1-DIVISION = '01'.
BAPISDHD1-REF_DOC = '10000047'.
UNPACK BAPISDHD1-REF_DOC TO BAPISDHD1-REF_DOC.
BAPISDHD1-REFDOC_CAT = 'B'.
BAPISDHD1X-UPDATEFLAG = 'I'.
BAPISDHD1X-DOC_TYPE = 'X'.
BAPISDHD1X-SALES_ORG = 'X'.
BAPISDHD1X-DISTR_CHAN = 'X'.
BAPISDHD1X-DIVISION = 'X'.
BAPISDHD1X-REF_DOC = 'X'.
BAPISDHD1X-REFDOC_CAT = 'X'.
LT_BAPISDITM-REF_DOC = '10000047'.
UNPACK LT_BAPISDITM-REF_DOC TO LT_BAPISDITM-REF_DOC.
LT_BAPISDITM-REF_DOC_CA = 'B'.
LT_BAPISDITM-REF_DOC_IT = '000001'.
APPEND LT_BAPISDITM TO BAPISDITM.
LT_BAPISDITMX-UPDATEFLAG = 'I'.
LT_BAPISDITMX-REF_DOC = 'X'.
LT_BAPISDITMX-REF_DOC_CA = 'X'.
LT_BAPISDITMX-REF_DOC_IT = 'X'.
APPEND LT_BAPISDITMX TO BAPISDITMX.
LT_BAPIPARNR-PARTN_ROLE = 'AG'.
LT_BAPIPARNR-PARTN_NUMB = '84671700'.
UNPACK LT_BAPIPARNR-PARTN_NUMB TO LT_BAPIPARNR-PARTN_NUMB.
APPEND LT_BAPIPARNR TO BAPIPARNR.
LT_BAPIPARNR-PARTN_ROLE = 'WE'.
LT_BAPIPARNR-PARTN_NUMB = '3200004102'.
UNPACK LT_BAPIPARNR-PARTN_NUMB TO LT_BAPIPARNR-PARTN_NUMB.
APPEND LT_BAPIPARNR TO BAPIPARNR.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = BAPISDHD1
order_header_inx = BAPISDHD1X
IMPORTING
SALESDOCUMENT = VBELN
tables
RETURN = BAPIRETURN
ORDER_ITEMS_IN = BAPISDITM
ORDER_ITEMS_INX = BAPISDITMX
order_partners = BAPIPARNR.
Edited by: calinzt on May 19, 2011 6:19 PM
Edited by: calinzt on May 19, 2011 6:27 PM
‎2011 May 19 5:46 PM
Maintain copy control between Quation type and Order type as well as for item categories. Talk to you functional consultant.
Seems, he just created the Quotation type or order type.
‎2011 May 19 5:46 PM
Maintain copy control between Quation type and Order type as well as for item categories. Talk to you functional consultant.
Seems, he just created the Quotation type or order type.
‎2011 May 19 6:21 PM
ok I will talk with the consultant sd and other data, either manually by the transaction VA01 to make reference to the quotation. this is created without problems.
‎2011 May 19 7:07 PM
But is not that when referring to a document, in this case to quotation, quotation data must be added to this document as if it were done manually (VA01)?
It's not a config or data transfer issue. This is a common misconception. The SD BAPI's do not behave the same way as the respective transactions, specifically regarding copy control and data transfer from the reference document. This is covered in OSS note 370988. You can use the reference document to make the link in doc flow, but for the values that don't get populated automatically, you need to specify them in the BAPI interface.