Clearing of selections screen

Hi!
I wanted to asked how to clear a first screen of selections screen ( contains Parameters ans select options )  from another scrren ?
I created an ALV report. The first screen of the report is a selections screen that contains select options and Parameters. The Alv was created by Object oriented method (not by the function 'reuse_alv_*' ) in
a second screen. I want from the second screen on certain circumstances to leave the alv screen and to set the first screen ( that contains select options and Parameters ), however when i call the first screen i want to clear all select options and parameters, and my question is how to clear all select options and parameters before i leave to the first screen ?
thanks
moshe

Hi Moshe
Just I said in my answer you can't do a CLEAR statament in that point of your code, because the system manages the return of old data in selection screen.
The system do what importing old data from ABAP MEMORY in the event INITIALIZATION, so or you clear the ABAP MEMORY or you clear the selection-screen in the event AT SELECTION-SCREEN OUTPUT.
You can try this:
IF g_it_d_data[] IS INITIAL.
CALL FUNCTION 'POPUP_FOR_INTERACTION'
EXPORTING
headline = text-011 " 'Information'
text1 = text-010
ticon = 'I' " 'No data was found for
" the selection criteria.'
button_1 = 'OK'.
here i need to clear parameters and selects option
before leaving to screen 0
FREE MEMORY.
LEAVE TO SCREEN 0.
ENDIF.
or you place FREE MEMORY statament in INITIALIZATION.
INITIALIZATION.
FREE MEMORY.
You can try to use CLEAR and REFRESH statament in AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
Only first time
CHECK FL_FIRST = SPACE.
FL_FIRST = 'X'.
REFRESH <SELECT-OPTION>.
CLEAR <PARAMETERS>.
Max

