Application Development 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: 

Regarding Bapi "'BAPI_BILLINGDOC_CREATEMULTIPLE'"

Former Member
0 Kudos

Hi,

When i execute this below code, Billing document is not created in the table t_success,instead in table t_returns i am getting the message "Delivery type LR cannot be invoiced with billing type F8".

code is

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 = 'F8'.

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

.

Regards,

Shasiraj.C

3 REPLIES 3

Former Member
0 Kudos

Hi,

"Delivery type LR cannot be invoiced with billing type F8".

Look in to tcode VTFL,better tho sit with functional guy.He might be able to solve this problem.This problem seems to be a functional.

Regards

Kiran Sure

Former Member
0 Kudos

Hi,

But when i create billing document using VF01, its creating.

Can you give an example which works fine.

Regards,

Shasiraj.C

Former Member
0 Kudos

Hi,

DATA: it_atg_billing LIKE bapivbrk OCCURS 1 WITH HEADER LINE,

it_atg_return LIKE bapiret1 OCCURS 1 WITH HEADER LINE,

it_atg_success LIKE bapivbrksuccess OCCURS 1 WITH HEADER LINE,

git_likp type table of likp with header line.

LOOP AT git_likp.

it_atg_billing-ref_doc = git_likp-vbeln.

it_atg_billing-ref_doc_ca = 'J'.

APPEND it_atg_billing.

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

TABLES

billingdatain = it_atg_billing

return = it_atg_return

success = it_atg_success.

IF sy-subrc = 0.

CLEAR: it_atg_billing, it_atg_billing[].

ENDIF.

ENDLOOP.

The above code creates the invoice number for respective delivery number.

If this was helpful rewards points

Regards

Pratap.M