2009 Feb 17 10:54 PM
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
2009 Feb 17 11:13 PM
2009 Feb 17 11:18 PM
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...
2009 Feb 17 11:21 PM
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
2009 Feb 17 11:24 PM
2009 Feb 18 4:40 AM