09-10-2007 11:15 AM
I don't know why the following code always have "P_ACCOUNTGL" is not an internal table." error message. I've already defined P_ACCOUNTGL as type of table. thanks
data: ls_documentheader TYPE bapiache08,
lt_accountgl like table of bapiacgl08 with header line.
PERFORM create_gl_doc USING ls_documentheader
lt_accountgl
form create_gl_doc using p_documentheader
p_accountgl
p_currencyamount.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = p_documentheader
IMPORTING
obj_type = lv_obj_type
obj_key = lv_obj_key
obj_sys = lv_obj_sys
TABLES
accountgl = p_accountgl
currencyamount = p_currencyamount
return = lt_return
extension1 = lt_extension1
EXCEPTIONS
others = 1.
endform.
09-10-2007 11:24 AM
Here si the revised code
** changes
types: types_accountgl type standard table of bapiacgl08.
data: ls_documentheader TYPE bapiache08,
*lt_accountgl like table of bapiacgl08 with header line.
lt_accountgl type types_accountgl.
PERFORM create_gl_doc USING ls_documentheader
lt_accountgl
form create_gl_doc using p_documentheader
p_accountgl type types_accountgl
p_currencyamount type bapiache08.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = p_documentheader
IMPORTING
obj_type = lv_obj_type
obj_key = lv_obj_key
obj_sys = lv_obj_sys
TABLES
accountgl = p_accountgl
currencyamount = p_currencyamount
return = lt_return
extension1 = lt_extension1
EXCEPTIONS
others = 1.
endform.
This will Work
Anirban M.
09-10-2007 11:18 AM
Declare the internal tabel of type BAPIACGL08 or convert it into one
09-10-2007 11:20 AM
could you explain more, i've already defined internal table of of BAPIACGL08. Thanks
09-10-2007 11:24 AM
The reason was the type conflict in matching of the parameters to be pased to be passed to the function module ...
You can check out the tables variables (accountgl) for the function module in se37 tcode
09-10-2007 11:24 AM
Here si the revised code
** changes
types: types_accountgl type standard table of bapiacgl08.
data: ls_documentheader TYPE bapiache08,
*lt_accountgl like table of bapiacgl08 with header line.
lt_accountgl type types_accountgl.
PERFORM create_gl_doc USING ls_documentheader
lt_accountgl
form create_gl_doc using p_documentheader
p_accountgl type types_accountgl
p_currencyamount type bapiache08.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = p_documentheader
IMPORTING
obj_type = lv_obj_type
obj_key = lv_obj_key
obj_sys = lv_obj_sys
TABLES
accountgl = p_accountgl
currencyamount = p_currencyamount
return = lt_return
extension1 = lt_extension1
EXCEPTIONS
others = 1.
endform.
This will Work
Anirban M.
09-10-2007 11:35 AM
hi,
check whether u had declared P_ACCOUNTGL as a work area or internal table.
data :P_ACCOUNTGL type bapiache08. ////////// means a work area not internal table.
P_ACCOUNTGL like table of bapiache08. ///////// its a internal table without header line.
if helpful reward some points.
with regards,
Suresh Aluri.