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

BAPI for Create Invoice

Former Member
0 Likes
772

Hi everyone

I need to create an invoice document using some bapi, i found this two bapi BAPI_BILLINGDOC_CREATEMULTIPLE and BAPI_INCOMINGINVOICE_CREATE; but i don't know how can i use. Can anyone help me please?

Thanks & Regards

David N

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
675

Hi,

Check this example..

DATA: s_vbap TYPE vbap.

*

TABLES: vbak,vbap,likp, lips.

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

DATA: t_conditions TYPE STANDARD TABLE OF bapikomv WITH HEADER LINE.

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

DATA: t_ccard TYPE STANDARD TABLE OF bapiccard_vf WITH HEADER LINE.

DATA: t_errors TYPE STANDARD TABLE OF bapivbrkerrors WITH HEADER LINE.

DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE

.

PARAMETERS: p_vbeln TYPE vbeln.

select single * from likp

where vbeln = p_vbeln.

SELECT SINGLE * from lips where

vbeln = likp-vbeln.

t_billing-salesorg = likp-vkorg.

t_billing-ref_doc = likp-vbeln.

t_billing-ref_item = lips-posnr.

t_billing-doc_number = p_vbeln.

t_billing-itm_number = lips-posnr.

t_billing-ordbilltyp = '<b>Billing document type</b>'.

t_billing-price_date = sy-datum.

t_billing-ref_doc_ca = likp-vbtyp.

t_billing-material = lips-matnr.

t_billing-plant = lips-werks.

APPEND t_billing.

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

TABLES

billingdatain = t_billing

return = t_return

success = t_success

.

commit work.

Thanks,

Naren

3 REPLIES 3
Read only

Former Member
0 Likes
675

u just need to pass data to this...Check the documentation what needs to be passed.

Read only

Former Member
0 Likes
675

Can anyone have an examples about these two bapi.

Thanks & Regards

David N

Read only

Former Member
0 Likes
676

Hi,

Check this example..

DATA: s_vbap TYPE vbap.

*

TABLES: vbak,vbap,likp, lips.

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

DATA: t_conditions TYPE STANDARD TABLE OF bapikomv WITH HEADER LINE.

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

DATA: t_ccard TYPE STANDARD TABLE OF bapiccard_vf WITH HEADER LINE.

DATA: t_errors TYPE STANDARD TABLE OF bapivbrkerrors WITH HEADER LINE.

DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE

.

PARAMETERS: p_vbeln TYPE vbeln.

select single * from likp

where vbeln = p_vbeln.

SELECT SINGLE * from lips where

vbeln = likp-vbeln.

t_billing-salesorg = likp-vkorg.

t_billing-ref_doc = likp-vbeln.

t_billing-ref_item = lips-posnr.

t_billing-doc_number = p_vbeln.

t_billing-itm_number = lips-posnr.

t_billing-ordbilltyp = '<b>Billing document type</b>'.

t_billing-price_date = sy-datum.

t_billing-ref_doc_ca = likp-vbtyp.

t_billing-material = lips-matnr.

t_billing-plant = lips-werks.

APPEND t_billing.

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

TABLES

billingdatain = t_billing

return = t_return

success = t_success

.

commit work.

Thanks,

Naren