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

Selection screen

Former Member
0 Likes
532

Hi all,

My requirement is as follows.

1. If purchase order radio button selected, text box associated for sales order should be input disable and text box associated for purchase order should be input enabled

2. If Sales Order radio button is selected, text box associated for sales order should be input enable and text box associated for purchase order should be input disable

Please help me with the code.

Thanks,

Ramya

5 REPLIES 5
Read only

Former Member
0 Likes
498

hi,

U can use

Loop at screen.

screen-active = 0.

modify screen.

endloop.

Read only

Former Member
0 Likes
498

Hi,

Refer and Use the following piece of code

REPORT zzbatchjob MESSAGE-ID zt.

PARAMETERS : p_radi RADIOBUTTON GROUP g1 USER-COMMAND p1,

p_rad2 RADIOBUTTON GROUP g1 DEFAULT 'X',

p_fld TYPE i.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'P_FLD' AND p_radi IS NOT INITIAL.

screen-INPUT = 0.

MODIFY SCREEN.

ELSEIF screen-name = 'P_FLD' AND p_rad2 IS NOT INITIAL.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards,

Himanshu

Read only

Former Member
0 Likes
498

Hi Ramya,

Refer the below code

parameters: p_radio1 radiobutton group rad1 user-command chk1,

p_radio2 radiobutton group rad1 .

parameters : p_path type rlgrap-filename,

p_path1 type rlgrap-filename.

at selection-screen output.

if p_radio1 is initial.

loop at screen.

if screen-name = 'P_PATH'.

screen-input = '0'.

clear p_path.

endif.

if screen-name = 'P_PATH1'.

screen-input = '1'.

clear p_path1.

endif.

modify screen.

endloop.

endif.

if p_radio2 is initial.

loop at screen.

if screen-name = 'P_PATH1'.

screen-input = '0'.

clear p_path1.

endif.

if screen-name = 'P_PATH'.

screen-input = '1'.

clear p_path.

endif.

modify screen.

endloop.

endif.

Read only

Former Member
0 Likes
498

see the below logic for same as yours ..

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.          

reward points if it is usefull .....

Girish

Read only

Former Member
0 Likes
498

Hi,

You could attach modifier ID with text fields for Sales Order and pourchase Order text

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

PARAMETERS: R_SALES RADIOBUTTON GROUP G1

DEFAULT 'X' USER-COMMAND RAD1,

R_PURCHASE RADIOBUTTON GROUP G1.

SELECTION-SCREEN END OF BLOCK B1.

SELECT-OPTIONS: S_MATGRP FOR MARA-MATKL MODIF ID MGR,

P_SORD_NO LIKE VBAK-VBELN MODIF ID SALE,

P_PORD_NO LIKE EKKO-EBELN MODIF ID PURC,

SELECTION-SCREEN END OF BLOCK B2.

Further you could handle by using AT SELECTION-SCREEN OUTPUT event

as,

AT SELECTION-SCREEN OUTPUT.

        • Hiding or making visible selection options

IF R_SALES EQ 'X'.

LOOP AT SCREEN.

CASE SCREEN-GROUP1.

WHEN 'SALE'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

WHEN 'PURC'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

ELSEIF R_PURC EQ 'X'.

LOOP AT SCREEN.

CASE SCREEN-GROUP1.

WHEN 'SALE'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

WHEN 'PURC'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

ENDIF.

Reward for helpful answers.

Regards,

Amit R