At selection screen output problem when a field is obligatory

Hi All,
I have two radiobuttons on the selection screen and when I select first radiobutton one screen should display and the other should not be displayed and vice-versa. It is working fine if I do not have a mandatory field.I am pasting my code here.Can anyone please help me how to handle this situation when we have some mandatory fields on one of these screens.
TABLES : mara,marc.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_meth1 RADIOBUTTON GROUP g1 USER-COMMAND g1,
             p_meth2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK matnr WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1 obligatory.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : so_werks FOR marc-werks MODIF ID m1 .
SELECTION-SCREEN END OF BLOCK matnr.
SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-003.
SELECTION-SCREEN SKIP 1.
PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2 LOWER CASE.
SELECTION-SCREEN END OF BLOCK file.
SELECTION-SCREEN BEGIN OF BLOCK date WITH FRAME TITLE text-004.
SELECTION-SCREEN SKIP 1.
PARAMETERS : p_date TYPE datuv.
SELECTION-SCREEN END OF BLOCK date.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'M1'.
IF p_meth1 = 'X'.
screen-active = 1.
ENDIF.
IF p_meth2 = 'X'.
screen-active = 0.
ENDIF.
WHEN 'M2'.
IF p_meth2 = 'X'.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
IF p_meth1 = 'X'.
screen-active = 0.
ENDIF.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
Thanks in advance
Sandeep

Obligatory fields with your requirement will not work, reason : The GUI checks obligatory fields before passing the control back to the program (i.e Before triggering the PAI )
If you check for empty fields and give appropriate error message in the PAI, the program will not allow you to switch to the other radio button until you fill something in the fields because the moment you select a radiobutton, it will validate the field and issue the error message.
So it is like a catch 22 situation.
All you can really do is to check see which radio button is clicked and then do your processing. Also make sure to assign a user command to the radiobutton and query it in the AT SELECTION SCREEN and based on the radiobutton selected, decide which fields should be validated.
" Additon...
INITIALIZATION  " Default values
p_meth1 = 'X'.
AT SELECTION-SCREEN.  " General PAI
if p_meth1 EQ 'X'.
"validate fields for meth1.
elseif p_meth2 EQ 'X'.
" validate fields for meth2.
endif.
regards,
Advait

