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

Interface Bapi

Former Member
0 Likes
399

Sir,

My client want to transfer data from FBCJ to F-02 through regular interval with in sap. ( related with fianance).

They required this interface should run in background process. So, is there any standard BAPI .

or any another method through which will help me

2 REPLIES 2
Read only

Former Member
0 Likes
370

hi,

use this program.

REPORT ZTESTE_DOC .

*********************************************************************

*DATA DECLARATION

**********************************************************************

*

*&u2014HEADER DECLARATION

data: header type bapiache09. u201C HEADER DATA

**********************************************************************

*INTERNAL TABLE DECLARATION

**********************************************************************

*&u2014-G/L ACCOUNT ITEM

data: accountgl type standard table of bapiacgl09.

*&u2014g/l Account tax

data: account_tax type standard table of bapiactx09.

*&u2014CURRENCY ITEMS

data: currency_amount type standard table of bapiaccr09.

*&u2014-RETURN PARAMETER

data: return type standard table of bapiret2 with header line.

**********************************************************************

*WORK-AREA DECLARATION

**********************************************************************

*&u2014-WORKAREA FOR G/L ACCOUNT ITEM

data: wa_accountgl type bapiacgl09.

*&u2014WORKAREA FOR CURRENCY ITEMS

data: wa_currency_amount type bapiaccr09.

*&u2014WORKAREA FOR TAX ITEMS

data: wa_tax type bapiactx09.

**********************************************************************

INITIALIZATION .

**********************************************************************

header-header_txt = u2018TEST HEADERu2019.

header-username = u2018DEVELOPERu2019.

header-comp_code = u20181000u2032.

header-fisc_year = u20182008u2032.

header-doc_date = u201820080618u2032.

header-pstng_date = u201820080618u2032.

header-trans_date = u201820080618u2032.

header-doc_type = u2018SAu2019.

header-bus_act = u2018RFBUu2019.

wa_accountgl-itemno_acc = u20180000000010u2032.

wa_accountgl-gl_account = u20180011401001u2032.

wa_accountgl-item_text = u2018SO_DOC textou2019.

wa_accountgl-PROFIT_CTR = u2018ADM_RIOu2019.

wa_accountgl-de_cre_ind = u2018Su2019.

append wa_accountgl to accountgl.

clear wa_accountgl.

wa_accountgl-itemno_acc = u20180000000020u2032.

wa_accountgl-gl_account = u20180034101002u2032.

wa_accountgl-item_text = u2018SO_DOC textou2019.

*wa_accountgl-ACCT_TYPE = u2019Ru2019.

append wa_accountgl to accountgl.

clear wa_accountgl.

wa_currency_amount-itemno_acc = u20180000000010u2032.

wa_currency_amount-amt_doccur = u2018500u2032.

wa_currency_amount-currency = u2018BRLu2019.

append wa_currency_amount to currency_amount.

clear wa_currency_amount.

wa_currency_amount-itemno_acc = u20180000000020u2032.

wa_currency_amount-amt_doccur = u2018-500u2032.

wa_currency_amount-currency = u2018BRLu2019.

append wa_currency_amount to currency_amount.

clear wa_currency_amount.

*WA_TAX-ITEMNO_ACC = u20190000000010u2032.

*WA_TAX-TAX_CODE = u2019V0u2032.

*APPEND WA_TAX TO ACCOUNT_TAX.

*CLEAR WA_TAX.

*

*WA_TAX-ITEMNO_ACC = u20190000000020u2032.

*WA_TAX-TAX_CODE = u2019V0u2032.

*APPEND WA_TAX TO ACCOUNT_TAX.

*CLEAR WA_TAX.

**************************************************************

*START-OF-SELECTION

**************************************************************

start-of-selection.

call function u2018BAPI_ACC_DOCUMENT_POSTu2019

exporting

documentheader = header

*CUSTOMERCPD =

*CONTRACTHEADER =

*IMPORTING

*OBJ_TYPE =

*OBJ_KEY =

*OBJ_SYS =

tables

accountgl = accountgl

*ACCOUNTRECEIVABLE =

*ACCOUNTPAYABLE =

ACCOUNTTAX = ACCOUNT_TAX

currencyamount = currency_amount

*CRITERIA =

*VALUEFIELD =

*EXTENSION1 =

return = return

*PAYMENTCARD =

*CONTRACTITEM =

*EXTENSION2 =

*REALESTATE =

.

if return-type na u2018EAu2019.

call function u2018BAPI_TRANSACTION_COMMITu2019

exporting

wait = u2018Xu2019.

*IMPORTING

*RETURN = RETURN.

write:/ return-message.

else.

write:/ return-message.

endif.

write:/ return-message+36(10).

write:/ return+36(10).

~linganna

Read only

Former Member
0 Likes
370

Hi,

If you want do it by ale idoc process use the FM : Idoc_input_fidcc2.

Regards,

Ravinder.S