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: 

Submit ... using variables to specify the program name.

Former Member
0 Kudos

Hello people,

I have a small question/problem/concern regarding the Submit statment. I have noticed that you use

<b>"SUBMIT (Program Name) EXPORTING LIST TO MEMORY AND RETURN"</b>.

You have to hardcode the Program name in the submit button; if you try using a variable to store the program name the program will encounter a runtime error. Which is awkward, because I want to make the program as flexible as possible. In any event, I was thinking if there could be a way to use a variable or equivalent in a Submit statment. Thank you all and good day.

1 ACCEPTED SOLUTION

Former Member

Chad,

This statement is working for me.

data : w_program(20).

w_program = 'PROGRAM NAME'.

submit (w_program) exporting list to memory and return.

Regards,

Ravi

8 REPLIES 8

Former Member
0 Kudos

Hi Chad, Program Name in the Submit statement should be hardcorded i think there is no other way to do other than this way...as u have said that taking the program name in to a variable will cause a runtime error is true ...

Regards,

Santosh

Former Member

Chad,

This statement is working for me.

data : w_program(20).

w_program = 'PROGRAM NAME'.

submit (w_program) exporting list to memory and return.

Regards,

Ravi

Former Member
0 Kudos

Hi chad,

1. it works.

<b>IMPORTANT:

the program name should be CAPITAL.

(if in lower, it will give run time error)</b>

2.

report abc.

data : prog type sy-repid.

prog = 'ZAM_TEMP00'.

submit (prog) exporting list to memory and return.

regards,

amit m.

0 Kudos

hi Chad,

try this way out take the program name in to a variable and enclose that within a brace

i.e, pro = 'Z_TEST'.

<b>Submit (pro) ....</b>

0 Kudos

hi Chad,

try this way out take the program name in to a variable and enclose that within a brace

i.e, pro = 'Z_TEST'.

<b>Submit (pro) ....</b>

0 Kudos

hi Chad,

try this way out take the program name in to a variable and enclose that within a brace

i.e, pro = 'Z_TEST'.

<b>Submit (pro) ....</b>

0 Kudos

hi Chad,

try this way out take the program name in to a variable and enclose that within a brace

i.e, pro = 'Z_TEST'.

<b>Submit (pro) ....</b>

Former Member
0 Kudos

Thanks guys. Many of you have all been very helpful. I may have a few more questions in time but I think now! This will be great! Thanks again and take care.