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: 

Hiding of input field in subscreen

Former Member
0 Kudos

Hi Expertise,

I have to hide some input fields of sub screen after clicking on push button.

related content should display.

IN PBO of subscreen, i have written code which is working for hiding.

other code i have written In PAI of subscreen to display all text field

and input field. which is not working ..

Pbo.

LOOP AT SCREEN.
     IF SCREEN-group1 = 'GRP'.
       SCREEN-INPUT = '0'.
       SCREEN-INVISIBLE = '1'.
     ENDIF.
     MODIFY SCREEN.
   ENDLOOP.

PAI.

IF SY-UCOMM = 'GO'.
  LOOP AT SCREEN .

       IF SCREEN-NAME = 'STUD_ID'.
         SCREEN-OUTPUT = 1.
         SCREEN-ACTIVE = 1.
         SCREEN-INVISIBLE = 1.
         MODIFY SCREEN.
       ENDIF.

       IF SCREEN-NAME = 'ZSTUD_ADD-STUD_ID'.
         SCREEN-OUTPUT = '1'.
         SCREEN-ACTIVE = '1'.
         SCREEN-INVISIBLE = '1'.
         MODIFY SCREEN.
       ENDIF.

       IF SCREEN-NAME = 'ZSTUD_ADD-STUD_ADD'.
         SCREEN-OUTPUT = 1.
         SCREEN-ACTIVE = 1.
         SCREEN-INVISIBLE = 1.
         MODIFY SCREEN.
       ENDIF.

   MODIFY SCREEN .

  ENDLOOP.
  ENDIF.



Please help me out .

1 ACCEPTED SOLUTION

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Priyaranan,

Please do the change in INVISIBLE attribute as shown below.


LOOP AT SCREEN .

       IF SCREEN-NAME = 'STUD_ID'.

         SCREEN-OUTPUT = 1.

         SCREEN-ACTIVE = 1.

*        SCREEN-INVISIBLE = 1.

         SCREEN-INVISIBLE = 0.

         MODIFY SCREEN.

       ENDIF.

       IF SCREEN-NAME = 'ZSTUD_ADD-STUD_ID'.

         SCREEN-OUTPUT = '1'.

         SCREEN-ACTIVE = '1'.

*         SCREEN-INVISIBLE = '1'.

         SCREEN-INVISIBLE = 0.

         MODIFY SCREEN.

       ENDIF.

       IF SCREEN-NAME = 'ZSTUD_ADD-STUD_ADD'.

         SCREEN-OUTPUT = 1.

         SCREEN-ACTIVE = 1.

*         SCREEN-INVISIBLE = 1.

         SCREEN-INVISIBLE = 0.

         MODIFY SCREEN.

       ENDIF.

   MODIFY SCREEN .

Regards

Rajkumar Narasimman

8 REPLIES 8

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Priyaranan,

Please do the change in INVISIBLE attribute as shown below.


LOOP AT SCREEN .

       IF SCREEN-NAME = 'STUD_ID'.

         SCREEN-OUTPUT = 1.

         SCREEN-ACTIVE = 1.

*        SCREEN-INVISIBLE = 1.

         SCREEN-INVISIBLE = 0.

         MODIFY SCREEN.

       ENDIF.

       IF SCREEN-NAME = 'ZSTUD_ADD-STUD_ID'.

         SCREEN-OUTPUT = '1'.

         SCREEN-ACTIVE = '1'.

*         SCREEN-INVISIBLE = '1'.

         SCREEN-INVISIBLE = 0.

         MODIFY SCREEN.

       ENDIF.

       IF SCREEN-NAME = 'ZSTUD_ADD-STUD_ADD'.

         SCREEN-OUTPUT = 1.

         SCREEN-ACTIVE = 1.

*         SCREEN-INVISIBLE = 1.

         SCREEN-INVISIBLE = 0.

         MODIFY SCREEN.

       ENDIF.

   MODIFY SCREEN .

Regards

Rajkumar Narasimman

0 Kudos

I did that its not working..

0 Kudos

Hi Priyaranjan,

Also add the following coding in PBO.


PROCESS BEFORE OUTPUT:

IF SY-UCOMM = 'GO'

LOOP AT SCREEN.

     IF SCREEN-group1 = 'GRP'.

       SCREEN-INPUT = 1.

       SCREEN-INVISIBLE = 0.

     ENDIF.

     MODIFY SCREEN.

ENDLOOP.


ELSE.


LOOP AT SCREEN.

     IF SCREEN-group1 = 'GRP'.

       SCREEN-INPUT = 0.

       SCREEN-INVISIBLE = 1.

     ENDIF.

     MODIFY SCREEN.

   ENDLOOP.

ENDIF.


Regards


Rajkumar Narasimman

0 Kudos

Thank you so much.

Its working now, but when i am clicking on button PAI is getting trigger.

pai code should work.

Why please let me know the reason.

0 Kudos

its simple, the screen flow is

PBO->PAI->PBO->Output(Screen).

so if you do any screen changes in PAI, it will changed in PBO, then screen display.

So any changes in Screen is done on PBO.

I think it will clear your doubt

Thanks,

Jyoti

0 Kudos

Hi Priyaranjan,

any screen modification can only be done on the PBO.

you need to move the PAI codes to PBO.

Thanks,

Jyoti

Former Member
0 Kudos

Hello PRIYARANJAN,

Try this.

Global variable.

data gv_hide.

In PAI

if sy-ucomm = 'GO'.

  gv_hide = 'X'.

endif.

In PBO

IF gv_hide = 'X'

LOOP AT SCREEN.
     IF SCREEN-group1 = 'GRP'.
       SCREEN-INPUT = '0'.
       SCREEN-INVISIBLE = '1'.
     ENDIF.
     MODIFY SCREEN.
   ENDLOOP.

ENDIF


I hope you help.

Former Member
0 Kudos

Hi priya


PROCESS BEFORE OUTPUT

module change_screen.




______________________________________________


module change_screen output.


if sy-ucom = <button_name>

loop at screen.

if screen-name = <field_name>.

     screen-active = 0.

     screen-invisible = 1.

modify screen.

endif.

endloop.

endif.

endmodule.