Using Form Variables in a Formatted Search

Hi everyone, I'm relatively new to SAP B1 and just trying to get some info. I have created a few formatted searches, but I am having trouble with this one in particular.
I am trying to get the 'Business Partner Type' Field under Business Partner Master Data (BP Type, [Form=134 Item=40 Pane=0 Variable=1 OCRD,CardType] to change the user defined fields category displayed [Form=-134 Item=9 Pane=0 Variable=62]
For example, when CardType is Vendor ('S' value), I'd like the user defined fields category 'vendor'( '1' value) to show
Here is my query
SELECT CASE
WHEN $[$40.0.1]='S' THEN '0'
ELSE WHEN $[$40.0.1]='C' THEN '1' END
Which is then assigned as a formatted search to that field.
I was trying to find some sort of definitive guide on form variables and formatted search queries; if anyone can point me in the right direction, I'd appreciate it (I have seen the $[$x.y.z] variables but I am not 100% sure on their usage).
Thanks in advance

Hi,
Try this:
SELECT CASE  $[OCRD.CardType\]
WHEN 'S' THEN '0'
WHEN 'C' THEN '1'
END
Please also response for your previous open thread. You may just close it if you do not like the answer.
Thanks,
Gordon

Similar Messages

  • Is it possible to use repository variable in conditional formatting

    Is it possible to use repository variable in conditional formatting . if no then is there any workaround for implementing the same....
    Also i came across a sql of an init block.. which goes like 'exec OracleBi..procedure_name'
    Is 'OracleBi..' a keyword or something like that....

    Refer http://www.biblogs.com/2008/09/03/obiee-repository-variables-filtering-and-conditional-formatting/
    Init blk is calling any procedure here with name OracleBI here...no any specific significance.
    Hope this help
    Edited by: Deepak Gupta on Aug 12, 2011 8:27 AM

  • Using a variable for the "format" parameter for disk/directory name

    In the interest of maintainability, I'm trying to use an environment variable in the format parameter. I've found that RMAN is able to interpret the $ORACLE_HOME and $ORACLE_BASE variables, but others give the error:
    RMAN-03006: non-retryable error occurred during execution of command: backup
    RMAN-07004: unhandled exception during command execution on channel t1
    RMAN-10035: exception raised in RPC: ORA-07217: sltln: environment variable cannot be evaluated.
    RMAN-10031: ORA-19583 occurred during call to DBMS_BACKUP_RESTORE.BACKUPPIECECREATE
    Is there any more specific documentation about what variables are supported within RMAN? (I've found nothing in the manuals beyond the excerpt I included below.) Does anyone know if the "port-specific directory" mentioned in the excerpt below
    can be modified/customized?
    Thanks....
    format 'format_string'
    specifies the filename to use for the backup piece. Any name that is legal as a sequential filename on the platform is allowed, provided that each backup piece has a unique name. If backing up to disk, then any legal disk filename is allowed, provided it is unique. If you do not specify the format parameter, RMAN stores the backup pieces in a port-specific directory ($ORACLE_HOME/dbs on UNIX).

    i have used a different directory other then port-specific one and i am able to backup .
    format '/disk2/app/oracle/test/%d_%s_%t' , i have given full path names instead of substitution variables. i am not sure how
    they(variables) will work though in rman.

  • How can we use  form variable in where clause while personalization

    Dear,
    I have a requirment for using select in personalization, actully we have created temporary table, now we want to get data from select satatement on event"when-new-record-instance' trigger, now in action tab i have selected action which is property and message, in message column showing value "${item.q_res.transaction_id.value}" it shows on validate button but when this form variable use in action type(property) which is consist on select statement "=SELECT to_char(QTY) FROM TEST_TABLE where transaction_id = ${item.q_res.transaction_id.value}" system didn't get value pressing validate button although there is a single record in customize table while without where cluase was getting data perfectly.
    please advice.

    >
    I am looking for to decode the actual db value something in different for my report.
    like if A then Accepted
    elseif R then Rejected
    elseif D then Denied
    these conditions I have to check in where clause.
    >
    what are you trying to do?
    may be you are looking for
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and
       (decode(:code, 'A','Accepted') = <table_column>
        or
        decode(:code, 'R','Rejected') = <table_column>
       or
        decode(:code, 'D','Denied') = <table_column>
       )

  • How to use "insert into & select" in format search

    Hello,
    I am just wonderring whether you can help me solve this issue.
    I want to change the value of a field in the title area for a sales quotation. however, this field is not shown up on the interface.
    For example, there is a field in the title area, "OQUT.Ref1". You actually cannot see this field from the quotation interface or any other doc. Now I want to update the value of this field.
    What I am now trying to do is to create an field named "update" in the title area, use format search to update. the code for the command will be something like
    Insert into $[OQUT.Ref1.0]
    select $[OQUT.U_MFG#]
    here, U_MFG# is UDF. as you may understand, I want to copy the value in the U_MFG# to the field of "Ref1".
    However, when I run "Execute", it gives me error. I believe there is something wrong with the code of "Insert into $[OQUT.Ref1.0]
    Does anyone know how to write the code?
    many thanks
    Stanley

    Thanks both Suda and sagar. The reason I wanted to do this is because I wanted to have UDF info be shown on the  MS word-templated quotation document.
    As you know, when you click the word symbol, a word-templated doc will be generated. The client needs two completely different format of quotation printout. thus I plan to print one type from PLD and other type by clicking the Word symbol. but later, I found out that the UDF field cannot be selected on the MS word template, or only system fields.
    Thus, the only way I can do is to copy the value from udf to some unused sytem fields and then show that system fields on the MS word template.
    any idea do you have?
    I wanted to tell SAP that It is not useful if the udf fields cannot be inserted into word template.
    thanks
    Stanley

  • Using Session Variable with Conditional Formatting Filter

    Hi,
    I'm trying to add a condition to my report in order to flag all opportunities that have a close date that is in the past. The way I'm trying to do this is by adding a condition to say when close date is less than current_date, flag the column with an image.
    Issue I'm having is that the filter window within conditional format tab appears to not have the session variable option as you do when you create a filter on a column the normal way. A colleague told me to use an SQL expression, but again this option seems to be unavailable too within the conditional format tab.
    Can anybody assist please?
    Thanks

    Create a new column and write a CASE WHEN condition like case when close date < current_date then 'Y' ELSE 'N' END.
    Then on your actual date column, you can do conditional analysis based on the newly created column for values having Y then the image.
    finally, you can hide the newly created column.

  • Using a variable in a Powershell search and replace string

    Hi
    a couple of days ago I posted a question about doing a search and replace with wildcards
    Search and repalce with Widcards
    I got a swift and very helpful answer but now I need to build on it.
    In a text file I wanted to replace all the text between two defined words.  the script I got was this
    $text = 'Some Server this bit of text varies Language stuff'
    $text -replace '(.*Server) .+? (Language.*)','$1 it will always say this $2'
    It works great but now I want to replace "it will always say this" with a variable and I can't figure out the correct grammar to make this happen.
    Can anyone help??
    Thanks
    Alex

    Here's one way:
    $replace = 'it will aways say this'if ( $text -match '(.*Server) .+? (Language.*)' )
    { "{0} $Replace {1}" -f $matches[1,2] }
    else { $text }
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • How to diplay database elements using form variables

    please tell me how to display inserted database items using a
    form field (like a text box) to display selected records using this
    form field

    jessyarai,
    > please tell me how to display inserted database items
    using a form field (like a text box) to display selected records
    using this form field
    Start by generating some pages using the Wizards for
    Master/Detail
    pages, Insert page, etc. with your database. Then switch to
    Code View to
    see the code that is generated. That's how I learned it :)
    Hope this helps,
    Randy

  • Formatted Search - Using field index to refer to UDF in many documents

    I have some UDFs in my marketing documents - say U_VALUE
    I want to write a fairly complicated formatted search and use it for the same thing across all my marketing documents.
    I don't want to use
    $[ORDR.U_VALUE]
    in my formatted search as this will only work in the sales order document.
    I want to use something like
    $[$4.0.0]
    which brings back the cardcode independant of the form we are looking at. However
    $[$U_VALUE.0.0]
    will not work!
    Hoping someone can help!
    Edited by: Daniel Abbatt on Apr 10, 2008 6:16 PM

    Yes you would have to have a UDF called VALUE on the marketing document for this example to run and even then it will error!
    That's the point, the code above will not work, SBO only seems to be able to know about ORDR in a sales order and OINV in an invoice. So if I am in a sales order, it errors on the reference to OINV, even though the code that uses the
    $[OINV.U_VALUE]
    is never actually accessed by the SQL. I guess this is because SBO does the substitutions before it executes the code.
    All I am basically trying to do is create a generic formatted search that will perform an action using the value of a UDF, say some formatting, the problem is I want it to work with any marketing document.
    The only way I can find to access a UDF though is by having to use the
    $[TABLE.U_FIELDNAME]
    way, which seems to mean by definition I can only create a formatted search to access a header UDF for a single type of document. I cannot create a generic formatted search, that reverses the string for example, and use that formatted search across all marketing documents.
    I know you can access normal fields also by their item reference, i.e.
    $[$4.0.0]
    , but this syntax does not seem to work with UDF, even though the system information shows the item reference as U_VALUE, I cannot use the
    $[$U_VALUE.0.0]
    which would be ideal...
    Edited by: Daniel Abbatt on Apr 14, 2008 12:05 PM

  • Problem With Formatted Search.

    Hi to all,
    I have linked a formatted search to a UDF that lies at row level in AP Invoice. This field is used to display the Sales  Order Price. The requirement is that from SO we create a purchase order and subsequently create a goods receipt and AP invoice.. Now in invoice it is showin perfectly fine whether it is copied from goods receipt or purchase order.. But in the purchase order and goods receipt screen this query will not work. And the same query used in AP invoice is being linked to these documents. Is there any work around for this?? Is it possible to run queries based on the form numbers?? If so ho do i pull the form number in the formatted search query??
    Please Help!!!!
    Regards
    Aris

    I recommend creating separate queries for each document.
    ie
    1 formatted search to lookup price on sales order from AP Invoice
    1 formatted search to lookup price on sales order from GRPO
    1 formatted search to lookup price on sales order from PO
    then change the lookup to pull fields from the document that you are using as a reference.
    when you are building the formatted searhes start by returning the values that are you are using as a reference. That way you are sure that you are pulling the correct information.
    Then layer in the lookup to the sales order.
    If you get stuck I recommend that you copy and paste the formatted search in SQL Server management studio and replace the variables refereces with real values.
    In my experience troubleshooting queries is more effective when using SQL Server management studio. (the error reporting is better).

  • Formatted Search and Item Events

    Hi,
      I am having a huge problem with using Formatted Search and Add-Ons.
    On the Sales Order Form I have a Formatted search Setup on the Customer Reference Number, it is set to Auto-Refresh when the CardCode changes.  This is the only Formatted search on this form and it works fine.
    However, when I run my Add-On, and enter an Item Code it takes about 30 seconds to display the Item Description. In tracing my Add-On it appears to call the Item Event et_GOT_FOCUS on the Item Code Column I just entered over 50 times.  I don't use other events, but for testing I did turn on all events and the only other event it occured with was et_LOST_FOCUS.
    If I turn off my Add-On or turn off Auto Refresh on the Formatted search everything runs as it should.
    I figure the Auto Refresh of the Formatted search has something to do with this, but I need to have this turned on.  Another thing is that it only seems to call this event when Before Action = false, It does not seem to be called on Before Action = True. 
    Can I disable the Formatted search temporarily from within my add-on or is there something else I need to do to keep this from happening.
    Thanks for Any Help
    Paul

    Hi Alfredo,
      Thanks for the suggestion, that sounds like it might be what I am looking for. But I am confused on trying to visualize how this would work. Do I need to duplicate the entire logic that Business One already does or are there some functions in the DI/UI that I can call that does the functions.  Since I am doing this from a System(Sales Order) not User Defined Form, does that change anything.  I did see the FormattedSearches Object to add a Formatted Search through the DI, but that seems like it will just create the Object and not help me execute it from my Add On.
    Is there some code snipits you could provide or get me going in the right direction on how to implement the formatted searches from within my Add-On. 
    Thanks Again,
    Paul

  • Currency Formatted Search problem

    Hi
    I am trying to creat a formatted search for the marketing docs price / unit price field that populates the field with the currency and money value. I have a lookup table defined in sap where i store the currency and price i want to populate the udf with, based on certain conditions from udf's on the marketing doc's lines.
    when i try to type in a price manually on the form e.g. USD 1 SAP accepts the value with no problems, however business one only lets me insert the actual money value in the field and then inserts the default currency ie if my local currency is ZAR and my formatted search returns a price of 1 then SBO automatically formats the field as ZAR 1.
    If i want to insert a value of USD 1 into the field with the formatted search then SBO returns an error message. I have tried variations such as returning 'USD 1', '1 USD', '1USD', 'USD1' with the formatted search, all of which return an error message. However if i manually type any of the examples in SBO accepts them and formats the column correctly.
    This is quite an important functionality requirement as the customer needs the ability to have different currencies on different lines of a marketing document.
    I have also tried using pricelist lookups with the formatted search but experience exactly the same problem in that i cannot specify the currency in the formatted search.
    If anyone has experienced this problem please let me know if you were able to come up with a solution as manually capturing the prices per line is not an option (documents are often in excess of 500 lines)

    Hi Philip,
    Your question is obviously about functionality of the B1 application - rather than the B1 SDK - and thus might fit better into the "SAP Business One" Forum: SAP Business One Application
    However, I tried to use the non-LC in a Formatted Search in B1 2007 - and I didn't have a problem with that.
    Maybe it's just a bug (that has been fixed)?
    Maybe you should consider using an Add-On / SDK?
    Maybe there's just sth wrong in your query? ...are you sure that your "USD 1" variations are exactly as you wrote?
    Regards,
    Frank

  • CAN I PASS FORM VARIABLES TO THE DATABASE PROCEDURE IN PERSONALIZATION

    When I try to use form variable in the database procedure call from personalization I get the attached error.
    Under forms personalization
    From Actions tab --> builtin --> Execute Procedure when I call a database procedure and pass one of the form variable as parameter I get "ora-01008 couldn't be validate" error
    Can we pass on form variables to the database package using personalization ? If yes, then is this the right way?
    Message was edited by:
    omitchel

    I tried customizing the Quoting Form, it works.
    What you have done is correct, but this is how you call it
    ='begin
    db_proc('''||${item.qothddet_main.quote_name.value}||''');
    end'
    here
    qothddet_main : block name
    quote_name : item name
    Thanks
    Tapash

  • Formatted Search Query for BatchNo

    Dear All,
    I am using the following query as formated search for Identifying the batches availble during the creation of  Delivary document
    in a user defined column at row level. When i click on this field it's showing the Batches for the Item with Zero Qty also.
    I need to display only the batches where the QTY >0. This query displaying even the Zero Qty Batches also. Please help me to modify the below query for getting the above. Below is the  query .
    SELECT distinct  T4.[BatchNum] FROM [dbo].[OIBT]  T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN DLN1 T2 ON T1.ItemCode = T2.ItemCode INNER JOIN ODLN T3 ON T2.DocEntry = T3.DocEntry INNER JOIN IBT1 T4 ON T0.BatchNum = T4.BatchNum AND T3.DocNum = T4.BaseNum INNER JOIN OWHS T5 ON T0.WhsCode = T5.WhsCode WHERE T0.[ItemCode] = $[$38.1] AND  T4.[WhsCode] = $[$38.24] AND T0.[Quantity]>=$[$38.11]
    Regards
    Srini

    i removed that T5, But It's  showing the  Batches where the qty in the main warehouse for that batch is Zero.That batch was actually present in another warehouse. And also when i am working on other warehouses it's showing the batches in the main warehouse where the qty is present.
    Regards
    Srini
    Edited by: Srini on May 11, 2010 10:24 PM

  • 2 Formatted Searches on the same field

    Good Evening
    Experts:
    I thought maybe one of you might have come across a similar need to what I have to do and could help out.  I have a screen that uses Whse id as the unique identifier for each record. I have a Formatted search on the Whse id in my screen that displays the Whse Code and Name from the OWHS table.  This is good for adding records so the User can see which ones are valid in the table OWHS. However, when I switch to Find mode,  I would like the User to see a list of records for my screen by Whse Id. 
    So, the Add needs to see all the valid Warehouses(OWHS) and the Find needs to see all records in my screen table that have been entered. 
    Do you have any suggestions how I can achieve this?
    Thanks,
    Ed

    Thanks for responding Owen...
    After re-reading my question here this morning, it appears I was not very clear in my explaining what I need to do here. 
    Table OHWS has the following records:
    Whse     Name
    01          Location 1
    02          Location 2
    03          Location 3
    04          Location 4
    I have a custom screen with a field called Whse id...it is the unique identifier for the table records in a table called "Test".
    I started with the Add on my custom screen and put a formatted search on the Whse id field(Select Whse, Name from OWHS).  This is great for the User when doing an Add so they can see all the possible Whse to pick from. 
    So, the User adds a few records to the "Test" table and they might look like:
    Whse     Item     Buyer
    01          X          Joe
    04          Z          Bob
    Now, when in Find mode for that Whse id field on my custom screen, I want the Formatted search to display the Whse's in my "Test" table that have been used  already.  So, the Formatted search would display 01 and 04 instead 01,02,03 and 04 like it would for the Add.
    Thanks,
    EJD

Maybe you are looking for