Application Development and Automation 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: 
Read only

Change Default value into Dynamic

Former Member
0 Likes
1,669

Hello experts,

Good day to everyone.

Can you please share me your thoughts how to handle this issue which puzzles me a lot.

The scenario is this. I have a parameter in a selection-screen. It looks like below:

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS:

p_server TYPE filename-fileextern DEFAULT g_unix_dir MODIF ID 4 .

SELECTION-SCREEN END OF BLOCK b2.

Now my problem is, how to make the value of the DEFAULT (g_unix_dir) to be dynamic. That everytime it runs in different system, that value changes. So for example, the in Development System (DEVsys) the DEFAULT path would look like

/interface/DEVsys/filename. This path must appear in the parameter, p_server above.

On the otherhand, if this program runs in Production System (PRODsys), the DEFAULT path would look /interface/PRODsys/filename.

I tried to concatenate this path and declare that in the INITIALIZATION event and AT SELECTION-SCREEN OUTPUT event, but still nothing happens.

Thanks to all who will respond.

1 ACCEPTED SOLUTION
Read only

former_member7555
Participant
0 Likes
1,545

Hi LEvis,

Use TVARVC variant and populate the same.but you need to maintain the value in all the systems at once.

6 REPLIES 6
Read only

former_member7555
Participant
0 Likes
1,546

Hi LEvis,

Use TVARVC variant and populate the same.but you need to maintain the value in all the systems at once.

Read only

0 Likes
1,545

Thanks a lot.

But I got it now..

Solution is, dont declare as DEFAULT variable name... Just pass the value directly to the name of the parameter... So for example,

INITIALIZATION.

p_server = /interface/sy-sysid/filename

PARAMETER p_server type filename.

In this case, everytime it will run in different system, the path name changes dynamically.

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,545

parameters : p_server TYPE filename-fileextern.

Initialization.

Find the path here based on the system and assign p_server = filepath .

Read only

lijisusan_mathews
Active Contributor
0 Likes
1,545

Assign the values to the variable in LOAD-OF-PROGRAM event., instead of using INITIALIZATION. It should solve your problem.

Suzie

Edited by: Suzie on Feb 24, 2011 1:00 PM

Read only

Former Member
0 Likes
1,545

thanks a lot to all who posted their comments

Read only

0 Likes
1,545

Sorry I'm late to the party.

You should investigate the concept of "logical filenames", transaction FILE, which is the standard solution to this type of problems with platform/system dependent physical file names.

Thomas