Wrong values from calculated field (Java API)

Hi All,
Help me please solve the problem.
We have a table with calculated text field in MDM repositor. For some records the value of this field in MDM Data Manager differs from the value returned when we read record by MDM Java API.
Parameters of system:
MDM ver.: 7.1 SP10
DBMS: Oracle
OS: Linux
The issue solved. I've found error in program code :-)
I apologize for the worry.

Assuming you want every field, the equivalent of "SELECT *" in SQL, you can use the RepositorySchema object to get a TableSchema, and with that get all FieldIds for the table.
If your RepositorySchema variable is rs it would be something along the lines of:
TableSchema mainTableSchema = rs.getTableSchema(mainTableId);
ResultDefinition rd = new ResultDefinition(mainTableId);
rd.setSelectFields(mainTableSchema.getFieldIds());
Hope this helps,
Greg

Similar Messages

  • Get Field Values from Table using Java api

    I am using the example java code "RetrieveLimitedRecords" that can be found at :
    https://help.sap.com/javadocs/MDM71/current/API/index.html
    The code give the expected result and retrieves the record count for the main table
    Now I want to get the values of the fields for one record
    I added the lines:
    Record[] records = recordResultSet.getRecords() ;
    FieldId[] fields = records[0].getFields();
    System.out.println ("Field Length = "+fields.length);
    and the output is::
    Field Length = 0
    How can I get the fields of the record and read their values?
    Thanks
    Nicolas

    Assuming you want every field, the equivalent of "SELECT *" in SQL, you can use the RepositorySchema object to get a TableSchema, and with that get all FieldIds for the table.
    If your RepositorySchema variable is rs it would be something along the lines of:
    TableSchema mainTableSchema = rs.getTableSchema(mainTableId);
    ResultDefinition rd = new ResultDefinition(mainTableId);
    rd.setSelectFields(mainTableSchema.getFieldIds());
    Hope this helps,
    Greg

  • Calculating values from repeated fields.

    I have a subform that repeatable, how to i calculate a value from a fields from the repeated values?

    Hi,
    Try using the following FormCalc code on the "total" field which is outside of your repeating row/subform:
    total.rawValue = sum(form1.Page1.Row1[*].Amount[*]);
    Row1 - Repeating Row
    Amount - Column dedicated to Amount
    Hope this helps
    Thanks,
    VJ

  • Search for a Multilingual value in MDM using JAVA API

    Good day,
    Could you kindly assist.
    I am trying to search for a field in MDM, from Portal using JAVA API. I do retrieve the value in English, but the problem is when I am trying to retrieve it in other languages. Please see sample code:
         private Search getSearch(MDMConnection mdmconnection,String value, TableId tableid){
              Search search =null;
              FieldSearchDimension fielddimension=null;
              TextSearchConstraint textcontrain=null;
              RepositorySchema reposchema =mdmconnection.reposchema;          
                                               if(value!=null)
                   search= new Search(tableid);
                   fielddimension=new FieldSearchDimension(reposchema.getFieldId("ATTR_VAL_ABBR","TEXT_VALUE"));
                   textcontrain=new TextSearchConstraint(value,TextSearchConstraint.EQUALS);
                   search.addSearchItem(fielddimension,textcontrain);
                   search.setComparisonOperator(Search.AND_OPERATOR);
              return search;
    Thank you in advance.
    Regards,
    Simni

    Hi ,
    Mdm- Multilingual value in MDM using JAVA API:
    you can check the first point as its reagrdign youisue related pdf and soloutions for your question.
    1.  http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
    2.  http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
    Hope this information helps you in solving the  issue!!
    Thanks&Regards
    AswinChandraGirmaji

  • Inserting a value from page field into an xml file

    Hi there,
    I have added a field 'Comments' on a create vacancy page.
    There are other fields on that page and the values from those fields are getting stored in an xml file.
    This xml file is getting stored in TRANSACTION_DOCUMENT column of table HR_API_TRANSACTIONS.
    Is it possible to add the value from the field (that I've added on the page) into the same xml file?
    If yes, please tell me how
    and if no, tell me what should I do to store that value.
    Regards,
    Gaurav.

    Hi Gaurav,
    You need to check in seeded files for the logic of generation of XML file and setting it in DB column. May be in PLSQL API this code would exist.
    Once you get that logic you can append your column value in XML tag (need to create new tag) if you are allowed to modify seeded API. Otherwise use free additional attributes of the table.
    Hope I am clear.
    Regards,
    Mukesh Uchaniya

  • Field with a default value from another field

    I need to populate a field as the default value from another field that the user inputs. I've tried the scripting that I found from the below Topic in the Archived Forums, but I'm not able to make it work. I've tried numerous variations and still to no avail. I tried to make the scripting work in Acrobat 6 and then decided that maybe I needed to upgrade, so I'm now trying it in Acrobat 8 with no results. Can anyone help?
    Topic
    Acrobat 5 - field with default value of another field
    Ben PF - 03:31am Mar 23, 2007 Pacific
    How can I have a field date2 which has the default value of field date1, but which can be edited by the user if necessary without changing the value of date1.
    I've tried, but I just can't figure it out!
    Any help much appreciated.
    Ben
    | Back to Topic List | Bookmark | Subscribe
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages
    2 messages. Displaying 1 through 2.
    First Previous Next Last Show All Messages
    Gene Dianoski - 5:22am Mar 23, 07 PST (#1 of 2)
    This, or some variation of this, should work:
    if(this.getField("date2").value == ""{
    this.getField("date2").value = this.getField("date1).value;
    | Bookmark back to top
    Ben PF - 6:49am Mar 23, 07 PST (#2 of 2)
    Thanks very much.
    I put it in at document level to start, but it didn't run the script automatically when date1 was first filled in, so I have put it in as a mouse exit action in date1 and it works a treat.
    Thanks for your help.
    Ben

    Okay forget what I posted above and lets start over. Go to your first field and under Properties -> Actions Tab -> Select Trigger -> On Blur Run A JavaScript.
    Put this:
    this.getField("myField2").value = event.target.value;
    Make sure that you replace ("myField2") with the actual name of your second field. I just tested this and it works for Acrobat version 6.
    I haven't been doing as much javascripting as I used to, so sometimes I too make some basic mistakes.

  • Deriving 1 Value from 2 Fields Based on Values in Fields

    I have a query that needs to return 1 of my values based on the values from 2 fields from 2 tables. However, the value should only be returned in 1 field and one of the fields should be evaluated first. If this first evaluated field has a certain value ('Y') then the other field is ignored.
    To be more clear, per the normal query below, what I want is to somehow, if possible, combine the case t2.el_contr and case t1.contr_type statements so that one field, say: mbr_contr_type_desc returns a value.
    So that if the value of t2.el_contr is 'Y' then 'SUB CHILD' is returned. It is important that this field should be evaluated first (If the value of it is 'Y' then the other field evaluation can be ignored). If this is not 'Y', then t1.contr_type should be evaluated and the values as listed below also returned to mbr_contr_type_desc.
    I know the following isn't correct, but it might better illustrate what I'm trying to do (the normal query is below this)
    case t2.el_contr
    when 'Y' then 'SUB CHILD'
    case t1.contr_type
    when 'A' then '1 PARTY MALE SUB'
    when 'B' then '1 PARTY FEMALE SUB'
    when 'C' then '2 PARTY MALE SUB'
    when 'D' then '2 PARTY FEMALE SUB'
    when 'F' then 'FAMILY MALE SUB'
    when 'G' then 'FAMILY FEMALE SUB'
    end as mbr_contr_type_desc
    In an Access query I would do the following in a column:
    iif([el_contr]='Y',"SUB CHILD',SWITCH([contr_type]="A","1 PARTY MALE SUB",[contr_type]="B" etc.))
    *NORMAL QUERY*
    select t1.ssn
    t1.type,
    t1.grp_id,
    t1.contr_type,
    t2.el_contr,
    case t2.el_contr
    when 'Y' then 'SUB CHILD'
    end as mbr_contr_type_desc_2,
    case t1.contr_type
    when 'A' then '1 PARTY MALE SUB'
    when 'B' then '1 PARTY FEMALE SUB'
    when 'C' then '2 PARTY MALE SUB'
    when 'D' then '2 PARTY FEMALE SUB'
    when 'F' then 'FAMILY MALE SUB'
    when 'G' then 'FAMILY FEMALE SUB'
    end as mbr_contr_type_desc_1
    from member_elig t1
    inner join grp_master t2 on
    t1.grp_id = t2.grp_id

    Perfect!
    Thanks, didn't know that existed. Still learning my way around pl/sql..
    One other (unrelated) question..when i hit the CTRL+LEFT ARROW* button in my SQL window, it will not tab back. This is really annoying! I have looked through PREFERENCES-EDITOR and can't seem to find any setting that will allow this. Do you know of any way to change this so I can tab backwards/fowards through code in the SQL window?
    Thanks for any suggestions!
    *Or CTRL+RIGHT ARROW for that matter..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • First occurence of a value from a  field in the internal table.

    How to select the first occurence of a value from a field in an internal table ?
    I don think , we can use select query .
    Any suggestions?
    provide syntaxs also .

    Hi...
    You have to use this code.
    DATA : Begin of IT_MARA occurs 0,
                 mtart type mara-mtart,
                 matnr type mara-matnr,
                 meins type mara-meins,
              END OF IT_MARA.
    START-of-SELECTION.
      SELECT MTART MATNR MEINS FROM MARA INTO TABLE IT_MARA.
    END-OF-SELECTION.
    LOOP AT  IT_MARA.
    <b>  AT NEW MTART.      "This will trigger for every first/new value of the field
                 <<<<WRITE YOUR CODE here>>
       ENDAT.</b>
    ENDLOOP.
    You can also use.
    LOOP AT  IT_MARA.
    <b> <b>  ON CHANGE OF IT_MARA-TART.   
                 <<<<WRITE YOUR CODE here>>
       ENDON.</b></b>
    ENDLOOP.
    <b>Reward if Helpful.</b>

  • I want a sum to include values from duplicated fields

    How do I set up my total to also include the value from added fields?

    Kit you want to use the simplified field notation option with field names that include punctuation or space, you have to escape each special character with a backslash. So "name1.1" would be entered as "name1\.1"

  • How to retrieve data from MDM using java API

    hi experts
    Please explain me the step by step procedure
    how to retrieve data from MDM using java API
    and please tell me what are the
    important classes and packages in MDM Java API
    thanks
    ramu

    Hi Ramchandra,
    You can refer to following links
    MDM Java API-pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49
    webinr of java API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/89243c32-0601-0010-559d-80d5b0884d67
    Following Fourm Threads will also help.
    Java API
    Java API
    Re: usage of  java API ,
    Matching Record
    Need Java API for Matching Record
    Thanks and Regards,
    Shruti.
    Edited by: Shruti Shah on Jul 16, 2008 12:35 PM

  • Remove 0 Value in Calculated Field

    I copied the below question for another post here as it asks the question perfectly.
    "I set up an invoice form to calculate totals from quantity x unit price. Every line has this formula, however the users may not have a priced item on every line of the form. My total column shows a $0.00 value until I input data. I'd rather have nothing show in that column unless quantity and price are entered. Is that possible?"
    However, and I apologize, but I don't understand the answer that was posted. This is the first time I've needed a calculated field -- and I've not done scripting in Acrobat before.
    Can someone walk me through the exact steps of how to enter and what to enter in the form to remove "0" values from the form?
    Thanks, in advance, for any and all help.

    Thanks, again, so much. I think I got it, the procedure that is! But, but the 0 is still there.
    This does now sound like a simple thing if you know the code. But apparently I'm not there yet!
    This is what I did.
    Under Advanced, Document Processing, JavaScript Functions.
    Entered two different scripts, as follows (this is exactly how I entered them):
    SCRIPT 1
    Name: ds_format
    Script:
    function ds_format()
    if (+event.value) {
    //$ format for nonzero values
    AFNumber_Format(2,0,0,0,"$",true);
    } else {
    //Don't show anything if result is zero event.value="";}
    SCRIPT 2
    Name: ds_keystroke
    Script:
    function ds_keystroke() {
    AFNumber_Keystroke(2, 0, 0, 0, "$", true);
    Then, under the calculated field properties (in my case, Total Cost),
    Format Tab, Custom Format, Custom Format Script section, I selected edit and typed in:
    ds_format();
    Ditto above, but under Custom Keystroke Script:
    ds_keystroke();

  • Need to get the values from "Signed" field from PDF form.

    Hi,
    This is Dinesh. I am PHP Developer. My issue is "I am not able to get the value of "signed" field from the PDF form when the form has been submitted.". I want to get the Digital Signature value of that field and i need to store it in the DB.
    Please help me here Or Please forward this issue to any of the PHP developer who solved this issue and let me know.
    Thanks & Regards
    Dinesh

    Hi Vikas,
    you can use this badi MRM_WT_SPLIT_UPDATE, the method will be WHTAX_SPLIT_UPDATE
    in this badi please see the importing and exporting parameters, you will get the  values of withholding tax code  as TE_RBWS in export parameters.
    Please search in google or SCN you will get how to use it.

  • How to copy value from one field to another in a Apex Form

    Hello guys,
    There are 2 addresses one is shipping and other is billing. I do not want the customer to re-enter all the details if it is the same address. So based upon an action, it should take the live values from one address field and populate the other address field. I know in JS you can do it, but how to implement that in Apex?
    I guess using Dynamic Actions to achieve this in Version 4 but do not know how. Read quite some info but no luck.
    Thanks in advance!

    Hi,
    I have assumed that you have your shipping address at the top of the page, and then further down the page you have your billing address that you want to enable the users to copy (if this is in reverese, you will need to switch the js variables in the code following).
    I would create a Select List item above the 'Billing Address' details, called PX_SAME_ADDRESSThis select list would be static, with the options Null.
    I also assume you would have pairs of address page items such as:
    PX_SHIPPING_ADDRESS_L1
    PX_BILLING_ADDRESS_L1
    PX_SHIPPING_ADDRESS_L2
    PX_BILLING_ADDRESS_L2
    PX_SHIPPING_POST_CODE
    PX_BILLING_POST_CODEThen copy the following code into the HTML Header of the page definition:
    <script language="JavaScript" type="text/javascript">
    function copyAddress()
       if( $x('PX_SAME_ADDRESS').value == 'YES')
         $x('PX_BILLING_ADDRESS_L1').value = $x('PX_SHIPPING_ADDRESS_L1').value;
         $x('PX_BILLING_ADDRESS_L2').value = $x('PX_SHIPPING_ADDRESS_L2').value;
         $x('PX_BILLING_POST_CODE').value = $x('PX_SHIPPING_POST_CODE').value;
       else //Clear Address Fields
         $x('PX_BILLING_ADDRESS_L1').value = " ";
         $x('PX_BILLING_ADDRESS_L2').value = " ";
         $x('PX_BILLING_POST_CODE').value = " ";
    </script>Then, in your PX_SAME_ADDRESS item, copy the code below into the Element > HTML Form Element Attributes field.
    onChange="copyAddress();"Hopefully this works for you too, and should give you some basis to play around with.
    Amanda.

  • Copy value from one field in subform, to another field in a different subform

    Hi all.  I have been back and forth with enterprise support, and they are telling me what I want to do is impossible.  I find that hard to agree with, so hoping I can get some help here.  I have a document that I am creating, based off an XML.  The page consists of a header subform, a flowing table of variable name, and then a footer.  My problem comes in, that when the table flows to mutliple pages, my header subform will not repeat, even though I have it set as the overflow header.  According to Enterprise Support, this is by design.  The header will repeat on the footer page, if that is on a separate page, just not when the table flows to another page.  So, I came up with a solution to create an additional Header in my table, merge all the cells into one column, and copy my subform into that new header.  I would set that header to appear only on subsequent pages.  So, when I preview my document, it shows the static text fine, as I would expect, however the text fields are blank.  I need a way of copying the values from the original header subform, into the newly created table header subform.  The values will be different based on teh XML input, meaning that the first 3 pages will have one set of values, and the next 3 another, etc..  See sample below...
    <NameValueList>
         <NameValue>
              <NameValueName>Name1<NameValueName>
              <NameValueDesc>Desc1<NameValueDesc>
               <TableValueList>
                   <TableValue>
                        Blah
                   </TableValue>
                   <TableValue>
                        Blah 2
                   </TableValue>
              </TableValueList>
         </NameValue>
         <NameValue>
              <NameValueName>Name2</NameValueName>
              <NameValueDesc>Desc2<NameValueDesc>
              <TableValueList>
                   <TableValue>
                        Blah 5
                   </TableValue>
                   <TableValue>
                        Blah 6
                   </TableValue>
              </TableValueList>
         </NameValue>
    </NameValueList>
    So, if I bind my original header to NameValueName, it will show on the first page which has my header, and the third page that has my footer.  But my 2nd page, that has the table flowed to it, has a blank value.  I tried to put code in the Initialize event of both text boxes, to copy from MainHeader.NameValueName to TableHeader.NameValueName, but that didn't work properly. 
    Any ideas on how to do this?

    Thank you very much for the reply.  I tried putting the copy statement in both the MainHeader and TableHeader initialize events.  There was different behavior, depending on the place I put the copy statement, however neither was correct.  If I put it in the initialize of the TableHeader, the NameValueName that appears on other page is Name1.  Even though the header shows Name2 when it hits the next nodes.  If I put it in the initialize of MainHeader, nothing is copied on the proper table header pages.
    I initially had Master pages, however that really didn't work.  The master pages traversed the NameValueName nodes on it's own loop.  So, Each page displayed the next value in it's own loop, when the main subform loop is still showing data from the previous value.  I know this might be hard to understand, but I'm doing my best to explain.  THanks again for your reply, and I hope that there is another idea out there to fix this...

  • How do I use pots on my client machine to change values, from the field, on my server machine and all other client machines?

    I am using Lookout 4.5, build 12, and I am having a problem concerning pots. I have data tables created for the different size sewer stations my system monitors. For each station, there are setpoints for starting and stopping of the pumps. I want to be able to change the setpoints for a station on the client file using a pot and have it change on all other machines running Lookout. I did this in 3.8 using DDE, but I don't want to use DDE anymore.
    I created a pot on the client file and URL'ed it to a pot on the server. On the server I created a table with a generic member "A" named "Lead Setp" and then created a member "A1" named
    "C5_1LeadSetp" then a member "A2" named "C3_1LeadSetp" and so on....
    In this table I connected the generic member "A" to the Pot I created on the server, and I connected A1 to its corresponding setpoint signal coming in from the field.
    On the client file I connected (in the table similar to the one on the server but with all signals for the station) the "A1" member to the setpoint signal coming in from the field, and I connected the "A" member to the Pot I created on the client file which is URL'ed to the pot on the server file.
    But, when I change the value of the pot on the client file, only the pot on the server and the "A" member in the table on the server change to the value of the pot on the client. The "A1" member whose screen I am changing the values from on the client does not change! This is the last thing I have to do and my file will be completely converted to 4.0. Does anyone have any ideas?
    Thanks for any responses..
    GBWY
    Jason
    Jason Phillips

    Hi Jason,
    If I understood your task correctly, you want to change the Setpoints on the Server DataTable using Pots from different clients. And also reflect these changes on the clients locally.
    You correctly remoted the Pots on the Clients to the corresponding Pots on the Server. However, you do not need tables on your clients. All you need is Expressions on each client to the particular cell of the Clients.
    So, to summarize: On the Server, the Pots write to the DataTable. And since the Pots on the Clients are remoted to these Pots on the Server, you can affect any change using these Pots. Because of the common remote source (Server Pots, i.e.) all of these Pots will always be in sync. Finally, to get the Setpoints on the Clients, just insert Expressio
    ns to the Server's DataTable.
    I am attaching a simple example (exmpl.zip) which does this. There are three processes -- My_Server, My_Client1, and My_Client2. I had them setup on the same machine so the paths are all process relative, but you can always change those to computer relative or absolute and move the client processes to diff machines.
    Hope this helps.
    Rgds,
    Khalid
    Attachments:
    exmpl.zip ‏12 KB

Maybe you are looking for

  • Problem with flash in InternetExplorer 7

    Hi, previously I had a lot of crashes in IE 7 and it was caused by Flash10a.ocx. So couple of days ago I uninstalled and reinstalled the newest version of Flash player. Today the same problem occured with the following error message: Program error in

  • Crystal report SQL Command and using IN

    Post Author: geozuh CA Forum: Crystal Reports Does any one know how to get a multiple value prompts to work in Crystal report SQL Commands? I have an extremely large database and do not want to pull back all the records to the report. I know I can do

  • Packages Into Sql 2008 Executing By SSIS 2005

    Hy Guys , I have a environment Sql 2005 that all was migrated to Sql 2008r2 except SSIS Instance  .  So I migrated all packages of Old Instance to New Instance , Configure MsDtsSrv.ini/xml to new Instance and i am able to Connect By Sql SSMS   ( 2005

  • Log4j async appender and line number output

    Hello, I am trying to implement log4j in my application, and would like to log the caller class and the line number of the call. When I do not use async appender, the caller class and the line number are logged. However when I add the same appenders

  • Add button in WebClient UI

    Hi expert! We need to add a button in the WebClient UI, in BT116h_srvo component (quotation header). We do the following steps: 1. Tcode SM34 - Create an enhancement set (ZSET_CABECERA) in cluster view BSPWDVC_CMP_EXT 2. Tcode SM30 - Assign the enhan