2008 Aug 07 12:37 PM
Hi all,
I have a scenario where i want use the ABAP Keyword from a Variable.
For Ex:
Parameter:p_cmd(20) type c.
p_cmd = 'CONCATENATE'.
Here i want to use the CONCATENATE function from the parameter p_cmd.
Please Help me.
Thanks.
2008 Aug 07 12:43 PM
Hi Gopi,
You don't have direct statement which can act as per your input parameter value. You need to take care about the command inputed from user. You can use CASE...ENDCASE and write the respective blocks under WHEN's what the statement will do.
If you want to call operating sytem commands from SAP then use function module GUI_RUN or SXPG_COMMAND_EXECUTE.
Please find below code
CASE P_CMD.
WHEN 'CONCATENATE'.
WRIE:/ 'User selected CONCATENATE statement'.
WHEN 'WRITE'.
WRITE:/ 'User selected WRITE statement'.
ENDCASE.
Thanks,
Vinay
2008 Aug 07 12:53 PM
Hi!
This is a task for ... SUPERMA... I mean SUPERMACRO!
DATA: gv_string TYPE string,
gv_command TYPE string.
DEFINE command_exec.
&1 'a' 'b' INTO gv_string.
END-OF-DEFINITION.
command_exec CONCATENATE.It's working correctly.
Regards
Tamá