LOOKUP and retreiving values

I need to retreive some data from an other application with a logic.
Pour une logique je vais avoir besoin de rechercher des données dans
une autre application. J'air echerché des trucs sur SDN et sur la Doc
mais les exemples ne sont pas tres clairs. Voila mon problème :
Here is the example :
The logic is called in the application COGS
The data to retreive are in application SALES
SALES has one dimension more than COGS : it's CHANNEL. I need to retreive data only from CHANNEL="D12V_COMMON".
I need to retrive data only from the dimension Time = 2020.JAN
Here is my Code
*LOOKUP SALES
*DIM CHANNEL="D12V_COMMON"
*ENDLOOKUP
*WHEN LOOKUP(SALES)
*IS <> 0
*WHEN TIME
*IS 2020.JAN
*REC()
*ENDWHEN
*ENDWHEN
*COMMIT
The logic doesn't trough any error but it doesn't retrieve any data either.
Can you the errors ?
Do you have some full example of logic that retreive data from one application ?
Do you have some link for documentation? I found only example of Rate but i can fit them to my issue.
Best regards
Damien

The log file; does it indicate that you have values from your LOOKUP process?  You might try to add more parameters to the the LOOKUP, that you have in the scope of the send process. The trick is to make sure that the matches occur at the Account as well.  So if there is a specific account to lookup, you need that as well in the logic, or lookup or both. 
Once you can see that it has data in a set, then the Script must be able to match a scope from the send to the lookup set.  If the lookup app has 1 more dimension than the script app, then you may need another lookup variable to create a match.

