Q: LIKE or = in WHERE and READ...

Hi,
I have a problem with my code below. The problem is either in my SELECT-statement or in my READ-statement. I am having problems debugging so I cannot narrow it down. I have the following code:
SELECT DISTINCT MAT_SALES
    FROM /BI0/PMAT_SALES
    INTO TABLE i_mat_sales
    WHERE /BIC/ZACCASGRP IS NULL
            OR /BIC/ZACCASGRP LIKE ' '
            OR /BIC/ZACCASGRP LIKE 'A1'
            OR /BIC/ZACCASGRP LIKE 'C3'.
LOOP AT SOURCE_PACKAGE into source_wa.
    T_INDEX = SY-TABIX.
     READ TABLE I_MAT_SALES WITH KEY MSALE =
             source_wa-MAT_SALES TRANSPORTING NO FIELDS.
     IF SY-SUBRC NE 0.
            DELETE SOURCE_PACKAGE INDEX T_INDEX.
     ENDIF.
The MAT_SALES field and the ZACCASGRP fields are both of type CHAR, and I have changed my where to LIKE instead of = but for the READ is not possible to use LIKE.
Does anybody have any idea about what can be wrong in this code?
Thank you in advance,
Mikael

Hi
First of all you can instead of
OR /BIC/ZACCASGRP LIKE ' '
OR /BIC/ZACCASGRP LIKE 'A1'
OR /BIC/ZACCASGRP LIKE 'C3'.
you can write
OR /BIC/ZACCASGRP IN (' ','A1','C3').
Second.
/BIC/ZACCASGRP IS NULL  you ask if it initial
/BIC/ZACCASGRP LIKE ' '    you ask if it empty
you need only one of them
and...
i dont think that in checking you need
TRANSPORTING NO FIELDS
plus
you can check if MSALE and
source_wa-MAT_SALES have same type...
also
LOOP AT I_MAT_SALES into wa_mat_sales.
DELETE SOURCE_PACKAGE where MAT_SALES  = WA_MAT_SALES-MSALE.
ENDLOOP.
instead of your lines
LOOP AT SOURCE_PACKAGE into source_wa.
T_INDEX = SY-TABIX.
READ TABLE I_MAT_SALES WITH KEY MSALE =
source_wa-MAT_SALES TRANSPORTING NO FIELDS.
IF SY-SUBRC NE 0.
DELETE SOURCE_PACKAGE INDEX T_INDEX.
ENDIF.
Regards
Yossi
Message was edited by:
        Yossi Rozenberg
Message was edited by:
        Yossi Rozenberg