Similar Messages

  • At selection screen output problem

    Hi all,
    I am trying to make a few fields disabled based on the selection of a radio button. I have done it in dialog programming, but in report its not working. Please tell me where i have gone wrong. My code:
    * Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETER : rb_dwld RADIOBUTTON GROUP radi DEFAULT 'X',
                rb_upld RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    SELECT-OPTIONS : so_cctrl FOR /dceur/z_crconar-crdt_ctrldsa MODIF ID
                                             sc1 NO INTERVALS OBLIGATORY,
                     so_cusno FOR /dceur/z_crdtlmt-dealer MODIF ID sc1.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    SELECT-OPTIONS : so_ctrl1 FOR /dceur/z_crconar-crdt_ctrldsa MODIF ID
                                             sc2 NO INTERVALS OBLIGATORY.
    PARAMETER pa_fname TYPE rlgrap-filename MODIF ID sc2.
    SELECTION-SCREEN END OF BLOCK b3.

    Hi,
    Please check the below code.
    This is one of my requirement.
    * Creation of two blocks with parameter fields for create and update
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETER p_create LIKE rlgrap-filename MODIF ID crt.
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETER p_update LIKE rlgrap-filename MODIF ID upt.
    SELECTION-SCREEN: END OF BLOCK b2.
    * Making one parameter field active at a time
    AT SELECTION-SCREEN OUTPUT.
      IF rb_crt = 'X'.                              "CREATE BUTTON IS SELECTED
        PERFORM hide_rb_options.
        CLEAR p_create.
      ELSE.                                         "UPDATE BUTTON IS SELECTED
        PERFORM hide_rb_options.
        CLEAR p_update.
      ENDIF.
    *&      Form  hide_rb_options
    FORM hide_rb_options .
      IF rb_crt = 'X'    .
        LOOP AT SCREEN.
          CASE screen-group1.
            WHEN 'CRT'.
              screen-active = 1.
              MODIFY SCREEN.
            WHEN 'UPT'.
              screen-active = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          CASE screen-group1.
            WHEN 'UPT'.
              screen-active = 1.
              MODIFY SCREEN.
            WHEN 'CRT'.
              screen-active = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " hide_rb_options
    May it helps you.
    Regards.
    DS.

  • Problem in using at selection-screen output

    Hai Frnds,
    I am using 5 parameters in the selection screen . I am entering data in the 4 input fields. Then I am doing concatenate 4 fileds data into the 5th field in the event AT SELECTION-SCREEN OUTPUT, but my problem is When ever i click ENTER , then only 5th field is updating. With out ENTER key , Is it possible update 5th filed.
    Thanks,
    Kiran.

    Hi,
    We can restrict the functionality of ENTER.
    User the Concatenation in AT SELECTION-SCREEN EVENT
    because AT SELECTION-SCREEN OUTPUT is triggered before
    selection screen is displayed.Below code will definitly work.
    Ex:
    Tables:SSCRFIELDS.
    At selection-screen.
    IF SY-ucomm = ' '.
    Clear SSCRFIELDS-UCOMM.
    ENDIF.
    CHECK  SSCRFIELDS-UCOMM EQ 'ONLI'.
    CONCATENATE <FIELDS> INTO PARAMETER5.
    ONLI is Function code of F8
    ' ' is for enter.
    The above code will surely work.
    Thanks.

  • Problems in at selection-screen output - setting pushbutton invisible

    Hello,
    I hope I can get some help here
    I have a problem with setting a pushbutton invisible
    i have a field (long-text) in my screen - and behind this a pushbutton for calling the editor
    if in a variant the parameters field is set invisible i also want to set the pushbutton invisible
    i have no idea why in the at selection-screen output event screen-invisible is always 0 - but in the variant the field is set invisible.
    i need to know if the parameters field is invisible to set the pushbutton the same
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) S_TXB_L1.
    PARAMETERS S_TXT_L1 TYPE ZHR_FC_STRING.
    SELECTION-SCREEN PUSHBUTTON 79(15) P_LTX_1 USER-COMMAND YLTXT1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) S_TXB_L2.
    PARAMETERS S_TXT_L2 TYPE ZHR_FC_STRING.
    SELECTION-SCREEN PUSHBUTTON 79(15) P_LTX_2 USER-COMMAND YLTXT2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) S_TXB_L3.
    PARAMETERS S_TXT_L3 TYPE ZHR_FC_STRING.
    SELECTION-SCREEN PUSHBUTTON 79(15) P_LTX_3 USER-COMMAND YLTXT3.
    SELECTION-SCREEN END OF LINE.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
        IF SCREEN-NAME(7) = 'S_TXT_L'.
          MERK_INVISIBLE = SCREEN-INVISIBLE.
        ENDIF.
        IF SCREEN-NAME(6) = 'P_LTX_'.
         SCREEN-INVISIBLE = MERK_INVISIBLE.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Thanks very much...
    Helmut

    I agree - there seems to be some confusion here. In the variant the field can only be "hidden" while in the code it is possible to make the field completely invisible. 'Hiding' the field in the variant merely hides it by default and adds a 'plus' button to the toolbar, by clicking which the hidden elements can be exposed.
    As far as changing the screen fields goes, I find it usefull to use MODIF ID. Perhaps this blog could be helpful:
    http://friendlyabaper.blogspot.com/2009/07/my-super-awesome-selection-screen.html
    P.S. Please use the code tags for the code, per Forum Rules.

  • Selection screen output obligatory field

    Hi all,
    I have two radio buttons, if i selected one radio button one selection screen will come for entries another will be invisible.
    in that selection screen i have all are mandatory fields. so it is not allowing to another radio button with out entering the values
    Chek my code.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text001.
    PARAMETERS     : p_aut RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND ac.
    PARAMETERS     : p_man RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text002.
    PARAMETERS     : p_zbukr   TYPE reguh-zbukr  MODIF ID aut.
    SELECT-OPTIONS : s_laufi   FOR  reguh-laufi  MODIF ID aut OBLIGATORY,              
                     s_laufd   FOR  reguh-laufd  MODIF ID aut OBLIGATORY,               
                     s_hbkid   FOR  reguh-hbkid  MODIF ID aut OBLIGATORY,          
                     s_hktid   FOR  reguh-hktid  MODIF ID aut OBLIGATORY.              
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text003.
    PARAMETERS     : p_bukrs   TYPE bsak-bukrs   MODIF ID man DEFAULT 'LTGI'.
    SELECT-OPTIONS : s_augbl   FOR  bsak-augbl   MODIF ID man OBLIGATORY, 
                                 s_augdt   FOR  bsak-augdt   MODIF ID man OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b3.
    Will it move from one radion button to another even those are obligatory.
    Regards,
    Sri
    Edited by: Thomas Zloch on Sep 14, 2010 2:34 PM - please use code tags!

    Hi,
    True. There are some variables to keep track of.
    So, I have two radio buttons. P_UPL and P_DNL. If P_DNL is selected and gv_mode has already been set to "download status", then I do the check. AT SELECTION-SCREEN OUTPUT happens after AT SELECTION-SCREEN so my gv_mode variable won't be set on the first AT SELECTION-SCREEN when the radio button is selected.
    * SELECTION SCREEN EVENTS
    AT SELECTION-SCREEN OUTPUT.
      DATA: lv_type(3).
      IF p_upl = 'X'.
        gv_mode = c_screen_upload.
      ELSE.
        gv_mode = c_screen_download.
      ENDIF.
      LOOP AT SCREEN.
        IF NOT screen-group1 IS INITIAL.
          IF screen-group1 = gv_mode.
            screen-active = 1.
          ELSE.
            screen-active = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    AT SELECTION-SCREEN.
      IF p_dnl = 'X' and gv_mode = c_screen_download.
        IF p_aland is INITIAL.
          MESSAGE text-m03 type 'E'.
        ENDIF.
        IF so_azone[] is INITIAL.
          MESSAGE text-m04 TYPE 'E'.
        ENDIF.
      endif.

  • Problem on  "at selection-screen output." command

    Hi ,
    in my programe a part of code is :-
    selection-screen : begin of block b0 with frame title text-000.
       selection-screen:  skip 1.
      parameters: s_box1  radiobutton group g1 user-command u1  default            'X',
                  s_box2 radiobutton group g1.
    selection-screen : end of block b0 .
    selection-screen : begin of block b2 with frame title text-002.
    select-options  : s_vend for bseg-lifnr modif id m1 .
    selection-screen : end of block b2 .
    selection-screen : begin of block b3 with frame title text-003.
    select-options  : s_budat for bkpf-budat modif id m2 .
    selection-screen : end of block b3 .
    at selection-screen output.
    if s_box1 = 'X'.
    loop at screen.
    if screen-group1 = 'M2'.
    screen-active = '0'.
    modify screen.
    elseif  screen-group1 = 'M1'  .
    screen-active = '1'.
    modify screen.
    endif.
    endloop.
    elseif s_box2 = 'X'.
    loop at screen.
    if screen-group1 = 'M2'  .
    screen-active = '1'.
    modify screen.
    elseif  screen-group1 = 'M1'.
    screen-active = '0'.
    modify screen.
    endif.
    endloop.
    endif.
    while executing this one...
    while clicking S_BOX2 from S_BOX1 , S_VEND is changing to S_BUDAT but if I click again S_BOX1 this program goes to infinite loop.
    Please help me to correct this problem.
    Thankx in adv.
    Biswajit
    N.B:- This is a test code. no coding convention  is followed.

    I just copied your code and Tested it is working fine with out any problem.
    REPORT  zscreen_test_.
    TABLES:bseg,bkpf.
    SELECTION-SCREEN : BEGIN OF BLOCK b0 WITH FRAME TITLE text-000.
    SELECTION-SCREEN: SKIP 1.
    PARAMETERS: s_box1 RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X',
    s_box2 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN : END OF BLOCK b0 .
    SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECT-OPTIONS : s_vend FOR bseg-lifnr MODIF ID m1 .
    SELECTION-SCREEN : END OF BLOCK b2 .
    SELECTION-SCREEN : BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    SELECT-OPTIONS : s_budat FOR bkpf-budat MODIF ID m2 .
    SELECTION-SCREEN : END OF BLOCK b3 .
    AT SELECTION-SCREEN OUTPUT.
      IF s_box1 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'M2'.
            screen-active = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1 = 'M1' .
            screen-active = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF s_box2 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'M2' .
            screen-active = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1 = 'M1'.
            screen-active = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    "If you have any code next to this place that under appropriate
    "events.

  • At selection-screen output probelm

    Hi ,
    I am using 4 parameters in the selection screen . I am entering data in the 3 input fields. Then I am doing concatenate 3 fileds data into the 4 th field in the event AT SELECTION-SCREEN OUTPUT, bur my problem is  When ever i click ENTER , then only 4th field is updating. With out ENTER key , Is it possible update 4th filed.
    regards,
    ramajay reddy

    Hi,
    This is not possible without a user action on the screen, unless your fields are drop down lists, check box or radiobutton respectively, Reason is that the SAP Screen processing will not trigger the PAI event unless there is a user action on the screen like pushing a button, radiobutton , checkbox or selecting a value from a dropdown list. And hence PBO will not get triggered either. Thus entering value in input fields and pressing the tab key is not enough. The user must press 'Enter' if the PAI--PBO should be triggered.
    Pressing 'Enter' is much more user friendly and convinient than adding a button/radiobutton/checkbox on the selection screen to update other fields on the selection screen as in your scenario.
    regards,
    Advait

  • At selection screen output not responding

    Hi ppl,
    I've 4 selection options in my screen. however I just need user to insert only 1 of the 4 for searching. Therefore i included 4 radio buttons. when user select <i>rbf</i>, <i>sfileno</i> will activer and other 3 will be grayed out, when user select <i>rbi</i>, <i>sidnum</i> will active and other will not be active and so forth. You can see the codes below.
    However, during the program running, I found out when i select <i>rbf,</i> the other select options fields - <i>sfileno</i>, <i>sidnum</i> n <i>scompsno</i> are not inactive/grayed. It is the same when I seledt the other radio button. I just seem that i receive no response from the program. What have i done wrong here. please help. TQ
    SELECTION-SCREEN BEGIN OF BLOCK frm1 WITH FRAME TITLE text-t01 .
    SELECT-OPTIONS : sfileno FOR zlic_masterdb-nofailpermohonan modif id f01
                      sidnum FOR zcustomer-idnumber modif id i01,
                      sconame FOR zcustomer-contactname modif id n01,
                      scompsno FOR zcom_compdhdr-compsno modif id c01.
    PARAMETERS: rbf RADIOBUTTON GROUP g1 ,
    rbi RADIOBUTTON GROUP g1,
    rbn RADIOBUTTON GROUP g1,
    rbc RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END   OF BLOCK frm1.
    INITIALIZATION.
    sfileno = '00001'.
                     AT SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
      CHECK SCREEN-GROUP1 = 'f01' OR
    SCREEN-GROUP1 = 'i01' OR
    SCREEN-GROUP1 = 'n01' OR
    SCREEN-GROUP1 = 'c01'.
    IF rbf = 'X'.
      IF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ELSEIF rbi = 'X'.
      IF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ELSEIF rbn = 'X'.
      IF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ELSEIF rbc = 'X'.
      IF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
    continue.
    ENDLOOP.

    hi Enzo
    Check my sample code
    TABLES: eban,
            SSCRFIELDS.
    SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE title.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETER:rad1 RADIOBUTTON GROUP rad USER-COMMAND frad1 DEFAULT 'X',
              rad2 RADIOBUTTON GROUP rad .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETER: mtr AS CHECKBOX MODIF ID g3 USER-COMMAND chk1,
               p_matnr TYPE eban-matnr MODIF ID g1,
               sloc AS CHECKBOX MODIF ID g3 USER-COMMAND chk2,
               str_loc TYPE eban-lgort MODIF ID g4.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    SELECT-OPTIONS: matnr1 FOR eban-matnr MODIF ID g2.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN PUSHBUTTON /20(10) name USER-COMMAND UCOM.
    SELECTION-SCREEN END OF SCREEN 100.
    name = 'FETCH'.
    title = 'Test Report'.
    CALL SELECTION-SCREEN '100'.
    TYPE-POOLS slis.
    * declaration of internal tables and work areas to be used
    DATA: BEGIN OF it_pr OCCURS 0,
          banfn TYPE eban-banfn,
          bnfpo TYPE eban-bnfpo,
          loekz TYPE eban-loekz,
          statu TYPE eban-statu,
          ekgrp TYPE eban-ekgrp,
          matnr TYPE eban-matnr,
          werks TYPE eban-werks,
          lgort TYPE eban-lgort,
          preis TYPE eban-preis,
          peinh TYPE eban-peinh,
          END OF it_pr.
    DATA: BEGIN OF it_mat OCCURS 0,
          matnr TYPE eban-matnr,
          END OF it_mat.
    *DATA:BEGIN OF ITAB1 OCCURS 0,
      DATA: l_answer.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
          wa_fieldcat LIKE LINE OF it_fieldcat,
          it_event TYPE slis_t_event,
          wa_event TYPE slis_alv_event.
    * declaration of variables to be used
    DATA: r_ucomm TYPE sy-ucomm,
          mat_no TYPE eban-matnr,
          len TYPE i VALUE 1,
          count TYPE i VALUE IS INITIAL,
          iflag TYPE i VALUE IS INITIAL,
          iflag1 TYPE i VALUE 0.
    DATA :pr_id TYPE sy-repid,
    rt_extab TYPE slis_t_extab.
    INITIALIZATION.
      pr_id = sy-repid.
    probably it would sol;ve ur problem
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • Using Selection screen and selection screen output

    Hi All,
    I am trying to execute AT SELECTION-SCREEN and AT SELECTION-SCREEN output. Both the para's working fine seperately. But when I execute them together AT SELECTION-SCREEN output is not working. Please let me know how to solve this problem. Please see below for the code.
    PARAMETERS:  p_werks LIKE marc-werks OBLIGATORY MEMORY ID WRK,
                 p_lgort LIKE mard-lgort OBLIGATORY,
                 p_rlgort LIKE mard-lgort OBLIGATORY.
        PARAMETERS: p_boml TYPE c RADIOBUTTON GROUP mode user-command flag.
            SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
                PARAMETERS: p_aufnr LIKE aufk-aufnr MODIF ID cp2.
            SELECTION-SCREEN: END OF BLOCK b1.
    *SELECTION-SCREEN COMMENT 1(44) text-004 FOR FIELD p_cmpl.
        PARAMETERS: p_cmpl TYPE c RADIOBUTTON GROUP mode.
           SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
                PARAMETERS: p_matnr type marc-matnr MODIF ID cp1,
                            p_verid type afpo-verid MODIF ID cp1,
                            p_labst type mard-labst MODIF ID cp1.
           SELECTION-SCREEN: END OF BLOCK b2.
       PARAMETERS: p_mstr TYPE c RADIOBUTTON GROUP mode.
    AT SELECTION-SCREEN output.
      LOOP AT SCREEN.
        IF p_boml <> 'X' AND
           screen-group1 = 'CP1'.
           screen-active = '1'.
           MODIFY SCREEN.
        ENDIF.
        IF p_cmpl <> 'X' AND
           screen-group1 = 'CP2'.
           screen-active = '1'.
           MODIFY SCREEN.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    AT SELECTION-SCREEN.
      IF p_boml EQ 'X'.
        IF p_AUFNR EQ space.
            MESSAGE e000(z1) WITH 'Please fill Production Order.'.
        ENDIF.
      endif.
      IF p_cmpl EQ 'X'.
        IF p_MATNR EQ space  OR p_verid EQ space OR p_labst EQ space.
            MESSAGE e000(z1) WITH text-003 'Production Version & Quantity. '.
        ENDIF.
      endif.
    Thanks,
    Senthil

    Hi Senthil,
    As far as my knowledge is concerned AT Selection-Screen output and AT Selection-Screen wont work together.In this code you are trying to do the validation in AT Selection-Screen. Instead of that try doin your validations in Start-of-selection Event.
    i,e., modify your code as follows:
    PARAMETERS: p_werks LIKE marc-werks OBLIGATORY MEMORY ID WRK,
    p_lgort LIKE mard-lgort OBLIGATORY,
    p_rlgort LIKE mard-lgort OBLIGATORY.
    PARAMETERS: p_boml TYPE c RADIOBUTTON GROUP mode user-command flag.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_aufnr LIKE aufk-aufnr MODIF ID cp2.
    SELECTION-SCREEN: END OF BLOCK b1.
    *SELECTION-SCREEN COMMENT 1(44) text-004 FOR FIELD p_cmpl.
    PARAMETERS: p_cmpl TYPE c RADIOBUTTON GROUP mode.
    SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_matnr type marc-matnr MODIF ID cp1,
    p_verid type afpo-verid MODIF ID cp1,
    p_labst type mard-labst MODIF ID cp1.
    SELECTION-SCREEN: END OF BLOCK b2.
    PARAMETERS: p_mstr TYPE c RADIOBUTTON GROUP mode.
    AT SELECTION-SCREEN output.
    LOOP AT SCREEN.
    IF p_boml <> 'X' AND
    screen-group1 = 'CP1'.
    screen-active = '1'.
    MODIFY SCREEN.
    ENDIF.
    IF p_cmpl <> 'X' AND
    screen-group1 = 'CP2'.
    screen-active = '1'.
    MODIFY SCREEN.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    START-OF-Selection.
    Perform validation.
    form validation.
    IF p_boml EQ 'X'.
    IF p_AUFNR EQ space.
    MESSAGE e000(z1) WITH 'Please fill Production Order.'.
    ENDIF.
    endif.
    IF p_cmpl EQ 'X'.
    IF p_MATNR EQ space OR p_verid EQ space OR p_labst EQ space.
    MESSAGE e000(z1) WITH text-003 'Production Version & Quantity. '.
    ENDIF.
    endif.
    endform.
    Kindly reward if useful.
    Thanks,
    pavithra

  • Selection icons destroyed by AT SELECTION SCREEN OUTPUT

    Hello
    I have a following code excerpt:
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'CUSTORDS' OR
           screen-name = 'TRNSORDS' OR
           screen-name = 'REASONCD'.      
          screen-input = '1'.
        ELSEIF ( screen-group1 = 'ONE'
                 AND custords = set_x ) OR
               ( screen-group1 = 'TWO'
                 AND trnsords = set_x ).
          screen-input = '1'.
        ELSE.
          screen-input = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    The problem is, that when user gives special selection criteria for select-option field, the icon which appears to the left ('=', '>', etc) next to the affected select-option field inherits the screen-group from the select-option and the coding sets screen-input = 1 for this icon thus destroying it. Instead of an icon a text appears, just like this: '@20\QSelect: Equal to@'.
    How can this behavoiur be prevented ?

    Add screen-group3 ne 'OPU' to the elseif statement:
    ELSEIF ( screen-group1 = 'ONE' and screen-group3 ne 'OPU'
    AND custords = set_x ) OR
    ( screen-group1 = 'TWO' and screen-group3 ne 'OPU'
    AND trnsords = set_x ).
    Regards
    Sridhar

  • AT SELECTION-SCREEN OUTPUT not working!

    Hi,
    I am useing the statement AT SELECTION-SCREEN OUTPUT to disable some input fields based on a check box(PR_FILE).however when I execute the program the changes on the screen are not reflected!I have written the AT SELECTION-SCREEN OUTPUT stmt immediately after SELECTION-SCREEN stmt .
    Defination for the screen elements is  as  follows:
    SELECT-OPTIONS s_plants FOR  ls_selected_plant-plant
                                                         NO INTERVALS.
    SELECTION-SCREEN BEGIN OF BLOCK filesel WITH FRAME TITLE text-012.
    PARAMETERS pr_file TYPE xfeld .
    PARAMETER : pr_path LIKE rlgrap-filename .
    SELECTION-SCREEN END OF BLOCK filesel.
    AT SELECTION-SCREEN OUTPUT.
      IF pr_file = 'X'.
        LOOP AT SCREEN.
          IF screen-name = 's_plants'.
            screen-input    = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-name = 'pr_path'.
            screen-input    = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Can anybody suggest what wrong i have done??

    You need to use the User Command for the checkbox and the Modificaiton ID (Group) for the fields.
    Try like this:
    TABLES: VBRP.
    SELECT-OPTIONS S_PLANTS FOR VBRP-WERKS NO INTERVALS MODIF ID GP1.
    SELECTION-SCREEN BEGIN OF BLOCK FILESEL WITH FRAME TITLE TEXT-012.
    PARAMETERS PR_FILE TYPE XFELD USER-COMMAND USR1.
    PARAMETER : PR_PATH LIKE RLGRAP-FILENAME MODIF ID GP2 .
    SELECTION-SCREEN END OF BLOCK FILESEL.
    AT SELECTION-SCREEN OUTPUT.
        IF PR_FILE = 'X'.
          LOOP AT SCREEN.
            if screen-group1 = 'GP1'.
              SCREEN-active = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ELSE.
          LOOP AT SCREEN.
            IF SCREEN-group1 = 'GP2'.
              SCREEN-active = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ENDIF.
    Regards,
    Naimesh Patel

  • At selection-screen output and  at selection-screen on

    Hi Experts,
    I had coded in both at selection-screen output for disabling input of certain fields and at selection-screen for validation like this:
    AT SELECTION-SCREEN output.
      IF p_amt = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_AMT'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_B4C'.
              screen-input = '1'.
            WHEN 'P_AFC'.
              screen-input = '1'.
            WHEN 'P_COM'.
              screen-input = '1'.
            WHEN 'P_COM1'.
              screen-input = '1'.
            WHEN 'P_COM2'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_amt = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_AMT'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_B4C'.
              screen-input = '1'.
            WHEN 'P_AFC'.
              screen-input = '1'.
            WHEN 'P_COM'.
              screen-input = '1'.
            WHEN 'P_COM1'.
              screen-input = '1'.
            WHEN 'P_COM2'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_pdf = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_PDF'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_PATH'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_afc = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'S_FID-LOW' OR 'S_FID-HIGH'.
              screen-input = '0'.
            WHEN 'S_ORG-LOW' OR 'S_ORG-HIGH'.
              screen-input = '0'.
            WHEN 'S_OFF-LOW' OR 'S_OFF-HIGH'.
              screen-input = '0'.
            WHEN 'S_DAT-LOW' OR 'S_DAT-HIGH'.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    AT selection-screen on block b5.
    if p_tst is initial.
      message text-016 type 'E'.
    endif.
    AT selection-screen on block b2.
    if p_amt ne 'X' and p_pdf ne 'X'.
    if s_fid is initial and s_org is initial.
    message text-000 type 'E'.
    endif.
    if s_dat is initial.
    message text-000 type 'E'.
    endif.
    endif.
    when i comment out at selection-screen validations the input is disabled for the screen fields as set, else the validations are executed first.
    Any solution for this???
    Thanks in advance.

    AT SELECTION-SCREEN
    Syntax
    AT SELECTION-SCREEN selscreen_event.
    Effect
    This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
    Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
    AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
    Note
    The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data.

  • AT SELECTION-SCREEN OUTPUT event of standard tcode

    Hi
    I need User-exit or BADI or Enhancment spot in AT SELECTION-SCREEN OUTPUT event of ME55.
    I need to populate the default cost center into the cost center field from user parameters with pid 'KOS' when i execute the ME55.
    I maintained the PID in user parameters but the value is not getting populated in ME55.
    Please let me know
    Govi

    Thanks Benedict
    Creating Module %_S_KOSTL and write our own logic to bring the parameter id value of Cost center from User profiles is NOT possible in program RM06BF00,  screen 1000.
    We can do that in Copied program of RM06BF00 ..which is the very last option.
    I wanted to do that with User-exits or BADI or Enhancement spot etc...which i Couldn't do it so far...
    The alternate might be Zprog and Ztcode or an SNOTE..
    if you ALL think its NOT possible with User-exits or BADI or Enhancement spot or SNOTE etc..Then i will close this Thread...
    Please let me know ASAP...
    Thanks
    Govi

  • KDMAT need to be included in the current VA01 selection screen or list when

    Hello SAP SD Consultants,
    Please help me with below requirement or what user exit should we use to implement below requirement.  I have discussed with with ABAP and gave some User exits that has related description, however, ABAP confirmed that none of below UE suits the requirement.
    1. AD010002 - Delimit selection and/or filter data that is determined
    2. CLCLRS01 - Additional Fields on the Result Screen
    3. CLCLRS02 - Fill the Additional Fields on the Result Screen
    4. V60P0001 - Data provision for additional fields for display in lists
    5. WVLB0001 - Display additional data in subscreen for simulation list
    Thus, kindly help us on how we can proceed with this.
    000----
    Requirement:
    The field  u201CCustomer-material numberu201D or field name KDMAT need to be included in the current VA01 selection screen or list when creating sales orders with reference from a contract.
    Currently, customer have its own description or material code to classify or define the product they want to order  which are sometimes not exactly the same as the material number maintained in the system or the product / material code used by the Company for sales. These material descriptions were manually entered in the system thru the use of customer-material number field or KDMAT. When sales orders or contracts are created for certain or specific customers, the user or the person who creates that contract / order manually inputs the description in the customer-material number field.
    The said entry should also be seen in the Selection List for Reference Document. The transaction to be modified is VA01 under program screen SAPMV45A specific to screen number 4413.
    Test Data used:
    Reference Transaction: VA41 (create contract), VA43 (display contract)
    Order Type: ZCQ (example)
    Contract No. 40000040
    Transaction: VA01
    Order type: ZOR (example)
    Contract No. 40000040
    a. Go to tcode VA01, input the order type ZOR, click the button CREATE with REFERENCE.
    b. Input the reference contract document, since our reference doc is a contract, go to tab CONTRACT and input the contract no..
    Expected output:
    Upon inputing the contract no. in the contract tab, click u201CSelection Listu201D.
    The customer-material number or KDMAT should be included as one of the field and should be displayed in the Selection List for Reference Document window.
    Edited by: ria sumagaysay on Mar 26, 2010 11:30 AM

    Hello,
    Thank you for the responce.
    The reason why they want to reflect KDMAT in the selection list is that, during order creation, not all materials or KDMAT will be ordered by that customer, only specific materials. However, during order processing, the customer only gives the details of the KDMAT. Thus, if there are around hundreds of items inside that contract, the sales personnel who creates the order needs to exclude those material not included in the customer order list manually via checking table VBAP and compare the material code from the selection list.
    This is very tedious on their part and commonly caused human error, however, when the KDMAT field is available, although the process has manual intervention, it will serve them well and lessen the burden.

  • Query related to at selection screen event & at selection-screen output

    Hi all,
    thanks in advance
    i have two radio buttons say rd1 & rd2
    on my selection screen i have date,period,year and these fields r mandatory fields
    when i try to select the radio button rd2 then it is not disabling the fields period and year rather it is checking the fields for mandatory and vicevesr
    here is the code plz help me out
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
        IF rd1 = 'X'.
          IF screen-group1  = 'GR1'.
            screen-input  = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
        IF rd2 = 'X'.
          IF screen-group1  = 'GR2'.
            screen-input  = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN.
    blank period is not allowed
        IF monat[] IS INITIAL.
          MESSAGE e008.
        ENDIF.
    blank fiscal year is not allowed
        IF gjahr[] IS INITIAL.
          MESSAGE e009.
        ENDIF.
    blank document date is not allowed
        IF bldat[] IS INITIAL.
          MESSAGE e020.
        ENDIF.
    awiting for all u r replies

    I UNDERSTOOD Y U HAVE GIVE ERROR MESSAGE,
    WHEN U R DECLARING THE VALUES AS OBLIGATORY BEFORE, THEN NO NEED TO GIVE MESSAGES IN AT SELECTION SCREEN.
    BUT BASED ON SOME CONDITIONS, IF U WANT TO MAKE THEM OBLIGATORY DYNAMICALLY THEN GIVE THE CONDITION ALSO
    EXAMPLE
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF a = 'X'.
          IF screen-group1 = 'GR2'.
            screen-input = 0.
                 ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
        IF c = 'X'.
          IF screen-group1 = 'GR1'.
            screen-input = 0.
         ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN.
    IF  d is initial.
    MESSAGE e009.
    ENDIF.
    start-of-selection.
    write b.
    2ND EXAMPLE:
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF a = 'X'.
          IF screen-group1 = 'GR2'.
            screen-input = 0.
                 ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
        IF c = 'X'.
          IF screen-group1 = 'GR1'.
            screen-input = 0.
         ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN.
    IF B = 5 AND d is initial.
    MESSAGE e009.
    ENDIF.
    start-of-selection.
    write b.
    I HAVE SENT U TWO EXAMPLES, IN THE SEOND EXMAPLE, IT WORKS FINE AS U HAVE GIVEN SOME OTHER CONDITION.
    IN THE FIRST EXAMPLE, AS IT WILL NOT WORK AS IAM CHECKING ONLY INITIAL CONDITION.
    FOR CHECKING ONLY INITIAL CONDITION, NO NEED TO WRITE IT AT SELECTION SCREEN , U CAN DIRECTLY DECLARE AS OBLIGATORY IN THE BEGINING IT SELF.
    JUST COPY AND PASTE MY TWO PROGRAMS AND FIND OUT THE DIFFERENCE IAM EXPLAINING
    Message was edited by: Hymavathi Oruganti

Maybe you are looking for

  • HOW CAN I CUSTOMIZE A CONTROL BUTTON

    Hi, I want to costumize a control button puting on it a picture or something like that, Do I need an especial toolkit or something else?

  • Ora-12514 - sqlnet.log states ora-12564

    Oracle 8.1.5 w/Patch level 02 applied I have come to the end of my rope. I have tried and tried to connect to my database using the following: sqlplus system/manager@mydbname and always get ora-12514. When I look at the sqlnet.log file I find: Tns er

  • EMF file opens as blank

    I am trying to open an emf file in Illustrator, but it just appears as a blank page.  I tried some emf files that I created a few years ago, and they open fine.  But the new ones that I made are not appearing.  What am I doing wrong? 

  • Installing 6.0.3 on a new iMac

    so, after years of never having the time to learn Adobe Premiere, i've instead decided to switch from PC to Mac. my intent is to make a documentary from DV footage (non-HD) that will be somewhat professional looking, with audio music and narration in

  • E71x software update

    I performed the software update on my E71x yesterday.  I am not sure what all it might have changed but I do know that I can't set defaults for my contacts now.  I don't know if there is something I can do to fix this.  When I try to choose defaults