2011 Apr 18 4:36 PM
Hi Experts,
I have a requirement where in I am supposed to create an invoice independent of the PO, GRN using BAPI.
I foound the bapi BAPI_INCOMMINGINVOICE_CREATE but this can be used to create an invoice with reference to a PO or a GRN .
But my requirement is to create an invoice without reference to any document( i.e.. a BAPI for FI invoice)
please let me know is there a standard bapi available for this or I will have to go for a custom development.
Please help.
Regards,
Renuka
Hi,
the Message in sm13 is "Update was Terminated".
Update was terminated
System ID.... SED
Client....... 300
User..... SKELTA
Transaction.. SE38
Update key... 2ED970E0EBC5F197990000215E74FE66
Generated.... 27.04.2011, 19:48:12
Completed.... 27.04.2011, 19:48:12
Error Info... ABAP/4 processor: RAISE_EXCEPTION
I have created a Zprogram with following data in the structure and called the BAPI.
DATA: lt_glacct TYPE TABLE OF bapiacgl09,
lt_vendact TYPE TABLE OF bapiacap09,
lt_curramt TYPE TABLE OF bapiaccr09,
lt_return TYPE TABLE OF bapiret2.
Workarea and variable declaration
DATA: lv_objtyp TYPE bapiache09-obj_type,
lv_objkey TYPE bapiache09-obj_key,
lv_objsys TYPE bapiache09-obj_sys,
wa_docheader TYPE bapiache09,
wa_glacct LIKE LINE OF lt_glacct,
wa_curramt LIKE LINE OF lt_curramt,
wa_vendact LIKE LINE OF lt_vendact,
wa_return LIKE LINE OF lt_return.
All necessary fields for vendor invoices will be considerd.
Populate header data of document
*wa_docheader-obj_type = 'REACI'.
*wa_docheader-obj_key = '$'.
*wa_docheader-obj_sys = 'SEDCLNT300'.
*wa_docheader-bus_act = 'RMRP'.
wa_docheader-comp_code = 'STEL'.
wa_docheader-username = sy-uname.
wa_docheader-header_txt = 'Upload using BAPI'.
wa_docheader-doc_date = '20110420'. "'20090331'.
wa_docheader-pstng_date = '20110420'. "'20090331'.
wa_docheader-fisc_year = '2011'. "'2009'.
wa_docheader-doc_type = 'KR'.
WA_DOCHEADER-REF_DOC_NO = '1234'.
Account payable are maintained here
wa_vendact-itemno_acc = '0000000001'.
wa_vendact-vendor_no = '0000100005'.
wa_vendact-COMP_CODE = 'STEL'.
wa_vendact-BUS_AREA = '3GB'.
wa_vendact-pmnttrms = '0001'.
wa_vendact-bline_date = '20110420'. "'20090421'.
wa_vendact-BUSINESSPLACE = 'BHPA'.
wa_vendact-SECTIONCODE = 'BHPA'.
wa_vendact-item_text = 'Account payable'.
APPEND wa_vendact TO lt_vendact.
Corresponding entry in GL Account
*wa_glacct-itemno_acc = '0000000002'.
*wa_glacct-gl_account = '0000089000'.
*wa_glacct-item_text = 'GL account'.
wa_glacct-ITEMNO_ACC = '0000000002'.
wa_glacct-GL_ACCOUNT = '0001404301'.
wa_glacct-DOC_TYPE = 'KR'.
wa_glacct-COMP_CODE = 'STEL'.
wa_glacct-BUS_aREA = '3GB'.
wa_glacct-PLANT = 'BHPA'.
wa_glacct-FISC_YEAR = '2011'.
wa_glacct-FIS_PERIOD = '04'.
wa_glacct-TAX_CODE = 'M1'.
wa_glacct-CSHDIS_IND = 'H'.
*APPEND GL_aCC TO GL_ACC.
APPEND wa_glacct TO lt_glacct.
*Make sure total amount balance for a document should be zero
wa_curramt-itemno_acc = '0000000001'.
wa_curramt-curr_type = '10'.
wa_curramt-currency = 'INR'.
wa_curramt-amt_doccur = '-1000.00'.
APPEND wa_curramt TO lt_curramt.
CLEAR wa_curramt.
wa_curramt-itemno_acc = '0000000002'.
wa_curramt-curr_type = '10'.
wa_curramt-currency = 'INR'.
wa_curramt-amt_doccur = '1000.00'.
APPEND wa_curramt TO lt_curramt.
CLEAR: wa_curramt,wa_glacct,wa_vendact.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = wa_docheader
IMPORTING
obj_type = lv_objtyp
obj_key = lv_objkey
obj_sys = lv_objsys
TABLES
accountgl = lt_glacct
accountpayable = lt_vendact
currencyamount = lt_curramt
return = lt_return.
IF sy-subrc EQ 0.
WRITE:/ lv_objtyp.
WRITE:/ lv_objkey.
WRITE:/ lv_objsys.
LOOP AT lt_return INTO wa_return.
WRITE:/ wa_return-message.
CLEAR wa_return.
ENDLOOP.
COMMIT WORK AND WAIT.
BREAK-POINT.
ENDIF.
Plz help
2011 Apr 19 1:15 PM
Pls check BAPI_ACC_INVOICE_RECEIPT_POST
Documentation indicates:
Definition: invoice receipt
Invoice Verification (MM-IV)
A term from Invoice Verification describing the receipt of an invoice issued by a vendor (creditor).
The following types of invoice receipt are possible in the SAP system:
Invoice receipt referencing a purchase order
Invoice receipt referencing a goods receipt
nvoice receipt without reference
Regards,
Shyam
2011 Apr 20 7:07 PM
Hi Shyam,
thanks for replying..
I tried using the bapi but it gives error saying the "Tax code doesnt belong to the COmpany Code" , but the tax code is assigned to the company code in my server.
I even tried using the bapi "BAPI_ACC_DOCUMENT_POST" with all mandatory parameters , and even called the bapi_transaction_commit in sequence .
After the BAPI_ACC_DOCUMENT_POST when I chek the return parameters it says " DOCUMENT SUCCESSFULLY POSTED " and gives the document number as well but " commit ' bapi gives error saying " Update is terminated".
Please help.
Regards,
Renuka
2011 Apr 20 7:22 PM
Did you review the update terminate records in SM13? You'll get the error as well as the code point.
2011 Apr 26 6:27 AM
Hi Brad,
In SM13 it gives an error message saying "Update was Terminated".
Error Details: Class 00, Number 671
ABAP/4 processor" RAISE _EXCEPTION
Please help.
Regards,
Renuka
2011 Apr 26 6:47 AM
Hi Renuka,
Please provide the detailed error analysis available in SM13.
Thanks & Regards,
Harish
2011 Apr 27 3:23 PM
Hi,
the Message in sm13 is "Update was Terminated".
Update was terminated
System ID.... SED
Client....... 300
User..... SKELTA
Transaction.. SE38
Update key... 2ED970E0EBC5F197990000215E74FE66
Generated.... 27.04.2011, 19:48:12
Completed.... 27.04.2011, 19:48:12
Error Info... ABAP/4 processor: RAISE_EXCEPTION
I have created a Zprogram with following data in the structure and called the BAPI.
DATA: lt_glacct TYPE TABLE OF bapiacgl09,
lt_vendact TYPE TABLE OF bapiacap09,
lt_curramt TYPE TABLE OF bapiaccr09,
lt_return TYPE TABLE OF bapiret2.
Workarea and variable declaration
DATA: lv_objtyp TYPE bapiache09-obj_type,
lv_objkey TYPE bapiache09-obj_key,
lv_objsys TYPE bapiache09-obj_sys,
wa_docheader TYPE bapiache09,
wa_glacct LIKE LINE OF lt_glacct,
wa_curramt LIKE LINE OF lt_curramt,
wa_vendact LIKE LINE OF lt_vendact,
wa_return LIKE LINE OF lt_return.
All necessary fields for vendor invoices will be considerd.
Populate header data of document
*wa_docheader-obj_type = 'REACI'.
*wa_docheader-obj_key = '$'.
*wa_docheader-obj_sys = 'SEDCLNT300'.
*wa_docheader-bus_act = 'RMRP'.
wa_docheader-comp_code = 'STEL'.
wa_docheader-username = sy-uname.
wa_docheader-header_txt = 'Upload using BAPI'.
wa_docheader-doc_date = '20110420'. "'20090331'.
wa_docheader-pstng_date = '20110420'. "'20090331'.
wa_docheader-fisc_year = '2011'. "'2009'.
wa_docheader-doc_type = 'KR'.
WA_DOCHEADER-REF_DOC_NO = '1234'.
Account payable are maintained here
wa_vendact-itemno_acc = '0000000001'.
wa_vendact-vendor_no = '0000100005'.
wa_vendact-COMP_CODE = 'STEL'.
wa_vendact-BUS_AREA = '3GB'.
wa_vendact-pmnttrms = '0001'.
wa_vendact-bline_date = '20110420'. "'20090421'.
wa_vendact-BUSINESSPLACE = 'BHPA'.
wa_vendact-SECTIONCODE = 'BHPA'.
wa_vendact-item_text = 'Account payable'.
APPEND wa_vendact TO lt_vendact.
Corresponding entry in GL Account
*wa_glacct-itemno_acc = '0000000002'.
*wa_glacct-gl_account = '0000089000'.
*wa_glacct-item_text = 'GL account'.
wa_glacct-ITEMNO_ACC = '0000000002'.
wa_glacct-GL_ACCOUNT = '0001404301'.
wa_glacct-DOC_TYPE = 'KR'.
wa_glacct-COMP_CODE = 'STEL'.
wa_glacct-BUS_aREA = '3GB'.
wa_glacct-PLANT = 'BHPA'.
wa_glacct-FISC_YEAR = '2011'.
wa_glacct-FIS_PERIOD = '04'.
wa_glacct-TAX_CODE = 'M1'.
wa_glacct-CSHDIS_IND = 'H'.
*APPEND GL_aCC TO GL_ACC.
APPEND wa_glacct TO lt_glacct.
*Make sure total amount balance for a document should be zero
wa_curramt-itemno_acc = '0000000001'.
wa_curramt-curr_type = '10'.
wa_curramt-currency = 'INR'.
wa_curramt-amt_doccur = '-1000.00'.
APPEND wa_curramt TO lt_curramt.
CLEAR wa_curramt.
wa_curramt-itemno_acc = '0000000002'.
wa_curramt-curr_type = '10'.
wa_curramt-currency = 'INR'.
wa_curramt-amt_doccur = '1000.00'.
APPEND wa_curramt TO lt_curramt.
CLEAR: wa_curramt,wa_glacct,wa_vendact.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = wa_docheader
IMPORTING
obj_type = lv_objtyp
obj_key = lv_objkey
obj_sys = lv_objsys
TABLES
accountgl = lt_glacct
accountpayable = lt_vendact
currencyamount = lt_curramt
return = lt_return.
IF sy-subrc EQ 0.
WRITE:/ lv_objtyp.
WRITE:/ lv_objkey.
WRITE:/ lv_objsys.
LOOP AT lt_return INTO wa_return.
WRITE:/ wa_return-message.
CLEAR wa_return.
ENDLOOP.
COMMIT WORK AND WAIT.
BREAK-POINT.
ENDIF.
Plz help
2011 May 23 8:10 AM
Hi all,
the bapi is working fine when i give tax code in the account payables structure, but gives error when given in the account gl table...
the error is "Tax statement item missing for tax code"...
regards,
renuka
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |