At selection-screen on exit-command

hi to all  my querry is as  follows . pls tell what is the usse of
at selection-screen on exit-command  event where do we  use it . can u pls give some sample coding . points will be rewarded definitely .

Hi
We use<b> exit-command </b> in Module pool programs to come out of the Program, without entering data in the madatory fields  on screen.
We don't use exit commands for selection screens in Reports
So you are asking this exit command for selection screens
see the sample code for Module pools programs
PROCESS AFTER INPUT.
Forced Exit from the transaction
  MODULE exit AT EXIT-COMMAND.
*&      Module  exit  INPUT
Exit from the Transaction
MODULE exit INPUT.
  CASE okcode.
    WHEN 'EXIT' OR 'CANCEL'.
      CLEAR okcode.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " exit  INPUT
Reward points for useful Answers
Regards
Anji

Similar Messages

  • How to use 'at selection screen on exit command'

    Hi,
    How do I use the above event in the following scenario.
    Scenario: I have a report program which has two radio buttons on the selection screen to which user command is assigned. On selection one, some fields should get disappeared on the selection screen. But one of the fields is a mandatory field, which doesn't allow to proceed unless we enter some value in that(which is redundant since anyway it will be disappearing).
    I thought 'on exit command' event works, but the user command assigned to the radio button is not of type E.
    Issuing a message at selection screen instead of making the field mandatory will work, but I don't want to do that.
    Can anyone please tell me how to handle this?
    Incorrect answers will be suitably punished.
    Thanks,
    Sumanth
    Edited by: Julius Bussche on Sep 26, 2009 12:40 PM
    Silly comment suitably modified.

    do not make that field mandatory using obligatory. so now your radio button work is done.
    now, how to make the field look like and work like mandatory field on execution:
    at selection-screen output.
    loop at screen.
       if screen-name = 'P_MAN'. " lets say this is the field which you want to make mandatory.
          screen-required = 2. "this will just  put a tick mark on the input , looks like mandatory.
       endif.
    endloop.
    now, how to check the mandatory option.
    at selection-screen.
    if p_man is initial.
      display your message to fill this.
    endif.
    hope this helps...
    and as per forum rules, kindly do not encourage people by talking about forum rules.

  • 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 EXIT-COMMAND in ABAP OO

    Hi everyone!
    I need to execute some instructions when user exit from the program.
    Something like AT EXIT-COMMAND in PAI.
    But i dont have any PAI module or declared flow logic in my screen definition,
    becouse screen is calling automaticly by abap, i cant change anything there.
    Structure of my program is similiar to this: [http://help-abap.blogspot.com/2008/10/dispaly-alv-report-output-in-same.html|http://help-abap.blogspot.com/2008/10/dispaly-alv-report-output-in-same.html]
    How i should run some code when user leave the program?
    EDIT:
    ok, i got solved it
    i needed this one:
    AT SELECTION-SCREEN ON EXIT-COMMAND .
    PERFORM EXIT_PRG.
    Best regards,
    Przemek
    Edited by: hamsterman on Jul 26, 2010 11:15 AM

    Try the event:
    AT SELECTION-SCREEN ON EXIT-COMMAND .

  • What is AT Exit-Command in MPP

    Hi all
    What is AT Exit-Command in MPP...

    Hi rohini,
    The statement associated with at exit command is :
    MODULE <module_name> AT EXIT-COMMAND.
    Addition AT EXIT-COMMAND at the event PAI causes module <module_name> to be called exactly as if:
    a)The function used to trigger event PAI has function type "E"
    b )Into the input field of the standard toolbar, the user entered a character string starting with "E" and confirmed it using ENTER.
    The dialog module is called before the automatic input checks defined in the system or in the ABAP Dictionary and independent of its position in the event block. The only screen field transported to the ABAP program is the OK field. If the function that triggered the PAI event does not fulfill any of the above prerequisites, the MODULE statement is not executed.
    If several MODULE statements have the AT EXIT COMMAND addition, only the first one is executed. If no MODULE statement has the addition AT EXIT COMMAND, a normal PAI processing is executed: The predefined input checks are executed and then the PAI event block is processed sequentially. Provided the screen processing is not terminated in the dialog module mod, after the return from the dialog module, the complete PAI processing is executed. You must not use the addition AT EXIT COMMAND in connection with the statement FIELD.
    The function type of a function is determined in the Screen Painter or Menu Painter. Usually those functions of the user interface are defined with function type "E" that are assigned to the icons Back, Exit and Cancel in the standard toolbar of the GUI status. Therefore, the called dialog module should terminate the screen processing and allow security checks, if required.
    If you are talking about the on exit-command in report programming,
    then the statement associated with it is
    at selection-screen on exit-command.
    Effect
    This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.

  • Dynamic selection list based on selection screen values ?

    I have a requirement which I can't solve in one step in a selection screen
    first field I have to select the contract like you do with me33k
    in the second field I have to select the position of the contract filled in at the first field ?
    if the position is selected I have to fill other fields in the selection screen and block them for altering the information entered by the position selected
    anybody got some sample on how to do this ??
    kind regards
    arthur de smidt

    I really don't understand why it's not working. after input of the parameter field debugging doesn't start when is it evaluated ??
    I want the screen modified at every change of p_contr.
    SELECTION-SCREEN: BEGIN OF BLOCK s01 WITH FRAME TITLE text-s01.
    parameters:       p_bukrs like ekko-bukrs MEMORY ID BUK obligatory,
                      P_WERKS like EKPO-WERKS MEMORY ID WRK OBLIGATORY,
                      p_ekorg like ekko-ekorg MEMORY ID EKO obligatory,
                      P_EKGRP like EKKO-EKGRP MEMORY ID EKG OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK s01.
    SELECTION-SCREEN: BEGIN OF BLOCK s05 WITH FRAME TITLE text-s05.
    parameters:       p_contr AS CHECKBOX USER-COMMAND contr,
                      p_konnr like EKKO-ebeln  MATCHCODE OBJECT MEKK ,
                      P_KTPNR like EKPO-ktpnr.
    SELECTION-SCREEN: END OF BLOCK s05.
    SELECTION-SCREEN: BEGIN OF BLOCK s02 WITH FRAME TITLE text-s02.
    parameters:       p_lifnr like ekko-lifnr modif id CTR,
                      p_EVERK like EKKO-VERKF," obligatory,
                      p_afnam type zafnam,
                      p_uwkenm like EKPO-TXZ01,
                      P_IHRAN like EKKO-IHRAN DEFAULT SY-DATUM,
                      P_KDATB like EKKO-KDATB," obligatory,
                      P_KDATE like EKKO-KDATE," obligatory,
                      p_cntVU LIKE RP50G-PERNR OBLIGATORY
                                  MATCHCODE OBJECT PREM,
                      p_advies type lifnr.
    SELECTION-SCREEN: END OF BLOCK s02.
    SELECTION-SCREEN: BEGIN OF BLOCK s03 WITH FRAME TITLE text-s03.
    SELECTION-SCREEN  PUSHBUTTON /1(17) WERK USER-COMMAND WERK.
    parameters:       P_TXZ01 like EKPO-TXZ01 obligatory,
    *                 p_txt9  type tline,
                      P_MATKL like EKPO-MATKL DEFAULT 'DNST-02' OBLIGATORY.
    selection-screen begin of line.
    SELECTION-SCREEN COMMENT 1(31) TEXT-001 FOR FIELD p_menge.
    parameters:       P_MENGE like EKPO-MENGE DEFAULT '1' OBLIGATORY,
                      P_MEINS like EKPO-MEINS DEFAULT 'ST' OBLIGATORY.
    selection-screen end of line.
    selection-screen begin of line.
    SELECTION-SCREEN COMMENT 1(31) TEXT-002 FOR FIELD p_netpr.
    parameters:       P_NETPR like EKPO-NETPR obligatory,
                      P_EPEIN like EKPO-BPRME DEFAULT 'ST' OBLIGATORY.
    SELECTION-SCREEN POSITION 55.
    parameters:       p_schpr like ekpo-schpr.
    selection-screen end of line.
    parameters:       p_saknr like mepoaccounting-sakto obligatory,
                      p_aufnr like mepoaccounting-aufnr obligatory.
    SELECTION-SCREEN: END OF BLOCK s03.
    initialization.
      clear h_exit.
      set pf-status 'STANDAARD'.
      move 'Werkomschrijving' to WERK.
    at selection-screen on p_contr.
    loop at screen.
    if p_contr = 'X'.
          if screen-group1 = 'CTR'.
            screen-input = 0.
            screen-active = 0.
            screen-required = 0.
            modify screen.
          else.
            screen-input = 0.
            screen-active = 1.
            screen-required = 1.
            modify screen.
          endif.
    endif.
    endloop.
    at selection-screen on exit-command.
      case sy-ucomm.
        when '&F03' or '&F015' or '&F12'.
          leave program.
      endcase.
    at selection-screen on block S01.
      case sy-ucomm.
        when 'ONLI'.
          type_doc = 'B'.
        when 'ONLI1'.
          type_doc = 'O'.
      endcase.
    perform checks_org.
    at selection-screen on block S02.
      perform checks_lev.
    at selection-screen on block s03.
      check sy-ucomm(4) eq 'ONLI'.
      perform checks_werk.
    at selection-screen.
      case sy-ucomm.
        when 'WERK'.
          perform lange_omschrijving.
        when 'SPOS'.
          CALL FUNCTION 'RS_VARIANT_SAVE_FROM_SELSCREEN'
            EXPORTING
              CURR_REPORT = 'ZBESTELLING'.
      endcase.
    start-of-selection.

  • 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 find out the selection screen values

    Hi All,
    in BI we are having the maximum allowed cells as 500000 for a report.
    for some of the reports execution fetching the data morethan 500000 by different users.
    i could findout the report and user who has executed, But i wanted to findout for which selection user has executed.
    is it possible to find out...please help.
    Thanks,
    Krishna.

    Hi,,
    Yes it is possible.
    Open your query result in the design mode by going to BEx Analyzer->Design ToolBar
    Now take one text element and assign it to the variable which you have used for the selection screen.
    Take the same number of text element as there are in selection screen.
    Exit the design mode. In place of the text element you will find the value of the variables assigned to them.

  • Value from Program to Selection screen using pushbutton on Selection Screen

    Sir,
    I am creating a Selection screen for update some fields using selection screen. I have 6 fields on screen. First 3 Fields are mendaotry for fetching the data to dispay last 3 fields. I have create a push button for fetch the last 3 fields using first 3 fields.
    So Plz guide me how to do that. I have used At Selection Screen with user command. but result is zero.
    AT SELECTION-SCREEN.
      IF sscrfields-ucomm = 'FETCH'.
          IF AGSLNO-LOw is NOT INITIAL.
              SELECT SINGLE AGATE_ENTRY_NUM BTRANSPORTER_CODE  B~TRUCK_NO
                      INTO (V_GTENT_N, V_TR_CODE, V_TRUCK_NO)
                      FROM ZGATEOUT AS A
                INNER JOIN ZGATE_IN AS B ON AGATE_ENTRY_NUM = BGATE_ENTRY_NUM
                                     AND AWERKS = BWERKS
                                     AND ATRANSPORTER_CODE = BTRANSPORTER_CODE
                INNER JOIN ZTRPTR_REQ AS C ON AWERKS = CWERKS
                                     AND ATRANSPORTER_CODE = CTRANSPORTER_CODE
                WHERE C~AGSLNO = AGSLNO-LOW.
          ENDIF.
       ENDIF.
              S_GTENT_N-low = V_GTENT_N.
              S_TR_CODE-low = V_TR_CODE.
              S_TRUCK_NO-low = V_TRUCK_NO.
    Thanks.
    Ram

    Hi.,
    did you assigned user command to push button..!!
    put a break point at  IF sscrfields-ucomm = 'FETCH'. and check whether at selection screen event is triggered or not. and check the ucomm value . 
    check this help  for reference: http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm
    hope this helps u.,
    Thanks & regards,
    Kiran

  • Personalization and Default values in selection screen variables

    Hi everyone,
    I have certain questions regarding Front end part:-
    1)     Can we have multiple personalizations for a single user in Web templates; I know it is quite possible in BEx using Variants. Is there any such approach or any other solutions regarding it?
    2)     In our project we had a range selection screen customer exit variable on 0CALMONTH, which is showing a default value of 07.2007 to 09.2007, although we have removed the default values from the query variable and also checked the customer exits where it is used, but still it’s showing the value. We can’t delete and recreate the variable as such, as it is used in number of function module. Also these values are also transported to Quality system, where also it’s showing the same value.
    Did anyone face such a situation before?
    Eagerly waiting for a solution.....
    Thanks in advance

    Hi Chiran,
    Please try with following approach for multiple   personalizations for a single user in Web templates.
    While Defining Variable Choose the Option Copy personalization data from variable .
    The Features  of above approach is as follows.
    1)It will personalize variable values for Input Variables for each user.
    2)These values are saved for each variable as well as for user.
    3) At the time of defining variable it will allow us to enter one or more default values.All these values are appear in the variable screen when u execute the query or Web Application.
    So you can see the variable values in web also.Just try with this approach.
    May be it will resove u r issue some extent.
    Regarding u r Second Query Just try with Some tables, all the default values entries were saved in those tables. Delete default values from those entries.
    Thanks & Regards,
    Chandu.

  • EXIT-COMMAND in BADI

    Hi All,
    I am working with BADI ME_GUI_PO_CUST. I implemented a customer screen for customer fields. Everything is working fine but problem is that on some conditions some fields become required. Now i want to avoid this check " Fill in entry in required fields ". Actually i create a button with function code 'E' and fill data in these fields with some given value(e.g. from warranty master i want to populate all data in these fields so i create a button with exit-command for this purpose). But when i press this button, it gives me meassage  " Fill in entry in required fields ". bcoz some fields are already required. I want to avoid this mesaage & fill all fields according to warranty master. When i press this button, it did not go in this screen so EXIT-COMMAND does not execute & it still gives me message " Fill in entry in required fields ".
    Anybody have idea how to work with EXIT-COMMAND in BADI or customer-exit?

    Hi
    Exit command is used to come out of any kind of loop like:
    loop...endloop or
    Do...enddo... or
    While...endwhile.
    You can use them in BADI or userexit.
    Regards,
    Sankar

  • Display internal table as per value entered in selection screen

    hi experts,
       i need help on this issue. I have an internal table like this.
         f1  f2   f3  
         a   2    5
         b   3    4
         c   4    3
         d   5    2
         e   2    6
    totf2 =16  totf3= 20
    i am getting this sum displayed using AT END OF.
    Now there is a provision to enter a value for totf2, totf3 in selection screen. so based on this value entered for eg. if totf2 = 9 and totf3 = 13, is entered, then my internal table display shd b like:
    f1  f2  f3
    a   2  5
    b   3  4
    c   4  3
    totf2 = 9, tot f3= 12.
    someone plz help quick.
    thanks.

    Hi,
    Try this..
    DATA: v_totf2 TYPE I.
    DATA: v_totf3 TYPE I.
    * Create a internal table similar to your internal table.
    DATA: ITAB_FINAL LIKE TABLE OF itab.
    LOOP AT itab INTO wa.
    * Sum up the total for fields 2 and 3
      v_totf2 = v_totf2 + wa-f2.
      v_totf3 = v_totf3 + wa-f3.
    * If total exceeds for the field 2 and 3 than given in the selection screen.Then exit.
      IF v_totf2 >= p_totf2.     " p_totf2 - selection screen value
              OR
          v_totf3 >= p_totf3.    " p_totf3 - selection screen value
        EXIT.                         " Exit out of the loop.
      ENDIF.
    * Move the values to the final internal table.
      APPEND wa to ITAB_FINAL.
    ENDLOOP.
    * ITAB_FINAL will have the final values.
    Thanks
    Naren

  • Need selection screen values in Search help user exit in same report

    Hi Experts,
    I am using Logical Data Base PNP.
    Created a custom search help to validate the records for IT000 based on the selection screen dates.
    Enter the DATEs for Data Selection Period and Person selection period in the selection screen.
    When I for search help for PERNR field in the same report, I need the selectin screen DATE values to be in user-exit of search help.
    This will help me in validating the records for specific employees within the date range of given DATE in selectin period.
    As of now it's picking the employees based on the DATE selection of selection screen,
    Regards,
    Prasad

    Hi,
    Go Ahead as mentioned by Satyesh T - (Option two).
    Reading Select Options from DYNP_VALUES_READ
    reffer the above link for getting more clarity for using  'DYNP_VALUES_READ'
    Regards.
    Arun

  • How to run the variable exit without calling the variable selection screen?

    Hi all
    I have a query with 2 variables 0P_PRQUA (Previous Calendar Quarter (SAP Exit)) and ZCCDAT02.
    ZCCDAT02 is a Key Date variable that is derived based on the last day of the quarter that is entered in 0P_PRQUA. The exit code works correctly when calling up the variable screen and ZCCDAT02 is derived properly.
    The problem is that 0P_PRQUA is set to "Can be changed in query navigation". So if the user changes the value of the quarter the exit is not triggered and the value of ZCCDAT02 does not change.
    Is it possible to trigger the exit or is there another way to do it? Ideas would be appreciated. I am trying to create a Web Template with a Dropbox box for the Quarter.
    Query is written in BW 3.X.
    Regards
    Chami

    Hi guys
    Just to restate the requirement. I want the user to be able to change the value of the variable, WITHOUT calling the variable selection screen.
    I want the user to be able to change the value of the quarter by using a dropdown box from within the web template. Once that is selected I want the value of ZCCDAT02 to be derived from the new value of the quarter.
    Regards
    Chami

  • User exit or Badi to add custom fields in selection screen of tcode CATS_AP

    Hi Guys,
    I want to add a custom field to the selection screen of report RCATS_APPROVE_ACTIVITIES (tcode CATS_APPR_LITE).
    I also want to display filtered by this custom fields.  Please let me know the user-exit (prefebly) or BADI.
    I will appreciate if somebody can share the steps.
    Thanks,

    Hi,
    Yes there is, the BADI name is CATS_REPORTING.
    It can be views in transaction SE17.
    thanks.
    JB

Maybe you are looking for

  • Creating a document script for Clock in Acrobat Professional.

    Hi, I am trying to add a field on my PDF form which shows a continuous clock. I do not know how to add code to a document script in Acrobat Professional. "Advaned/ Javascript/ Set Document Actions" is greyed out. Thanks in advance, Damo.

  • How to start with bootable backup

    My iMac power button has "ceased function". but I have a bootable backup on one external drive, and also an additional Time Machine drive. Any suggestions on how to use a loaner iMac while this one is being repaired? i.e. - How do I start up with the

  • Printing in Snow Leopard

    Although Snow Leopard automatically finds drivers for existing printers, the Gutenprint drivers deliver very slow and poor performance. By downloading the latest printer drivers (for HP printers which I use) from HP which ran in Leopard (os 10.5) I w

  • Re: ABAP query

    Hi, I have reqiurement like as need to download and upload ifno sets,queries from one system to another system. I can achieve this by using sap transport tool 'RSAQR3TR' . I tried using RSAQR3TR with download and upload not with export and import. Af

  • Flash player won't update on my macbook?

    I've tried about two dozen times to get flash player to update on my macbook 10.5.8 and it still won't work. The installation always goes fine, and says it was successful at the end, yet never actually works (yes, i've tried restarting my computer af