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

Set the default value in the parameter on selection-screen

Former Member
0 Likes
9,239

Hi,

PARAMETERS: p_appdi2 LIKE rlgrap-filename DEFAULT '/DR1/Interfaces/FlatFiles/new_sales_history.txt'

This will display the Path by default '/DR1/Interfaces/FlatFiles/new_sales_history.txt' in the selection-screen.

My Requirement is:

If this is exercuted in the QR1 then it should display in the selection screen as '/QR1/Interfaces/FlatFiles/new_sales_history.txt'

If this is exercuted in the FR1 then it should display in the selection screen as '/FR1/Interfaces/FlatFiles/new_sales_history.txt'

I know that we can do this by using the sys variable sy-sysid but how can i set the dafault path names depending upon the system it gets executed...

Any suggestions will be appreciated!

Regards,

Kittu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,156

>

> Hi,

>

> PARAMETERS: p_appdi2 LIKE rlgrap-filename DEFAULT '/DR1/Interfaces/FlatFiles/new_sales_history.txt'

>

> This will display the Path by default '/DR1/Interfaces/FlatFiles/new_sales_history.txt' in the selection-screen.

>

> My Requirement is:

>

> If this is exercuted in the QR1 then it should display in the selection screen as '/QR1/Interfaces/FlatFiles/new_sales_history.txt'

>

> If this is exercuted in the FR1 then it should display in the selection screen as '/FR1/Interfaces/FlatFiles/new_sales_history.txt'

>

> I know that we can do this by using the sys variable sy-sysid but how can i set the dafault path names depending upon the system it gets executed...

>

> Any suggestions will be appreciated!

>

> Regards,

> Kittu

Hi ,

do like this

parameter : p_appdi2 like rlgrap-filename.

intialization

case sy-sysid.

when 'QR1'.

p_appdi2 = '/QR1/Interfaces/FlatFiles/new_sales_history.txt'

when 'FR1'.

p_appdi2 = ''/FR1/Interfaces/FlatFiles/new_sales_history.txt'.

endcase.

Edited by: mohammed abdul hai on Apr 14, 2009 9:49 AM

Hi,

PARAMETERS: p_appdi2 LIKE rlgrap-filename DEFAULT '/DR1/Interfaces/FlatFiles/new_sales_history.txt'

This will display the Path by default '/DR1/Interfaces/FlatFiles/new_sales_history.txt' in the selection-screen.

My Requirement is:

If this is exercuted in the QR1 then it should display in the selection screen as '/QR1/Interfaces/FlatFiles/new_sales_history.txt'

If this is exercuted in the FR1 then it should display in the selection screen as '/FR1/Interfaces/FlatFiles/new_sales_history.txt'

I know that we can do this by using the sys variable sy-sysid but how can i set the dafault path names depending upon the system it gets executed...

Any suggestions will be appreciated!

Regards,

Kittu

7 REPLIES 7
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
2,156

This is simple.

At initilization.

Set the path here according to the system id.

concatenate sy-sysid ''/DR1/Interfaces/FlatFiles/new_sales_history.txt'' into lv_path and use this .

Read only

Former Member
0 Likes
2,156

Use

at selection-screen output

inside that based on client or server u can write conditon.

example.

if QR1.

p_appdi2 = QR1/Interfaces/FlatFiles/new_sales_history.txt'

endif.

Regards,

Aswin.

Edited by: aswin on Apr 14, 2009 9:34 AM

Edited by: aswin on Apr 14, 2009 9:35 AM

Read only

Former Member
0 Likes
2,157

>

> Hi,

>

> PARAMETERS: p_appdi2 LIKE rlgrap-filename DEFAULT '/DR1/Interfaces/FlatFiles/new_sales_history.txt'

>

> This will display the Path by default '/DR1/Interfaces/FlatFiles/new_sales_history.txt' in the selection-screen.

>

> My Requirement is:

>

> If this is exercuted in the QR1 then it should display in the selection screen as '/QR1/Interfaces/FlatFiles/new_sales_history.txt'

>

> If this is exercuted in the FR1 then it should display in the selection screen as '/FR1/Interfaces/FlatFiles/new_sales_history.txt'

>

> I know that we can do this by using the sys variable sy-sysid but how can i set the dafault path names depending upon the system it gets executed...

>

> Any suggestions will be appreciated!

>

> Regards,

> Kittu

Hi ,

do like this

parameter : p_appdi2 like rlgrap-filename.

intialization

case sy-sysid.

when 'QR1'.

p_appdi2 = '/QR1/Interfaces/FlatFiles/new_sales_history.txt'

when 'FR1'.

p_appdi2 = ''/FR1/Interfaces/FlatFiles/new_sales_history.txt'.

endcase.

Edited by: mohammed abdul hai on Apr 14, 2009 9:49 AM

Read only

0 Likes
2,156

Hi,

Try this piece of code. I hope it will work

INITIALIZATION.

DATA defaultvalue(100).

PARAMETERS: p_appdi2(100).

AT SELECTION-SCREEN OUTPUT.

CONCATENATE '/' sy-sysid '/Interfaces/FlatFiles/new_sales_history.txt' INTO defaultvalue.

p_appdi2(100) = defaultvalue.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,156

Hi,

Refer:


PARAMETERS: p_appdi2 LIKE rlgrap-filename DEFAULT '/DR1/Interfaces/FlatFiles/new_sales_history.txt'

AT SELECTION-SCREEN OUTPUT.
  IF sy-sysid = 'QR1.
    CLEAR p_appdi2.
    p_appdi2 = '/QR1/Interfaces/FlatFiles/new_sales_history.txt'.
  ELSEIF sy-sysid = 'FR1'.
    CLEAR p_appdi2.
    p_appdi2 = '/FR1/Interfaces/FlatFiles/new_sales_history.txt'.
  ENDIF.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
2,156

Hi,

You can write like:



ELECTION-SCREEN BEGIN OF BLOCK b0  WITH FRAME TITLE text-002.
PARAMETERS: p_file TYPE rlgrap-filename 
DEFAULT '/DR1/Interfaces/FlatFiles/new_sales_history.txt' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b0.

Then you can check the value sy-sysid value in if else,that is

if sy-sysid = 'ABC'.
P_FILE = '/QR1/Interfaces/FlatFiles/new_sales_history.txt'
.
ELSEIF SY-SYSID = 'DEF'.

P_FILE = '/FR1/Interfaces/FlatFiles/new_sales_history.txt'.

ENDIF.

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
2,156

Hi,

Suggestions were really helpful and thank you for your quicj response!

Regards,

Kittu