How to check whether a value is empty in ABAP Sql

Select matnr from mara where
MARA~LVORM is null
Basically if LVORM is blank, i.e., not popoulated, I want to get matnr.
Will above query accomplish this in ABAP OPEN SQL.

Hi,
LVORM column is defined as a NOT NULL column.. so the values will be either a initial value (space, in this case) or filled with some value
SELECT matnr
  INTO TABLE t_matnr
  FROM mara
  WHERE LVORM = space.
https://cw.sdn.sap.com/cw/docs/DOC-40206
http://learnsapmdm.blogspot.com/2009/01/data-modelling-and-database-design-in.html
regards,
Paulo Carvalho

Similar Messages

  • How to check whether the Resultset is empty or not ??

    I wanna check whether my Result set is empty or not ( I don't want the no of rows it contains..) i'm using this function...
    boolean result=myResultSet.isAfterLast() | myResultSet.isBeforeFirst() ;
    if (result == true)
    {//Result Set is populated
    else
    {//ResultSet Blank
    Is it ok to do like this ?? Or is there any other functanality to do this, since in big appl..i'm using it more than 10-15 times & it's working fine evrywhere except for one jsp where it is returing TRUE everytime ...
    Help Appreciated !!

    try,
    rs = pstmt.executeQuery();
    boolean b = false;
    if( b = rs.next() ) {
    while( b ) {
    //... rs.getXXX( YYY );
    b = rs.next();
    else {
    //...empty rs processing
    or,
    ResultSet rs = ps.executeQuery();
    if(rs.next()) {
    do {
    System.out.println(rs.getString(1));
    } while(rs.next());
    } else {
    System.out.println('empty result set');
    but I usually avoid using do...while although this may be an exception.

  • How can we check whether a ResultSet is EMPTY or NOT ?

    i'm getting some data inside ResulSet (using JDBC inside Servlet).
    now i want to redirect response according to ResultSet...., if ResultSet is EMPTY then on diff page, else on different page...
    how can i check whether a ResultSet is empty or not...
    i've used next() , wasNull() methods ,,, but not solving the purpose...
    thanx in advance...

    What you could do is to ask the database fora
    record count and check that for zero.
    How?????You just do an SQL statement but instead of the list of fields after SELECT you put
    SELECT count(*) FROM ...... WHERE .....
    That returns a single integer value into the resultset giving the number of matching records currently in the database.
    The trouble is you can't be certain that when you subsequently access the records the number won't have changed, because databases are generally accessible to more than one process at a time and some other process might add or delete a record between counting and retrieving or, for that matter, during the process of retrieval.
    Also the count is likely to take more time than just doing rs.next() and seeing if you get a record.
    Since you seem to be in a servlet environment you should consider doing the database query and the first rs.next() at the top of the servlet/JSP that presents the results and, if there are no records, using getServletContext.getRequestDispatcher(...).forward(request, response) to swich to your error page if it returns false.
    So the stucture looks like:
    rs = stmt.executeQuery(......);
    if(!rs.next())
          getServletContext().getRequestDispatcher("/noresultspage.jsp").forward(request, response);
    else {
         do   {
             .... display result data
          } while(rs.next());
        }

  • How to check whether a field contains at least one numeric value

    how to check whether a field contains at least one numeric value..

    Hi,
    I hope that this code will works.
    constants:
       c_digit_grp        TYPE char11         VALUE '0123456789',        " Digit group
    * Data Declaration
    data :
      str   type string.
    * if you want check entire string and pass entire string
    if  str CA c_digit_grp.
    * write your logic ---this block will execute atleast one numeric value exists in the string
    Endif.
    Regards
    Bhupal Reddy

  • How to check  if all values from a dataset  has come to  an internal table

    How to check  if all values from a dataset  has come to  an internal table ?

    Hi,
    After OPEN DATASET statement check if sy-subrc = 0 if its success then proceed with split statement and save the dataset values into a internal table and while debugging the internal table you will find that whether all values get into internal table.
    Checking sy-subrc after OPEN DATASET statement is must to fill up the values in the internal table.
    For e.g.
    OPEN DATASET p_inpfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
        WRITE :/ 'No such input file' .
        EXIT.
      ELSE.
    READ DATASET p_inpfile INTO loc_string.
          IF sy-subrc NE 0.
            EXIT.
          ELSE.
            CLEAR loc2.
    *Spliting fields in the file-
            REPLACE ALL OCCURRENCES OF '#' IN wa_string WITH ' '.
           SPLIT wa_string AT const INTO loc2-pernr
                                           loc2-werks
                                           loc2-persk 
                                           loc2-vdsk1.
    Hope you get some idea.
    Thanks,
    Sakthi C

  • SAP Script - How to check a text element is empty in Script.

    Hello Friends,
                  I like to display a text element when it is not empty, otherwise I like to display some other text.
    I know how to read text element in Script, but 
    How to check a text element is empty in Script
    Thank you for your time.
    Senthil

    Hi Senthil,
    Inside text element, we print the variables.
    Variables actually gets printed in the form.
    if the variable contains value the variable gets printed on script. if not, then variable not gets printed.
    hope this helps.

  • How to check whether campaign has been uploaded to online server

    Hi,
    How to check whether campaign has been uploaded to online server by using SQL analyzer
    Thanks,
    Rasheed

    Hi Rasheed,
    To quickly check if the campaign has been uploaded from MSA to the server, you can check the TR_STATUS column on the SMOPCCAMPN table for your campaign, if the value is P000 or P*** then it has been uploaded to the server and is waiting for confirmation, if the status is O, it has been uploaded and created in the server.
    Best Regards,
    Ankan

  • How to check sign of value ' - ' and ' + '.

    Hi Experts,
            can you tell me what is the preocedure to check the sign
    of value whether it would be ' - ' or ' + '.
             if i have to check the sign of -1100 then system should tell me the sign is ' - ' . how it can be possible.

    Hi,
    Try this.
    Check whether the value of variable say v1.
    If v1< 0.
    Then display the message as '  -  '.
    else.
    Then display the message as '  + '.
    endif.
    The message is according to your requirement.
    Sharin.

  • How to check whether ESBAgentListener listener is started or not for ESBSys

    Hi,
    I am working on Oracle ESB 10g, I want to know how to check whether the ESBAgentListener listener is started or not for particular ESB system. I know we can verify the logs but I want to know is it possible from database or any other sources.
    Thanks in advance.
    Ramesh

    Hi Jogdand ,
    You can get the PO total value change form the PO business Object BUS2201 attribute  POTotalValueIncreased .
    Below code sample decribes how to get the BO attribute values
    1. INCLUDE <swfcntn01>.
    2. Create an instance of the BO by calling the macro and passing the three parameter.
        swf_create_object     <po bor object>     <BUS2201>     <po_guid>
    3. Get the PO attribute by calling macro
      swf_get_property   <po BOR object>   < 'POTotalValueIncreased' >    < lv_pototalvalueincreased>
    OR
    You can query the table BBP_PDHGP and get the original Value of the PO and call the FM BBP_PD_PO_GETDETAIL to get the new Value of the PO. Check the difference and if there is any difference then the PO value is changed.
    I hope this will be very useful.
    Regards,
    Surender

  • R12.1.1 staging complete! How to check whether the stage is Good

    Hi Gurusl,
    I have completed staging R12.1.1 for Hp unix B.11.31. I want to know how to check whether the stage is good for installation or whether it is corrupted. Is there any metalink note or script from where we can check it. Ur help will be highly appreciated. Thanks in advance
    regards,

    Hi,
    Please refer to (Note: 802195.1 - MD5 Checksums for R12.1.1 Rapid Install Media).
    Regards,
    Hussein

  • How to check whether transport path exist between two systems in sld??

    Hi,
         I have two systems namely 'A' and 'B' and created business systems for both of them.Then i created transport path between the two systems.How i check whether what i have done is right in SLD.

    <b>WRT to CMS</b>
    am not sure with this but u can try:
    1. Start CMS: http://<host>:<J2EE Engine http port>/webdynpro/dispatcher/sap.com/tcSLCMS~WebUI/Cms.
    2. Goto lansdscape configurator and check there
    Message was edited by:
            Prabhu  S

  • How to check whether follow on document is created for sc or po,is there any table or fm available?

    How to check whether follow on document is created for sc or po,is there any table or fm available?

    Hello Venu
    Check FM: BBP_PD_SC_GETDETAIL and BBP_PD_PO_GETDETAIL table E_HEADER_REL
    Check this: SRM Shopping cart and PO tables link
    Regards

  • How to check whether there r new txt files in a folder n file creation date

    How to check whether there r new text files in a specified folder and what is the date of creation of the text file.........?

    Hi
    I have been searching for a solution to find the date of creation of a file for over 6 months now but haven't found it. So I presume that it is not possible though I havent found any authentication of my assumption in any document.
    Cheers!
    Shailesh

  • How to check whether calendar is being used in any of the sap application

    Hello All,
    We are having few factory calendars. However some of the calendar having valid to year 2010. Can you please let me know how to check whether these calendar is being used in any of the sap application/module
    kindly reply as early as possible
    Regards
    Girish

    Hi RKS
    yesterday BLOG by our SUMMER WANG helps every SRM consultant to debug the PO error
    /people/summer.wang/blog/2010/05/11/trouble-shooting-of-srm-po-transfer-error
    Good work Summer wang !!
    Muthu

  • How to check the numerica value

    Dear Experts,
    Would you please show me the code how to check a character value is numeric or not, include negative sign '-'.
    For example the character value (01.-10) should not be a good numeric value use in later.  the (-1.00) should be a good numeric value.
    Thanks,
    Helen

    Hello,
    Use the FM <b>NUMERIC_CHECK</b>
    Regards,
    Vasanth

Maybe you are looking for

  • How do I purchase multiple iphones from Apple store

    I wish to purchase, online, 4 iPhones for myself and family next week. I do not currently have service with ATT. On Apple's site, I am able to select the appropriate family ATT plan, and I can give them ONE existing phone number which I want to trans

  • Format over catalog file, tried to recover file but now corrupt?!

    I recently performed a format of my hard drive.  When doing this, I did not back up my catalog file from photoshop elements(I have pse 8.0).  I backed up everything else, and I do have all of the original full size photo files from my hard drive, ~11

  • What is the best way to back up macbook air to qnap

    I've had the macbook air since January and this is the 4th or 5th time I've had to start the Timemachine backups from scratch.  This time it's not working at all Every time we have to restart the qnap for any reason the time machine fails.  It tells

  • Just learning can't install

    I am trying to learn to use flex. It seemed to install, and now when I go to start flex2 I get an error. I am running this on Vista home Premium. I ran a trial for 30 days, and I used the beta for a while. I just got flex builder 2 and uninstalled al

  • Errors transporting process chains

    Hi, we got some problems while transporting process chains. The error occurs in the method execution. The transport log says: Start of the after-import method for object type R3TR RSPC (Activation Mode). Version 'M' of chain <i><name of the chain></i