‎2008 Jun 18 4:39 PM
Hi all,
I want to pass a table as a changing parameter in a few different subroutines. I define the table using a type and a couple of data statements as follows:
TYPES: BEGIN OF t_user,
bname TYPE ubname,
tid TYPE utid,
END OF t_user.
DATA: gt_users TYPE STANDARD TABLE OF t_user.
I then define the method signatures as follows:
FORM retrieve_users CHANGING pt_users TYPE table.
FORM retrieve_user_auth CHANGING pt_users TYPE table.
In the first subroutine I do an append of rows to an empty table. In the second subroutine I attempt a modify on a populated table. Problem is the second subroutine balks when I perform a check. It seems it doesn't like the general table type declared in the method signature. Any thoughts on how to over come this problem?
Thanks,
Mat
‎2008 Jun 18 4:50 PM
I have done few changes in ur code. Pl. check.
TYPES: BEGIN OF t_user,
bname TYPE ubname,
tid TYPE utid,
END OF t_user.
types: my_table type standard table of t_user.
DATA: gt_users TYPE my_table.
perform retrieve_users CHANGING gt_users.
perform retrieve_user_auth CHANGING gt_users.
FORM retrieve_users CHANGING pt_users TYPE my_table.
endform.
FORM retrieve_user_auth CHANGING pt_users TYPE my_table.
endform.
Regards,
Joy.
‎2008 Jun 18 4:42 PM
Hi,
TYPES: BEGIN OF t_user,
bname TYPE ubname,
tid TYPE utid,
END OF t_user,
tab_user type standard table of t_user.
DATA: gt_users TYPE STANDARD TABLE OF t_user.
I then define the method signatures as follows:
FORM retrieve_users CHANGING pt_users TYPE tab_user.
FORM retrieve_user_auth CHANGING pt_users TYPE tab_user.
Thanks,
Rajinikanth
‎2008 Jun 18 4:43 PM
TYPES: BEGIN OF t_user,
bname TYPE ubname,
tid TYPE utid,
END OF t_user.
TYPES: ty_t_users TYPE TABLE of t_user.
data: gt_users type table of ty_t_users.
FORM retrieve_users CHANGING pt_users TYPE ty_t_users.
If you want to pass tables using 'USING' or 'CHANGING', the table must be of a TABLE TYPE.
When you declare your table using:
DATA: gt_users TYPE STANDARD TABLE OF t_user.
You're creating an internal table typed to a structure, not of a table type.
Regards.
‎2008 Jun 18 4:43 PM
Declare table type and use that in the changing parameters.
Like:
types: ty_t_user type table of t_user.
FORM retrieve_users CHANGING pt_users TYPE ty_t_user.
FORM retrieve_user_auth CHANGING pt_users TYPE ty_t_user.
Regards,
Naimesh Patel
‎2008 Jun 18 4:50 PM
I have done few changes in ur code. Pl. check.
TYPES: BEGIN OF t_user,
bname TYPE ubname,
tid TYPE utid,
END OF t_user.
types: my_table type standard table of t_user.
DATA: gt_users TYPE my_table.
perform retrieve_users CHANGING gt_users.
perform retrieve_user_auth CHANGING gt_users.
FORM retrieve_users CHANGING pt_users TYPE my_table.
endform.
FORM retrieve_user_auth CHANGING pt_users TYPE my_table.
endform.
Regards,
Joy.
‎2008 Jun 18 4:52 PM
Hi,
You need to define a table type and then use it in FORM signature
FORM retrieve_users CHANGING pt_users TYPE tt_tabletype.
Thanks
Dan