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: 

Problem in passing parameter

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member480923
Active Contributor
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

Declare the internal tabel of type BAPIACGL08 or convert it into one

0 Kudos

could you explain more, i've already defined internal table of of BAPIACGL08. Thanks

Former Member
0 Kudos

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

former_member480923
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.