Selection-screen messaging

hi friends i have a problem in selection-screens
  SELECT-OPTIONS so_cuno FOR kna1-kunnr.
  PARAMETERS p_cuna LIKE kna1-name1.
SELECTION-SCREEN PUSHBUTTON /10(20) text-003 USER-COMMAND disp.
SELECTION-SCREEN PUSHBUTTON 40(20) text-004 USER-COMMAND rese.
SELECTION-SCREEN PUSHBUTTON 70(20) text-005 USER-COMMAND exit.
  here we want an error message when so_cuno is empty only when i press f8 and it needs to be show the selection-screen to be redisplayed instead of going to the list.
   here after pressing enter or after pressing exit button, or after reset we don't want the error message
   thanku friends bye

Hi Shiva,
My suggestion would be to have the following code.
tables sscrfields.
at selection-screen.
  if ( so_cuno is initial ) and
     ( sscrfields-ucomm eq 'ONLI' ).
    message ....
  endif.
I reiterate again the recommendation of using SSCRFIELDS-UCOMM instead of SY-UCOMM. Please refer to the other posts on this topic in this forum for more explanation.
Regards,
Anand Mandalika.

Similar Messages

  • Custom error messages in selection-screen

    Hello All,
    I have one query. I have developed a vendor aging report. In the SELECT-OPTIONS, there are 5 fields namely company code, business area, vendor group, vendor code and cash management group. What the user wants is if he enters any invalid value in any of the 5 fields, custom error message should be displayed like 'invalid company code' etc. I think we have to write these messages in 'at-selection-screen' event. Can u help me out with a sample code snippet w.r.t the above program? I have written the code as:
    AT SELECTION-SCREEN.
      IF S_BUKRS ne BSIK-BUKRS.
      MESSAGE e000. 'invalid company code' TYPE 'E'.
      ENDIF.
    But not giving the correct output.i.e. even if I enter a valid company code, the error message is displayed. Can u help me in solving this problem?
    Thanks and Regards,
    Satvik
    Edited by: Satvikpanchal on Jul 22, 2011 9:42 AM

    Hi,
      use AT SELECTION-SCREEN on S_BUKRS-low.
    Use select query for checking the Company code in T001 table check the
    Company code already exist or not? If it is not there show the message.
    Code like
    AT SELECTION-SCREEN on S_BUKRS-low.
    select single bukrs into lv_bukrs
          from T001 where bukrs = s_bukrs-low.
    if sy-subrc NE 0.
    MESSAGE e000. 'invalid company code' TYPE 'E'.
    ENDIF.
    i think you company code is select option so you have to check S_BUKRS-high also.
    using the event AT SELECTION-SCREEN on S_BUKRS-high.
    Regards,
    DHina..

  • How to display a message in Selection Screen

    Hi,
    I am inserting values into a system defined table by using a report.
    For this i have created one selection screen by using all the table fields and i am inserting the values which user has given in selection screen by using Insert statement.
    Now i want a message in status bar of selection screen when Insert command is success.
    Please give me some help on this
    Thanks
    Venkatrami Reddy B

    Hii
    This is the Way...
    AT SELECTION-SCREEN.
      <<FOR VALIDATIONS>>
    <b>START-OF-SELECTION.</b>
    INSERT <<statement>>.
    IF SY-SUBRC EQ 0.
    <b>MESSAGE 'Record inserted'  type 'S'.
    LEAVE LIST-PROCESSING.  "Now the message appears in Selection screen
    </b>
    ENDIF.
    <b>REWARD IF HELPFUL.</b>

  • How to add customize message on the variable selection screen in the query

    Hi all,
    Can we add an customise message on the variable selection screen in the query? If yes please let me know how it can be achevied?
    Thanks,
    Rani

    Hi Rani,
    I faced a similar issue (for what I understand your request is).
    My requirement for the Variable Screen was to do:
       1) place a link to a ppt file
       2) remove buttons "Save", "Save As...), "Delete"... the standard buttons come when running the Query or WebTempl
    We were using a Web Templ for BI7.0
    I struggled trying to find out how to do it. My conclusions are:
    - WAD, not sure we can accomplish it using a Web Template but i did not "play" a lot with the Web_Template Properties in order to know
    - XHTML, I was told in my post HTML modification was the way, but I have close to nil background in HTML and couold not find the way of accessing the Variable Entry screen
    For instance, I had to remove similar buttons and change some font size from a link on the Web Template (WAD), which was pretty straight forward. In WAD the buttons come with its own icon and to increase the Font size for that link we used XHTML (<font size="2" >). But the heck of the variable screen...well, i just did not get trhough to it to modify it in any way.
    Good luck,
    Definetly in a Query I would say that no.
    alex
    PS: If anyone had a better insight, please feel free to share it.

  • Error Message in selection screen Status bar is getting truncated

    Hi Guys,
    Error Message in selection screen Staus bar is getting truncated (full message is not getting displayed).... can anybody tell me how to reslove this

    Hi
    Maimum we can give the error message length is 50 char. If you give more than that it will get truncated.
    What you can do this split 50 and 50 like that you can give 200 chnars.
    Data : Text1 type char50
              Text2 type char50
    If sy-surc ne 0.
    Message Text1 Text2  TYPE "E'' or 'S'
    endif.

  • Displaying error message while entering selection screen fields

    Moderator message: don't offer points
    hi experts...
    i generated a report.
    in that report, the selection screen fields are plant and material type..
    now my rqmt  is like this :
    if user enters any plant except '8210' in  the selection screen, then a pop up should appear like.. enter 8210 plant only, and the cursor should remain in the same screen allowing user to enter correct plant.
    and then same with the case of material type also..user should enter 'mcfe' material type only..
    im using message classes like this:
    if so_bwkey-low ne '8210' or so_bwkey-high ne '8210'.
      message i000(zts).
      endif.
    if so_mtart-low is not initial and so_mtart-high is not initial and so_mtart-low ne 'mcfe'
       or so_mtart-high ne 'mcfe'.
      message i001(zts).
      endif.
    with this logic, when i enter plant..it is prompting
    1) enter plant 8210 only..
    and then when i press enter key it is again prompting
    2)enter material type mcfe only..
    but iam not entering material type here..
    i want to get 2nd error message if and only if i enter material type..
    help me regarding this issue..
    <<text removed>>
    thanks in advance,
    harini.
    Edited by: Matt on Feb 9, 2009 10:14 AM

    Hi,
    Use Error type message in SELECTION SCREEN EVENT.It will place the cursor in the relevant Field.
    At SELECTION-SCREEN ON SO_BWKEY-Low.
    if so_bwkey-low ne '8210' .
    message E000(zts).
    endif.
    At SELECTION-SCREEN ON SO_BWKEY-HIGH.
    if  so_bwkey-high ne '8210'.
    message E000(zts).
    endif.
    At SELECTION-SCREEN ON so_mtart-LOW.
    if so_mtart-low is not initial and  so_mtart-low ne 'mcfe' .
    message E001(zts).
    endif.
    At SELECTION-SCREEN ON so_mtart-HIGH.
    if so_mtart-high is not initial 
    and so_mtart-high ne 'mcfe'.
    message E001(zts).
    endif.
    This will resolve the issue..
    Regards,
    Gurpreet

  • Error message disble the Fields in Selection Screen

    Hi,
    In my Report i am validating some fields as mandatory.
    If the field is initial then one Error message should be display in the screen and user has to modify the selection screen.
    But after displaying the errro message my selection screen is input disable except the mandatory field.
    I want all the fields should be input enable.
    Sample code for Error message,
    MESSAGE E018 WITH 'Enter Plant'.
    Please provide the code for this.

    Performing checks on SELECTION-SCREEN
    - if the check uses only one independent field (e.g.: value exist in a table) use a[ AT SELECTION-SCREEN ON <field>|http://help.sap.com/abapdocu/en/ABAPAT_SELECTION-SCREEN_EVENTS.htm#!ABAP_ALTERNATIVE_2@2@], the field will be editable when error is raised
    - if the check uses some fields, group them using [SELECTION-SCREEN BEGIN OF BLOCK <block>/END OF BLOCK <block>|http://help.sap.com/abapdocu/en/ABAPSELECTION-SCREEN_BLOCK.htm] and then [AT SELECTION-SCREEN ON BLOCK  <block>|http://help.sap.com/abapdocu/en/ABAPAT_SELECTION-SCREEN_EVENTS.htm#!ABAP_ALTERNATIVE_4@4@], each field of the block will be editable when error is raised
    So, if you really want that each and every field be editable when an error is raised, declare every parameter and select-options in a big block, and perform the check in a unique AT SELECTION-SCREEN ON BLOCK xxx.
    Use Error message, Warning and Information don't break the flow of the report.
    Regards,
    Raymond

  • Hi Experts, a question about messages in selection screen? thank you!

    Hi Experts,
    I have a selection screen and two parameters on it, I need to check if the entries exist if the fields is filled in, if it doesn't exist I need to issue a warning message, but if the two parameters are both filled in and the related entries both don't exist, how can I handle this situation? what I mean is that I want to display the two warnings at the same time(like below), now I only can display one warning, can anyone help me on this? thank you much!
    You are not authorised for this purchasing organisation
    Plant: invalid entry
    Purchasing organisation: invalid entry
    No valid record selected
    Kind regards
    Dawson

    Hi Dawson
    As far as i get from your disciption of the problem, i get that: -
    (a) You want to check that both the fields are filled or not
    (b) If they are filled, then you want to check if in database there exists any record pertaining to them.
    Correct me if i am wrong.
    If this is correct, then you will have to make use of nested if condtions to diaplay the warnings.
    Like as follows: -
    If pa1 IS INITIAL and pa2 IS INITIAL.
      <your warning message>.
    ELSEIF pa1 IS INITIAL and pa2 IS NOT INITIAL.
      <your warning message>.
    ELSEIF pa1 IS NOT INITIAL and pa2 IS INITIAL.
      <your warning message>.  
    ELSEIF pa1 IS NOT INITIAL and pa2 IS NOT INITIAL.
      <try matching it with the database records>.
      <your warning message>.
    ENDIF.
    As far as i know, the 2 warning messages cannot be issued as they appear in the status bar of the current screen. SO you will have to put them in if condition only and display the approriate warning .
    Hope this solves your problem.
    Regards
    Gaurav.

  • Error message in Selection Screen

    Hi
    reference no (p_ref) is in my selection screen.
    If this field contains special characters (\ / : * ? " |, ) system must prompt  error message in selection screen. How to do this. Pls help me
    Regards
    Anbu

    after input form the user
    use if condtion
    and validate the field and through message.........
    Reward IF........
    Regards
    Anbu
    Edited by: Anbu B on Jun 17, 2008 8:04 AM
    Edited by: Anbu B on Jun 17, 2008 8:06 AM

  • At selection-screen problem: triggering an error message...

    Hello experts,
    I have 3 radiobuttons and 1 parameter in my selection screen. it works in such a way that whenever the user clicks on the 3rd radiobutton the parameter will be inputtable. Now, what I want to do is that whenever the 3rd radiobutton is clicked and the user forgot to put a value in the paramater an error message will be triggered saying 'please put a value'.
    Now, creating a code for that is easy but here is the problem: whenever I click on any of the radiobuttons the message triggers. Anyway, below is my code:
    SELECTION-SCREEN BEGIN OF BLOCK box1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pr_upld RADIOBUTTON GROUP grp MODIF ID id3
                                              USER-COMMAND ucomm.
    SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme MODIF ID id3.
    PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:\' MODIF ID id3.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(22) text-002 FOR FIELD p_dcode MODIF ID id1.
    PARAMETERS: p_dcode LIKE vbak-kunnr MODIF ID id1,
                p_name1 LIKE kna1-name1 MODIF ID id1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pr_list RADIOBUTTON GROUP grp MODIF ID id4.
    SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list MODIF ID id4.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pr_add  RADIOBUTTON GROUP grp MODIF ID id2.
    SELECTION-SCREEN COMMENT 2(3) text-005 FOR FIELD pr_add MODIF ID id2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pr_edit RADIOBUTTON GROUP grp MODIF ID id5.
    SELECTION-SCREEN COMMENT 2(4) text-006 FOR FIELD pr_edit MODIF ID id5.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 03(20) text-a12 FOR FIELD p_code MODIF ID id2.
    *PARAMETERS: p_kunnr LIKE zts0001-kunnr.
    PARAMETERS: p_code LIKE zts0001-cdseq MODIF ID id6.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK box1.
    AT SELECTION-SCREEN OUTPUT.
    IF v_compflag EQ space.
        LOOP AT SCREEN.
          IF screen-group1      = 'ID1'.
            screen-input        = '0'.
            screen-output       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID2'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID3'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID4'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID5'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID6'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF v_compflag NE space.
        LOOP AT SCREEN.
          IF screen-group1      = 'ID1'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID2'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID3'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID4'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID5'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID6'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *for users that are not controllers
      LOOP AT SCREEN.
        IF screen-name   = 'P_CODE'.
          screen-input   =  '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
      IF pr_list = 'X' OR
         pr_add  = 'X'  OR
         pr_upld = 'X'.
        LOOP AT SCREEN.
          IF screen-group1   =  'ID6'.
            screen-input     =  '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSEIF pr_edit  =  'X'.
        LOOP AT SCREEN.
          IF screen-group1   =  'ID6'.
            screen-input     =  '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    *for controllers
      IF pr_upld = 'X'.
        LOOP AT SCREEN.
          IF screen-name      = 'P_FLNME'.
            screen-input     = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSEIF pr_list = 'X'.
        LOOP AT SCREEN.
          IF screen-name      = 'P_FLNME'.
            screen-input     = '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    AT SELECTION-SCREEN.
      IF pr_edit = 'X' AND p_code IS INITIAL.
        MESSAGE e008 WITH 'Please specify Code.'.
      ENDIF.
    Again, thank you guys and have a nice day!

    Hi viraylab,
    1. Such validations can be handled in the event
       START-OF-SELECTION.
    2. We should them and other such validations,
       using this logic
    START-OF-SELECTION.
    IF ERRORCONDIDTION.
    <b>MESSAGE 'PLEASE ENTER ' TYPE 'S'
    LEAVE LIST-PROCESSING.</b>
    ENDIF.
      WRITE :/ 'ABC'.
    3.
    The most important statements are
    A) message should be of type I, or S, or W
       (and not error E)
    b) LEAVE LIST-PROCESSING
      (it discontinues the further list showing,
       and again, re-displays, the selection screen)
    regards,
    amit m.

  • "Get Variants" button disabled after error message in AT SELECTION SCREEN

    Hi,
    In "AT SELECTION SCREEN" I throw an error message if certain criteria return no data. 
    After the error message is thrown, the button for choosing variants no longer appears to work.  I click it and the variant selection box doesn't come up.  It just changes the values that have been populated from red to black. 
    What is the code that remedies this?  If an error is thrown, it should allow you to select a variant still. 
    Thanks,
    Kevin

    "AT SELECTION SCREEN" is not an option here.  Let me clarify.
    In START-OF-SELECTION, I call another program with a SUBMIT statement.  That program uses a logical database.  So it makes no sense to move this to "AT SELECTION SCREEN".  Even when I did that, I still couldn't solve this problem. 
    If the SUBMIT statement returns no data (if sy-subrc = '4') then I need to go back to the initial screen.  I need to display some kind of message, of type I or E or S, I don't care. 
    It just needs to go back to the selection screen and VARIANTS need to WORK, and you need to be able to SAVE the variants.
    For some reason, if I get no data with the SUBMIT statement, I can display a message and get back to the selection screen but variants do not work.  I've tried EXIT, STOP, CALL SELECTION SCREEN 1000 (the only one in the program), END LIST-PROCESSING, etc.  NOTHING WORKS!

  • Error message for ranges in selection screen

    Hi
    i have this select option statement
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    i have written this code for error message display...
    AT SELECTION-SCREEN ON S_FEVOR.
    I_FEVOR-SIGN = 'I'.
    I_FEVOR-OPTION = 'EQ'.
    I_FEVOR-LOW = S_FEVOR.
    I_FEVOR-HIGH = S_FEVOR.
    IF not I_FEVOR-LOW EQ s_FEVOR .
    SELECT  FEVOR
         FROM AFKO
           INTO S_FEVOR
             WHERE FEVOR = S_FEVOR.
                UP TO 1 ROWS.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    MESSAGE E000.
    ENDIF.
    ENDIF.
    if i enter the correct data then also it is giving error message
    how to solve this?
    Regards
    Smitha

    Hi,
    Refer this code:-
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    DATA : BEGIN OF t_fevor OCCURS 0,
             fevor TYPE afko-fevor,
           END OF t_fevor.
    AT SELECTION-SCREEN FOR s_fevor.
      s_fevor-sign = 'I'.
      s_fevor-option = 'EQ'.
      s_fevor-low = S_FEVOR.
      s_fevor-high = S_FEVOR.
      APPEND s_fevor.
      CLEAR s_fevor.
      IF NOT s_fevor-low IN s_fevor.
        SELECT fevor
              FROM afko
              INTO TABLE t_fevor
              WHERE fevor IN s_fevor.
        IF sy-subrc NE 0.
          MESSAGE e000.
        ENDIF.
      ENDIF
    Hope this helps you.
    Regards,
    Tarun

  • Adding a message to the variable selection screen

    Hi there
    I have been asked to find a way to add a message to the variable selection screen.
    It appears that DIVISION needs to be added to the selection screen, as this makes the query run faster. However, they don't actually want the user to enter a division, as this causes other problems.
    So, ideally, I would be able to add a message to the variable selection screen that advises users against entering a value for division.
    I don't know how to do this.
    I create the web template, and I can therefore add messages or anything you like to the template, but I don't believe I have any control over the variable selection screen.
    Does anyone know if this is possible?
    We are running a 2004s system if that helps.
    Cheers,
    Andrew

    Hello,
    Well i think if you make the variable used for division not ready for input it would not be available for the users to input anything.
    you can find the checkbox for this in the properties of the variable in query designer.
    Hope this matches your requirement.
    Regds,
    Shashank

  • At selection-screen. - message - go back to the field on selection-screen

    At selection-screen.
    If the user enter the wrong profitcenter .
    just  I  need to issue a  message saying the user to "enter the correct profit center "
    and cursor should go back to the profit center field on the selection screen.
    How to code this ?

    Hello Sam
    Here a more detail code sample:
    *& Report  ZUS_SDN_RETURN_TO_SELSCREEN
    REPORT  zus_sdn_return_to_selscreen.
    PARAMETERS:
      p_bukrs    TYPE bukrs  DEFAULT '1000'.
    SELECTION-SCREEN BEGIN OF BLOCK profit WITH FRAME TITLE text-bl1.
    *                                  text-bl1 = 'Profit Center Selection'
    PARAMETERS:
      p_prctr    TYPE prctr  OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK profit.
    AT SELECTION-SCREEN ON BLOCK profit.
      IF ( p_prctr BETWEEN '0000001000'  AND '0000002000' ).
      ELSE.
    *   IF condition only used to trigger either error message
        IF ( p_prctr BETWEEN '0000002001' AND '0000003000' ).
          MESSAGE 'Invalid profit center' TYPE 'E'.
        ELSE.
    *     or
          MESSAGE e398(00) WITH 'Profit Center' p_prctr 'invalid' .
        ENDIF.
      ENDIF.
    START-OF-SELECTION.
    * do something...
    END-OF-SELECTION.
    Regards
      Uwe

  • Selection screen error message

    Dear friends:
    I have a report.In the selection screen,In the sales group field , I should enter only C01 , If i give C02 or other input, the system should show a error message. Please help me with sample & simple code, because i am a functional consultant.
    Thanks&Regards
    MSReddy

    hi,
    u have to write all your validations at AT SELECTION-SCREEN event.
    u can valdate a single field or no.of. fileds based on your requirement.
    parameters: p_group like [salesgroup name].
    AT selection-screen. [ for no of fields]
    if p_group NE 'C01'.
         message E000 with 'NTER ONLY C01 materials'.
    endif.
    for single field in selection screen then
    AT selection-screen on fldname. [ for single field]
    if p_group NE 'C01'.
         message E000 with 'NTER ONLY C01 materials'.
    endif.
    if helpful reward soem points.
    with regards,
    suersh.

Maybe you are looking for

  • Syncing contacts of my BB Torch 9800 to BB Curve 8520

    Hi, I recently got a BB Curve from the company I work for. I also own a BB Torch 9800 (my personal phone) which I use to use for official purpose. Now, I need help in transferring all my contacts to my BB Curve. Request guidance. Thanks.

  • Flash Chart with Asynchronous Update

    Hello all, I'm trying to use the Asynchronous Update option of the chart's, but in different version of APEX it doens't work. In my local DB I have APEX v. 4.0.1.00.03 and it works fine, loads the graphic and keep updating, but in the server the grap

  • Can't open images in Photoshop

    I was away from home for two months and my Mac book was turned off. Since I returned recently and booted it up, I have been unable to open any images (be they tiff, jpeg, gif) in Photoshop and only receive the "not responding" message. Any ideas?

  • Plz help? how to make exe of java prg.

    how can i make exe file of .class files. so that it may run automatically. Do i need jdk at the system at which it running ?

  • Sourcing in Classic/Extended Classic

    Hi Gurus, Can any one guide me through the difference in sourcing in Extended classic and classic scenarios. I am concern about the process while converting the SC in to PO. What is the difference in that Process. IS