10-26-2006 8:39 AM
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.
10-26-2006 8:41 AM
you should use the BAPI_TRANSACTION_COMMIT after calling the BAPI_BILLINGDOC_CREATEMULTIPLE.
Regards
- Gopi
10-26-2006 8:41 AM
you should use the BAPI_TRANSACTION_COMMIT after calling the BAPI_BILLINGDOC_CREATEMULTIPLE.
Regards
- Gopi
10-26-2006 8:50 AM
YES i have done that. I am looking for return code 'S' and billing document number in 'SUCCESS' table.
10-27-2006 2:28 AM
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
10-27-2006 3:08 AM
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
10-27-2006 5:28 AM
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 doesnt look okay, its all <b>zeros</b>. Do we have to populate <b>condition</b> table in BAPI?
Regards,
Tim
10-27-2006 2:43 AM
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
10-27-2006 5:30 AM
Hi,
Pass the PRICE_DATE field with the date...It will get the conditions also..
GT_BILLINGDATAIN-PRICE_DATE = SY-DATUM..
Thanks,
Naren
10-27-2006 6:07 AM
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
10-24-2011 3:50 AM
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