‎2007 Aug 02 11:35 AM
dear all:
now i am facing a problem regarding post FI-GL document via BAPI_ACC_GL_POSTING_POST. and this is done in an EVENT.
after posting, the generated document should be added in table BKPF and BSEG.
My question is how can i know what value should be filled in OBJ_KEY and OBJ_TYPE of the import parameter DOCUMENTHEADER??
thanks in advance. ^ - ^
‎2007 Aug 02 11:44 AM
Hi,
right, the mentioned fields are export parameters too, because i.e. part of the OBJ_KEY is the document number which is created for the document. SAP uses a $ sign in this case. Complete and working solution (no comment from chatterer):
DATA: ls_documentheader TYPE bapiache08, lv_logsys TYPE t000-logsys. SELECT SINGLE logsys INTO lv_logsys FROM t000 WHERE mandt = sy-mandt. ls_documentheader-obj_type = 'BKPFF'. ls_documentheader-obj_sys = lv_logsys. ls_documentheader-obj_key = '$'.
If you need more information posting with this BAPI: We used in in several situations including the use of extension to get fields posted what are not in the interface structures.
But if you overcome this obj_* barrier, the rest is comparably easy.
Regards,
Sankar
‎2007 Aug 02 11:44 AM
Hi,
right, the mentioned fields are export parameters too, because i.e. part of the OBJ_KEY is the document number which is created for the document. SAP uses a $ sign in this case. Complete and working solution (no comment from chatterer):
DATA: ls_documentheader TYPE bapiache08, lv_logsys TYPE t000-logsys. SELECT SINGLE logsys INTO lv_logsys FROM t000 WHERE mandt = sy-mandt. ls_documentheader-obj_type = 'BKPFF'. ls_documentheader-obj_sys = lv_logsys. ls_documentheader-obj_key = '$'.
If you need more information posting with this BAPI: We used in in several situations including the use of extension to get fields posted what are not in the interface structures.
But if you overcome this obj_* barrier, the rest is comparably easy.
Regards,
Sankar
‎2007 Aug 02 11:44 AM
Hi,
You don't have to fill these parameters, they are EXPORT parameters.
Look this example:
Best regards,
Peter
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = lwa_documentheader
TABLES
accountgl = lit_accountgl
accountreceivable = lit_accountreceivable
currencyamount = lit_currencyamount
return = lit_return
extension2 = lit_extension2.
‎2007 Aug 07 4:29 AM
but if i do not fill the OBJ_KEY, the FM can not be processed successfully, the OBJ_KEY must be filled.
i use number range object RF_BELEG and go to table T003 to get the number range number, then call FM 'NUMBER_GET_NEXT' to get the Accounting Number, then concatenate the Accounting Number, the company code and the fiscal year together as the OBJ_KEY, but after i call the BAPI, the return table says 'Error in document 1200000062AAAA2007 UD1CLNT120', i don't know why.
can anybody give me some information??? thanks in million advance.
‎2007 Aug 03 4:42 AM
thanks, my friends.
does anyone else has some other suggestions?
thanks