Can we use is null in our select statement in ABAP program

hi,
I want to use 'is nul' or 'not null' in select statement of my ABAP program for any field. I have written below query but I am getting sy-subrc = 4 and getting no data. Can anyone resolve this.

Hi,
I think you've posted your question on the wrong forum. This is the SAP Business One development forum which is not part of ERP and doesn't include any ABAP or Netweaver programming.
For a list of forums please see here:
http://forums.sdn.sap.com/index.jspa
Kind Regards,
Owen

Similar Messages

  • How to use  'is null' in select statement of ABAP program

    hi,
    I want to use 'is nul' or 'not null' in select statement of my ABAP program for any field. I have written below query but I am getting sy-subrc = 4 and getting no data.
    SELECT * FROM mara INTO TABLE it_mara
          WHERE volum IS NULL .
    Can anyone resolve this.

    Hi PKB,
    Check the below thread for NULL and Space value in ABAP . It will help you
    NULL and Space value in ABAP
    Regards,
    Pawan

  • How can I use home sharing between our iphones (create playlists from both accounts at once)

    How can I use home sharing between our iphones, so that we can create playlists with songs from both of our libraries?  We share a Macbook Pro (separate accounts) and each have the new iphone, but when I have my iphone and try to create a new playlist, I can only grab songs from one account.  Is there a way to create a playlist using both accounts since we are sharing?
    Does it have to be created within iTunes first on our Mac?

    The short answer: because Home Sharing isn't designed for sharing apps, and apps aren't designed to be shared.
    The longer answer:  Think of it like this...
    You download some music in iTunes.  With Home Sharing, another user can listen to it by streaming it over the network.  But the data itself is on your computer.  If you turn off the computer or take it off the network, the other user can't access it.
    But if you send another user the app, they aren't just streaming the data- they installed it on their iOS device.  Because they weren't the one that purchased it, such a transfer could easily be considered "piracy" or "stealing," and nobody likes that (least of all, Apple). 
    When iTunes sees this app, it obviously recognized it, as if saying, "Hey, how did you get this app on your device, if I have no record of you purchasing/downloading it from the iTunes store?"
    post edited to correct spelling errors

  • Use of cursors insted of select statements

    could any one please explain what is the advantage of using cursors instead of simple select statements
    thanks
    siby

    A benefit to using an explicit cursor rather than a select statement, is for the NO_DATA_FOUND exception. Its kind of like a free IF statment. IF no data is found, then stop.
    if you write a select statement, and no data is returned, you SHOULD code for the NO_DATA_FOUND exception. Often people say, "i'll ALWAYS get a row returned". but you should always cover your code "just in case". so you must code an exception...
    declare
    v_var varchar2(1);
    procedure do_something(p_parm varchar2) is
    begin
    null;
    end do_something;
    procedure log_error is
    begin
    null;
    end log_error;
    begin <<main>>
    do_something('x');
    begin <<selectblock>>
    select dummy
    into v_var
    from dual
    where dummy = 'a';
    do_something(v_var);
    exception
    when no_data_found then
    log_error;
    end selectblock;
    do_something (v_var||'abc');
    end main;
    if you use an explicit cursor instead, you don't need to code for the NO_DATA_FOUND. If an explicit cursor opens and finds no rows, there are simply no rows. of course, you don't need a loop if you expect only 1 row returned under normal circumstances.
    BTW, don' forget that SQL%ROWCOUNT and your_cursor%ROWCOUNT are not initialized. There is a null, until a row is successfully fetched. therefore if no rows are returned at all, %ROWCOUNT is NULL.
    declare
    v_var varchar2(1);
    cursor my_cur is
    select dummy
    from dual
    where dummy = 'a';
    procedure do_something(p_parm varchar2) is
    begin
    null;
    end do_something;
    procedure log_error is
    begin
    null;
    end log_error;
    begin << main>>
    for cur_rec in my_cur loop
    dbms_output.put_line('inside');
    begin <<loop_block>>
    if nvl(my_cur%rowcount,0) > 1 then
    do_something(cur_rec.dummy);
    else
    log_error;
    end if;
    end loop_block;
    end loop;
    end main;
    /

  • Using pop-up value in select statement

    Hello.
    I want to select a value from a pop-up box and then use that value in a select statement for another pop-up. Is that possible?
    The first pop-up is P39_PIIN_CALL but it is not recognized in the second pop-up when I use it in the select statemnt... select * from table where PIIN = :P39_PIIN_CALL. I get nothing back because it has no idea what :P39_PIIN_CALL is. I'm desperate and on a timeline.
    Thanks,
    Mark E

    Hi,
    After fetching the value from first popup the page should submit so that the value is availble to the second popup..
    Edit the first popup.. and in HTML Form Element Attributes and enter onchange="doSubmit('MyRequest')"
    Regards,
    Shijesh

  • Limitations in using a function within a select statement

    I have a function which retrieves various data elements from the
    database and formats it accordingly. The data (varchar2)
    returned could be in excess of 2,000 characters length.
    I need to use the returned data as part of a view. I am able to
    use the function in a "select" statement, but when I use it with
    returned data in excess of 2,000 chars, I get the following
    error:
    ORA-06502: PL/SQL: numeric or value error
    This error is occurring whenever the returned data is in excess
    of 2,000 characters.
    Is there an alternative method to what I am proposing, I have
    tried alternative data types but if I am able to use it in a
    "select" statement, I get the above error when the returned
    length exceeds 2,000 chars.
    Thanks
    Peter

    are u using oracle 7. varchar2 limit in 8 is 4000.

  • Can I use a C/C++ xml parser in my java program?

    Hi,
    How can I use a C/C++ xml parser in my java program?
    Elvis.

    You would still need to convert the XML data structure into a Java data structure to import it into Java.
    Don't assume you need C++ to do anything. I woudl write it in Java first, then profile the application to see where the bottle necks are and then optimise them
    Don't optimise code unless you have proof it needs to be optimised.
    If you want to improve the speed of reading XML, try XMLbooster

  • SELECT statement help_HR ABAP

    Hello experts.
    i have browsed the forum about the how to solve my current issue.
    i am creating an FM where i have to update an infotype.
    here is my code:
    IF sy-ucomm EQ lc_route.
        gwa_p0490-zzeval = zneweval.                  <<<<this already has a value
    SELECT <what should i select here?>
          CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
            EXPORTING
              number             = pa0490-pernr
          IF sy-subrc EQ 0.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty                  = ???
              number                 = ???
              SUBTYPE                = ???
              record                 = ???
              operation              = ???
                IF sy-subrc EQ 0.
             ENDIF.
          ENDIF.
          CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
            EXPORTING
              number        = gwa_pa0490-pernr
          IF sy-subrc EQ 0.
          ENDIF.
        ENDLOOP.
        LEAVE TO SCREEN 0.
    ENDif.
    here's what i wanted to do:
    i have a push button with a function code: 'ROUTE', and when i clicked that one,
    infotype pa490-zzeval should be updated with the value of ZNEWEVAL.
    questions:
    1. how can i update it? whats the select statement should i use?
    2. ZNEWEVAL value is obtained and stored in P0494. how can i link these two infotypes together in order to update the other infotype?
    thanks for future responses.
    Mark

    Hi
    before that HR_INFOTYPE_OPERATION .loop at P0490.
    and give operation as mod.

  • Can I use oracle to build our webiste for free?

    Hi all~~
    I am a student in unversity and learning oracle database technology.
    Moreover,I hope to put it into practise.
    Therefore,I wanna use oracle and Java EE to build our own website for our club(an organization in our school) and we will deploy it to our own server.
    Can we use oracle without paying anything?
    Jason

    According to License Terms on OTN, you can has limited license to use the programs only for the purpose of developing, testing, prototyping and demonstrating your application, and not for any other purpose. So it sounds to me if this is purely for learning and internal use without commercial and production purpose, you don't have to pay. But Oracle and it's sales rep will have the final words. Better double check to confirm.
    http://www.oracle.com/technology/software/products/database/index.html
    LICENSE RIGHTS
    We grant you a nonexclusive, nontransferable limited license to use the programs only for the purpose of developing, testing, prototyping and demonstrating your application, and not for any other purpose. If you use the application you develop under this license for any internal data processing or for any commercial or production purposes, or you want to use the programs for any purpose other than as permitted under this agreement, you must obtain a production release version of the program by contacting us or an Oracle reseller to obtain the appropriate license. You acknowledge that we may not produce a production release version of the program and any development efforts undertaken by you are at your own risk. We may audit your use of the programs. Program documentation, if available, may accessed online at http://otn.oracle.com/docs.

  • Cannot use Is Null in record selection

    I cannot use Is Null in a record selection expert.  I use the same wording in excel and SQL QA with no issues.
    I need all records that are not '5 - Project' including Nulls.  Once I put the criteria of '5 - Project' it excludes the null records.
    {@dtCompleted} = {?Completed_Date_ Range} and
    {TASKS.TYPE} = "Information Technology" and
    {TASKS.PRIORITY} <>'5 - Project'
    This does not give me the nulls for the Priority field.
    The one I use in QA or in Excel is
    {@dtCompleted} = {?Completed_Date_ Range} and
    {TASKS.TYPE} = "Information Technology" and
    ({TASKS.PRIORITY} <>'5 - Project' or {TASKS.PRIORITY} is null)
    This gives me the "The ) is missing" error.  Help!

    (isnull({TASKS.PRIORITY}) or {TASKS.PRIORITY} <>'5 - Project')
    and
    @dtCompleted} = {?Completed_Date_ Range} and
    {TASKS.TYPE} = "Information Technology";
    Make sure that under File | Report Options or under File | Options the the box next to "Convert Database Null values to default' is NOT checked.
    {TASKS.PRIORITY} NOT EQUAL TO '5 - Project'.  Use the Greater than and less than symbols.
    Edited by: Sanjay Kodidine on Feb 27, 2009 8:49 PM

  • HT4557 We have a wired in network in our house, we also have an apple airport for use with my ipad/our ipods/iphones, etc.  Can we use home sharing if our desktops do not have wifi?

    Hi,
    this is my first time on the support board, so hopefully I'm doing this correctly.  We have 3 desktop computers in our family, which are wired in with ethernet cables.  We also use the cables with our laptops (we have various connections throughout the house)  I have an iphone, and an ipad, my boys have ipod touches.  I purchased an airport router to use when I'm using my ipad, etc.  The boys and I would like to be able to share apps that we have purchased.  I'm wondering if there is a way to use home sharing in our situation.
    thanks!

    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

  • Can use place holder (?)in select statement.

    Is it possible to have have a place holder in my select clause or it is possible to have only in where clause?
    Please find the below query I am having place holder in select statement emp_id=? nit it is throwing an error for me.
    select * from(select myrows.*, rownum rn from(select acc as account, es as identity,address as street_address
    state as stae,select id from mytable where emp_id=? as my site from myview
    where ert_id=? and chek=?
    I am getting an error ORA-00936:     missing expression is it possible to have a place holder in select statement
    Please help me on this.
    Regards,
    BA

    user575682 wrote:
    Is it possible to have have a place holder in my select clause or it is possible to have only in where clause?
    Please find the below query I am having place holder in select statement emp_id=? nit it is throwing an error for me.
    select * from(select myrows.*, rownum rn from(select acc as account, es as identity,address as street_address
    state as stae,select id from mytable where emp_id=? as my site from myview
    where ert_id=? and chek=?
    I am getting an error ORA-00936:     missing expression is it possible to have a place holder in select statement
    Please help me on this.
    Regards,
    BAfor clarity and easy to be read i attempted to rearrranged your code and this is what it will look like:
    select *
      from (select myrows.*, rownum rn
              from (select acc as account,
                           es as identity,
                           address as street_address
                           state as stae,
                           select id
                      from mytable
                     where emp_id = ? as my site from myview where ert_id=? and chek=?apparently the syntax is not correct and by that you are missing some comma in your column, ? question mark symbol will not be recognize, and some ')' closed parenthesis.
    are you using a report builder that you want to use a placeholder column?

  • How can i use multiple row subquery in update statement

    Hai All
    I using group function in my update statement.. and i need to update more rows so i need to use multiple row
    subquery pls tell me how to use multiple row subquery in update statement
    For example
    while i am using this like this i got an error
    update dail_att set outtime in (select max(r2.ptime) from temp_att where empcode=r2.enpno and
    barcode=r2.cardn and attend_date=r2.pdate group by enpno,pdate,cardn);
    Pls tell me how to use with example
    Thanks & regards
    Srikkanth.M

    Hai Man
    Thanks for ur response Let me clear what i need
    First step Fetch the records as text file and stores into table T1
    and the next step is i have seperated the text using substring and stores in different columns of a table
    There are two shifts 0815 to 1645 and 1200 and 2000
    Here I rep IN and O rep OUT
    Empno date time inout
    001 01-01-10 0815 I
    002 01-01-10 0815 I
    003 01-01-10 0818 I
    001 01-01-10 1100 0
    001 01-01-10 1130 I
    002 01-01-10 1145 0
    002 01-01-10 1215 I
    004 01-01-10 1200 I
    005 01-01-10 1215 I
    004 01-01-10 1315 O
    004 01-01-10 1345 I
    001 01-01-10 1645 0
    002 01-01-10 1715 0
    003 01-01-10 1718 0
    004 01-01-10 2010 0
    005 01-01-10 2015 0
    This is my T1 table i have taken data from text file and stored in this table from this table i need to move data to another table T2
    T2 contains like this
    Empno Intime Intrin Introut Outtime Date
    001 0815 1100 1130 1645 01-01-10
    002 0815 1145 1215 1715 01-01-10
    003 0818 1718 01-01-10
    004 1200 1315 1345 2010 01-01-10
    005 1215 2015 01-01-10
    This what i am trying to do man but i have little bit problems Pls give some solution with good example
    And my coding is
    declare
         emp_code varchar2(25);
    in_time varchar2(25);
    out_time varchar2(25);
    Cursor P1 is
    Select REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
    From temp_att
    group by REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
    ORDER BY enpno,pdate,ptime;
    begin
         for r2 in p1 loop
    declare
    bar_code varchar2(25);
    begin
    select barcode into bar_code from dail_att where empcode=r2.enpno and attend_date=r2.pdate;
    For r3 in (select empcode,empname,barcode,intime,intrin,introut,addin,addout,outtime,attend_date from dail_att)loop
    if r2.inout ='O' then
    update dail_att set outtime =(select max(r2.ptime) from temp_att where empcode=r2.enpno and barcode=r2.cardn and attend_date=r2.pdate group by r2.cardn,r2.enpno,r2.pdate );
    end if;
    end loop;     
    exception
         when no_data_found then
         if r2.inout ='I' then
                   insert into dail_att(barcode,empcode,intime,attend_date)(select r2.cardn,r2.enpno,min(r2.ptime),r2.pdate from temp_att group by r2.cardn,r2.enpno,r2.pdate );
         end if;
    end;
    end loop;
    commit;     
         end;
    Pls tell me what correction i need to do i the update statement i have used a subquery with group function but when i used it will return only one row but my need is to return many rows and i need to use multiple row subquery
    and how can i use it in the update statement
    Thanks In Advance
    Srikkanth.M

  • How to use variables in an sql select statement.

    Hi, I have seen examples using the update, but nothing using a select statement.
    I have four variables I am getting from drop down menus in my JSP I set the user selected items to strings.
    How would I create the select statement like this:
    .String XName = request.getParameter("UserInputX");
    rsInResult = stmtInResult.executeQuery("SELECT ColumxX FROM TableZ WHERE ColumnX = XName")Obviously it tries to read "XName" as a column and of course can't find it, how would I set it up to have it see the Value of XName and not the literal XName.

    read this:
    rsInResult = stmtInResult.executeQuery("SELECT ColumxX FROM TableZ WHERE ColumnX = '"+XName+"')
    {code}
    better way is PreparedStatement:
    {code}
         // example code to change password to an user in the USERS table
         String newPWD = "my password";
         String user = "luxjava";
         PreparedStatement prepStat;
         String updatePWD = "UPDATE LOGISTIC.USERS "+
                                  "SET logistic.users.password = ? "+
                                  "WHERE logistic.users.username = ?";
         prepStat = ql.conDb.prepareStatement(updatePWD);
         prepStat.setString(1, newPwd);
         prepStat.setString(2, user);
         int zeroNotFound = prepStat.executeUpdate();
         if (zeroNotFound==0)
              ql.conDb.rollback();
              prepStat.close();
         else
              ql.conDb.commit();
              prepStat.close();
    {code}
    ... use the SQLException to capture errors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problems with Hints in abap code to use an index in a Select statement

    Hi,
    I want to use an especific index in a select statement but I can´t get it. I use de next statement:
    SELECT ltaklgnum ltaktanum ltakvbeln ltaptapos ltapnltyp ltappvqui
           FROM ltak AS ltak INNER JOIN ltap AS ltap
                            ON  ltaktanum = ltaptanum
                            AND ltaklgnum = ltaplgnum
           INTO TABLE l_t_tanum_silo
           WHERE ltap~lgnum EQ ip_lgnum
             AND ltap~pquit EQ ' '
             AND ltak~lgnum EQ ip_lgnum
             AND ltak~kquit EQ ' '
             AND ltak~queue EQ ip_queue
             %_HINTS DB2 ''.
    We have DB2 for Linux Unix and Windows 9.5 as DB system.
    How can I fix this?
    Thanks a lot.
    Regards

    The DB2 for Linux Unix and Windows is coded DB6 for SAP and not DB2
    Look at the following OSS notes
    - [Note 129385 - Database hints in Open SQL|https://service.sap.com/sap/support/notes/129385]
    - [Note 150037 - Database hints in Open SQL for DB6 (DB2 for LUW)|https://service.sap.com/sap/support/notes/150037]
    - [Note 1270314 - DB6: DB2 9.5 Perf. degrad. for queries with INLIST clause|https://service.sap.com/sap/support/notes/1270314]
    - [Note 868888 - DB6: Optimization Guidelines|https://service.sap.com/sap/support/notes/868888]
    You should use a
    SELECT ltak~lgnum ltak~tanum ltak~vbeln ltap~tapos ltap~nltyp ltap~pvqui
      FROM ltak AS ltak INNER JOIN ltap AS ltap
      ON ltak~tanum = ltap~tanum
        AND ltak~lgnum = ltap~lgnum
      INTO TABLE l_t_tanum_silo
      WHERE ltap~lgnum EQ ip_lgnum
        AND ltap~pquit EQ ' '
        AND ltak~lgnum EQ ip_lgnum
        AND ltak~kquit EQ ' '
        AND ltak~queue EQ ip_queue
      %_HINTS DB6 '<IXSCAN TABLE=''LTAP'' INDEX=''"LTAP~M"'' />'.
    In note 868888 there is a sample for a join.
    SELECT A~TABSPACE
    FROM TADB6 AS A
    JOIN IADB6 AS B ON A~TABART = B~TABART
    %_HINTS DB6 '<NLJOIN><IXSCAN TABLE=''IADB6'' />'
            DB6 '<IXSCAN TABLE=''TADB6'' /></NLJOIN>'.
    Regards

Maybe you are looking for

  • How do i disable "top hits" on iphone 5s

    I cant seem to do this , I tried the many solutions but none work, any thoughts anyone?

  • How do I edit notes on my Mac mini?

    I have just switched from a PC to a Mac, and for convenience I am still using Thunderbird for email. As far as I can tell from the User Guide, Notes on the iPhone can be edited in Mail. Is there a way to set up Mail without having it be my default em

  • Do not renew my membership

    Dear Adobe, Please do not renew my Creative Cloud membership. I've spent 30 minutes looking for a button to do this. I've been harassed to not cancel my membership in the live chat where I wasted another 15 minutes. I do not wish to cancel early and

  • Moving After Effects Output Templates into Media Encoder

    With the introduction of the CC apps, Adobe is encouraging users to export most content through the Adobe Media Encoder application. I'm happy to make the switch if it helps my overall workflow. As part of moving over to the AME for all things in Aft

  • Simple fade-in fade-out doesn't work with premiere 9

    Hello, I'm using Windows 7, service pack 1 on a Dell computer XPS 8300 (Intel® Core™ i7-2600 CPU @ 3.40GHz × 8), 64 bits. Complex fades work, but not simple as fade-in fade-out. Note I had the same problem with Studio : it was solved by not using har