Skip to Content

Select-Options

Hi,

I want to delete internal data based on user input so I wrote the following code and it is working fine if I hard-code s_zage-low and s_zage-high but without that hardcode if you user inputs it's not working. How to make it work?

Advance thanks.

-


SELECT-OPTIONS: s_zage FOR zsubdci-znldays.

MOVE: 'NB' TO s_zage-option,

'I' TO s_zage-sign,

'10' TO s_zage-low,

'20' TO s_zage-high.

APPEND s_zage.

DELETE itab_data WHERE

zage IN s_zage.

Regards,

V Balaji.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2004 at 12:03 PM

    Hello Balaji,

    It is not totally clear why you face a problem here. But I can think of one thing that you might have missed out.

    In the statement DELETE ITAB_DATA WHERE ZAGE IN S_ZAGE, if the select-options internal table is empty, that is to say if the user does not enter anything in this field on the selection-screen, then all the contents of the internal table will get deleted.

    Is this the problem you are facing? If yes, then you can do some processing and adopt either of these two approaches as suits your case:

    1. Force the user to amke some input on these select-options, by making them mandatory. For example, you can use something like:

    tables vbak.

    select-options s_vbeln for vbak-vbeln obligatory.

    2. You need not make the select-options field mandatory, but you can give warning message on the selection screen when the user hits EXECUTE (F8) on the screen. For example:

    AT SELECTION-SCREEN.

    IF S_VBELN IS INITIAL.

    MESSAGE W001(XYZ) WITH 'All the records will be deleted, are you sure you want to continue?'.

    ENDIF.

    If these are not the actual descriptions of your problem, please state the exact nature of the issue that you are facing.

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 25, 2004 at 12:03 PM

    That code must work... it deletes all data who is not between 10 and 20...

    If you used SELECT-OPTIONS without the MOVE and APPEND sentences, it must work too, I believe... Just be sure your selection is well done (maybe your user is selecting data BETWEEN 10 and 20 and not NOT BETWEEN them...

    Try to debug it and catch the values of s_zage...

    Best luck,

    Vic

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 25, 2004 at 12:06 PM

    Hi,

    plz dbug , if SO s_zage is the same

    1) with your default values

    and

    2) with user values

    perhaps option (NB in 1) differs,

    Grx Andreas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.