on 01-27-2014 5:51 AM
Dear Friends,
could any one please let me know is there any BAPI for Vendor Out Going Payment Tcode(F-53)
Thanks
Vijaya
Hello Vijaya,
There are two options:-
1) You can use bapi-BAPI_ACC_DOCUMENT_POST to post a vendor document posting, and enter the amount and transaction keys. but this will not clear the Vendor invoice items,
You can do clearing by a seperate program
2) You can write a BDC program for F-53 to perform the clearing of the items during the posting. There is not specific BAPI which can perform this function.
Regards
Rishab
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijaya,
Alternatively, you could use FM POSTING_INTERFACE_CLEARING to post the payment document and clear the vendor. Before you should call to FM POSTING_INTERFACE_START.
Note that in POSTING_INTERFACE_CLEARING you must set the parameter i_auglv to 'AUSGZAHL', which means outgoing payment (Check table T041A).
Sample Code:
SELECT * FROM bseg INTO TABLE xbseg
WHERE bukrs = i_bukrs
AND belnr = i_belnr
AND gjahr = i_gjahr.
CHECK sy-subrc EQ 0.
LOOP AT t_bseg.
CHECK NOT t_bseg-rfzei IS INITIAL.
READ TABLE xbseg WITH KEY bukrs = t_bseg-bukrs
belnr = t_bseg-belnr
gjahr = t_bseg-gjahr
buzei = t_bseg-buzei.
CHECK sy-subrc IS INITIAL.
xbseg-rfzei = t_bseg-rfzei.
MODIFY xbseg INDEX sy-tabix.
ENDLOOP.
SELECT SINGLE * FROM bkpf WHERE bukrs = i_bukrs
AND belnr = i_belnr
AND gjahr = i_gjahr.
CHECK sy-subrc EQ 0.
* ------ Posting interface start ---------------------------------------
CALL FUNCTION 'POSTING_INTERFACE_START'
EXPORTING i_function = fipi-function
i_group = fipi-group
i_holddate = fipi-holddate
i_keep = space
i_mode = fipi-mode
i_update = fipi-update
i_user = fipi-user.
CLEAR ftclear.
ftclear-agkoa = 'D'.
* Lesen der abgerechneten Kreditkartenforderungsposition
LOOP AT xbseg WHERE koart EQ 'S'
AND NOT ccbtc IS INITIAL
AND rfzei = i_rfzei.
* Posten ist eine Rechnung
IF xbseg-shkzg = 'S'.
lc_shkzg = 'H'.
lc_bschl = t041a-bssha.
* Posten ist eine Gutschrift
ELSE.
lc_shkzg = 'S'.
lc_bschl = t041a-bssso.
ENDIF.
EXIT.
ENDLOOP.
CHECK sy-subrc EQ 0.
LOOP AT xbseg WHERE rfzei = i_rfzei
AND koart = 'D'
AND shkzg = lc_shkzg.
ftclear-agkon = xbseg-kunnr.
ftclear-agbuk = xbseg-bukrs.
ftclear-xnops = 'X'.
ftclear-agums = ' '.
ftclear-selfd = 'BELNR'.
ftclear-selvon = xbseg-belnr.
ftclear-selvon+10 = xbseg-gjahr.
ftclear-selvon+14 = xbseg-buzei. "BELNR/GJAHR/BUZEI
CONDENSE ftclear-selvon NO-GAPS.
APPEND ftclear.
fb05-wrbtr = xbseg-wrbtr.
ENDLOOP.
ftpost-stype = 'K'.
ftpost-count = '1'.
WRITE i_bldat TO fvalue DD/MM/YYYY.
PERFORM ftpost_field USING: 'BKPF-BLDAT' fvalue,
'BKPF-BLART' i_blart,
'BKPF-BUKRS' i_bukrs.
WRITE i_budat TO fvalue DD/MM/YYYY.
IF bkpf-bktxt IS INITIAL.
bkpf-bktxt(10) = text-001.
bkpf-bktxt+15(10) = i_ccbtc.
ENDIF.
PERFORM ftpost_field USING: 'BKPF-BUDAT' fvalue,
'BKPF-WAERS' bkpf-waers,
'BKPF-XBLNR' bkpf-xblnr,
'BKPF-BKTXT' bkpf-bktxt.
ftpost-count = 0.
* ------ Sachkontenzeile lesen -----------------------------------------
LOOP AT xbseg WHERE koart = 'S'
AND rfzei = i_rfzei.
EXIT.
ENDLOOP.
CHECK sy-subrc eq 0.
ftpost-stype = 'P'.
ftpost-count = '1'.
CALL FUNCTION 'FI_COMPANY_CODE_DATA'
EXPORTING i_bukrs = i_bukrs
IMPORTING e_t001 = t001.
SELECT SINGLE * FROM tccaa WHERE ktopl = t001-ktopl
AND hkont_v = xbseg-hkont.
IF sy-subrc NE 0 or
tccaa-hkont_n IS INITIAL.
MESSAGE e032 WITH t001-ktopl xbseg-hkont.
ENDIF.
* ------ Habenbuchung auf Verrechnungskonto ----------------------------
WRITE fb05-wrbtr TO fvalue CURRENCY bkpf-waers.
CONDENSE fvalue NO-GAPS.
PERFORM ftpost_field USING: 'BSEG-HKONT' tccaa-hkont_n,
'BSEG-SGTXT' xbseg-sgtxt,
'BSEG-ZUONR' xbseg-zuonr,
* 'BSEG-XREF1' XBSEG-XREF1,
* 'BSEG-XREF2' XBSEG-XREF2,
* 'BSEG-XREF3' XBSEG-XREF3,
'BSEG-BSCHL' lc_bschl,
'BSEG-WRBTR' fvalue.
* ------ CALL FB05 -----------------------------------------------------
CALL FUNCTION 'POSTING_INTERFACE_CLEARING'
EXPORTING i_auglv = fipi-auglv
i_tcode = fipi-tcode
IMPORTING e_subrc = subrc
e_msgid = msgid
e_msgty = msgty
e_msgno = msgno
e_msgv1 = msgv1
e_msgv2 = msgv2
e_msgv3 = msgv3
e_msgv4 = msgv4
TABLES t_ftpost = ftpost
t_ftclear = ftclear
t_fttax = fttax
t_blntab = xblntab.
* ------ Meldung und Ende ----------------------------------------------
fb05-subrc = subrc.
MESSAGE ID msgid TYPE msgty NUMBER msgno
WITH msgv1 msgv2 msgv3 msgv4.
PERFORM msgtab_append.
CALL FUNCTION 'POSTING_INTERFACE_END'.
REFRESH: ftpost, ftclear.
CLEAR: ftpost, ftclear.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.