Check if field has value 0 - zero value on field

Hi,
I've got the following code:
DATA: v_qtd TYPE i.
SELECT-OPTION s_qtd FOR v_qtd.
I'm using a Z table Z001 and there's a numeric field there that's filled with values >0 (greater then zero).
If I have 6 materials and only 4 have the field QTD with a value:
MAT 1000 QTD 1
MAT 1002 QTD 5
MAT 1003 QTD 1
MAT 1005 QTD 2
MAT 1001 and 1004 exist but don't have any entries in table Z001.
I'm making a report to get the values from table Z001 depending on how s_qtd is filled.
My problem is how can I get the materials 1001 and 1004? How can I check if s_qtd is the value 0 (zero)?
If I check s_qtd IS INITIAL then I get all the materials (1000 to 10005).
If I check s_qtd-low = 0 it's the same as IS INITIAL.
IF s_qtd IS INITIAL.
     (all materials 1000 - 10005)
ELSE.
     IF s_qtd IS NOT INITIAL.
          (materials with entries in Z001 1000, 1002, 1003, 1005)
     ELSE.
          (never gets here)
I can't check s_qtd-low = 0 and s_qtd-high = 0 because it's the same as s_qtd IS INITIAL.
Thank you.

Hi Carlos,
Try the below code:
TABLES: z001.
DATA: it_z001 TYPE TABLE OF z001,
wa_z001 TYPE          z001.
SELECT-OPTIONS: s_num for z001-qtd.
START-OF-SELECTION.
IF s_num-low is INITIAL and s_num-high is INITIAL.
SELECT *
from z001
INTO TABLE it_z001.
ELSEIF s_num-low is not INITIAL and s_num-high is INITIAL.
SELECT *
from z001
INTO TABLE it_z001
WHERE qtd eq s_num-low.
ELSEIF s_num-low is NOT INITIAL and s_num-high is not INITIAL.
SELECT *
from z001
INTO TABLE it_z001
WHERE qtd BETWEEN s_num-low and s_num-high.
ELSEIF s_num-low is INITIAL and s_num-high is NOT INITIAL.
SELECT *
from z001
INTO TABLE it_z001
WHERE qtd BETWEEN s_num-low and s_num-high.
ENDIF.
LOOP AT it_z001 INTO wa_z001.
WRITE:/ wa_z001-mat, wa_z001-qtd.
CLEAR: wa_z001.
ENDLOOP.
Revert back in case of any issues.
With Regards,
Giriesh M

