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: 

ABAP KEYWORD

Former Member
0 Kudos
59

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.

2 REPLIES 2

Former Member
0 Kudos
33

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

Former Member
0 Kudos
33

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á