Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

A simple BAPI for VF01

Former Member
0 Likes
10,118

Hi all! this time i'm needing a BAPI for Trx. VF01. An Example would be like this: First i create a salesorder document with Bapi BAPI_SALESORDER_CREATEFROMDAT2. then with this document number i need to create with VF01 the corresponding invoice. I have to put a text in every position of the invoice. I find BAPI_BILLINGDOC_CREATEmultiple. does anyone has an example code for this BAPI? Does anyone has a better way to please my requirement???

Im using bapi because i need the Rollback feature.

Thanks in advance...and as usual, rewarding points for Help!!!!

Message was edited by:

Andrew Argen

Message was edited by:

Andrew Argen

4 REPLIES 4
Read only

Former Member
0 Likes
4,322

Hi,

Check this sample code of creating the billing document using the bapi BAPI_BILLINGDOC_CREATEMULTIPLE.

DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE.

DATA: t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE.

DATA: t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE.

t_billing-salesorg = vbak-vkorg.

t_billing-DISTR_CHAN = vbak-vtweg.

t_billing-DIVISION = vbak-spart.

t_billing-DOC_TYPE = vbak-auart.

t_billing-ref_doc = vbak-vbeln.

t_billing-ref_item = vbap-posnr.

t_billing-doc_number = vbak-vbeln.

t_billing-ITM_NUMBER = vbap-posnr.

t_billing-ordbilltyp = 'BILLING TYPE'.

t_billing-price_date = sy-datum.

t_billing-ref_doc_ca = vbak-vbtyp.

t_billing-sold_to = vbak-kunnr.

t_billing-material = vbap-matnr.

t_billing-plant = vbap-werks.

APPEND t_billing.

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

TABLES

billingdatain = t_billing

return = t_return

success = t_success.

commit work.

Thanks,

Naren

Read only

Former Member
0 Likes
4,322

Hi!!! does anyone has some example code for my requirement, please??????

i have tried with de code above but i have some problems with it. Please i really need some help....I will be very thankful if somebody could help me.

Thanks in advance... Andrew.

Read only

0 Likes
4,322

Hi,

You can do that with the help of <b>GN_INVOICE_CREATE</b>

or <b>RV_INVOICE_CREATE</b> Function module. use any one of them and try.

Regards

Vijay

Read only

Former Member
0 Likes
4,322

hi Vijay Babu Dudla, the problem is that i need to use de Rollback feature of the Bapis. Can i do something like this with the function modules that you gave me????

Thank for the advice and i promise you will be rewarded for your amiability, since I am really needing fast aid .