Similar Messages

  • How to clear all selection screen parameters before calling transaction?

    Hi Experts
       I have a ABAP report that displays data using ALV.
      When I double click a cell it calls transaction MB51. Before calling the transaction I need to set some parameters of the selection screen  of the transaction.
      My code is like below:
      <UL>
       <LI>FREE MEMORY ID 'MAT'. <I>"material</I>
       <LI> FREE MEMORY ID 'WRK'. <I>"plant</I>
       <LI> FREE MEMORY ID 'CHA'. <I>"batch</I>
       <LI><I>* Get the selected ALV row data</I>
       <LI>READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
       <LI><I>*   If link MB51 is clicked then open tcode MB51</I>
       <LI> IF p_selfield-sel_tab_field+8(4) = 'MB51'.
       <LI><I>*   Pass material, plant to the corresponding tcode</I>
       <LI>       SET PARAMETER ID 'MAT' FIELD x_recon-matnr.
       <LI>       SET PARAMETER ID 'WRK' FIELD p_plant.
        <LI>      CALL TRANSACTION 'MB51' AND SKIP FIRST SCREEN.
    </UL>
    The problem is:
    <UL> <LI> 1. First, I run the given transaction before running the report in a separate session with some set of values in the selection screen. For example: plant = AB01, Material = 990001 and Batch = 10001.</LI>
    </UL>
    <UL>
            <LI> 2. Then in another session I run my report. In the report ALV I have selected a record where plant = AB01, Material = 990001 but Batch is blank. But it opens the transaction with plant = AB01, Material = 990001 and Batch = 10001.
    Even though in my ALV record the batch is blank yet it uses the batch value from the memory. That is, the batch value that was given in the transaction earlier. Why it is not getting cleared? I have also used FREE MEMORY ID code in the beginning. But still it is not clearing the values in the memory.
    </UL>
    <UL>
            <LI>What shall I do to clear all the selection screen parameters before calling the transaction?</LI>
    </UL>
    <UL>
            <LI>
    Thanks
    Gopal
    </LI>
    </UL>
    Edited by: gopalkrishna baliga on Aug 11, 2010 10:29 AM

    Its because sap memory is globally shared.
    Do it like this.
    READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
    IF p_selfield-sel_tab_field+8(4) = 'MB51'.
    perform bdc_dynpro      using 'RM07DOCS' '1000'.
    perform bdc_field       using 'BDC_OKCODE'   '=ONLI'.
    perform bdc_field       using 'MATNR-LOW'  x_recon-matnr.
    perform bdc_field       using 'WERKS-LOW'  p_plant.
    perform bdc_field       using 'CHARG-LOW'  p_batch.
    perform bdc_field       using 'DATABASE'  'X'.
    call transaction 'MB51' with i_bdcdata mode 'E'.
    endif.
    form bdc_dynpro using program dynpro.
      clear la_bdcdata.
      la_bdcdata-program  = program.
      la_bdcdata-dynpro   = dynpro.
      la_bdcdata-dynbegin = 'X'.
      append la_bdcdata to i_bdcdata.
    endform.
    form bdc_field using fnam fval.
        clear la_bdcdata.
        la_bdcdata-fnam = fnam.
        la_bdcdata-fval = fval.
        append la_bdcdata to i_bdcdata.
    endform.

  • Clear the selection screen

    In a report, after executing the program,  when the back button is pressed, the selction secren should not contain the previous value.
    Satis

    Hi Sathish,
    1. we have to apply some little logic to do this.
    2. we to use the following concepts :
       export .. to memory id
       imprt .. from memory id
      start-of-selection.
      at selection-screen output.
    3. Just copy paste this in new program.
      (it will CLEAR the fields, after execution
       and pressing BACK button)
    4.
    REPORT  ZAM_TEMP00                              .
    parameters : a(10) type c default 'Hi'.
    parameters : b(10) type c default 'Friend'.
    data : flag type c.
    IMPORTANT
    start-of-selection.
      flag = 'X'.
      export flag to memory id 'FLAG'.
      write :/ 'hello'.
    IMPORTANT.
    at selection-screen output.
      import flag from memory id 'FLAG'.
      if flag = 'X'.
        flag = ''.
        a = ''.
        b = ''.
      endif.
      flag = ''.
      export flag to memory id 'FLAG'.
    regards,
    amit m.

  • Clear the selection screen cached values

    Hello BW gurus,
    Is there a way to clear the contents of the selection screen(cached variable values) whenever it is refreshed?
    Thanks,
    madhuri

    Hi Madhuri,
    Please check this link if any use let me know
    http://help.sap.com/saphelp_crm50/helpdata/en/6e/798e07b33b11d5993800508b6b8b11/frameset.htm
    thanks
    Ranganath

  • How to clear parameters defined in selection screen on back button

    Hi,
    I have a report with parameters, few being input fields, and check boxes. After report is executed when user selects the back button, the selection screen is displayed again but with the old selection values. I want to clear them.
    So in the Initialization even I added the code to clear all these parameters;
    CLEAR: p_aaa, p_bbb, p_ccc.
    I debugged and control passes through this code but still the fields are not cleared and they retain the old input values.
    How to clear them ?
    thnks

    >
    Rob Burbank wrote:
    > Yes he did. My mistake.
    >
    > But isn't this what he wants? To clear the Selection screen so that something has to be entered?
    >
    > Rob
    IMO, he only wants to clear the selection screen parameters on the click of 'BACK' button
    in the list screen. If the OP clears the selection screen variables in AT SELECTION-SCREEN OUTPUT
    even, the values assinged to the selection parameters in the INITIALIZATION and with the DEFAULT addition of the PARAMETERS and SELECTION-OPTIONS statements will also be overwritten even when the report is executed for the
    first time.
    -Rajesh.

  • Clear download path in the selection screen

    Hi All,
    Im facing the problem in the selection screen.
    User wants to clear the selection screen download path when they are changing the radio button one to another another radio button. this is as below
    PARAMETERS::pa_werks like ekpo-wekrs,
                             pa_path like string.
    PARAMETERS:rb1 RADIOBUTTON GROUP g01 USER-COMMAND radio,
                  rb2 RADIOBUTTON GROUP g01,
                  rb3 RADIOBUTTON GROUP g01.
    ex:first default is rb1 radio button,so they will select the download path based on F4 help. then they will choose rb2,now the download path has to clear. cause they want choose F4 according to second radio button RB2.
    Thank you very much.
    Anu.

    Hi Anitha,
    Please try this code.
    PARAMETERS: P_FNAME LIKE RLGRAP-FILENAME.
    PARAMETERS:RB1 RADIOBUTTON GROUP G01 USER-COMMAND RADIO,
    RB2 RADIOBUTTON GROUP G01,
    RB3 RADIOBUTTON GROUP G01.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF RB1 = 'X'.
          CLEAR P_FNAME.
        ELSEIF RB2 = 'X'.
          CLEAR P_FNAME.
        ELSEIF RB3 = 'X'.
          CLEAR P_FNAME.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SY-REPID
          DYNPRO_NUMBER = SY-DYNNR
          FIELD_NAME    = 'PATH'
        IMPORTING
          FILE_NAME     = P_FNAME.

  • Reset selection screen parameters.

    Hi,
    I enter values in parameters on screen and generte output(add values to table/view report).  After I return to originial screen, the fields should be reset to initial empty status.
    How do I do that.
    Thanks
    Praveen

    Hi,
    U Clear the Selection Screen Parameters in At Selection Screen event, before clearing the value pass the Parameter value to some global variable for further use.
    eg:
    PARAMETERS : p_matnr TYPE matnr.
    DATA : gv_matnr TYPE matnr.
    AT SELECTION-SCREEN.
      gv_matnr = p_matnr.          "Passing the P_matnr value to global variable gv_matnr
          CLEAR : p_matnr.
    START-OF-SELECTION.
      WRITE : gv_matnr.
    Hope it helps!!
    Rgds,
    Pavan

  • Clearing Select-Options in selection screen

    Hello,
    im having trouble clearing the select options in a selection screen.
    i dont really know why, but if i run the program, and add REFRESH TABLE_RANGE[] (which was declared as a select-options) , it does clear the table in the debug, but shows it again on the screen.
    i've tried CLEAR too, but it didnt really help.
    is there a know solution?
    thanks.

    Hi,
    There are two things associated with select-option one is header and other table
    Try
    CLEAR: TABLE_RANGE[] .
    CLEAR TABLE_RANGE.
    And are you sure your select-option name is TABLE_RANGE as I think only 8 character are allowed to name the selection screen field.
    Regards,
    Atish

  • Selection screen / how to clear values in screen parameters parameters

    Hello ,
    I am developing report . It is simple one with standard screen 1000  ( Not Dynpro ).
    On the screen I have several parameters and select options . When I run program , display list
    and press the "Back" Button from tool bar  ,entered values still remain in screen parameters.
    I  code I did 'clear' of parameters  , so after pressing "back" button and before selection screen
    is displayed the parameters show up as initial ( empty ) but once selection screen is displayed
    the values are in parameters again .
    Can you advice how I can clean up the values from  screen parameters  .
    Thank you

    Hi,
    Try the below code....
    DATA: executed TYPE n.
    SELECT-OPTIONS : selop1 FOR sy-datum.
    INITIALIZATION.
    executed = 1.
    AT SELECTION-SCREEN OUTPUT.
      BREAK-POINT.
      IF executed = 1.
        executed = 0.
        REFRESH: selop1.
        CLEAR : selop1.
      ENDIF.
    Regards
    Arbind

  • Clearing Selection Screen (urgent)

    I have 4 radio buttons in my selection screen. First is selected by default. Now when 2nd will be selected, the contains of the screen fields will be cleared. I have tried with At selection screen output.
    Where the condition is
    if Rd2 = 'X".
    p1 = ' '.
    endif.
    but every time when the 2nd radio button is selected and entering data into screen fields, after  pressing enter all the screen gets cleared.
    Tell me some other options.........

    hi,
    try like this
    PARAMETERS:rad1 RADIOBUTTON GROUP rad1 USER-COMMAND rad,
               rad2 RADIOBUTTON GROUP rad1,
               rad3 RADIOBUTTON GROUP rad1,
               rad4 RADIOBUTTON GROUP rad1.
    PARAMETERS: mat LIKE mara-matnr DEFAULT '101'.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF rad2 = 'X'.
          IF screen-name = 'MAT'.
            screen-input = '1'.
            CLEAR mat.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    reward if usefull...

  • Clear Selection-Screen Fields

    Hello all,
    How to clear the fields content from a selection-screen when  the user returns from report to sel.screen?
    I try in PBO for selection screen to clear all the fields, works fine but with one exception, when it is pressed Enter,
    all the fields contents are empty.
    Thank you 
    Bogdan

    Hi Bogdan,
    i think you can achieve this with a flag and export/import to SAP-memory:
    AT SELECTION-SCREEN OUTPUT.
      IMPORT back FROM MEMORY ID 'back'.
      IF back = 'X'.
    *clear/refresh your sel-opt/param.
        refresh gjahr.
        CLEAR : gjahr , amount.
        CLEAR back.
        FREE MEMORY ID 'back'.
      ENDIF.
    START-OF-SELECTION.
    *end of your program
      back = 'X'.
      EXPORT back TO MEMORY ID 'back'.
    Andreas

  • Selection screen fields are not clearing..!

    Hi all,
    I have created one report which is having a selection screen with four select-options.
    Now after executing the report, when i click on "back" icon the selection screen entries are not clearing even i refresh the select-options also.
    Could any body please help me to resolve this issue??
    Regards,
    Joshu.

    Hi,
    Use FREE MEMORY after the report is printed..
    Check this example..
    PARAMETERS: P_MATNR LIKE MARA-MATNR OBLIGATORY.
    START-OF-SELECTION.
    WRITE: / P_MATNR.
    FREE MEMORY.
    Thanks,
    Naren

  • Clearing only a few fields in the selection-screen

    Hi Folks,
    I am having the following fields in the selection screen.
    werks.
    matnr
    quantity
    filename like rlgrap-file.
    First time the user enters some values and executes it and comes back to the selection-screen.At this point I want <b>only matnr and quantity</b> fields in the selection-screen to be cleared.
    If I use FREE MEMORY it is clearing all the fields.I want only the above mentioned fields.I don't want to set the data in the in werks as default in the program.Kindly let me know how to achieve this.
    Thanks,
    K.Kiran.

    Hi Kiran,
    You can write your code in AT-SELECTION SCREEN OUTPUT.
    So when ever selection screen called you will have your variables you want cleared.
    USe LOOP AT SCREEN.. there.
    Regards,
    Atish

  • Clear selection screen

    hi friends,
    i have created one report i have four parameter fields in my selection screen there are two ways to give inputs. one is selection screen another one is input from upload file.
    when i chose inputs from file at time my selection screen fileds is clear.
    i chose input file using at selection screen on request.
    how to do this?

    Hi,
    chek the code .may be useful to u.
    PARAMETERS : p_lpn TYPE filename-pathintern
                 DEFAULT c_lpn OBLIGATORY ,          "Logical Path Name
                 p_aserv RADIOBUTTON GROUP grp
                 USER-COMMAND app,                   "Application server
                 p_afile1 TYPE filename-fileextern , "Application File
                                                     "Name for contracts
                 p_afile2 TYPE filename-fileextern , "Application
                                                     "FileName for
                                                     "Long text
                 p_aerfl1 TYPE filename-fileextern , "Error File
                                                     "forcontracts
                 p_aerfl2 TYPE filename-fileextern , "Error File
                                                     "for Longtext
                 p_pserv RADIOBUTTON GROUP grp,     "Presentation Server
                 p_pfile1 TYPE rlgrap-filename ,    "Presentation File
                                                    "Name forcontracts
                 p_pfile2 TYPE rlgrap-filename ,    "Presentation File
                                                    "Name for long
                                                    "texts
                 p_errfl1 TYPE rlgrap-filename ,
                                                    "Error File for
                                                    "contracts
                 p_errfl2 TYPE rlgrap-filename .    "Err File Long text
    IF p_pserv IS  INITIAL.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_PFILE1'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'P_PFILE2'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'P_ERRFL1'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'P_ERRFL2'.
              screen-input = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_AFILE1'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'P_AFILE2'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'P_AERFL1'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'P_AERFL2'.
              screen-input = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
      ENDIF.
    Reward if helpful.
    Regards,
    Nagaraj

  • Clear a parameter at selection-screen

    Hi guys, haven't found the answer to this one yet:
    at my selection screen, I have the field p_name(40), it's default value is "Insert your name here", what I need is:
    when the user selects the field to input data, the field must be cleared to receive the name.
    already tried "at selection-screen" but it didn't react to field selection (or did I anything wrong?)
    thank you

    What you are asking for is simply not apart of the functionality of the SAPgui. The actions which you are talking about, placing the cursor is a field, and firing an event to the application is not possible within the SAPgui presentation client.  Instead, keep you parameter P_NAME clear with not default value and just have a selection screen comment beside it.
    report zrich_0001.
    selection-screen begin of line.
    selection-screen comment 1(10) com1.
    parameters: p_name(40) TYPE C.
    selection-screen comment (30) com2.
    selection-screen end of line.
    initialization.
    com1 = 'Name'.
    com2 = 'Please enter your name here'.
    Regards,
    RIch Heilman

Maybe you are looking for