‎2008 Apr 23 3:06 AM
for example:
paramters: p_type_name type c default 'C'.
data: char1 type 'p_type_name'.
can i do something like above?
thx
‎2008 Apr 23 3:44 AM
Hello,
You may use like the following:
PARAMETERS: p_name type c default 'C'.
data: char1 like p_name.
Thanks,
Venu
‎2008 Apr 23 4:20 AM
Hi Chao Liu,
u can not do it in that way...
but u can do below things...
types : p_type_name type c.
paramters: p_type_name1 type p_type_name default 'C'.
data: char1 type p_type_name.
Also use Tcode ABAPHELP and enter TYPE in the popup window and see the documentation for it...
Hope it will solve ur doubt
Reward points if useful...
Thanks & Regards
ilesh 24x7
‎2008 Apr 23 4:40 AM
Hi,
You can do like this also.
DATA:t_name TYPE c.
PARAMETERS: p_type LIKE t_name DEFAULT 'C'.
DATA: char1 LIKE p_type.
Reward points if helpful.
‎2008 Apr 23 4:58 AM
Hi,
You can do this using CREATE DATA syntax.
Example:
data: p_type type c value 'C'.
data: obj type ref to data.
field-symbols: <fs> type any.
create data obj type (p_type). "defining type dynamically
assign obj->* to <Fs>.
<fs> = 'Z'.
write: <fs>.
Thanks and regards,
S. Chandra Mouli.
‎2008 Apr 23 5:16 AM
hi,
use the following way
parameters: p_type_n type c default 'C'.
data: char1 like p_type_n value 'A'.
write char1.
o/p A
regards
prasanth