cancel
Showing results for 
Search instead for 
Did you mean: 

Park FI documents with BAPI_ACC_DOCUMENT_POST

Former Member
0 Kudos

Hello! Can I use BAPI_ACC_DOCUMENT_POST to park FI documents? If it is possible: which adjustements need to be made to do this?

Thank you very much.

Best regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

ravi_nagh
Active Contributor
0 Kudos

HI,

Adding to Kyoko's reply.

The following BTEs are available for parked documents via trans BERP:

00002210 DOCUMENT PARKING: Amount release

00002211 DOCUMENT PARKING: Account assignment approval

00002212 DOCUMENT PARKING: Determine accounting clerk

00002220 DOCUMENT POSTING: Det. person with release author

Please assign points if it useful.

Regards

Ravinagh Boni

Former Member
0 Kudos

I have searched the forums for the same answer. Right now, I do not think it is possible, but I am still looking for a way to use a BAPI_ACC_DOCUMENT_POST to park accounting documents.

See

Bob Unger

Former Member
0 Kudos

Hi,

BAPI_ACC_DOCUMENT_POST does not support document parking due to the technical reason. BAPI_ACC_DOCUMENT_POST creates FI document via accounting interface technique, and this does not support parked document.

You might want to consider using RFBIBL00 with transaction code FBV1.

Kind regards, Kyoko

Former Member
0 Kudos

Dear Friend,

I also need park document using custome abap program, please suggest me or any example got plese send to me.

My Mail id v v r a o 4 u s @yahoo.com

Former Member
0 Kudos

Hello,

Here is an ABAP function code i've written for parking documents with transaction FBV1

Regards

Murat

function zfi_rfc_park_fi_doc.

*"----

-


""Local interface:

*" IMPORTING

*" VALUE(I_MODE) LIKE RFPDO-ALLGAZMD DEFAULT 'N'

*" VALUE(I_UPDATE) TYPE RFPDO-ALLGAZMD DEFAULT 'S'

*" EXPORTING

*" VALUE(E_MESSAGES) LIKE MESSAGES STRUCTURE MESSAGES

*" VALUE(E_BLNTAB) LIKE BLNTAB STRUCTURE BLNTAB

*" TABLES

*" T_BSEG STRUCTURE VBSEG OPTIONAL

*" T_BKPF STRUCTURE VBKPF OPTIONAL

*" EXCEPTIONS

*" HEADER_IS_INITIAL

*" ITEMS_IS_INITIAL

*" NODOCUMENT

*"----

-


data: t_blntab like blntab occurs 10 with header line,

t_ftpost like ftpost occurs 10 with header line,

t_fttax like fttax occurs 10 with header line.

data groupid like apqi-groupid value 'AKD'.

data cnt(3).

data nodata(1) type c. " Keine BI-Daten für Feld

data t_return like bapiret2 occurs 10 with header line.

data : e_langu like sy-langu,

e_msgid like sy-msgid,

e_msgno like sy-msgno,

e_msgty like sy-msgty,

e_msgv1 like sy-msgv1,

e_msgv2 like sy-msgv2,

e_msgv3 like sy-msgv3,

e_msgv4 like sy-msgv4,

e_subrc like sy-subrc.

*----


*

if t_bkpf[] is initial.

raise header_is_initial.

endif.

if t_bseg[] is initial.

raise items_is_initial.

endif.

clear : t_ftpost.

*1

call function 'POSTING_INTERFACE_START'

exporting

i_function = 'C' " 'B':batch input 'C':ön plan

i_group = groupid

i_keep = 'X'

i_user = sy-uname

i_mode = i_mode

i_update = i_update

exceptions

client_incorrect = 1

function_invalid = 2

group_name_missing = 3

mode_invalid = 4

update_invalid = 5

others = 6.

*2

read table t_bkpf index 1.

t_ftpost-stype = 'K'. " K:header

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-BLDAT'.

write: t_bkpf-bldat to t_ftpost-fval dd/mm/yyyy.

append t_ftpost.

t_ftpost-stype = 'K'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-BLART'.

t_ftpost-fval = t_bkpf-blart.

append t_ftpost.

t_ftpost-stype = 'K'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-BUKRS'.

t_ftpost-fval = t_bkpf-bukrs.

append t_ftpost.

t_ftpost-stype = 'K'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-BUDAT'.

write: t_bkpf-budat to t_ftpost-fval dd/mm/yyyy.

append t_ftpost.

t_ftpost-stype = 'K'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-MONAT'.

t_ftpost-fval = t_bkpf-monat.

