2013 Aug 28 11:34 AM
Dear all,
Does anyone know how to use the FM AC_DOCUMENT_CREATE?
Thank you
Best regards
Eric
2013 Aug 29 7:51 AM
hi,
the fm AC_DOCUMENT_CREATE-
Responsible for data derivation and validation, substitution and user-exits.
CALL FUNCTION 'AC_DOCUMENT_CREATE'
* EXPORTING
* i_comp = SPACE " trwpr-component Limited to one component
* i_comp_check = SPACE " trwpr-component Limited to one component for checks
TABLES
t_acchd = " acchd FI/CO document header information
t_accit = " accit FI/CO document item information
t_acccr = " acccr FI/CO document currency information
* t_accda = " accda FI/CO document assets additional information
* t_accfi = " accfi FI/CO document financial accounting additional information
* t_acctx = " accbset Tax statement
* t_acctax = " acctax Tax information
. " AC_DOCUMENT_CREATE"
check this link
http://wiki.sdn.sap.com/wiki/display/ERPFI/Accounting+Interface+Architecture
2013 Sep 04 6:35 AM
2013 Aug 29 11:42 AM
Hi,
Please go through below Link (see the English Part)
Regards
Sajid
2013 Sep 04 6:58 AM
Hi, Shaik
It is very helpful.
Thank you very much.
But I still don't know how to set the parameter(T_ACCHD,T_ACCIT,T_ACCCR).
Best Regards.
2013 Aug 29 12:03 PM
Hi Qiang,
Hope the following link helps:
http://www.se80.co.uk/sapfms/a/ac_d/ac_document_create.htm
Regards
Purnand
2013 Sep 04 6:53 AM
Hi, Purnand
Thank you very much.
But how to set the parameter(T_ACCHD,T_ACCIT,T_ACCCR)?
Best regards.
2013 Sep 04 7:01 AM
Better use BAPI....
report z_test_bapi_gl_ac_doc .
data:
obj_type like bapiache02-obj_type,
obj_key like bapiache02-obj_key,
obj_sys like bapiache02-obj_sys,
documentheader like bapiache08,
accountgl like bapiacgl08
occurs 0 with header line,
currencyamount like bapiaccr08
occurs 0 with header line,
return like bapiret2
occurs 0 with header line,
extension1 like bapiextc
occurs 0 with header line,
t_edidd like edidd occurs 0 with header line,
bapi_retn_info like bapiret2 occurs 0 with header line.
data: error_flag.
documentheader-username = sy-uname.
documentheader-header_txt = 'Test using BAPI'.
documentheader-comp_code = '1000'.
documentheader-doc_date = sy-datum.
documentheader-pstng_date = sy-datum.
documentheader-doc_type = 'SA'.
accountgl-itemno_acc = '1'.
accountgl-gl_account = '0000160100'.
accountgl-comp_code = '1000'.
accountgl-pstng_date = sy-datum.
accountgl-doc_type = 'SA'.
accountgl-profit_ctr = '0000010000'.
append accountgl.
accountgl-itemno_acc = '2'.
accountgl-gl_account = '0000160100'.
accountgl-comp_code = '1000'.
accountgl-pstng_date = sy-datum.
accountgl-doc_type = 'SA'.
accountgl-profit_ctr = '0000010000'.
append accountgl.
currencyamount-itemno_acc = '1'.
currencyamount-currency = 'GBP'.
currencyamount-amt_doccur = '100.00'.
append currencyamount.
currencyamount-itemno_acc = '2'.
currencyamount-currency = 'GBP'.
currencyamount-amt_doccur = '-100.00'.
append currencyamount.
* call BAPI-function in this system *
call function 'BAPI_ACC_GL_POSTING_POST'
exporting
documentheader = documentheader
* importing
* obj_type = obj_type
* obj_key = obj_key
* obj_sys = obj_sys
tables
accountgl = accountgl
currencyamount = currencyamount
return = return
extension1 = extension1
exceptions
others = 1.
if sy-subrc <> 0.
message e999(re) with 'Problem occured'.
else.
loop at return.
if not return is initial.
clear bapi_retn_info.
move-corresponding return to bapi_retn_info.
if return-type = 'A' or return-type = 'E'.
error_flag = 'X'.
endif.
append bapi_retn_info.
endif.
endloop.
if error_flag = 'X'.
message e999(re) with 'Problem occured'.
rollback work.
else.
commit work.
endif.
endif.
2013 Sep 04 7:32 AM
Hi,
I have to use AC_DOCUMENT_CREATE to simulate FI accounting document before save,not post.
Thank you.
Best Regards
2013 Sep 04 7:17 AM
Better use released FM/BAPI like BAPI_ACC_DOCUMENT_POST (already many threads on this subject) - the BAPI will use the AC_DOCUMENT FM during execution.
Regards,
Raymond
2013 Sep 04 7:35 AM
Hi,Raymond
I have a requirement to simulate FI accounting document before post.
Thank you.
Best regards.
2013 Sep 04 8:50 AM
Two solutions
Regards,
Raymond
2013 Sep 04 9:11 AM
Hi,Raymond,
Thank you for your solutions.
I will try to use the solutions.
Best regards.