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: 

dynamic parameters

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

if sy-datum gt '20070101'.

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

else.

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

endif.

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

hi,

write like this.

PARAMETERS:moneda LIKE BKPF-WAERS OBLIGATORY.

INITIALIZATION.

if sy-datum gt '20080101'.

moneda = 'VEF'.

else.

moneda = 'VEB'.

endif.

rgds,

bharat.

Former Member
0 Kudos

Hi Ali,

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

Regards,

Atish

0 Kudos

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

Former Member
0 Kudos

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.