‎2009 Oct 11 9:52 AM
Hi I have a requirement that after the Delivery Document is created from VL01N, I need to process billing doc.
For this, I found an exit - DELIVERY_PUBLISH in VL01N which can be useful,
I've put below code under method: PUBLISH_AFTER_SAVE
method if_ex_delivery_publish~publish_after_save.
break devel2.
&----
*& DATA DECLARATION
&----
data: scr_xmclikp(17) type c value '(SAPLV53C)xmclikp',
header_return type table of bapireturn1,
it_header_data type table of bapivbrk,
wa_header_data type bapivbrk,
it_cc_data type table of bapiccard_vf,
wa_cc_data type bapiccard_vf,
it_bapikomv type table of bapikomv,
wa_bapikomv type bapikomv.
if sy-tcode = 'VL01N' and sy-uname = 'DEVEL2'.
call function 'BAPI_BILLINGDOC_CREATE'
tables
return = header_return
.
Now what happens is that after I select 'Post Goods Issue' from VL01N, Delivery doc is automatically populated in VF01 under 'Document' column.
How can I get the document number to be passed into billing_data_in for BAPI_BILLINGDOC_CREATEFROMDATA?
Also, I don't know what to pass for below tables.
condition_data_in =
ccard_data_in =
Please help.
‎2009 Oct 12 10:25 AM
Hello,
Previously I had the same requirement, and based on some investigation i was able to find out the BADI which gets triggered to get the functionality achieved.
The BADI I have used is MB_DOCUMENT_BADI and the method MB_DOCUMENT_UPDATE, make sure you use the function module CALL FUNCTION 'RV_INVOICE_CREATE_BACKGROUND' IN UPDATE TASK to get the Invoice created.
Requirements are that, for every delivery the Picking needs to be completed, so when the user click on the PGI automatically the Invoice gets created.
Cheers
Edited by: Sudhakar Pedhadodi on Oct 12, 2009 11:25 AM
‎2009 Oct 12 8:26 AM
Hi,
lt_request-document_type = 'A'.
lt_request-document_numb = WA_DATA-vbeln.
lt_request-document_item = WA_DATA-posnr.
lt_request-material = wa_data-matnr.
lt_request-plant = WA_DATA-werks.
lt_request-stge_loc = lv_lgort.
lt_request-quantity_base__uom = wa_data-qty.
lt_request-delivery_date = sy-datum.
append lt_request.
call function 'BAPI_DELIVERYPROCESSING_EXEC'
tables
request = lt_request
createditems = lt_createditems
return = lt_return.
Use this BAPI for delivery Processing .
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
VBKOK_WA = L_VBKOK
SYNCHRON = 'X'
NO_MESSAGES_UPDATE = ' '
COMMIT = 'X'
DELIVERY = lt_createditems-DOCUMENT_NUMB
UPDATE_PICKING = 'X'
NICHT_SPERREN = 'X'
Use this Function module for Posting Goods Issue.
Note:Use the delivery no from the above bapi then use it in the function below.
With regards,
Manesh.R
‎2009 Oct 12 10:25 AM
Hello,
Previously I had the same requirement, and based on some investigation i was able to find out the BADI which gets triggered to get the functionality achieved.
The BADI I have used is MB_DOCUMENT_BADI and the method MB_DOCUMENT_UPDATE, make sure you use the function module CALL FUNCTION 'RV_INVOICE_CREATE_BACKGROUND' IN UPDATE TASK to get the Invoice created.
Requirements are that, for every delivery the Picking needs to be completed, so when the user click on the PGI automatically the Invoice gets created.
Cheers
Edited by: Sudhakar Pedhadodi on Oct 12, 2009 11:25 AM
‎2009 Oct 12 2:33 PM
Hi Manesh,
I tried your method, but didnt work.
Sudhakar,
I tried using MB_DOCUMENT_BADI. As soon as I tried to activate the implementation, I got a pop up saying that my Implementation Migrated (see long text for instructions).
Upon saving, I get the error message: A customer implementation cannot be migrated into a SAP implementation
what should I do?
‎2009 Oct 15 11:14 AM
Hello
Can you please let me know the steps that you are following to create the implementation.
I guess there is some thing wrong that you might be doing unintentionally.
BR
Sudhakar