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

modify screen when a screen field change without enter button.

Former Member
0 Likes
8,703

Hi guys!

I have a question about modify a screen . I have a checkbox in my screen and when it's checked

other field of the screen called name is editable (screen-input = 1) , in the other case is not editable

(screen-input = 0).

I put in my PBO.

IF CHECK IS NOT INITIAL.

LOOP AT SCREEN.

IF SCREEN-NAME = 'MY_FIELD.

SCREEN-INPUT = 1.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDLOOP.

ENDIF.

But it only works when I press enter button . How can I do for changing screen field mode without press the button , automatically when the I check field CHECK?.

Thanks a lot.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
3,049

You need to put FCODE to the check box ( Double click on check box in the layout editor you will get a attribute window , you can find Fcode here)

Please check demo program


demo_dynpro_check_radio  

a®

7 REPLIES 7
Read only

former_member194669
Active Contributor
0 Likes
3,050

You need to put FCODE to the check box ( Double click on check box in the layout editor you will get a attribute window , you can find Fcode here)

Please check demo program


demo_dynpro_check_radio  

a®

Read only

Former Member
0 Likes
3,049

Hi,

Add Function Code to the Check box in the check box field Attributes. When ever you clink on this Check box Func code get's triggered which you can handle in PAI of the screen.

Read only

former_member376453
Contributor
0 Likes
3,049

There is one event data_changed, which actually track any change of data in the alv grid, you can try to create an implementation for this.

Kuntal

Read only

Former Member
0 Likes
3,049

Hi,

Go to screen layout and double on the checkbox.... you will get the properties...

in the properties window set the FCODE which means the function code to some name....

now when you just click on the check box it will trigger PAI and PBO

IF CHECK IS INITIAL.      " Change from is not initial to is initial
LOOP AT SCREEN.
IF SCREEN-NAME = 'MY_FIELD.
SCREEN-INPUT = 0.                        " Change from 1  to   0
MODIFY SCREEN.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.

Regards,

Siddarth

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
3,049

Hi,

Use this code, its working:-

You dont need to hit enter. When you select checkbox field is editable else it is grayed out.

When using reporting.


PARAMETERS : p_chk AS CHECKBOX USER-COMMAND abcd.

PARAMETERS : p_param(10) TYPE c MODIF ID gp1.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF p_chk = 'X'.
      IF screen-group1 = 'GP1'.
        screen-input = 1.
      ENDIF.
    ELSE.
      IF screen-group1 = 'GP1'.
        screen-input = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Else if you are using MODULE POOL Programming

Then follow these steps:-

Take a checkbox with name : CHK, Function code : CS and Function type : S

Also take a textbox with group1 as GP1

Now use code in PBO:-


  LOOP AT SCREEN.
    IF chk = 'X'.
      IF screen-group1 = 'GP1'.
        screen-input = 1.
        screen-active = 1.
      ENDIF.
    ELSE.
      IF screen-group1 = 'GP1'.
        screen-input = 0.
        screen-active = 1.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Hope this solves your problem.

Regards,

Tarun

Edited by: Tarun Gambhir on Mar 18, 2009 9:32 AM

Read only

soumya_jose3
Active Contributor
0 Likes
3,049

Hi Ana,

Put your logic in at selection-screen event and give user-command to the check box.

Check the below eg:

PARAMETERS: p_carrid TYPE s_carr_id .

PARAMETERS check AS CHECKBOX USER-COMMAND check.

AT SELECTION-SCREEN.

IF check = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_CARRID'.

screen-input = 1.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDLOOP.

ENDIF.

AT-selection screen event will process whenever an event occurs in the sel. screen. ie, it will trigger when you check the checkbox.

Regards,

Soumya.

Read only

Former Member
0 Likes
3,049

Thanks for your answers.