Note :For the F-47 posting, it only post to 1 line item whereby BAPI "BAPI_ACC_DOCUMENT_POST" have to post in 2 lines for balance the account.
*&---------------------------------------------------------------------*
*& REPORT ZFI_DOWNPAYMENT
*&
*&---------------------------------------------------------------------*
*&Source : http://abaptechnicalhelp.blogspot.com
*&Author : Kartikeyan K
*&Email : Karthikeyana2z@gmail.com
*&---------------------------------------------------------------------*
REPORT ZFI_DOWNPAYMENT.
DATA : T_ACCHD TYPE TABLE OF ACCHD WITH HEADER LINE,
T_ACCIT TYPE TABLE OF ACCIT WITH HEADER LINE,
T_ACCCR TYPE TABLE OF ACCCR WITH HEADER LINE,
T_RETURN TYPE TABLE OF MESSAGE_STRUCT WITH HEADER LINE.
T_ACCHD-MANDT = SY-MANDT.
T_ACCHD-AWTYP = 'BKPFF'.
T_ACCHD-GLVOR = 'RFBU'.
T_ACCHD-TCODE = 'F-47'.
T_ACCHD-BKTXT = 'TEST1'.
T_ACCHD-USNAM = SY-UNAME.
APPEND T_ACCHD.
CLEAR T_ACCHD.
T_ACCIT-MANDT = SY-MANDT.
T_ACCIT-POSNR = '000001'.
T_ACCIT-GSBER = '1015'.
T_ACCIT-BUKRS = '5010'.
T_ACCIT-BLDAT = SY-DATUM.
T_ACCIT-BUDAT = SY-DATUM.
T_ACCIT-BLART = 'KA'.
T_ACCIT-XBLNR = 'XBLNR-TEST'.
T_ACCIT-VORGN = 'AZAF'.
*T_ACCIT-BUPLA = .
T_ACCIT-UMSKZ = 'F'.
T_ACCIT-ZUMSK = 'A'.
T_ACCIT-BSTAT = 'S'.
T_ACCIT-BSCHL = '39'.
T_ACCIT-SHKZG = 'H'.
T_ACCIT-KOART = 'K'.
T_ACCIT-ZFBDT = '20140430'.
T_ACCIT-ZLSPR = 'P'.
T_ACCIT-EBELN = '4500000664'.
T_ACCIT-EBELP = '000001'.
T_ACCIT-LIFNR = '0000020070'.
APPEND T_ACCIT.
CLEAR T_ACCIT.
T_ACCCR-MANDT = SY-MANDT.
T_ACCCR-AWTYP = 'BKPFF'.
T_ACCCR-POSNR = '000001'.
T_ACCCR-WAERS = 'INR'.
T_ACCCR-WRBTR = '-1000'.
T_ACCCR-CURTP = '00'.
*T_ACCCR-CURTP = '10'.
APPEND T_ACCCR.
CLEAR T_ACCCR.
T_ACCCR-MANDT = SY-MANDT.
T_ACCCR-AWTYP = 'BKPFF'.
T_ACCCR-POSNR = '000001'.
T_ACCCR-WAERS = 'INR'.
T_ACCCR-WRBTR = '-1000'.
T_ACCCR-CURTP = '10'.
APPEND T_ACCCR.
CLEAR T_ACCCR.
DATA : E_BUKRS TYPE BUKRS,
E_BELNR TYPE BELNR_D,
E_GJAHR TYPE GJAHR.
CALL FUNCTION 'RFIDPT_ACC_DOCUMENT_POST_ADJ'
* EXPORTING
* I_COMP = ' '
* I_COMP_CHECK = ' '
* I_FREE_TABLE = 'X'
* I_TEST = 'X'
IMPORTING
E_BUKRS = E_BUKRS
E_BELNR = E_BELNR
E_GJAHR = E_GJAHR
TABLES
T_ACCHD = T_ACCHD
T_ACCIT = T_ACCIT
T_ACCCR = T_ACCCR
* T_ACCTX =
T_RETURN = T_RETURN
.
FREE T_RETURN.
*&---------------------------------------------------------------------*
*& REPORT ZFI_DOWNPAYMENT
*&
*&---------------------------------------------------------------------*
*&Source : http://abaptechnicalhelp.blogspot.com
*&Author : Kartikeyan K
*&Email : Karthikeyana2z@gmail.com
*&---------------------------------------------------------------------*
REPORT ZFI_DOWNPAYMENT.
DATA : T_ACCHD TYPE TABLE OF ACCHD WITH HEADER LINE,
T_ACCIT TYPE TABLE OF ACCIT WITH HEADER LINE,
T_ACCCR TYPE TABLE OF ACCCR WITH HEADER LINE,
T_RETURN TYPE TABLE OF MESSAGE_STRUCT WITH HEADER LINE.
T_ACCHD-MANDT = SY-MANDT.
T_ACCHD-AWTYP = 'BKPFF'.
T_ACCHD-GLVOR = 'RFBU'.
T_ACCHD-TCODE = 'F-47'.
T_ACCHD-BKTXT = 'TEST1'.
T_ACCHD-USNAM = SY-UNAME.
APPEND T_ACCHD.
CLEAR T_ACCHD.
T_ACCIT-MANDT = SY-MANDT.
T_ACCIT-POSNR = '000001'.
T_ACCIT-GSBER = '1015'.
T_ACCIT-BUKRS = '5010'.
T_ACCIT-BLDAT = SY-DATUM.
T_ACCIT-BUDAT = SY-DATUM.
T_ACCIT-BLART = 'KA'.
T_ACCIT-XBLNR = 'XBLNR-TEST'.
T_ACCIT-VORGN = 'AZAF'.
*T_ACCIT-BUPLA = .
T_ACCIT-UMSKZ = 'F'.
T_ACCIT-ZUMSK = 'A'.
T_ACCIT-BSTAT = 'S'.
T_ACCIT-BSCHL = '39'.
T_ACCIT-SHKZG = 'H'.
T_ACCIT-KOART = 'K'.
T_ACCIT-ZFBDT = '20140430'.
T_ACCIT-ZLSPR = 'P'.
T_ACCIT-EBELN = '4500000664'.
T_ACCIT-EBELP = '000001'.
T_ACCIT-LIFNR = '0000020070'.
APPEND T_ACCIT.
CLEAR T_ACCIT.
T_ACCCR-MANDT = SY-MANDT.
T_ACCCR-AWTYP = 'BKPFF'.
T_ACCCR-POSNR = '000001'.
T_ACCCR-WAERS = 'INR'.
T_ACCCR-WRBTR = '-1000'.
T_ACCCR-CURTP = '00'.
*T_ACCCR-CURTP = '10'.
APPEND T_ACCCR.
CLEAR T_ACCCR.
T_ACCCR-MANDT = SY-MANDT.
T_ACCCR-AWTYP = 'BKPFF'.
T_ACCCR-POSNR = '000001'.
T_ACCCR-WAERS = 'INR'.
T_ACCCR-WRBTR = '-1000'.
T_ACCCR-CURTP = '10'.
APPEND T_ACCCR.
CLEAR T_ACCCR.
DATA : E_BUKRS TYPE BUKRS,
E_BELNR TYPE BELNR_D,
E_GJAHR TYPE GJAHR.
CALL FUNCTION 'RFIDPT_ACC_DOCUMENT_POST_ADJ'
* EXPORTING
* I_COMP = ' '
* I_COMP_CHECK = ' '
* I_FREE_TABLE = 'X'
* I_TEST = 'X'
IMPORTING
E_BUKRS = E_BUKRS
E_BELNR = E_BELNR
E_GJAHR = E_GJAHR
TABLES
T_ACCHD = T_ACCHD
T_ACCIT = T_ACCIT
T_ACCCR = T_ACCCR
* T_ACCTX =
T_RETURN = T_RETURN
.
FREE T_RETURN.