07-06-2011 12:57 PM
Hi to all,
I'm using bapi 'BAPI_SALESORDER_CREATEFROMDAT2' to create Sales Order in a program but the order that I'm creating don't have billing plan (tab is empty). I need a way to create billing plan in sales order starting from file.
Thanks in advance
Andrea
07-06-2011 1:53 PM
Hi Andrea,
Unfortunately , BAPIs cannot process billing plan data. You can create orders or contracts and a billing plan scheme/rule can be determined if it's assigned to a item category. The price is taken from the according condition then.
System works differently while creating sales orders with Bapi's and VA01. BAPIs cannot process billing plan data. Please
check attached notes 550726 item 1 and 414058 item 2.
Thanks
Amber
07-06-2011 2:58 PM
Ok, but I need to create Sales Order with billing plan (with different billing dates) starting from file and using BAPI (not
necessarily that in the subject )but also other bapis or FM ) but NOT using batch-input.
At the moment I'm able to create Sales Order without billing plan. I think it should be a workaround for bill plan ? I have to reply to
my functional collegues...
thanks in advance
Andrea
05-17-2013 12:27 PM
HI ,
I m even looking for a solution to update Bill plan using some BAPI / FM .
Can you tell me if you got the solution .
Manish
05-17-2013 1:05 PM
you can use following sequence wise FM:
CALL FUNCTION 'BILLING_SCHEDULE_READ'
CALL FUNCTION 'BILLING_SCHEDULE_MAINTAIN'
CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
05-17-2013 3:19 PM
Hi Krupa,
Thanks for the prompt reply.
But unfortunately it is not working.
Here is my code
SELECT SINGLE * FROM vbkd INTO ls_vbkd
WHERE vbeln = p_stop AND
posnr = p_item1.
* CALL FUNCTION 'SD_SALES_DOCUMENT_READ'
* EXPORTING
* document_number = p_stop
* EXCEPTIONS
* error_message = 01.
* IF sy-subrc NE 0.
* PERFORM message_100 USING p_stop.
* EXIT.
* ENDIF.
CALL FUNCTION 'BILLING_SCHEDULE_READ'
EXPORTING
fplnr = ls_vbkd-fplnr
* I_VFKDAT =
* I_BFKDAT =
TABLES
zfpla = tfpla_old[]
zfplt = ifplt_stop[].
DATA: e_dataloss TYPE r185d-dataloss,
e_upd_fpla TYPE c ,
e_upd_fplt TYPE c .
tfpla_new[] = tfpla_old[].
break mnaharia.
ifplt_stop_temp[] = ifplt_stop_temp_new[] = ifplt_stop[].
LOOP AT ifplt_stop[] INTO ifplt_stop.
IF ifplt_stop-korte = 'A' " Correction date with inverted +/-
AND ifplt_stop-fkdat >= lv_dismantle_date AND ifplt_stop-nfdat > lv_dismantle_date .
ifplt_stop-fkarv = 'ZZZZ'.
ENDIF.
CALL FUNCTION 'BILLING_SCHEDULE_MAINTAIN'
EXPORTING
i_fplt = ifplt_stop
i_upd_fplt = 'U'
i_fplnr = ls_vbkd-fplnr
IMPORTING
e_dataloss = e_dataloss
e_upd_fpla = e_upd_fpla
e_upd_fplt = e_upd_fplt
TABLES
fpla_old = tfpla_old[]
fpla_new = tfpla_new[]
fplt_old = ifplt_stop_temp[]
fplt_new = ifplt_stop_temp_new[]
EXCEPTIONS
error_message = 1
OTHERS = 2.
IF sy-subrc NE 0.
RAISE error_in_cancel.
ENDIF.
ENDLOOP.
CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
EXCEPTIONS
error_message = 01.
IF sy-subrc NE 0.
PERFORM message_100 USING p_stop.
EXIT.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Would apprecite if you can help here.
11-04-2015 3:16 AM