Skip to Content
author's profile photo Former Member
Former Member

Select statement in ABAP

Hi,

I have a table with couple of GUID fields. Primary key is the main GUID. I have another field by name temp_guid which can have the normal guid values or 00000000000000000000000000000000. I want to write a select statement as follows:

My table name : X

Field required : temp_guid

Select temp_guid FROM X where del_ind = gc_no AND temp_guid is NOT (??)

I dont want to select those rows where temp_guid has the value 00000000000000000000000000000000.

I tried with IS NOT NULL. It doesnt seem to be working. Any help would be appreciated.

thanks,

Ashwin

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jan 09, 2008 at 02:46 PM

    Hi,

    well, probably the most correct thing to do, is to declare a constant of the same type as temp_guid, with the value '00000000000000000000000000000000' and use it in the select statement with the NE condition.

    ..otherwise the condition would depend on the type of temp_guid..

    regards,

    Stano

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 02:47 PM

    Give this a try:

    REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
    
    RANGES: r_gui FOR x-temp_guid.
    
    CLEAR   r_gui.
    MOVE '00000000000000000000000000000000' TO r_gui-low.
    MOVE 'EQ'     TO r_gui-option.
    MOVE 'E'      TO r_gui-sign.        "<=== Note
    APPEND  r_gui.
    
    SELECT temp_guid
      FROM x
      WHERE del_ind = gc_no
        AND temp_guid IN r_gui.
    

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 02:50 PM

    Hi,

    Declare a range.

    range r_xx for x_temp_guid.

    *population.

    r_xx-sign = 'E'. "Exclude

    r_xx-option = 'EQ'.

    r_xx-low = '00000000000000000000000000000000'.

    append r_xx.

    *select statement

    Select temp_guid FROM X where del_ind = gc_no AND temp_guid in r_xx.

    You will get it.

    regards,

    Subbu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2008 at 02:47 PM

    try sth like this:

    data h_guid type guid.

    clear h_guid.

    ...

    select ....

    and temp_guid <> h_guid...

    greetings

    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.