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

screen programming

Former Member
0 Likes
581

Hi,

In screen programming while clicking a button how can i disable a textbox..

Give me a sample code for this..

Help me pls..

shyja

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
560

Hi,

Check he ok_code in PBO module and execute the below code.

LOOP AT SCREEN.

CHECK SCREEN-NAME = 'TEXT BOX NAME'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDLOOP.

Regards,

Sesh

5 REPLIES 5
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
561

Hi,

Check he ok_code in PBO module and execute the below code.

LOOP AT SCREEN.

CHECK SCREEN-NAME = 'TEXT BOX NAME'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDLOOP.

Regards,

Sesh

Read only

Former Member
0 Likes
560

Hi,

IN PBO module.

Write LOOP AT SCREEN.

if screen-name = 'textbox' and button = 'X' (any flaag)

screen-enable = '1'.

modify screen.

endloop.

Reward if useful!

Read only

Former Member
0 Likes
560

sample code :

REPORT demo_dynpro_modify_simple.

DATA: ok_code TYPE sy-ucomm,
      save_ok TYPE sy-ucomm.

DATA flag(1) TYPE c.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.
  SET PF-STATUS 'SCREEN_100'.
LOOP AT SCREEN.
    IF screen-group1 = 'MOD'.
      IF flag = ' '.
        screen-input = '0'.
      ELSEIF flag = 'X'.
        screen-input = '1'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.

MODULE cancel.
  LEAVE PROGRAM.
ENDMODULE.

MODULE user_command_0100 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'TOGGLE'.
      IF flag = ' '.
        flag = 'X'.
      ELSEIF flag = 'X'.
        flag = ' '.
ENDIF.
ENDCASE.
ENDMODULE.

please see this link for all the screen fields properties with this you can do all the things for field display , hide , input , only output , inverse , intersify ,etc ..

<a href="http://">http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm</a>

reward points if it is usefull ....

Girish

Read only

Former Member
0 Likes
560

Hi Shyja,

Generally we do screen programing stuff using loop at screen commands

eg code:

*AT SELECTION-SCREEN OUTPUT.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

if screen-name eq 'PNPS$MSL'.

screen-active = 0.

endif.

modify screen.

endloop.

This example shows how different transactions codes can be used to produce different selection options for the same program. The example allows for lookups on Sales Order number, Purchase Order Number, Delivery Number or Invoice number.

*

--- SELECTION OPTIONS ---------------------------------------

SELECTION-SCREEN BEGIN OF BLOCK SO WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN,"Sales order number   

               S_VBELND FOR LIKP-VBELN,"Delivery number     

               S_VBELNI FOR VBRK-VBELN,"Invoice number      

               S_VBELNP FOR VBKD-BSTKD."PO number           

SELECTION-SCREEN END OF BLOCK SO.                            

 

*--- EVENT AT SCREEN OUTPUT -------------------------------

AT SELECTION-SCREEN OUTPUT.                                       

  CASE SY-TCODE.                                                  

    WHEN 'ZEDI6'.                                                 

      LOOP AT SCREEN.                                              

        CASE SCREEN-GROUP4.                                       

          WHEN '001'.                  "Sales order select        

            SCREEN-ACTIVE = '1'.       "1=Active, 0=Don't display 

            MODIFY SCREEN.                                        

          WHEN '002'.                  "Delivery select           

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display 

            MODIFY SCREEN.                                         

          WHEN '003'.                  "Invoice select            

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display 

            MODIFY SCREEN.                                        

          WHEN '004'.                  "PO Select                 

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display 

            MODIFY SCREEN.                                        

        ENDCASE.                                                  

      ENDLOOP.                                                     

    WHEN 'ZEDI6D'.                     "Delivery select            

      LOOP AT SCREEN.                                              

        CASE SCREEN-GROUP4.                                        

          WHEN '001'.                  "Sales order select         

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display  

            MODIFY SCREEN.                                         

          WHEN '002'.                  "Delivery select             

            SCREEN-ACTIVE = '1'.       "1=Active, 0=Don't display  

            MODIFY SCREEN.                                         

          WHEN '003'.                  "Invoice select             

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display  

            MODIFY SCREEN.                                         

          WHEN '004'.                  "PO Select                  

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display  

            MODIFY SCREEN.                                         

        ENDCASE.                                                   

      ENDLOOP.                                                     

    WHEN 'ZEDI6I'.                     "Invoice select                   

      LOOP AT SCREEN.                                                   

        CASE SCREEN-GROUP4.                                             

          WHEN '001'.                  "Sales order select              

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display       

            MODIFY SCREEN.                                              

          WHEN '002'.                  "Delivery select                 

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display       

            MODIFY SCREEN.                                              

          WHEN '003'.                  "Invoice select                  

            SCREEN-ACTIVE = '1'.       "1=Active, 0=Don't display       

            MODIFY SCREEN.                                              

          WHEN '004'.                  "PO Select                       

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display       

            MODIFY SCREEN.                                               

        ENDCASE.                                                        

      ENDLOOP.                                                          

    WHEN 'ZEDI6P'.                     "PO select                   

      LOOP AT SCREEN.                                               

        CASE SCREEN-GROUP4.                                         

          WHEN '001'.                  "Sales order select          

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display   

            MODIFY SCREEN.                                          

          WHEN '002'.                  "Delivery select             

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display   

            MODIFY SCREEN.                                           

          WHEN '003'.                  "Invoice select              

            SCREEN-ACTIVE = '0'.       "1=Active, 0=Don't display   

            MODIFY SCREEN.                                          

          WHEN '004'.                  "PO Select                   

            SCREEN-ACTIVE = '1'.       "1=Active, 0=Don't display   

            MODIFY SCREEN.                                          

        ENDCASE.                                                     

      ENDLOOP.                                                      

  ENDCASE.        

<b>Reward pts if found usefull:)</b>

<b>regards</b>

Sathish

Read only

Former Member
0 Likes
560

hi,

try like this,

AT SELECTION-SCREEN ON OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'TEXTBOX1'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

// like this u can have any no. of. conditions

if helpful reward some points.

with regards,

Suresh.A