Create SAP B1 Query with Optional User Input Fields

Hi All... any help is greatly appreciated, I am new to this forum and hope to contribute in the near future once I become more of an expert with B1.
I have a query I need to build that will search about 10 UDF's. The problem is, I don't know how to make the user input fields optional within the query. Currently, I have the following queries as testing searching 2 UDF"s:
SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] OR T0.[U_LengthFT] =[%1]
This query works when leaving one of the user input fields blank. However, the values it provides are wrong because it is an OR statement which will show item codes with a certain quality OR a certain size.
The following query is the same as above but switched the OR to AND:
SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] AND T0.[U_LengthFT] =[%1]
This query provides me with the correct values but will not work if one of the user defined fields is not filled out.
How do I go about getting the results I want and not having the user fill out all the UDF's for the query to execute properly?

I think I figured it out
SELECT T0.ItemCode, T0.ItemName, T0.OnHand
FROM OITM T0
WHERE (T0.U_Quality = '[%0]' OR '[$0]' = '0') AND (T0.U_LengthFT ='[%1]' OR '[%1]' = '0')
SAP must be defaulting empty user input field values to "0"
I tried the above query and it worked!!!
Is there anything you can add if I am missing something?
Thanks, Alec.

Similar Messages

  • How to create an ABAP Query with OR logical expression in the select-where

    Hi,
    In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
    Please help me on this.. Points will be rewarded.
    Thanks a lot.
    Regards,
    Question Man

    Hi Bhupal, Shanthi, and Saipriya,
    Thanks for your replies. But that didn't answer my question.
    Bhupal,
    You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
    Shanthi,
    Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
    Saipriya,
    Like what I have said, this is a standard SAP code so we can't do your suggestion.
    I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
    Thanks a lot.
    Points will be rewarded.
    Regards,
    Question Man

  • How to view a BI query with anonymous user in the portal

    <b>Hi Gurus,</b>
    Does anybody knows how to view a BI query in the portal with anonymous user?
    Cause when i try to view a query the portal always ask for authentification. And i don't want to sign with a user cause my portal is for everybody and if the user logged in it shows the roles that previously were assigned.
    I have the Netweaver 2004 with SP9
    <b>Thank you Very Much</b>

    do you have sso configured between portal and BW server, if yes the authentication pop up should not come.
    if you dont want to do sso between portal and bw server and still want to logon to BW query with anonymous user,
    in you bw server go to transaction sicf and navigate to DEFAULT_HOST->SAP->BW->BEX and double click on bex node in the resulting window, log on details section provide a default userid/password
    Raja

  • Open CC applications to default preferences with no user input

    I am searching for a way to open CC applications to default preferences with no user input. I understand there is a key board short cut (command/option/shift on start) but I am hunting for a way to have the preferences always revert to default. In the past I have written a script to delete the preference files upon computer start up but once again, it needs to be rewritten. Is there a method that does not require KLUDGE?

    Try:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Join SAP BW Query with SAP BW Table

    Hello guys,
    we would´need to join a SAP BW Query with information of an SAP BW Table like it is explained in the following example:
    The result of the query is:
    ID         Quantity    Revenue
    4711    10              20
    4713    20              40
    4714    30              30
    The table will look like this:
    ID         Category
    4711    A
    4712    B
    4713    C
    4714    A
    The result should be:
    ID        Category    Quantity    Revenue
    4711    A               10              20
    4713    C               20              40
    4714    A               30              30
    We would like to use the current SAP Business Objects 4.0 or 3.1 environment.
    Is it possible to join these data sources in the universe Designer or in Crystal reports?
    Regards,
    Markus

    Hello Markus,
    the Information Design Tool is able to create a relational Universe on top of InfoProvider which will show the tables from the cube, but the Information Design Tool in the current release is not able to show the tables from the ERP system.
    regards
    Ingo Hilgefort

  • Adobe form created in LiveCycle does not remember user input

    Adobe form created in LiveCycle does not remember user input when the file has been re-opened after it has been saved.
    Example:
    "Check box" that has been selected and who have registered Action script (may be that it should be disabled), seems to be reset when the file is re-opened, although it apparently is checked.
    Are there settings or script that can prevent this?

    Hi there,
    usually if the values are not kept in form after saving and re-opening the form, it would be because of your code... or because it is not Reader Extended PDF...
    If your code has a function which is to return a value to your field without it to be working based on your Design, it will reset any data..(variables)
    Which means...
    e.g.: You have an array/var/JSONobject which you populate varying on the data entered in the design, as long as you are in the actual form, without closing and re-opening the form, it will keep all values inside that array / variables / JSONobject. But, once the form closed and re-opened, if you have a function that returns a value to your field, whatever the field, from any variable in the script it will return nothing because every variables are reset. To avoid such a thing, you must repopulate all variables that were assigned previously before closing the PDF Form. To do so, I recommend to have a page(hidden) which contains every important values according to that function and you must repopulate those variables according to the values in the keepVar page...
    If you do not have any function that returns a value to a field based on your variables, this is not the solution you are looking for and I am not aware of the reason why it behaves like this... Maybe more information on the behaviour of your form would help locate the issue...
    Hope this help

  • SPARQL query with OPTIONAL

    Hi,
    When I run a SPARQL query with OPTIONAL in the WHERE clause, I saw a lot of "select 1 from ***" kind of queries got executed. The query runs very slow. I'm running Jena adaptor 2 against Oracle 11.1.0.6. We have about half million triples in the model. The queries we need to run tend to be complex and they run pretty slow. Does Oracle 11.1.0.7 have big query performance improvement over 11.1.0.6? Is there anything that we can do on the application side or on the database side to boost the query performance? Thanks,
    Weihua

    Native database support for OPTIONAL in SEM_MATCH based RDF query has been made available via patch 7600122 on 11.1.0.7. Direct use of SEM_MATCH to query your data from SQL has significant performance benefits.

  • Simulate query with different user

    Hello all,
    sometimes I receive calls from our user in BW that some query is not running/no authorization, but when i run the query it works, because I have rights to see everything.
    Is there any way to simulate how a query is running under a different user (which has restricted authorization). I want to check e.g  authorization but I do not want to copy existing user to a test user.
    I saw in the TA RSTRACE that I can enetr a different user, but how can I run a query with this user profile.
    Any help/ideas would be great. Thank you in advance.
    Best Regards,
    Stefan from Munich/Germany

    Hello Edwin,
    works perfect. Thank you.
    BR,
    Stefan

  • How to validate user input field?

    I need to validate a user input field against a table. This field is not part of an EO but is used to update an attribute on an existing EO.
    My question is, where would I place the sql that would validate the user input value against the table?
    Is there an easy way to do this?
    I'm at a roadblock and really need some help. Thank you.

    You can execute a sql query or a function from <your>AMImpl.java, using normal jdbc.
    but I would recommend this, it is easier and cleaner approach
    1. Create a VO (<your>VO) with the sql statement
    Select client
    from client_table
    where resp_id = :1
    and client= :2
    2. Add this vo to the am
    3. In AMImpl, get handle to the VO (this.get<your>VO1)
    4. Bind params
    this.get<your>VO1().setWhereClauseParams(0,current_resp );
    this.get<your>VO1().setWhereClauseParams(1,user_input_value);
    5. Execute the query
    this.get<your>VO1().executeQuery();
    6. Get the row after the query is executed
    oracle.jbo.Row <your>Row = this.get<your>VO1().first();
    7. Get the value of the attribute from the row
    l_client = <your>Row.getAttribute("Client") ;
    8. So now you have what you wanted to do with the sql.
    Thanks
    Tapash

  • Binding a Check Box with a User Defined Field

    Hi everyone,
    i v created a user defined field (U_CheckPro)in the system table "OITM" with two values: Y for Yes and N for No. In relation to that i v also created a check box on the form "150" and would like to know how can i bind my checkbox with  my user defined field properly.
    The user would be than able to enable or disable the check box for each item (article). The user setting schould be than be active and valid in sbo-business logic, each time an item is selected. (for example in case of sales order ID 133, "OINV").
    Any helfpul hints? Samples would be welcome as well.
    Thanks and regards
    Alban

    > First of all you should remove the valid values
    > because checkboxes does not work with valid values...
    > Just give a default value.
    Hi Rasmus,
    thank you very much for your helpful hint. I guess my problem is solved by that - nevertheless here is my complete code sequence once again in case of possible errors.
    I would appreciate any additional suggestion for improvement of the same.
    Thanks and regards
    Alban
    >>>
    Private Sub AddItem()
            ' Test UserSource
            oForm.DataSources.UserDataSources.Add("U_CheckPro", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
            oItem = oForm.Items.Item("122")
            ' Adding a Static Text item
            oNewItem = oForm.Items.Add("StaticTxt2", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oNewItem.Left = oItem.Left + 20
            oNewItem.Width = 100
            oNewItem.Top = oItem.Top + 12
            oNewItem.Height = 25
            oNewItem.FromPane = oItem.FromPane
            oNewItem.ToPane = oItem.ToPane
            oNewItem.LinkTo = "CheckBox1"
            oStaticText = oNewItem.Specific
            oStaticText.Caption = "Test_Caption"
            ' Adding a Check Box item
            oNewItem = oForm.Items.Add("CheckBox1", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
            oNewItem.Left = oItem.Left
            oNewItem.Width = 20
            oNewItem.Top = oItem.Top + 15
            oNewItem.Height = 19
            oNewItem.FromPane = oItem.FromPane
            oNewItem.ToPane = oItem.ToPane
            oNewItem.DisplayDesc = False
            oCheckBox = oNewItem.Specific
            'binding check box to source
            oCheckBox.DataBind.SetBound(True, "OITM", "U_CheckPro")
        End Sub
    >>>

  • Search for recordsgreater than 45 days and between user input fields

    Hi,
    How can I query where the
    Status id '3' greater than 45 days from the setup_date. (which is the sysdate)
    select ppcontract from proj_track where status_id = '3' and SETUP_DATE >= ADD_months (sysdate, +1.5)
    Also, How can I put a search criteria to the query which selects the creation_date between the beginning date (user input field) and the end date (user input field)
    I guess it would be like this, but it doesn’t work
    and creation_date between :p12_start and :p12_end
    Thank you in advance. Rav
    Message was edited by:
    user486969

    Try out this.
    Where START_DATE = Trunc(Sysdate) - 45
    Assuming both input fields are text/varchar2 type,
    DT Between To_Date(BEGIN_DT,'MM-DD-YYYY) And To_Date(END_DT,'MM-DD-YYYY)

  • Input Readiness of Query with optional variables

    Hi,
    I built one input ready query which is input ready upon execution with only one set of selections, for any other set of selections, it is not input ready.Query is built on aggregation level on the top of multiprovider. There are no data slices built, No lock entries in RSPLSE as well. Is it like if a variable in the selection screen of the query is optional, will it be moved to free characteristic and because of that input readiness of the query will disappear?? In my case, country is authorized variable which is optional. Please let me know if any one has solution for this.
    Thanks,
    Bindu

    Hi,
    Check if:
    1. You have added characteristic InfoProvider in filter area and restricted that to your plan cube?
    2. Any Keyfigure in query will have input-ready cell only if all the characterictics in the aggregation level of that query has unique values for that cell.
    In your case you have moved Country to free characteristic area and might have not provided any value for it as it's optional. So system is not finding a unique value for this characteristic for input-ready cells.
    Enter value for Country variable and then execute, query will be input-ready.
    Regards,
    Deepti

  • How to create SAP Business Analytics Prof. User in BO XI?

    Hi experts,
    we've some users of type "SAP Business Analytics Prof. User" in our contract with SAP. How to create this kind of users in CMC? I've created them in our ERP-System, but is there a way to attach them to BO user administration?
    Thanks and best regards,
    Max

    Hi Max,
    In terms of users in XI3.1 you have 2 options:
    1. You can manually create Enterprise Users in the Users and Groups area of the CMC.
    or;
    2. You can import the BW users in from your SAP system, done via the Authentication - SAP area of the CMC
    I'm assuming the SAP Business Analytics Prof users mentioned in your contract are simply users who are licensed to use the SAP Business Analytics product. If so when your uses are in the XI3.1 system, you can simply add them to a SAP Business Analytics group and give them access to the application. If user access to SAP Business Analytics exceeds the licence count then subsequent logons to SAP Business Analytics will be denied.
    I hope this is a very helpful answer to you.
    If not please clarify further.
    Kind regards,
    John

  • WGM creates new home folders with _unknown user/group, SA can't change it

    A little background:
    In our school we've got an xserve (about 1.5 yrs old), that was having issues last year. (the OD database pretty much ate itself). in august we did a clean install of 10.5, and updated to 10.5.3 (after suffering through the AFP/OD issues in 10.5.2). Because of the corrupt database from the last server, and the fact that a large number of our accounts have migrated through 4-5 iterations of servers from 9.2 on through 10.4.11, we created all new clean accounts by hand in WGM and moved the user files to the new home folders, changed user and permissions with SA to the new accounts and propogated that info to all the files for each home folder. everything has been going fine since then.
    until this week.
    the issue was discovered when we tried to create a new staff account (we created several accounts last week with no issue). in WGM everything looked fine. it created the account, assigned it to the proper group, and sucessfully created a home folder. the problem however was when we went into SA to change the permissions. we don't need everybody seeing everyone else's files, so we change the default group and everyone permissions to something more appropriate (don't even get me started on that gripe). When you navigate to the new home folder you just created in WGM, it shows the owner as _unknown (read/write) and group _unknown (read only... I think), Everyone (read only). Server Admin refuses to change the user or group. doesn't matter whether you use the 'show users/group' dialog and drag the account, or whether you edit it manually and insert the short name or UID. when you hit save, it stubbornly reverts back to unknown/unknown for user and group. we've tried creating accounts with different templates, no template, different account names and UID's, all with the same result.
    The odd part is that nothing in the OS has changed since we first set it up and created all the users. nothing installed, nothing updated...
    We've stayed at 10.5.3 due to the disaster in one of the updates (10.5.5 I think) that many of our other local districts had with network accounts not being able to see their own library folders due to permission issues, as well as the AFP causing 100% CPU use bug reported with 10.5.5
    A second, probably related issue is that when browsing home folders in Server Admin filesharing, any files our network users create seem to end up assignedunknown/unknown for user and group (as far back as October it seems). After searching around the net most of the day I came across a lot of info about the _unknown user issues for folks upgrading from 10.4, but these are all newly created 10.5 network users (not local) logging in and working in home folders on the server. The original owners can read/write/delete these files as normal.
    Any help would be most appreciated.

    ok... I find we were shot in the foot by one of our own.
    The quick answer: DO A GET INFO ON THE VOLUME WITH THE SHAREPOINTS! if the 'ignore permissions on this volume' box is checked... UNCHECK IT!
    Explaination: not sure how the ignore permissions box got checked, but I don't think it was done directly by human hands. we use Carbon Copy Cloner Ver. 3.something (not sure which at this point) to back up both our data (daily) and server (weekly) drives to remote storage. by striking coincidence, things started saving with _unknown user and group about the same time as crash reporter shows that CCC hosed itself. My guess is that CCC temporarily ignores permissions (as shown in the status when you do a clone) and then resets them to their original state. when it crashed, it looks like they were still set to ignore, so it happily set it back to that state every time it ran after that. not sure why the account creation issue suddenly turned up after so long... In any event, it turns out that if you have sharepoints on a server volume, AND you set the OS to ignore permissions on that volume, BAD things happen (I'm not sure it should even be an option on a shared volume, but that's for the engineering folks to figure out.) .... specifically, the symptoms above. if you login as root (yeah, I know that's something you should never do) and uncheck the ignore permissions box on the volume, then log into WGM, as root (yeah, yeah, I know... even worse) and set ALL of the Directory Administrator accounts to 'do not administer this server', and no change rights for the directory, save those settings, and then set them back to 'administer this server', and FULL rights to change the open directory, save again. and then WAIT until the drives stop going nuts... after that everything works fine.

  • Create a dynamic query with or/and

    Hello!
    Please help to accomplish the following:
    User needs to create a dynamic query.
    There are few select lists: sex, race, state …
    User selects whatever he needs from select lists, which would become the first part of the “where clause” – i.e. (sex = ‘M’ AND state = ‘NY’).
    Then the user wants to add an additional condition using “OR/AND” – i.e. i.e. (sex = ‘M’ AND state = ‘NY’) OR (sex = ‘F’).
    I have been able to build the first clause and pass to a variable. I need to be able to clear the values in the select lists, but keep the value stored in the variable, and then append each new clause to the variable. This needs to be event driven by an item on the page.
    Any help is appreciated.
    Thank you in advance.

    Hi,
    At that point my application works fine.
    But I need to add ability to clear select lists and enter a new condition with 'OR'
    operator.
    The final SQL statement should look:
    select employee_id, name from employee_v where (sex = ‘M’ AND state = ‘NY’) OR (sex = ‘F’)
    Thank you.

Maybe you are looking for

  • HT1848 I have an iphone and an ipod mini currently showing as 2 separate libraries - how do I combine them into 1?

    i'm not very techy - can someone help me in simple, laymen's terms?!  thanks.

  • Navigation won't work on  menu buttons

    Hi I created a menu with apple template-light index in DVDSP 2.05 and added (dragged) motion assets (each chapters video clip) to the buttons. I used overlay colors=advanced and mapping type=grayscale for the norma-selected-activated states of the bu

  • Delta In infospoke

    Hi BW Gurus,    Can any body please give me idea about how delta works in Infospoke. I have to download around 80000 records data from infocube(Reques id say R1, R2 and R3)to DB table. Do i need to create two info spoke (1 for full upload and another

  • Date formatting with java and axis

    Hi, My wsdl file has date field which uses xsd:dateTime data type. In my web service implementation java class I am passing value to this variable using Calendar.getInstance(). I am using Axis framework. When I check my soap output using TCP monitor

  • Design wirless lan

    HI PLZ Provide me a link related to: how to design wirless lan 10xs