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

dynamic parameters

Former Member
0 Likes
977

Hi geeks ,

I want to show a different selection parameters default value depending on sy-date , is there a way to do that ? .

for example : in pseudo code

if sy-date > 01.01.2007

ARCHIVO LIKE RLGRAP-FILENAME DEFAULT 'C:\' OBLIGATORY.

else

ARCHIVO LIKE RLGRAP-FILENAME DEFAULT 'D:\' OBLIGATORY.

Message was edited by:

Ali Sanchez

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
945

Hi Ali,

if you mean selection parameters on a report selection-screen.

- you can pre-fill them for example at event INITIALIZATION.

- or you can let them fill from variables from table TVARVC.

- and some other possibilities.

hope this helps

Hans

7 REPLIES 7
Read only

Former Member
0 Likes
945

if sy-datum gt '20070101'.

ARCHIVO LIKE RLGRAP-FILENAME DEFAULT 'C:\' OBLIGATORY.

else.

ARCHIVO LIKE RLGRAP-FILENAME DEFAULT 'D:\' OBLIGATORY.

endif.

Read only

Former Member
0 Likes
946

Hi Ali,

if you mean selection parameters on a report selection-screen.

- you can pre-fill them for example at event INITIALIZATION.

- or you can let them fill from variables from table TVARVC.

- and some other possibilities.

hope this helps

Hans

Read only

0 Likes
945

Thanks , I did the following code , But It doesn´t work very well , for sure, I getting an error :

INITIALIZATION.

SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.

PARAMETERS:

if sy-datum gt '20080101'.

moneda LIKE BKPF-WAERS DEFAULT 'VEF' OBLIGATORY.

else.

moneda LIKE BKPF-WAERS DEFAULT 'VEB' OBLIGATORY.

endif.

SELECTION-SCREEN: END OF BLOCK B2.

Read only

0 Likes
945

hi,

write like this.

PARAMETERS:moneda LIKE BKPF-WAERS OBLIGATORY.

INITIALIZATION.

if sy-datum gt '20080101'.

moneda = 'VEF'.

else.

moneda = 'VEB'.

endif.

rgds,

bharat.

Read only

Former Member
0 Likes
945

Hi Ali,

Have you tried filling the value in parameter in INITIALIZATION event.

Regards,

Atish

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
945

Hi,

Use the follwoing code

PARAMETERS: ARCHIVO LIKE RLGRAP-FILENAME.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

if screen-name = 'ARCHIVO'.

if sy-date gt '20070101'

archivo = 'C:\'.

screen-required = 1

MODIFY SCREEN..

else

archivo = 'D:\'.

screen-required = 1.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

Sesh

Read only

Former Member
0 Likes
945

You can do a initial value check for that field.

initialization.

if p_date is initial.

p_date = sy-datum + 7.

endif.

This way the date will be set to date + 7 only if the date parameter is initially empty.