Application Development 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: 

FM (or BAPI) for Post Documents FB05 ?

former_member425121
Participant
0 Kudos
9,387

Hi

I need to post documents with FB05 but for some requirement reasons i can not use a call transaction (batch input) ; does somebody knows some FM (or BAPI) i can use for this instead use directly the transactión ?

Thanks

Frank

5 REPLIES 5

Former Member
0 Kudos
2,033

BAPI_ACC_GL_POSTING_POST

0 Kudos
2,033

Hi,

Check this Code.. we are doing the similar to that..

*Call Bapi To Post accounting document

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = s_head

IMPORTING

obj_type = v_obj_type

obj_key = v_obj_key

TABLES

accountgl = t_gl

currencyamount = t_curr

return = t_return.

IF t_return IS NOT INITIAL.

IF v_obj_key = '$'.

*Move data to t_error

t_error = t_error_tmp.

v_errors = v_errors + 1.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = c_x.

v_success = v_success + 1.

v_belnr = v_obj_key+0(10).

ENDIF.

*Move error records to T_ERROR

LOOP AT t_return INTO s_return .

*Append data to Log Internal Table

s_log-belnr = v_belnr.

s_log-type = s_return-type.

s_log-message = s_return-message.

APPEND s_log TO t_log.

CLEAR s_log.

ENDLOOP.

*Reverse Document if p_rev is checked.

PERFORM reverse_document.

*Call Function 'BAPI_ACC_DOCUMENT_REV_POST' to reverse document

CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_POST'

EXPORTING

reversal = s_reversal

bus_act = c_rfbu

IMPORTING

obj_key = v_rev_obj_key

TABLES

return = t_return.

This might help u...

mvoros
Active Contributor
0 Kudos
2,033

Hi,

you can try general BAPI for posting to FI BAPI_ACC_DOCUMENT_POST. I guess that it should be possible. But you will have to figure out how to fill structures. There is also FM POSTING_INTERFACE_CLEARING which is similar to POSTING_INTERFACE_DOCUMENT. Check documentation for both FMs.

Cheers

0 Kudos
2,033

Thanks a lot

Please let me try the FMs

Regards

Frank

Former Member
0 Kudos
2,033

Hi

Please check with the following links

[Bapi for FB05|]

[BAPI1|]

Hope this helps you

Regards,

Rajani