Similar Messages

  • Performance syntax loop at  and read table

    in the routine , for reading one line in a internal table  , the syntaxe
      loop at  xxx where   and read tabl exxx   with key     XXXX
    has a great difference on performance or not?

    Loop at statement is used only for processing multiple records.Read table is used for reading a particluar record of an internal table.If you just need to check whether record exists in internal table, use can sort and use binary search with TRANSPORTING NO FIELDS addition. Also, try to use field symbols so that performance is increased.

  • Data Streaming to HDD and Reading

    Hi,
    I have three channels at 1 KHz to 5 KHz selectable sampling rate. I would like to stream all three channels to disk in binary format with user supplied header / file name. I would like to watch data graph while continuously saving to disk and also need controls to select time duration to save data. I want to use same VI panel to read data with slider bar control. All three channels must show separate graph charts.
    This is like simple data recording and reading application in same window with three channels and binary format.
    Any help is highly appreciated,
    Kishor
    [email protected]

    I would be glad to help, but your posting sounds like you would like us to write the code for you. Have you started the project and have a specific question? You may want to look at the LabVIEW shipping examples. (open labVIEW 6.1 >> help >> find examples >> fundamentals >> file input and output. There are several examples for reading and writting to file. You may also be interested in the DAQ examples to see how to aquire the signal. Your outline for the slider suggests that you also need to know how to make a control work like an indicator and vise versa. This would be done with property nodes or local variables. Look for property examples at find examples >> programatically controlling VIs >> controlling front panel objects.

  • Where and how users and password are stored?

    1) I'd like to know where and how users and passwords are stored in portal30_sso schema.
    Does anybody know something about?
    2) Why have I to start httpd with ssl enabled as root user? Isn't it insecure?

    This only applies to Unix
    Mike
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sebastiaan van Dijk:
    Hi,
    When the portnumber is under 1024, you have to start it as root, but you can run it as another user.
    So, your SSL webserver instance can run under another user than root. Root only has to start it up.
    HTH, Sebastiaan<HR></BLOCKQUOTE>
    null

  • I authorized and dled ITUNES to the new pc.  Well i would like to know where is all my songs i purchased? I want to hear them on this pc, i bought them so where are they and how do i get them on here so i can buy new songs and make new playlists?

    I authorized and dled ITUNES to the new pc.  Well i would like to know where is all my songs i purchased? I want to hear them on this pc, i bought them so where are they and how do i get them on here so i can buy new songs and make new playlists?

    They will only be where you put them.  They do not magically appear in new places.
    Have you copied them from your old computer to your new one?

  • Can you set up a template where information can be filled in - like in a textbox and then collected

    can you set up a template where information can be filled in - like in a textbox and then collected
    Like a series of questions - then the student enters the information - and the information os then collected

    QuickTime is AppleScript aware and has its own "dictionary". Many scripts and droplets have already been compiled and you can download them from this link:
    http://www.apple.com/applescript/quicktime/
    Some need further editing to update them to version 7 features but it's not difficult using the Script Editor app.
    Tiger's new Automator app could also be used but its feature set is rather basic. Newer actions are available for download from the Mac OSX Downloads page.

  • HT201441 I would like to help where I can not open my iPad I bought it from the shop and iPad

    Hi
    I would like to help where I can not open my iPad I bought it from the shop and iPad user when I want to open the device to access the mechanism. Ask me to calculate the previous owner. I went to the store where you purchased told me Contact Apple. Please, I've lost a sum of money. Device number imei 013116000935329

    Only the previous owner can help you.  Take it back to the store and demand your money back.  You will not be able to activate and use it without help from the previous owner.  The shop should not have sold you an iPad that was still associated with the previous owner's account.

  • Ios 6 have some bugs on ipod touch 4g like appstore search bug and accessibility which i cant go out from and crashes every where and imassages that the massge i send goes up and stick to the other messages plz help or do ios 6.1

    Ios 6 have some bugs on ipod touch 4g like appstore search bug and accessibility which i cant go out from and crashes every where and imassages that the massge i send goes up and stick to the other messages plz help or do ios 6.1 can i change my a4 chip plz i swear when i pressed done to submite this safari crashed

    Try to do a hard reboot (no data is lost) by holding down the home and power buttons at the same time untilyou see the Apple logo. Then, let go of both buttons. If that doesn't work, try restoring your iPod and do NOT restore from a backup. This will erase your data, but you can sync back everything except app data and settings from iTunes.

  • I have an iPad 3 and would like to know where the digital compass is?

    I have an iPad 3 and would like to know where the digital compass is? I had to download a compass app. I've seen the iPhone 4S with a digital compass but not on my iPad 3. Thx.

    Screenshots from my iPhone.  Notice the lack of a circled X for the compass.  My phone is not JB.

  • Hi... I would like to purchase a Tablet Sony Xperia Z 2 10.1 (the last one of the Z series) and I was told that Adobe does not support Sony anymore.... I need to be able to open and read Adobe PDF files and I would like to know if this tablet can still us

    Hi... I would like to purchase a Tablet Sony Xperia Z 2 10.1 (the last one of the Z series) and I was told that Adobe does not support Sony anymore.... I need to be able to open and read Adobe PDF files and I would like to know if this tablet can still use Flash Player...
    Is there anyo who can help me with this? I asked in the shop and I was told "yes of course" , but when I contacted Sony directly I was advised to check with Adobe as apparently in the recent months Adobe and Sony haven't been getting along anymore...

    You may be mixing up two entirely different Adobe products.
    1. Adobe Flash Player. Needed to view web pages designed with Flash. Not needed to view PDF files. Not available for Android (not just Sony).
    2. Adobe Reader. Reads PDF files. However, the Android can also read most PDF files without needing Adobe Reader.

  • Please help, just recently got ios7 on my phone and have updated itunes but my iphone 4s wont sync i have tried everything like turning restrictions on and things, thank you for reading and please help

    please help, just got iso7 and the new itunes and have synced my ipone once already all fine but suddenly it doesnt work i have tried everything like turning restrictions on and off , please help

    fighter19lisa wrote:
    that only makes it say its synced, when its not.
    No, it does not.  It transfers purchases from the iDevice to the computer.  The computer must be authorized for the Apple ID that the content was acquired with.
    fighter19lisa wrote:
    my playlists wont show up on the phone.
    Are they selected to sync?  Is Manually Manage content on the device selected?
    fighter19lisa wrote:
    i had to change my password for my aol account again and i still cannot get my email on my phone to even work
    What does that have to do with syncing content to the device?  FYI, nothing.

  • Adobe reader  X and XI search don´t find text like other programs including adobe reader 9? Thanks

    Adobe reader  X and XI search don´t find text like other programs including adobe reader 9? Thanks

    You mean, you are trying to search text in a PDF file, and you can do it in Reader 9 but not in later versions of Reader (using the same file)?

  • I was bill$99.99 and I would like to report a wrong billing. Where and how can I do that?

    I was bill$99.99 and I would like to report a wrong billing. Where and how can I do that?

    You need to dispute the transaction with your credit card company. Apple is only a merchant. You can also contact the iTS web based customer service and tell them but they will direct you to dispute with the CC company.
    Change your iTS password.
    MJ

  • HT3819 I would like to be able to access books purchased by other family members and read it on my IPad

    I would like to access books purchased by other family members and read them on my Ipad2

    You need to download the books with their iTunes account and password.
    http://support.apple.com/kb/HT2519

  • Where and what to download if I like to use Oracle Form 11g

    Hello all:
    where and what to download if I like to use Oracle Form 11g
    Thx in advance.

    hi
    check out the following link.
    Oracle Forms 11g available now!!
    http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html
    Re: Install Forms & Rpts 11.1.1.3 with WebLogic Server 10.3.3 on Win32
    hope this helps u.
    sarah