append t_ftpost.

t_ftpost-stype = 'K'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-WAERS'.

t_ftpost-fval = t_bkpf-waers.

append t_ftpost.

t_ftpost-stype = 'K'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-XBLNR'.

t_ftpost-fval = t_bkpf-xblnr.

append t_ftpost.

t_ftpost-stype = 'K'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BKPF-BKTXT'.

t_ftpost-fval = t_bkpf-bktxt.

append t_ftpost.

*3

loop at t_bseg .

cnt = cnt + 1 .

t_ftpost-stype = 'P'. " P: Item

t_ftpost-count = cnt.

t_ftpost-fnam = 'RF05A-NEWBS'.

t_ftpost-fval = t_bseg-bschl. "t_bseg-NEWBS.

append t_ftpost.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'RF05A-NEWKO'.

if t_bseg-koart = 'S' .

t_ftpost-fval = t_bseg-hkont.

elseif t_bseg-koart = 'D' .

t_ftpost-fval = t_bseg-kunnr.

elseif t_bseg-koart = 'K' .

t_ftpost-fval = t_bseg-lifnr.

endif.

append t_ftpost.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'RF05A-NEWUM'.

t_ftpost-fval = t_bseg-umskz.

append t_ftpost.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BSEG-WRBTR'.

t_ftpost-fval = t_bseg-wrbtr .

condense t_ftpost-fval.

replace '.' with ',' into t_ftpost-fval.

append t_ftpost.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BSEG-SGTXT'.

t_ftpost-fval = t_bseg-sgtxt.

append t_ftpost.

if t_bseg-koart = 'S'. "??? geçici-AKD

if t_bseg-mwskz ne nodata.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BSEG-MWSKZ'.

t_ftpost-fval = t_bseg-mwskz.

append t_ftpost.

endif.

endif.

if t_bseg-fwbas ne nodata.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BSEG-FWBAS '.

t_ftpost-fval = t_bseg-fwbas .

condense t_ftpost-fval.

replace '.' with ',' into t_ftpost-fval.

append t_ftpost.

endif.

if t_bseg-prctr ne nodata.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

if t_bseg-koart = 'S'.

t_ftpost-fnam = 'COBL-PRCTR'.

else.

t_ftpost-fnam = 'BSEG-PRCTR'.

endif.

t_ftpost-fval = t_bseg-prctr .

append t_ftpost.

endif.

if t_bseg-kostl ne nodata.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

if t_bseg-koart = 'S'.

t_ftpost-fnam = 'COBL-KOSTL'.

else.

t_ftpost-fnam = 'BSEG-KOSTL'.

endif.

t_ftpost-fval = t_bseg-kostl .

append t_ftpost.

endif.

t_ftpost-stype = 'P'.

t_ftpost-count = '1'.

t_ftpost-fnam = 'BSEG-ZUONR'.

t_ftpost-fval = t_bseg-zuonr.

append t_ftpost.

endloop.

*4

data subrc like sy-subrc.

call function 'POSTING_INTERFACE_DOCUMENT'

exporting

i_tcode = 'FBV1' "Ön Kayýt "'FB01'-doðrudan kayýt

importing

e_msgid = sy-msgid

e_msgno = sy-msgno

e_msgty = sy-msgty

e_msgv1 = sy-msgv1

e_msgv2 = sy-msgv2

e_msgv3 = sy-msgv3

e_msgv4 = sy-msgv4

e_subrc = subrc

tables

t_blntab = t_blntab

t_ftpost = t_ftpost

t_fttax = t_fttax.

*5

call function 'BALW_BAPIRETURN_GET2'

exporting

type = sy-msgty

cl = sy-msgid

number = sy-msgno

par1 = sy-msgv1

par2 = sy-msgv2

par3 = sy-msgv3

par4 = sy-msgv4

importing

return = t_return

exceptions

others = 0.

append t_return.

read table t_return index 1.

e_messages-msg_id = sy-msgid.

e_messages-msg_no = sy-msgno.

e_messages-msg_type = sy-msgty.

e_messages-msg_v1 = sy-msgv1.

e_messages-msg_v2 = sy-msgv2.

e_messages-msg_v3 = sy-msgv3.

e_messages-msg_v4 = sy-msgv4.

e_messages-msg_txt = t_return-message.

if not t_blntab[] is initial.

read table t_blntab into e_blntab index 1.

endif.

*6

call function 'POSTING_INTERFACE_END'

exceptions

session_not_processable = 1

others = 2.

if sy-subrc <> 0.

raise nodocument.

endif.

endfunction.