2012 Mar 27 1:40 AM
Hi Everyone,
I am creating an order with reference to a contract using the funciton module 'SD_SALESDOCUMENT_CREATE'. The amount of Conditions of an item is fetched from Condition record. I want the amount to be fetched from item of the Contract. Am I missing any parameter? I am not feeding any condition details as all the condition types and details are system generated.
When I create manually via VA01, it takes amount from Contract's Item conditions. I need to have same case using the function module.
Looking for your suggestions.
Thanks
Hi Everyone,
I am creating an order with reference to a contract using the funciton module 'SD_SALESDOCUMENT_CREATE'. The amount of Conditions of an item is fetched from Condition record. I want the amount to be fetched from item of the Contract. Am I missing any parameter? I am not feeding any condition details as all the condition types and details are system generated.
When I create manually via VA01, it takes amount from Contract's Item conditions. I need to have same case using the function module.
Looking for your suggestions.
Thanks
2012 Mar 27 2:20 AM
Hi Bode
I'm not sure what version you're running but have you tried using the more specific and more recent Sales Order BAPI: BAPI_SALESORDER_CREATEFROMDAT2?
If you search SCN, you should find example programs.
Regards
Glen
2012 Mar 27 2:32 AM
The following SAP Note may also be useful:
https://service.sap.com/sap/support/notes/370988
Regards
Glen
2012 Mar 27 3:55 AM
2012 Mar 27 4:18 AM
Hi Khanshi,
You just paste that piece of code.Why can not you try with bapi.
Regards,
Madhu.
2012 Mar 27 4:49 AM
Hello Khanshi,
You need to create these references before calling the BAPI:
hdr-REF_DOC = i_vakgu-vbeln. "assign quotation # to sales order hdr-REFDOC_CAT = 'B'. "assign Quotation to VBTYP_N.
itm-REF_DOC = i_vakgu-vbeln. itm-REF_DOC_IT = i_vbap-posnr. itm-REF_DOC_CA = 'B'. append itm.
data: ret_text type BAPIRET2.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
ORDER_HEADER_IN = hdr
convert = 'X'
IMPORTING
SALESDOCUMENT = salesdoc
TABLES
return = ret_tbl
ORDER_ITEMS_IN = itm
ORDER_PARTNERS = prtnr
ORDER_ITEMS_inx = itmx
ORDER_CONDITIONS_IN = conds
ORDER_CONDITIONS_INX = condsx
order_schedules_in = schd_lin.
if sy-subrc = 0
and not salesdoc is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = ret_text.
Regards,
Yukti
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |