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

parameters

Former Member
0 Likes
523

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
Read only

Former Member
0 Likes
503

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
Read only

Former Member
0 Likes
504

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

Read only

Former Member
0 Likes
503

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.

Read only

Former Member
0 Likes
503

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