Similar Messages

  • How to connect database(oracle 10g) and retreive values using poral 10

    can anyone help me how to connect to database and retreive values in detail and also please post the sample code if u have any.

    Hello
    Thanks for your reply
    I tried to connect and here is the result: see below
    [oracle@ebstailin 11.1.0]$ sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.7.0 - Production on Sat Jul 17 15:35:31 2010
    Copyright (c) 1982, 2008, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> CONNECT apps/apps
    Connected.
    SQL>
    But still cannot connect using ORACLE SQL Developer
    thanks

  • RFC lookup with context values importing and exporting

    Hi,
    Input parameters for my RFC Lookup:
             one simple field: Occurrence 1
             one table type: Occurrence N
    I am getting table values from RFC Lookup
    and I need to repeat all values in the target structure.
    I am not able to capture the all values in the mapping: Help needed.
    Ramesh

    Hi Ramesh,
    If you want to use the first output to be repeated in all your mapping, try using the UseOneAsMany tool in the Message Mapping.
    HTH
    Regards,
    Juan

  • Urgent! Display lookup value and return value at the same time.

    We are using pop up lov.
    How can we display lookup value and return value at the same time. let me claer..
    Our lov query is like fallowing
    select dname, deptno from dept
    we want to return deptno column into a database bind text item and dname column into a display item (look up)
    can we do it (we need to do)
    thanks for your help.

    We did it .
    But pop up key lov (display description return value ) property doesn't appear for tabular forms item.
    (Report Attributes pages Tabular Form Element section display As property list)
    can we set or not.
    Thank you.

  • Insert multiple rows in on table and retreive sequence values

    Hello,
    I'm searching a way to insert several rows in a table that needs a sequence and retreive its.
    For one row i use ExecuteScalar method with the following SQL is :
    INSERT INTO MY_TABLE(MY_PK)
    VALUES(SEQ_MY_TABLE.NEXTVAL) RETURNING MY_PK INTO :MY_PARAMETER
    The aim is to insert several rows at one time. Currently I execute this SQL :
    INSERT INTO MY_TABLE(MY_PK, MY_VALUE)
    SELECT SEQ_MY_TABLE.NEXTVAL, MY_VALUE
    FROM (
    SELECT 0 MY_VALUE FROM DUAL UNION ALL
    SELECT 1 MY_VALUE FROM DUAL
    This query works well but i'm wondering how to retreive all sequence values generated by this query.
    Is it possible and how ?
    Thank you.
    Sebastien

    I tried this :
    string sql = "INSERT INTO MY_TABLE(MY_PK, MY_VALUE) " +
    "SELECT SEQ_MY_TABLE.NEXTVAL MY_PK, MY_VALUE FROM ( " +
    "SELECT 0 MY_VALUE UNION ALL " +
    "SELECT 1 MY_VALUE) " +
    "RETURNING MY_PK BULL COLLECT INTO : RETURN_IDS";
    using(var manager = myFactory.CreateDbManager()) // Initializes the connection and encapsulates ADO objects
    manager.SetCommand(sql);
    var cmd = (OracleCommand)manager.Command;
    cmd.ArrayBindCount = 2;
    var p = new OracleParameter();
    p.DbType = DbType.Int64;
    p.ParameterName = "RETURN_IDS";
    p.Direction = ParameterDirection.Output;
    p.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
    p.Size = 2*sizeof (long);
    cmd.Parameters.Add(p);
    cmd.ExecuteNonQuery();
    var result = (Oracle.DataAccess.Types.OracleDecimal[])p.Value;
    But I have an error ORA-00933 that indicates that the query is wrong at "RETURNING MY_PK".
    .......................................................................................................^
    Edited by: CITnDev on 1 août 2012 13:00
    Edited by: CITnDev on 1 août 2012 15:10

  • How to do a reverse lookup on a value set?

    I have a concurrent program which has multiple paramaters with various value sets. When I run reports, I want to dynamically list on the output the parameters the user gave. The problem is that these values are often the IDs and not the value the user sees.
    Are there any packages in applications that will let me to do a "reverse lookup" with the value sets to get the values the user saw?
    Thanks,
    Kurzweil4

    Hi Stomie,
    Based on your description, the network ID of your reverse lookup zone is 172.16.160.
    To create a reverse lookup zone, please follow steps below,
    Right click Reverse Lookup Zones, click New Zone, choose proper settings of
    Zone Type, Active Directory one Replication Scope,
    Reverse Lookup Zone Name type based on your actual situation.
    In the Reverse Lookup Zone Name page, check Network ID
    radio button, enter the network ID. For example, if the network ID is 172.16.160, then enter 172, 16, 160 in order. Then you will see it appears     
    160.16.172.in-addr.arpa in the Reverse lookup zone name edit.
    Or in the Reverse Lookup Zone Name page, check
    Reverse lookup zone name radio button, then enter the name of the reverse lookup zone directly. Such as, enter
    160.16.172.in-addr.arpa in the edit.
    Click Next twice, click Finish.
    Reverse lookup zone name end up with in-addr.arpa.
    Best Regards,
    Tina

  • Insert Value(s) in Lookup Flat Multi-valued Table with Java API

    I've been looking in MDM Java API Library Reference Guide, MDM SP4 API JavaDoc, and SDN Forums for information on how to Insert/Update different values in a field in the Main Table of a given repository that belongs to a Lookup Flat Multi-valued Table using the Java API with no success.
    I also haven't been successful in adding this values in the same way that I'll add a single value, using the MDM Java API, in a single-value Lookup Table (a2iFields.Add(new A2iField(FIELD_CODE,FIELD_VALUE)) for each value I want to add, like for example:
    a2iFields.Add(new A2iField("Country","USA")
    a2iFields.Add(new A2iField("Country","Mexico")
    a2iFields.Add(new A2iField("Country","Germany")
    Can anybody point me to the correct documentation that I need to read to fulfill this task? Or, even better, if someone can post a piece of code, I'll be more thankful.
    Thanks for your help.

    HI,
    little code example, where you add existing lookup values based on there record id:
         int USA = 1;
                        int GERMANY = 2;
                        A2iValueArray countryArray = new A2iValueArray();               
                        countryArray.Add(new Value(USA));
                        countryArray.Add(new Value(GERMANY));
                        A2iFields record = new A2iFields();
                        record.Add(new A2iField("Country", new Value(countryArray)));
    Please reward points if helpful.
    Regards,
    Robert

  • Lookup API - SPRAS value returned is not correct

    Hi All
    We are using the lookup API of XI to make a lookup in the SAP system and return values such as LAND1, and SPRAS. SPRAS has 2 kindoff value, one is the display value which is a 2 character value, and then the actual value which is a single character value. Internally a conversion routine takes care of converting this 2 character value to single character. For instance the countrykey of Poland is PL and its display SPRAS value is PL and actual value is L.
    While unit testing we get the correct value of 'L', but when we do the integration testing we get the display value of 'PL'. This is a problem we face when we use the Lookup API. But when I use a JCO call to make a lookup, I get the correct value being returned.
    This is a weird behavior, I am not sure if I overlooked something while using the lookup API. I even tried changing the function module to return a single char value, but still the wrong value is being returned with the lookup API. Could it be an issue with the Lookup API ??
    I used the code given in the following weblog,
    /people/francesco.bersani/blog/2007/03/05/data-lookup-optimized
    Any suggestion friends.
    regards
    Sameer

    Sameer,
    Using a single Function Module should not be an issue at all.
    Maybe there is some problem with,
    A) Either the logic of the Function Module written in R3
    B) Logic of your LookUp Code.
    It would be very difficult to say why you are facing this issue without looking at the code and the RFC but the way I see look up's if the FM code is valid and the Lookup Code is as per the corresponding Logic there should be no issue at all.
    I would suggest that you use the same test data that is causing the issue to test the FM in your R3 system and check what it returns . Is the output as expected. If yes, then time to look into your LookUP code.
    Add Trace statements and use this for debugging. Have found that they really help in real time to understand what is going wrong and why.
    Regards
    Bhavesh
    PS : Thanks for those encouraging words . It is also nice to see detailed questions on SDN that make life easy for everyone.

  • JDBC Scenario with JDBC Lookup and Updates

    Dear Experts,
    I am working on a JDBC receiver scenario.
    In this scenario, we are also using JDBC lookup to check the maximum EntyNumber which is a primary key. We are manually incrementing this primary key by one and inserting the record into the database.
    Both JDBC lookup and JDBC Insert are two differnt tasks. Thus when we send multiple IDOC's concurrently JDBC lookup fetches old values and when we try to insert the record if gives error of PRIMARY KEY VIOLATION.
    For example, consider the below scenario,
    Assume that there are already 10 records in the database.
    1. Two IDOCs No 1 and 2 sent from SAP system at the same time.
    2. Now, during the mapping of 1st IDOC we did a lookup and found that latest entry number in the database table is 10 and we mapped the entry number to 11 ( 10+1, i.e. next record )
    3. Before updating this record in the database, second IDOC triggered. During JDBC lookup of the sceond IDOC, we got the same entry as the earlier record has yet to be updated.
    4. During JDBC call we get the SQL error that "Primary Key Violation" because both the records have same primary key as "11".
    Kindly share your ideas.
    (SAP system is not sending the IDOC's in any certain order and we need a solution in PI itself. )
    - Shri

    >>> I am actually sending the primary key value to more than one table as a foreign key. I am looking for some solution
    If you are passing primary key value to many tables then jdbc lookup would not be solution. Use stored procedure.
    Refer this link for data type creation for stored procedure
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

  • Lookup and displayField

    I have a Lookup defined over a VO attribute. This lookup is using 2 different attributes as Value and Display (I store a code, but show a description). The problem is: when I define this attribute to be shown as displayField (read-only), this value is not showing the Display Attribute of my Lookup, but the Value Attribute. Anyway to solve this?
    My current workaround is to join the lookup table in my query and show the desired value as another attribute.
    This is NOT happening with Domains, only Lookups

    Idevaldo,
    I am not sure I understand your problem. Using display type "choice", this should not be an isue at all. In this case, you do not have to add the lookup entity object to your view object, if you set the lookup display attribute to "description", the description will show up in the drop down list.
    When using display type lov, you should add the lookup entity object with the description attribute to your view object, as you already did. Then, in your Lookup definition, you define this description attribute as base display attribute, and you should check the "Use LOv for Validation" checkbox. In the generated application, you can then enter values in the description field, and the lov will be used to validate this value, and to copy the corresponding code into the (non-displayed) code field.
    For detailed instructions, please refer to the Developer's Guide, chapter 3, section "Generating List of values".
    Or is you scenario somehow different from what is described in the developer's guide?
    Steven Davelaar,
    JHeadstart Team.

  • *LOOKUP AND *WHEN

    Dear Sap Expert,
    We are on SAP BPC NW 7.5 SP10.
    We have faced with the following problem.
    In ownership application we have several company with Method=25(Leaving Method.) 25 is transaction data.
    So in our Script Logic we need to make list of C_ENTITY members which have Method =25 (Leaving Method) in Ownership.
    If you look to script that i attached, you can see that
    1. We set list of all Entity using *SELECT COMMAND.
    2. Then for all this company we retrieve data from Ownership using *LOOKUP and *FOR.
    3, The last step is to make list Entity members which in *LOOKUP equal to 25. For solve this we use *WHEN and *XDIM_ADDMEMBERSET command also we use variable %LOOP_CUR% to set C_ENTITY. But this last step didn't work. When we look to XDIM_MEMBERSET C_ENTITY we see that all company was written on C_ENTITY, but we need to write just that company which have in LOOKUP 25.
    If you need any additional information about this issue, please feel free to ask it.
    Thanks,
    Kadraliyev Erlan
    *SELECT(%ENTITY_LIST%, "[ID]", C_ENTITY, "[CALC]=N")
    *LOOKUP OWNERSHIP
    *DIM C_CATEGORY="ACTUAL"
    *DIM GROUPS="CG001"
    *DIM TIME="2010.DEC"
    *DIM INTCO="I_NONE"
    *DIM O_ACCT="METHOD"
    *DIM MEASURES="PERIODIC"
    *FOR %LOOP_CUR%=%ENTITY_LIST%
    *DIM C_%LOOP_CUR%:C_ENTITY=%LOOP_CUR%
    *NEXT
    *ENDLOOKUP
    *XDIM_MEMBERSET C_CATEGORY = ACTUAL
    *XDIM_MEMBERSET C_DATATS = INPUT
    *XDIM_MEMBERSET FLOW = F_CLO
    *XDIM_MEMBERSET INTCO = I_NONE
    *XDIM_MEMBERSET C_M003 = M3_NONE
    *XDIM_MEMBERSET C_M004 = M4_NONE
    *XDIM_MEMBERSET GROUPS = NON_GROUP
    *XDIM_MEMBERSET TIME = 2010.DEC
    *XDIM_MEMBERSET MEASURES = YTD
    *XDIM_MEMBERSET RPTCURRENCY = KZT
    *FOR %LOOP_CUR%=%ENTITY_LIST%
    *WHEN LOOKUP(C_%LOOP_CUR%)
    *IS "25"
    *XDIM_ADDMEMBERSET C_ENTITY = %LOOP_CUR%
    *ENDWHEN
    *NEXT

    As far as i know , WHEN can only be used for masterdata filtering ,not for transaction data filtering in NW . Transaction data can be compared with boolean expression in REC statement.
    Is Method value changes frequently? If not, method can be maintained as property and entities list with method=25 can be retrieved with SELECT statement .
    If the purpose of transaction data comparison is to do  another calculation,it can be achieved with REC statement.Sample code is below.
    *FOR %LOOP_CUR%=%ENTITY_LIST%
    *WHEN ENTITY
    *IS %LOOP_CUR%
    *WHEN ACCOUNT
    *IS TESTACC
    *REC( EXPRESSION=LOOKUP(C_%LOOP_CUR%)=25? [ACCOUNT].[TESTACC]*2 : [ACCOUNT].[TESTACC]*3 )
    *ENDWHEN
    *ENDWHEN
    *NEXT
    Hope this helps.

  • Writing and retreiving clob

    I have written an xsl page which is very long (about 6k) and I think to store it in a table in a clob field so that I could retreive it later to apply to my xml page by using dbms_xmlquery.setxslt(queryctx,xslt_clob);
    I am trying to insert xsl page directly into a table like this:
    create table temp_table(xslt_clob clob);
    insert into temp_table(xslt_clob) values (
    '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <MainTag>
    </MainTag>
    When I do that I get an error:
    ORA-01704: string literal too long
    Are there any other ways to insert clob into and retreive it from a table?
    Thanx.

    I didn't see the fix for this posted, and I was running into the same thing.
    After trying to run the INSERT directly, I wound up creating a PL/SQL procedure to do the work. Once I did that it still wouldn't work and after some consultation with one of our DBA's he was able to get it to work. Then he went on to explain that SQLPlus has a problem with >4 or >6K for inserts's even though the CLOB is quite a bit larger so you have to create a procedure or package.
    CREATE OR REPLACE PROCEDURE Loadxmlstylesheet IS
    poXML CLOB;
    BEGIN
    poXML := '<?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet VERSION="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="env xs">
         <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:template>...</xsl:template>
    </xsl:stylesheet>';
    INSERT INTO xml_stylesheets
    VALUES (1, 'DBQueryToXMLOut', XMLTYPE(poXML));
    COMMIT;
    --Handle the exceptions
    EXCEPTION
    WHEN OTHERS THEN
         Pkg_Errorhandler.savemsg (p_code => SQLCODE,
    p_severity => 'F',
    p_message => SUBSTR (SQLERRM, 1, 900),
    p_src_name => 'loadXMLStylesheet',
    p_application_id => 'loadXMLStylesheet'
    END Loadxmlstylesheet;
    /

  • Formula behind fuzzy lookup Overall Similarity value

    Could someone help me in understanding how Fuzzy Lookup calculates the Overall Similarity value using the available fuzzy columns and how top n records are chosen? Is it based upon the similarity value ?
    Sowjanya Addanki

    This is a good white paper on Fuzzy lookup and explains most of internals on it
    http://msdn.microsoft.com/en-us/library/ms345128.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Read XML in BPEL and assign values to variables

    Hello,
    I need to read an xml message in BPEL and assign variables created in BPEL the values of elements in XML message. Whats the best possible way to do this.

    When you say"*read an xml message*", is the xml coming as input message or you need to read from file ?
    If you want to read from file, you can make use of the below function.
    Returns the string value of an element defined by lookupXPath in a XML file (docURL) given its parent XPath (parentXPath), the key XPath (keyXPath) and the value of the key (key). Usage: oraext:lookup-xml(docURL as string, parentXPath as string, keyXPath as string, lookupXPath as string, key as string)
    Example: oraext:lookup-xml('file:/d:/country_data.xml', '/Countries/Country', 'Abbreviation', 'FullName', 'UK') returns the value of the element FullName child of /Countries/Country where Abbreviation = 'UK' in the file d:\country_data.xml
    Thanks,
    Vijay

  • Avoiding null and duplicate values using model clause

    Hi,
    I am trying to use model clause to get comma seperated list of data : following is the scenario:
    testuser>select * from test1;
    ID VALUE
    1 Value1
    2 Value2
    3 Value3
    4 Value4
    5 Value4
    6
    7 value5
    8
    8 rows selected.
    the query I have is:
    testuser>with src as (
    2 select distinct id,value
    3 from test1
    4 ),
    5 t as (
    6 select distinct substr(value,2) value
    7 from src
    8 model
    9 ignore nav
    10 dimension by (id)
    11 measures (cast(value as varchar2(100)) value)
    12 rules
    13 (
    14 value[any] order by id =
    15 value[cv()-1] || ',' || value[cv()]
    16 )
    17 )
    18 select max(value) oneline
    19 from t;
    ONELINE
    Value1,Value2,Value3,Value4,Value4,,value5,
    what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
    thanks,
    Edited by: orausern on Feb 19, 2010 5:05 AM

    Hi,
    Try this code.
    with
    t as ( select substr(value,2)value,ind
            from test1
            model
            ignore nav
            dimension by (id)
            measures (cast(value as varchar2(100)) value, 0 ind)
            rules
            ( ind[any]=  instr(value[cv()-1],value[cv()]),
            value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
                                               and ind[cv()]=0     THEN ',' || value[cv()] END      
    select max(value) oneline
    from t;
    SQL> select * from test1;
            ID VALUE
             1 Value1
             2 Value2
             3 Value3
             4 Value4
             5 Value4
             6
             7 value5
             8
    8 ligne(s) sélectionnée(s).
    SQL> with
      2   t as ( select substr(value,2)value,ind
      3          from test1
      4          model
      5          ignore nav
      6          dimension by (id)
      7          measures (cast(value as varchar2(100)) value, 0 ind)
      8          rules
      9          ( ind[any]=  instr(value[cv()-1],value[cv()]),
    10          value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
    11                                             and ind[cv()]=0     THEN ',' || value[cv()] END 
    12          )
    13        )
    14   select max(value) oneline
    15   from t;
    ONELINE
    Value1,Value2,Value3,Value4,value5
    SQL>

Maybe you are looking for

  • How can I paste an image into a text/title box?

    Hi, I am putting together a 'memories' video using the 'Photo Album' theme in iMovie 11. What I want to do is insert some titles along the way (photo album type), have text above (no problem) with a still image in the box below. However, when I try t

  • PO and General Ledger Balance receiving accounts

    Hello, Can we compare report total of 'Receiving Value Report' (PO) (receiving a/c) with GL>Inquiry>Account, YTD (enter details and show balances button which displays YTD (receiving a/c))? If yes, what are the points we need to take care of. Thanks

  • Managed-property Syntax

    Hello, If I am trying to inject a managed bean with a managed-property of another object I've created in my system that is NOT another managed bean, what is the syntax for the value tag? I know that if my SummaryBO object were another managed-bean wi

  • Memory management while implementing JNI interfaces.

    The assumption here is that java code calls a C function from a shared library in Linux. How should memory management be done in the native code called from Java using a JNI interface? What role does the Garbage Collector play in handling memory that

  • HT4623 software updates and there is no option to update in settings menu

    My phone doesn't seem to be receiving software updates and doesn't give me the option in the settings menu.