Maybe you are looking for

  • TS3274 iPad iOS 7.0.2 does not Trust to iTunes [11.1.1(11)] on MacBook Air 10.8.5 to iPad iOS 7.0.2

    When trying to link iTunes [11.1.1(11)] on MacBook Air 10.8.5 to iPad iOS 7.0.2, even when I choose TRUST fails to connect indicating that my computer does not have permission. Even I choose TRUST, i end up with "iTunes could not connect to this iPad

  • SQL script: dynamic table creation

    Hello, I should write a sql script to do the following (simplified): - Create a table if it doesn't exist yet - Select something from the newly created table and do further conditional actions I've tried something like that: DECLARE lv_count INTEGER;

  • Where to submit feature suggestions?

    I occasionally have some suggestions for IOS and other OS for commands which I'm certain would be extremely popular, such as a "shut cycle 5" for interfaces which would power down the interface for 5 seconds, then bring it back up (handy for remote w

  • Help me Quickly to  Solve JAR Problem.

    Dear Sir, I have JAR That contain 3 files One is Meta-inf/Manifest.mf clasess3.class L886142440.t I can't understand the file extension called "t" If you make a web page and embad the jar file , it runs and opening an Image. Please help me to find a

  • After Effects Fails to render due to a big file size?

    I recorded some video clips in a x264 codec (AVI) and well since i cant import them into AAE (it wont recognize them) i just did some editng wit sony vegas and  rendered the full video in 1080p uncompressed and it was about 20 GB's total. i added it