Similar Messages

  • Check of field values from the delivery address in PO

    The customer likes to check a field from the delivery address (f.e. NAME1) before the PO is saved. I looked for Userexits but diddn't find any. The only way sees to be a modification. The question is where to modify...

    Name 1 fields is under Delivery Address tab for PO line item details.        -> This was not my question
    It can be maintained i n SPRO itself by defining Address for store locations .  -> This was not my question
    User have to put storage location in PO line Item itself then Name 1 field will displayed values in SPRO -> This was not my question
    It has to be CHECKED by the system if the content of field NAME1 (from wherever the system gets the address) equals to a special text. There must be a statement such as:
    if ADDR1_DATA-NAME1 eq '1234657678' ....
    The problem is to identify the right include where i can get the relevant fields.

  • Registry name and value to check if server has internet connection

    Hi
    I want to check that if server has internet connection though registry value. Can any one help me the path of registry to check if server has an internet connection or not

    > Martin Can I get the script to check the server has an internet
    > connection ?
    Sorry, I don't have one - we never had the need to check this... Short
    VBS snippet:
    strURL = "https://www.grumpfasdklfhsdf.comm"
    Set objExplorer = WScript.CreateObject("InternetExplorer.Application",
    "IEWindow_")
    objExplorer.Navigate strURL
    Do While objExplorer.ReadyState <> 4
        WScript.Sleep 100
    Loop
    Sub IEWindow_NavigateError( pDisp, sURL, sFrame, sStatus, sCancel )
        WScript.Echo sStatus
    End Sub
     sStatus in the Sub will contain HTTP error codes. 502 for "Host not found".
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • Check list field values using LINQ

    I have to check if the CURRENT USER is already in the list USERS by comparing his AccountName to the list field ACCOUNTNAME.
    If the USER is on the list I have to check if the field IsFollower is YES or NO and change it according to some conditions.
    I think LINQ would be the correct way of doing this but I have no clue how to do that.
    Any ideas pls, thanks

    Hi,
    Yes, you can query the list using LINQ.
    You need to get the SPList Object firstly, and then you can query list item value using LINQ.
    More information about how to check list field value using LINQ:
    http://msdn.microsoft.com/en-us/library/office/ee538250(v=office.14).aspx
    http://www.wolfsys.net/query-sharepoint-lists-with-linq/
    http://geekswithblogs.net/TanviBlog/archive/2013/06/06/linq-in-sharepoint-and-querying-list-items.aspx
    More information about how to use Server Object Model in SharePoint lists:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.aspx
    http://msdn.microsoft.com/en-us/library/office/ms456030(v=office.14).aspx
    Best regards

  • Other value check button disabled on Values of batch char

    The other values check button gets disabled after batch char. is
    created. We have many batch chars which have been created already and
    we need to link them to Master inspection characteristics. We can't
    link the qualitative characterisitcs to MIC unless selected set is
    assigned to batch char. This requirment is not for quantitative char's.
    So those are working fine. But qualitative characteristics are not
    working because of this issue. Please let us know what is the
    fix/workaround.

    The qualitative general characteristic has already been used and has values recorded in batches from what you are indicating.  You will not be able to change this characteristic unless you delete all the characteristic values from the batches, then delete the characteristic from all classes it is used in.  Once added, you'd have to go back to each batch and select the right value for each batch that had a value prior to the change. This is usually not practical in a live system.
    You will need to make a new general characteristic from scratch and link it with your MIC's.  Then add the new characteristic to the classes.   I suggest you change the old general characteristic to 'hidden' in all the classes so users don't use it anymore.
    You will need to update any COA profiles using the characteristic and any batch search strategies as well.  For COA's, you can include both the old and new characteristic and make them both optional.  One or the other should then print.  At some point in the future, go back to the COA profiles and delete the old characteristic and make the new one required.
    There is no 'easy' fix for this.  It is time consuming in a live system.  You might be able to set up a couple of LSMW's to help ease the pain depending on how many you have to change.
    Craig

  • Editing not possible because 'Request flag' has value X

    When i try to change an number range settings from number range administration, i get an error "Editing not possible because 'Request flag' has value X "
    how can and  where can i remove this flag from?
    Thanks

    Hi Tuncer,
                   I am not aware about the GUI table interface through which you can change the flag.
    But i guess there is an option
    Go to transaction se11 --> write /AIN* in the table name field.
    You will find all the table names related to SAP AII. In the search list now available to you, search for the word "Number".
    Then you will find all the table names related to number ranges.
    Here you can search the table which will be having that flag field. If you find this table,
    go into that table and make that entry manually.
    Here is what i can suggest you immediately to solve your problem
    please rvrt for other questions.

  • Hi guru's what is check tabale , what is value table

    hi guru's what is check tabale , what is value table

    The Check Table is the dependent table to which the relationship is defined using foreign keys. The contents of the check table field are shown in the input help for the referenced field.
    For example you have Employee master table & Employee Transaction table.
    When ever an employee Transacts we need to check whether that employee exists , so we can refer to the employee master table.
    This is nothing but a Parent & Child relationship . Here data can be maintained at client level , no development involved.
    As per DBMS what we call foregin key table, is called as check table in SAP.
    The Value table is the table attached to a field at the domain level, where the entry to the field can be only from the value table. They are not used in the Input Help.
    This is maintained at Domain Level.
    When ever you create a domain , you can entered allowed values. For example you go to Domain SHKZG - Debit/credit indicator. Here only allowed values is H or S.
    When ever you use this Domain, the system will forces you to enter only these values.
    This is a sort of master check . To be maintained as a customization object. This mean that if you want to enter values to this table you have to create a development request & transport the same.
    There is 1 more important Difference in Value Table and Check Table is that:
    1. The contents of the check will be used as an input help(F4 Help) for a particular field on which a check table is assigned.
    But the contents of Value Table are never used in Input Help.
    The Heirarchy which decides from where to used the Input Help is:
    1. Input help defined explicitly in ABAP Program or Dialog Module.
    2. Input Help Attached to the referenced Database Table field.
    3. Using the contents of Check Table as an input help if neither (1) or (2) help are there.
    4. Input help from Fixed value or Value range given in Domain.

  • Column has values in RSA3 but comes blank in PSA

    Hi All,
    I have added some code for datasource 0REFX_4 and extracting data into an ODS. My issue is that the column 0RECONTRACT has values in RSA3 but comes blank in PSA/ODS.
    Another funny thing is that when I do selection with company code in infopackage and extract, the column 0RECONTRACT gets filled!! It doesn't get filled only when i extarct without selection. Can any of you help me resolve this?
    -Narayan

    Narayan, so strange ! If I undertand, In RSA3 with or without selection, the column 0RECONTRACT gets filled. The problem is from BW (Infopackage). You can make a test:
    In you code to select the value to 0RECONTRACT (I don´t know the R/3 field), you put a "loop", in the start of exit function. Start Infopackage and goes to R/3 via SM50 transaction em DEBUG exit.
    Loop like this:
    v_stop = 1.
    while v_stop = 1.
      v_stop = 1.
    endwhile.
    Look the values from table C_T_DATA. Maybe the field that you use to select 0RECONTRACT is blank, when you start the load from BW. I´ve tried to find some SAP Notes, but nothing.
    Hugs,
    Marcelo

  • Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD

    Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD
    I configured the user profile service application and run Sync and user profiles and its properties returned from Active directory but when I want to read it pragmatically it returns null values.
    this is my code...
       void runQueryButton_Click(object sender, EventArgs e)
               // Get the My Sites site collection, ensuring proper disposal
                using (SPSite mySitesCollection = new SPSite("http://sp/my"))
                    //Get the user profile manager
                    SPServiceContext context = SPServiceContext.GetContext(mySitesCollection);
                    UserProfileManager profileManager = new UserProfileManager(context);
                    UserProfile profile = profileManager.GetUserProfile("Contoso\\user");
                    foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName + ":" + profile[prop.Name].Value + "<br />"; ;

     Hi,
    Please try with the following code
          PrincipalContext principalContext = new PrincipalContext(ContextType.Domain);
                                SPServiceContext context = SPServiceContext.GetContext(site);
                                UserProfileManager profileManager = new UserProfileManager(context);                        
      foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName
    + ":" + profile[prop.Name].Value + "<br />"; ;
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • I_selcrit_values has values even no query is selectd on the screen

    Dear Experts,
    Importing parameter i_selcrit_values of  method IF_POWL_FEEDER~GET_OBJECTS of feeder class CL_HRHAP00_STARTPG_POWL
    has values even if no data is passed on selection screen.Because of this data is getting filtered and user is not able to see whole data.
    Also this is not happening for all users.
    This issue we are facing in performance document in PMS.
    Kindly help.
    Thanks

    We have run this report powl_d01 , and deleted the cache , still facing the same issue. Please suggest
    Regards

  • Is B.Tech in distance learning has value in SAP?

    Please provide me suggestion asap. Please help me can I go head and do B.Tech in distance learning? Thanks
    Hello Sir,
    I am Venkatesh, completed my B.Sc CS in Bangalore university in 2005 but i have 2 back logs in final year but after my completion the next year they changed the syllabus and i could not completed till now i was working in BPO as network admin. Now i joined in SAP-BASIS course after that i can try in internal job posting for Basis in my company. if i have atleast another 4yrs experience then i can join outside with my degree. now i am planning to do distance education in B.Tech (IT) in KSOU or any other university or please suggest me any valuable university or else For B.Sc or BCA please suggest any Distance Learning university which has more valuable. If i do B.tech IT in Distance whether it has value or not.
    Also please confirm if i complete my degree in distance learning or correspondence is that degree has value or worth.
    My dream is settle in SAP. I am fearing whether i will not get in SAP due to my age. Now my age is 29yrs. In SAP domain is there any age restriction for job.
    Kindly advice some valuable universities in India or South India (KA, TN, AP)
    Please Please please help me out to chase my dream!!!
    Thanks- Venkatesh

    Hi Nishant,
    Welcome to SCN.
    Questions like these have been asked many times in these forums. I suggest you search for relevant information and if you are not satisfied, then post a specific question.
    Also, spend some time reading the The SCN Rules of Engagement
    pk

  • Check for the multiple values of the order type in if cond. in user exit

    Hi all,
    I have the exisitng code like this.
    IF AUFK-AUART = C_STAT_1000.
        RETAIL = C_RETAIL_X.
      ELSE.
        SEARCH W_SYST_STAT FOR 'SETC'.
        IF SY-SUBRC <> 0.
          ERR_MSG-MSGID = 'ZP'.
          ERR_MSG-MSGTY = 'E'.
          ERR_MSG-MSGNO = '017'.
          ERR_MSG-MSGV1 = DETAILS-RAUFNR.
          APPEND ERR_MSG.
          EXIT.
        ENDIF.
      ENDIF.
    In the above code, the order type aufk-auart is checked for a single value '1000'.
    How do i include the logic tocheck if aufk auart for multple values in tha if condition.
    It can be multiple values of whihc i do not have the detail.
    Regs,
    SuryaD.

    Hi all,
    I have the sample code with me.
    Hope this helps someone who is looking for the usage of this Function module.'K_HIERARCHY_TABLES_READ'
    DATA:
        l_set_node_tab  LIKE grpobjects OCCURS 0 WITH HEADER LINE,
        l_set_val_tab   LIKE grpvalues  OCCURS 0 WITH HEADER LINE,
        l_info          LIKE grphinfo,
        l_overrite      LIKE sy-datar,
        l_set_class(4) TYPE c,
        l_set_id(34) TYPE c,
        l_set_kokrs LIKE  sethier-kokrs,
        lr_auart TYPE RANGE OF auart,
        lr_auart-line LIKE LINE OF lr_auart.
      CONSTANTS:lc_set(3) TYPE c VALUE 'SET',
                  lc_id(22) TYPE c VALUE '0000Z-GPMRCMI-EXC-CUST',
                  lc_i      TYPE c VALUE 'I',
                  lc_bt(2)  TYPE c VALUE 'BT'.
      CLEAR:
          l_set_node_tab,
          l_set_node_tab[],
          l_set_val_tab,
          l_set_val_tab[].
      l_set_class = lc_set.
      l_set_id    = lc_id.
      CALL FUNCTION 'K_HIERARCHY_TABLES_READ'
           EXPORTING
                e_class                     = l_set_class
                e_setid                     = l_set_id
                e_kokrs                     = l_set_kokrs
                e_mandt                     = sy-mandt
           TABLES
                t_nodes                     = l_set_node_tab
                t_values                    = l_set_val_tab
           CHANGING
                c_info                      = l_info
                c_overwrite                 = l_overrite
           EXCEPTIONS
                no_controlling_area         = 1
                no_chart_of_account         = 2
                different_controlling_areas = 3
                different_chart_of_accounts = 4
                set_not_found               = 5
                illegal_field_replacement   = 6
                illegal_table_replacement   = 7
                fm_raise                    = 8
                convert_error               = 9
                no_overwrite_standard_hier  = 10
                no_bukrs_for_kokrs          = 11
                OTHERS                      = 12.
      IF sy-subrc = 0.
        CLEAR : lr_auart.
        REFRESH lr_auart.
    create internal set table
        LOOP AT l_set_val_tab.
          lr_auart-line-low      = l_set_val_tab-vfrom.
          lr_auart-line-high     = l_set_val_tab-vto.
          lr_auart-line-sign     = lc_i.
          lr_auart-line-option   = lc_bt.
          APPEND lr_auart-line to lr_auart.
          CLEAR lr_auart-line.
        ENDLOOP.
      ENDIF.

  • Check for the Numeric Values

    Hi All,
    I am new to java . Please help me the this problem .
    I have a string variable and which store the values like "ABC" or "123" but i need to check if the variable values are like "123" then process ..other wise ..exclude that( like "ABC" ....).
    Thanks in Advance ..
    prakash

    JosAH wrote:
    BIJ001 wrote:
    While a good and straightforward solution, it might incur some run-time penalty (exception-object-creation, exception handling overhead).Indeed, but what would be the runtime overhead for a RE that exactly matches the range of valid ints (or longs)?Assuming a reasonably well-written regex, matching only valid {color:000080}int{color}s shouldn't be significantly slower than using "&#92;\d+". On the other hand, throwing and catching exceptions is hideously expensive. If you expect to get a lot of invalid strings, you're definitely better off validating them with a regex before calling Integer.parseInt(). But none of this really matters unless you're processing large numbers of strings in a tight loop.

  • Entry in field Funds Center required; check the field control Mg No.FMEF010

    Hi,
    We have a Z tcode for converting planned order to purchase requisition.
    We use Account assignment P - Project and A - Asset.
    We have WBS element and fund center linked to it.
    For the Z tcode while converting Planned order to purchase requisition we are getting below error
    Error: Entry in field Funds Center required; check the field control Msg No.FMEF010
    While creating manually purchase requisition with same GL code and WBS element the fund center gets automatically picked.
    Can anyone pls let me know in which table we can find the link between WBS element and fund center so that we can code the same in our program. In PRPS table we can find the link between WBS and profit center.
    Or is there any user exit that can be used.
    Thanks in advance.
    Regards,
    Radha

    Hello
    If you do a F1 in the value date field it will give you the answer - The value date is used in bank accounts and bank sub-accounts.
    As regards the other query check whether the tax code has been already created.
    Hope it helps.
    Rgds

  • Table maintenance - autorization check on field level

    Dear all,
    I generated a table maintenance view for a custom table via SE11 --> Utilities --> Table maintenance generator.
    The table for which the maint. view was generated has a field bukrs. When a user enters a company code via table maintenance in SM30, i want to check if he has the right authorizations for that company code. This check, is this something i have to implement in the modification events or are there other alternatives?
    Suppose i want a non-key field to be unique, is there a way to automatically check this, or has this to be done via implementation of the same events?
    Kind regards,
    J

    Hi,
    You can do it via the events.
    There is one more alternative also.
    Create a Z report with the plant as parameter or select-options.
    Do an authorisation check on it using the authority object.
    Then call the FM of SM30.
    The FM of SM30 is 'VIEW_MAINTENANCE_CALL'
    See the following code
    PARAMETERS: y_p_lgnm TYPE lgnum.
    DATA : y_v_string   TYPE string.
    CONSTANTS: y_k_u        TYPE char1   VALUE 'U',
               y_k_x        TYPE char1   VALUE 'X',
               y_k_lgnum    TYPE char7   VALUE 'LGNUM',
               y_k_lgtyp    TYPE char5   VALUE 'LGTYP',
               y_k_eq       TYPE char2   VALUE 'EQ',
               y_k_viewname TYPE tabname VALUE 'YLOMANAGTROL'.
    *                   INTERNAL TABLE DECLARATION.
    DATA: y_i_seltab TYPE STANDARD TABLE OF vimsellist.
    *                   WORKAREA DECLARATION.
    DATA: y_wa_seltab TYPE vimsellist.
    START-OF-SELECTION.
    *authority check for warehouse number
      AUTHORITY-CHECK OBJECT 'L_LGNUM'
                  ID y_k_lgnum FIELD y_p_lgnm
                  ID y_k_lgtyp FIELD '*'.
      IF sy-subrc NE 0.
    * user not authorised
        CONCATENATE y_p_lgnm text-003 INTO y_v_string SEPARATED BY space.
        MESSAGE s015(ylo1) WITH text-001
                                sy-uname
                                text-002
                                y_v_string.
      ELSE.
    *Clear Internal Table
        CLEAR y_i_seltab.
        CLEAR y_wa_seltab.
    *passing the selection parameters to the function module
    *view_maintenance_call.
        y_wa_seltab-viewfield = y_k_lgnum.
        y_wa_seltab-value     = y_p_lgnm.
        y_wa_seltab-operator  = y_k_eq.
        APPEND y_wa_seltab TO y_i_seltab.
        CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
          EXPORTING
            action               = y_k_u
            view_name            = y_k_viewname
            show_selection_popup = y_k_x
          TABLES
            dba_sellist          = y_i_seltab.
      ENDIF.
    In my case i had a table YLOMANAGTROL with field LGNUM.
    So i put an authority check on LGNUM.
    Regards,
    Ankur Parab

  • How to disable certain form fields from a calculation with a check mark fields.

    How to disable certain form fields from a calculation with a check mark fields.
    In Canada we have to taxes
    I create a form that calculate them to a total
    I need to be able to turn off any of those to taxes to participate to the calculation and their visibile field should become 0
    I was thinking using a checkbox (when checkbox is on (Yes) the tax is calculated, Not ticked (Off) the tax is not calculated and the visible field should show 0 or nothing....
    I really need help on this one — I’m a complete newbie....
    Remark that the second tax is calculated on the sum of what the first tax add (first tax is pan-canadian tax (all provinces).
    The second tax is never use alone (Quebec only (on top of the Canadian one)
    Sometime for outside Canada sell - No tax at all is calculated....
    What should I do?

    I want to tank you to help, really appreciate —>
    This is the code and order... I just trow the checkbox in there (they have, so far, no purpose...)
    The code use is
    var a = this.getField("pricehorstx");
    event.value = Math.round (a.value * 7.25) / 100
    I guess -If the checkBox are check - The tax should be calculate — If “Off” the tax should be not calculated and PriceHST and /or PriceQST should show zero or be empty — The HST is always calculated in Canada, but the QST is added only in Quebec.
    I need to turn both to Zero for international sale.
    Message was edited by: Chacapamac

Maybe you are looking for