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: 

BAPI_BILLINGDOC_CREATEMULTIPLE Billing Doc not created

Former Member
0 Kudos

Hi All,

I am trying to create billing document using “<b>BAPI_BILLINGDOC_CREATEMULTIPLE</b>”. Please check code below for my BAPI preparation. Problem is billing document not getting created, in return table message type ‘I’ Message ID ‘VF’ Number ‘044’ Message ‘<b>The item is not relevant for billin</b>g’ and “SUCCESS” table is blank. If I use same sales order via VF01, billing document does get created.

I will commit once I get return ‘S’. But have you people come across such kind of message. Any ideas or sample code will be of much help. Thanks in advance.

Regards,

Tim

GT_BILLINGDATAIN-SALESORG = gs_vbak-vkorg.

GT_BILLINGDATAIN-DISTR_CHAN = gs_vbak-vtweg.

GT_BILLINGDATAIN-DIVISION = gs_vbak-spart.

GT_BILLINGDATAIN-DOC_TYPE = GS_INIT_ITAB2-auart.

GT_BILLINGDATAIN-ORDBILLTYP = p_fkart.

GT_BILLINGDATAIN-SOLD_TO = GS_INIT_ITAB2-kunnr.

GT_BILLINGDATAIN-ITEM_CATEG = GS_INIT_ITAB2-pstyv.

GT_BILLINGDATAIN-REQ_QTY = GS_INIT_ITAB2-kwmeng.

GT_BILLINGDATAIN-SALES_UNIT = gs_vbap-vrkme.

GT_BILLINGDATAIN-CURRENCY = gs_vbak-waerk.

GT_BILLINGDATAIN-SHORT_TEXT = 'Test'.

GT_BILLINGDATAIN-BILL_DATE = GS_INIT_ITAB2-afdat.

GT_BILLINGDATAIN-REF_DOC = GS_INIT_ITAB2-VBELN.

GT_BILLINGDATAIN-DOC_NUMBER = GS_INIT_ITAB2-VBELN.

GT_BILLINGDATAIN-ITM_NUMBER = GS_INIT_ITAB2-POSNR.

GT_BILLINGDATAIN-ITEM = GS_INIT_ITAB2-POSNR.

GT_BILLINGDATAIN-NO_MATMAST = co_x.

GT_BILLINGDATAIN-COUNTRY = 'AUS'.

GT_BILLINGDATAIN-MATERIAL = gl_matnr.

GT_BILLINGDATAIN-TAXCL_1MAT = '1'.

append GT_BILLINGDATAIN.

      • Prepare for BAPI call

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

EXPORTING

CREATORDATAIN = GS_CREATORDATAIN

  • TESTRUN = co_x

  • POSTING = co_x

TABLES

BILLINGDATAIN = GT_BILLINGDATAIN

  • CONDITIONDATAIN = GT_CONDITIONDATAIN

  • CCARDDATAIN =

  • TEXTDATAIN =

  • ERRORS =

RETURN = GT_RETURN

SUCCESS = GT_SUCCESS.

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

you should use the BAPI_TRANSACTION_COMMIT after calling the BAPI_BILLINGDOC_CREATEMULTIPLE.

Regards

- Gopi

9 REPLIES 9

gopi_narendra
Active Contributor
0 Kudos

you should use the BAPI_TRANSACTION_COMMIT after calling the BAPI_BILLINGDOC_CREATEMULTIPLE.

Regards

- Gopi

0 Kudos

YES i have done that. I am looking for return code 'S' and billing document number in 'SUCCESS' table.

0 Kudos

Hi All,

Still I am not able to create billing document using BAPI “BAPI_BILLINGDOC_CREATEMULTIPLE”. I am committing BAPI, still same issue. Any hints will be much appreciated.

Regards,

Tim

0 Kudos

Hi Tim

As Naren has highlighted, please check the <b>BILLING RELEVANCE</b> of the item category. To check the same, take the item category and check value of field <b>FKREL</b> in table <b>TVAP</b>.

Kind Regards

Eswar

0 Kudos

Hi Eswar,

Thanks a lot for that, for some reason order type was not okay. Any way it created a billing document, but condition record doesn’t look okay, it’s all <b>zero’s</b>. Do we have to populate <b>condition</b> table in BAPI?

Regards,

Tim

Former Member
0 Kudos

Hi,

Uncomment the errors parameters and assign a internal table and check the errors in it..

Looks the item category is not relevant for billing..Take an order which is relevant for billing..

THanks,

Naren

Former Member
0 Kudos

Hi,

Pass the PRICE_DATE field with the date...It will get the conditions also..

GT_BILLINGDATAIN-PRICE_DATE = SY-DATUM..

Thanks,

Naren

0 Kudos

Hi Naren,

Thanks for reply. I do pass "PRICE_DATE", still it's not populating condition records. In return table i am getting warning <b>"W VF 072 Document 0090012927 has been saved (foreign trade data incomplete)"</b> can this be a cause for not updating condition record. Thanks in advance.

Regards,

Tim

ki-young_bae
Member
0 Kudos

Dear,

It seems that you missed the reference document category field which is called "REF_DOC_CA" in that BAPI function.

And as you might know, the possible values are kept in the domain VBTYP (SD document category).

Regards,

Ki-Young

Edited by: Ki-Young Bae on Oct 24, 2011 4:52 AM