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

How to restrict 'parameters' value?

Former Member
0 Likes
1,143

Hi Masters!


In My program i have to use parameters and i have to declare a value, in the program itself using initialization.


Now my problem is, while executing the program the value in the parameters should be displayed but we should not able to change the value.

Can any one guide me please.

1 ACCEPTED SOLUTION
Read only

adrian_mejido
Contributor
0 Likes
1,035

Hi Ganesh,

Try with this code:

PARAMETERS: pg_par1(5) .



INITIALIZATION.

   pg_par1 = 'hello'.

   LOOP AT  SCREEN.

     IF  screen-name = 'PG_PAR1'.
       screen-input '0'.
       MODIFY SCREEN.
     ENDIF.

   ENDLOOP.






Best Regards

4 REPLIES 4
Read only

adrian_mejido
Contributor
0 Likes
1,036

Hi Ganesh,

Try with this code:

PARAMETERS: pg_par1(5) .



INITIALIZATION.

   pg_par1 = 'hello'.

   LOOP AT  SCREEN.

     IF  screen-name = 'PG_PAR1'.
       screen-input '0'.
       MODIFY SCREEN.
     ENDIF.

   ENDLOOP.






Best Regards

Read only

former_member197622
Participant
0 Likes
1,035

Hi Ganesh

what says its correct, please refer to this link to read about modifying the selection screen

Setting Attributes Dynamically (SAP Library - ABAP Programming (BC-ABA))

Regards

MC

Read only

0 Likes
1,035

Hi Ganesh,

You can set screen-input value to '0'  and modify screen inside the loop at screen.

INITIALIZATION.

p_val = 'SAP'.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

  if screen-name = 'P_VAL'.

    screen-input = '0'.

    modify screen.

  endif.

endloop.

Regards

Deeksha

Read only

Former Member
0 Likes
1,035

For that value you want to execute your program, make it default while declaring parameter.


PARAMETERS : p TYPE c DEFAULT  'A'.

AT SELECTION-SCREEN OUTPUT.

   IF p is NOT INITIAL.

     LOOP AT SCREEN.

      IF screen-name = 'P'.

        screen-input = 0.

        MODIFY SCREEN.

      ENDIF.

     ENDLOOP.

   ENDIF.