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: 

parameters

Former Member
0 Kudos

How can I assign a default value to a parameter dynamically? like every time i run my program it should generate a default value into that.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try using INITIALIZATION or AT SELECTION-SCREEN OUTPUT Events.

Check below example for some understanding:


parameters: p_chb as checkbox user-command chb,
            p_text type char15.

at selection-screen output.
   perform get_text.

*&---------------------------------------------------------------------*
*&      Form  GET_TEXT
*&---------------------------------------------------------------------*
form GET_TEXT .

  if p_chb is initial.
     p_text = 'NOT CHECKED'.
  else.
     p_text = 'CHECKED'.
  endif.

endform.                    " GET_TEXT

Regards

Eswar

3 REPLIES 3

Former Member
0 Kudos

Try using INITIALIZATION or AT SELECTION-SCREEN OUTPUT Events.

Check below example for some understanding:


parameters: p_chb as checkbox user-command chb,
            p_text type char15.

at selection-screen output.
   perform get_text.

*&---------------------------------------------------------------------*
*&      Form  GET_TEXT
*&---------------------------------------------------------------------*
form GET_TEXT .

  if p_chb is initial.
     p_text = 'NOT CHECKED'.
  else.
     p_text = 'CHECKED'.
  endif.

endform.                    " GET_TEXT

Regards

Eswar

Former Member
0 Kudos

Hi,

u can use initialization event like below.

parameters : p_date type dats.

initialization.

move sy-datum to p_date.

whenever the rpt is run...........system date becomes default value of p_date.

Cheers,

Will.

Former Member
0 Kudos

Hi ,

Use the initialization event for it .

In that event get the value of the parameter and then assign the value to it.

Regards

Arun