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_ACC_DOCUMENT_POST

Former Member
0 Likes
6,888

Hi Friends,

Give me sample coding for the FM BAPI_ACC_DOCUMENT_POST

Regards,

V.Balaji

7 REPLIES 7
Read only

Former Member
0 Likes
1,996

Hi,

check these..


 Program                          Short description

 /OBIZ/MZIINMD_ENDMNTFIPOSTING    Include for BAPI Postings(FI)
 /OBIZ/MZIINMD_POLICYFIPOSTING    Include for BAPI Postings(FI)
 ACC_BAPI_TEST_DOCUMENT           Test Access BAPI Accounting Document
 LACC9_PROXYU02
 LACEPS2_RWINF01
 LCRM_BILL_DOCU01                 Proxy Bapi for Billing
 RGUS6035                         Program for Object Type BUS6007 : Accounting Billing

Arunima

Read only

0 Likes
1,996

Hi Arunima,

I want what are all the inputs to be given for the fields.........

Read only

0 Likes
1,996

Hi,


ACC_BAPI_TEST_DOCUMENT             117     CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                                             EXPORTING
                                               documentheader    = gd_documentheader
                                               customercpd       = gd_customercpd
                                               contractheader    = gd_fica_hd
                                             IMPORTING
                                               obj_type          = l_type
                                               obj_key           = l_key
                                               obj_sys           = l_sys
                                             TABLES
                                               accountgl         = it_accountgl
                                               accountreceivable = it_accountreceivable
                                               accountpayable    = it_accountpayable
                                               accounttax        = it_accounttax
                                               currencyamount    = it_currencyamount
                                               criteria          = it_criteria
                                               valuefield        = it_valuefield
                                               extension1        = it_ext
                                               return            = it_return
                                               paymentcard       = it_paymentcard
                                               contractitem      = it_fica_it
                                               extension2        = it_ext2
                                               realestate        = it_re.

LACC9_PROXYU02                     326     CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                                             EXPORTING
                                               DOCUMENTHEADER    = DOCUMENTHEADER
                                               CUSTOMERCPD       = CUSTOMERCPD
                                               CONTRACTHEADER    = CONTRACTHEADER
                                             IMPORTING
                                               OBJ_TYPE          = OBJ_TYPE
                                               OBJ_KEY           = OBJ_KEY
                                               OBJ_SYS           = OBJ_SYS
                                             TABLES
                                               ACCOUNTGL         = ACCOUNTGL
                                               ACCOUNTRECEIVABLE = ACCOUNTRECEIVABLE
                                               ACCOUNTPAYABLE    = ACCOUNTPAYABLE
                                               ACCOUNTTAX        = ACCOUNTTAX
                                               CURRENCYAMOUNT    = CURRENCYAMOUNT
                                               CRITERIA          = CRITERIA
                                               VALUEFIELD        = VALUEFIELD
                                               EXTENSION1        = EXTENSION1
                                               RETURN            = RETURN
                                               PAYMENTCARD       = PAYMENTCARD
                                               CONTRACTITEM      = CONTRACTITEM
                                               EXTENSION2        = EXTENSION2
                                               REALESTATE        = REALESTATE
                                               ACCOUNTWT         = ACCOUNTWT
                                             EXCEPTIONS
                                               OTHERS            = 1.

LACEPS2_RWINF01                    115     CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                                             EXPORTING
                                               DOCUMENTHEADER = CS_BAPI_HEADER
                                             TABLES
                                               ACCOUNTGL         = CT_BAPI_ITEMS
                                               ACCOUNTRECEIVABLE = CT_AR_ITEM
                                               ACCOUNTPAYABLE    = CT_AP_ITEM
                                               ACCOUNTTAX        = CT_TAX_ITEM
                                               CURRENCYAMOUNT    = CT_BAPI_CURR
                                               CRITERIA          = CT_COPA_ATTR
                                               VALUEFIELD        = CT_COPA_VAL
                                               EXTENSION1        = CT_EXT1_ITEM
                                               PAYMENTCARD       = CT_PAY_ITEM
                                               CONTRACTITEM      = CT_CON_ITEM
                                               EXTENSION2        = CT_EXT2_ITEM
                                               REALESTATE        = CT_REAL_ITEM
                                       *       extension2        = lt_extension
                                               RETURN         = LT_RETURN.

LCRM_BILL_DOCU01                   202     CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                                                EXPORTING
                                                     documentheader    = is_achd
                                       *           CUSTOMERCPD       =
                                                     contractheader    = is_cah
                                                IMPORTING
                                                     obj_type          = e_obj_type
                                                     obj_key           = e_obj_key
                                                     obj_sys           = e_obj_sys
                                                TABLES
                                                     accountgl         = it_gl
                                                     accountreceivable = it_deb
                                                     accountpayable    = it_cred
                                                     accounttax        = it_tax
                                                     currencyamount    = it_cr
                                       *           CRITERIA          =
                                       *           VALUEFIELD        =
                                                     extension1        = it_bapiacextc
                                                     return            = lt_return
                                                     paymentcard       = it_pc
                                                     contractitem      = it_cai
                                                     extension2        = it_bapiparex.

RGUS6035                           107   CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                                           EXPORTING
                                             DOCUMENTHEADER = DOCUMENTHEADER
                                             CUSTOMERCPD = CUSTOMERCPD
                                             CONTRACTHEADER = CONTRACTHEADER
                                           IMPORTING
                                             OBJ_SYS = OBJSYS
                                             OBJ_KEY = OBJKEY
                                             OBJ_TYPE = OBJTYPE
                                           TABLES
                                             REALESTATE = REALESTATE
                                             EXTENSION2 = EXTENSION2
                                             CONTRACTITEM = CONTRACTITEM
                                             PAYMENTCARD = PAYMENTCARD
                                             RETURN = RETURN
                                             EXTENSION1 = EXTENSION1
                                             VALUEFIELD = VALUEFIELD
                                             CRITERIA = CRITERIA
                                             CURRENCYAMOUNT = CURRENCYAMOUNT
                                             ACCOUNTTAX = ACCOUNTTAX
                                             ACCOUNTPAYABLE = ACCOUNTPAYABLE
                                             ACCOUNTRECEIVABLE = ACCOUNTRECEIVABLE
                                             ACCOUNTGL = ACCOUNTGL
                                             ACCOUNTWT = WITHHOLDINGTAX
                                           EXCEPTIONS
                                             OTHERS = 01.

Arunima

Read only

Former Member
0 Likes
1,996

Hi balaji

Check This Link [Sample code for BAPI_ACC_DOCUMENT_POST|;

Ranga

Read only

satsrockford
Active Participant
0 Likes
1,996

hi

check this link:

http://abap.wikiprog.com/wiki/BAPI_ACC_DOCUMENT_POST

hope it helps..

regards

Satish

Read only

Former Member
0 Likes
1,996

Hi All,

I am using the mentioned bapi to post FI document for both CO-PA and non CO-PA relevant G/L Accounts. For non CO-PA relevant G/L Accounts, this bapi is working perfectly fine but for CO-PA relevant G/L Accounts its throwing an error as

1. Field Prof.Segmt is a required field for G/L account 4800 300001

2. G/L Account 300001 requires an assignment to a Profitability Segment (GGB0)

I have filled the material number, profit center and cost center for each line item in PA segment as it is required in FB50, but then also FI document is not getting posted.

Can you please help which field in this bapi structure am I missing to populate in case of CO-PA relevant G/L Accounts?

Read only

Former Member
0 Likes
1,996

Please read the following thread just now i put sample coding for the FM BAPI_ACC_DOCUMENT_POST