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 posting FI document (FB01)

Former Member
0 Likes
11,794

Hi,

Is there any BAPI/FM to post FI document (FB01).

Thanks & REgards,

Abhishek Sarkar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,057

Hi Abhishek,

<b>BAPI_ACC_GL_POSTING_POST</b>

Regards

Aneesh.

6 REPLIES 6
Read only

Former Member
0 Likes
6,058

Hi Abhishek,

<b>BAPI_ACC_GL_POSTING_POST</b>

Regards

Aneesh.

Read only

Former Member
0 Likes
6,057

Hi,

Use <b>BAPI_ACC_DOCUMENT_POST</b>.

Regards

Kannaiah

Read only

Former Member
0 Likes
6,057

Hi,

BAPI_ACC_DOCUMENT_POST

Regards

Read only

0 Likes
3,929

Call this BAPI 

  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
        EXPORTING
          document header    lw_document_header
        TABLES
          accountgl               lt_accountgl
          accountreceivable lt_accountcust
          accountpayable    lt_accountvend
          accounttax        lt_accounttax
          currencyamount    lt_currencyamount
          return                     lt_return
          extension2        lt_extension2.
 

DATA: lv_success TYPE abap_bool.
lv_success = abap_true.

LOOP AT lt_return INTO DATA(ls_return).
WRITE: / ls_return-message. "Output return message
IF ls_return-type = 'E' OR ls_return-type = 'A'.
lv_success = abap_false. "Set success flag to false on error
ENDIF.
ENDLOOP.

"Commit Work if Successful
IF lv_success = abap_true.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WRITE: / 'Document posted successfully:', lv_document_number.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. "Rollback on error
WRITE: / 'Document posting failed.'.
ENDIF.

Read only

0 Likes
4,026

any one have documentation how we can use BAPI_ACC_DOCUMENT_POST

Read only

oliver_beie
Participant
0 Likes
3,945

Hi,

check note 2083799 and the referenced notes for special postings.

Regards, Oliver