Skip to Content
avatar image
Former Member

Problem with the selection screen

Hi All,

In my program i have given the input in selection screen , Its process something and a msg was displayed , and user confirm it to continue , the program take us back to the selection screen - in this case i have to clear all the values from the selection parameters.

I tried lot , but i didn't get this result.

I know this is the standard functionality , But anything is there to clear the selection parameters.

Regards,

S.C.K

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Jan 11, 2012 at 02:19 PM

    HI friend,

    You can clear the selection parameters after displaying the message.

    For example you have created a parameter p1.

    Just give the statement clear p1.

    Also it should be mentioned at AT SELECTION SCREEN OUTPUT or AT INITIALIZATION.

    because AT SELECTION SCREEN OUTPUT is just like PBO it process the selection screen values and again displays the selection screen based on new condition.

    So try clearing values there it will work.

    If you face any issues please revert back to me i will help you.

    Thanks,

    Sri Hari.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi friend,

      Make a sy-ucomm check. And then do the process.

      Or else after message set and flag variable and check that variable for clearing the values.

      I think you can handle this in these ways.

      Thanks,

      Sri Hari

  • Jan 11, 2012 at 04:10 PM

    Hi All,

    >

    > In my program i have given the input in selection screen , Its process something and a msg was displayed , and user confirm it to continue , the program take us back to the selection screen - in this case i have to clear all the values from the selection parameters.

    >

    > I tried lot , but i didn't get this result.

    > I know this is the standard functionality , But anything is there to clear the selection parameters.

    >

    >

    >

    > Regards,

    > S.C.K

    There are a couple ways to achieve this, one is by leaving the transaction all together as someone has already suggested, this can be done either via LEAVE TO TRANSACTION <tcode> or SUBMIT <program name> VIA SELECTION-SCREEN, using this technique you won't be able to clear any 'DEFAULT' values set for the selection screen fields, the second is by using IMPORT/EXPORT techniques, EXPORT a flag variable in START OF SELECTION and IMPORT the same in AT SELECTION SCREEN OUTPUT and clear all the selections screen fields...

    -Rajesh.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 11, 2012 at 04:43 PM

    Welcome to SDN.

    You can clear selection screen values, just before writing the Message statement in start-of-selection event.

    Clear P_par1.

    Message XXXXXX.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Having a clear statement in At selection screen output should clear the fields in selection screen.

      Flag was the concept which i incorporated for additional check. I did not try with flag variable, but without flag variable it works fine. would update you once i try with flag variable.

      It was an additional check which i incorporated assuming, if report has to be displayed and back button is pressed then they may want to see the original values given on selection screen.

      If fl_flag is not updated in PBO of selection screen, then as suggested by Vishnu we can export and import the updated value.

      Anyways would give a try once again on updating fl_flag variable without export and import statements.

  • avatar image
    Former Member
    Jan 11, 2012 at 05:06 PM

    Hi Chandra,

    Well try doing something out of box..Instead of displaying normal information message, use FM -

    POPUP_TO_CONFIRM

    In it you can display your required message. User needs to press OK.

    Then after FM executes, you can code that..

    IF answer EQ 1.

    CLEAR: p_field1, p_field2.

    Try this once.

    Regards,

    Harsh Bansal

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 11, 2012 at 07:24 PM

    Hi All,

    In my program i have given the input in selection screen , Its process something and a msg was displayed , and user confirm it to continue , the program take us back to the selection screen - in this case i have to clear all the values from the selection parameters.

    I tried lot , but i didn't get this result.

    I know this is the standard functionality , But anything is there to clear the selection parameters.

    Regards,

    S.C.K

    I didn't go through the long list of replies nor I don't know if you gave it a thought, but you can try this,

    create a [system variant|http://help.sap.com/saphelp_nw04/helpdata/en/c0/980389e58611d194cc00a0c94260a5/content.htm] (variant name starts with CUS& eg: CUS&BLANK) with the entire selection screen fields blanks and use the following function module to call that variant after msg is displayed.

    CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
           EXPORTING
                report               = sy-repid
                variant              = 'CUS&BLANK'
           EXCEPTIONS
                variant_not_existent = 01
                variant_obsolete     = 02.
    

    You can hide the variant by checking the box "Only display in catalog".

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 12, 2012 at 05:47 AM

    Hi,

    Try this:

    parameters : p_werks type werks_d.

    AT SELECTION-SCREEN.

    */.. Validate plant.

    SELECT SINGLE werks

    INTO lv_werks

    FROM t001w

    WHERE werks EQ p_werks.

    IF sy-subrc NE 0.

    CLEAR : p_werks.

    SET CURSOR FIELD 'P_WERKS'.

    */.. Error stating invalid plant

    MESSAGE 'Please enter a valid Plant.'

    TYPE 'E'.

    ENDIF.

    This will help you.

    Add comment
    10|10000 characters needed characters exceeded