Unable to read field value from main table - unexpected socket read error

Hi Friends,
While executing the below code, I am able to get the value of the field 'id' but i am unable to get the value for the 'materialnumber' field. i am getting the below exception
+com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
     at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:158)
     at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(RetrieveLimitedRecordsCommand.java:157)
     at updaterecords.main(updaterecords.java:126)
Caused by: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
     at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:100)
     at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:146)
     ... 2 more
Caused by: java.io.IOException: Unexpected socket read.  Result is -1.
     at com.sap.mdm.internal.net.DataSocket.receiveData(DataSocket.java:59)
     at com.sap.mdm.internal.net.ConnectionImpl.readInt(ConnectionImpl.java:417)
     at com.sap.mdm.internal.net.ConnectionImpl.nextMessage(ConnectionImpl.java:501)
     at com.sap.mdm.internal.net.ConnectionImpl.receiveMessage(ConnectionImpl.java:472)
     at com.sap.mdm.internal.net.ConnectionImpl.send(ConnectionImpl.java:209)
     at com.sap.mdm.internal.net.ReservedConnection.send(ReservedConnection.java:105)
     at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:97)
     ... 3 more+
import com.sap.mdm.commands.AuthenticateUserSessionCommand;
import com.sap.mdm.commands.CommandException;
import com.sap.mdm.commands.CreateUserSessionCommand;
import com.sap.mdm.commands.DestroySessionCommand;
import com.sap.mdm.commands.GetRepositoryRegionListCommand;
import com.sap.mdm.data.Record;
import com.sap.mdm.data.RegionProperties;
import com.sap.mdm.data.ResultDefinition;
import com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand;
import com.sap.mdm.ids.TableId;
import com.sap.mdm.net.ConnectionException;
import com.sap.mdm.net.ConnectionPool;
import com.sap.mdm.net.ConnectionPoolFactory;
import com.sap.mdm.schema.FieldProperties;
import com.sap.mdm.schema.RepositorySchema;
import com.sap.mdm.schema.commands.GetFieldListCommand;
import com.sap.mdm.schema.commands.GetRepositorySchemaCommand;
import com.sap.mdm.search.Search;
import com.sap.mdm.server.DBMSType;
import com.sap.mdm.server.RepositoryIdentifier;
public class updaterecords {
     public static void main(String[] args) {
          try {               
                String serverName = "159.112.6.26";
                ConnectionPool connections = null;
                try {
                     connections = ConnectionPoolFactory.getInstance(serverName);
                } catch (ConnectionException e) {
                     e.printStackTrace();
                     return;
               // specify the repository to use
               // alternatively, a repository identifier can be obtain from the GetMountedRepositoryListCommand
               String repositoryName = "DEMO";
               String dbmsName = "MDMD";
               RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.ORACLE);
               // get list of available regions for the repository
               GetRepositoryRegionListCommand regionListCommand = new GetRepositoryRegionListCommand(connections);
               regionListCommand.setRepositoryIdentifier(reposId);
               try {
                    regionListCommand.execute();
               } catch (CommandException e) {
                    e.printStackTrace();
                    return;
               RegionProperties[] regions = regionListCommand.getRegions();
               // create a user session
               CreateUserSessionCommand sessionCommand = new CreateUserSessionCommand(connections);
               sessionCommand.setRepositoryIdentifier(reposId);
               sessionCommand.setDataRegion(regions[0]); // use the first region
               try {
                    sessionCommand.execute();
               } catch (CommandException e) {
                    e.printStackTrace();
                    return;
               String sessionId = sessionCommand.getUserSession();
               // authenticate the user session
               String userName = "meter1";
               String userPassword = "meter1";
               AuthenticateUserSessionCommand authCommand = new AuthenticateUserSessionCommand(connections);
               authCommand.setSession(sessionId);
               authCommand.setUserName(userName);
               authCommand.setUserPassword(userPassword);
               try {
                    authCommand.execute();
               } catch (CommandException e) {
                    e.printStackTrace();
                    return;
               GetRepositorySchemaCommand cmd=new GetRepositorySchemaCommand(connections);
               cmd.setSession(sessionId);
               try{
                    cmd.execute();               
               }catch(CommandException e){
                    System.out.println(e.getLocalizedMessage());
               RepositorySchema repsch=cmd.getRepositorySchema();
               // the main table, hard-coded
               TableId mainTableId = new TableId(1);     
               // specify the result definition (what to retrieve); in this example, nothing
               ResultDefinition rd = new ResultDefinition(mainTableId);
               // select all records
               Search search = new com.sap.mdm.search.Search(mainTableId);
               //get fields
               GetFieldListCommand getFieldListCommand = new GetFieldListCommand(connections);
               getFieldListCommand.setSession(sessionCommand.getUserSession());
               getFieldListCommand.setTableId(mainTableId);
               try {
                    getFieldListCommand.execute();
               } catch (CommandException e) {
                    System.out.println(e);
               FieldProperties[] lookupFields = getFieldListCommand.getFields();
               // add fields to records to retrieve
               rd.addSelectField(repsch.getFieldId("Products","Id"));
               rd.addSelectField(repsch.getFieldId("Products","MaterialNumber"));                              
               // retrieve the records
               RetrieveLimitedRecordsCommand limitingCommand = new RetrieveLimitedRecordsCommand(connections);
               limitingCommand.setSession(sessionId);
               limitingCommand.setResultDefinition(rd);
               limitingCommand.setSearch(search);
               //limitingCommand.setPageSize(2000);
               try {
                    limitingCommand.execute();
               } catch (CommandException e) {
                    e.printStackTrace();
                    return;
               System.out.println("Record count is " + limitingCommand.getRecords().getCount()+"\n");
               Record[] records=limitingCommand.getRecords().getRecords();
System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","Id"))+ " \n");
System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","MaterialNumber"))+ " \n");
               // finally destroy the session
               DestroySessionCommand destroySessionCommand = new DestroySessionCommand(connections);
               destroySessionCommand.setSession(sessionId);
               try {
                    destroySessionCommand.execute();
               } catch (CommandException e) {
                    e.printStackTrace();
                    return;
          } catch (Exception e) {
               System.out.println(e.getLocalizedMessage());
               e.printStackTrace();
Kindly let me know where i am going wrong. MaterialNumber field is a TEXT not a lookup table field.  Above fields are from the main table.
Thanks,
Raags

Hi Friends,
I got the solution. It was the error because of not having a the below statement.
limitingCommand.setPageSize(1);
As i havent used that statement, it was trying to get 1000 records, and i dont know exactly what makes this to get that error. Anyhow., As i want to use for updation, i cn live with one record.
Thanks,
Raags

Similar Messages

  • To find a field value from a table

    i want to get some field value from a data dictionary table.
    for eg Tragr from Mara. in Fields list it shows the field is in Mara table. but in content screen it does not showing the field at all. Actually of 220 fields of mara table only 99 fields are shown. how to view all the fields of a particular field. is there any setting is there.

    Hi Deva,
    When we execute any table by default SAP will display only few columns.(90 i guess) If we want to view all the columns of the table then do like this after executing the table i.e in ur table output.
    Menupath->Settings->User parameters->choose radiobotton
    Grid display Here u can see all the fields.
    If u don't want to see all the fields then do like this.
    Settings->listformat->Choosefields->Deselectall->Select what
    ever fields u want using the search button in bottom and press enter. It will display only selected fields.
    Some times we will come up with strange situations.
    EG: In the field list some field will be there. But if u select that field from that table in select query it will give u syntax error saying field xxx does't exist in table yyy. This field is nothing but text table field. If u want to select this field then u have to select it from the text table. U can find the text table exist for some table or not in
    Menupath->goto->text table. (In this case makt is text table for mara)
    Just check below code for ur reference.
    DATA: wa_mara TYPE  mara.
    SELECT SINGLE * INTO wa_mara FROM MARA .
    Here if u go to mara table u have field MAKTX But above select will not return the field maktx even we are refering wa_mara to data base table mara. We have to explicitly select it from MAKT.
    Hope this clarified all ur doubts.
    Thanks,
    Vinod.

  • How to replace NULL values from main table

    Dear all,
    I like to remove the NULL values from a main table field. Or the question is how to replace any part of the string field in MDM repository main table field.
    e.g.   I have a middle name field partly the value is NULL in some hundreds of records, I like to replace NULL values with Space
    any recommendation.
    Regards,
    Naeem

    Hi Naeem,
    You can try using Workflows for automatically replacing NULLs with any specific value.
    What you can do is: Create a workflow and set trigger action as Record Import, Record Create and Record Update. So, that whenever any change will occur in the repository; that workflow will trigger.
    Now create an assignment expression for replacing NULLs with any specific value and use that assignment expression in your workflow by using Assign Step in workflow.
    For exiting records, you will have to replace NULLs manually using the process given by Preethi else you can export those records in an Excel spreadsheet which have NULLs and then replace all NULLs with any string value and then reimport those records in your MDM repository.
    Hope this will solve your problem.
    Regards,
    Varun
    Edited by: Varun Agarwal on Dec 2, 2008 3:12 PM

  • Function module to fetch SOBID field value from hrp1001 table

    Hi,
    Is there any function module, to fetch the value of the SOBID field from hrp1001 table by passing RSIGN,RELAT,OTYPE,SCLAS field values to that function module.
    Regards,
    Shalini.

    Hi Sikindar,
    I am not able to find these function modules.I am getting message as function module not found.Please let me know is there any other function module.
    Thanks,
    Shalini.

  • Reading Field Labels from Lookup Table

    Post Author: Ohmylord
    CA Forum: Formula
    I'm trying to read the field labels from the database so I can have one set of reports and have them work in multiple languages by changing the display value. I created a lookup table that has these fields and values: ID    EnglishValue   DisplayValue1    Customer   Cliente2   CustomerNumber    Numero del Clienteetc.   I then created a formula field for each label (@Customer Label, @CustomerNumber Label).  The formula just contains the DisplayValue field.  Then I used Select Records and added a Where ID=1 or ID=2.  The problem is that whatever the last value I put in for the ID applies to each of the different formulas I created.  In other words, it reads the labels from the database, but they are all the same. It seems like it should be pretty easy but I'm obviously missing something. Most reports probably have 15 or so labels on them. Thanks for any help!  

    Post Author: Ohmylord
    CA Forum: Formula
    Here's some sample data from the table I created.
       Translation
       Autonumber
       ID
       EnglishLabel
       DisplayValue
      1
      1
      Customer
      Cliente
      2
      2
      Customer Number
      Codice Cliente
      3
      3
      Quote Date
      Data Quota
      4
      4
      Expiration Date
      Data Scadenza
    What I want on the report is 4 fields each one would show a different value. The simplified select statement I'm trying to get for the different fields is something like:Field 1 - Select DisplayValue where ID=1Field 2 - Select DisplayValue where ID=2etc for the other 2 fields.   When a different user has a different language we would just populate the DisplayValue with different data.  

  • Report query not returning the field value from external table

    hi
    I have an issue regarding reports. I have a query having 4 fields from external table and remaining from db tables. the report query returns all the fields from the db tables and only 2 fields from external table. but the same query if I tried in plsql developer it returns all the fields values.
    Can anyone please help me in this issue.
    Thanks and Regards
    kk

    Duplicate post?
    value not displaying in report whereas it returns in plsql developer
    value not displaying in report whereas it returns in plsql developer
    Please log a SR if you do not get any reply to your thread instead of creating new one.
    Thanks,
    Hussein

  • Read field value from another page

    Hallo,
    I have PAGE1.HTM (with MVC) with 2 input fields (country and state). For field STATE there´s a F4-button which calls PAGE2.HTM (page with logic) and in order to display the correct information for states I need to get the value in field country.
    I cannot send the value from page1.htm because the code is client-side for F4 (specially if it changes) and I cannot use
    var = document.getElementById("country");
    in page2.htm because it´s Javascript code inside ABAP code, which is not allowed (I think).
    Does somebody have an idea on how to collect that value or if I can use Javascript code in the event OnInitialization ??
    Thanks a lot

    Hi,
    that´s something I do when the content of the view is created and works Ok. The values of that content come from the data bank. The problem is when the user enters a new value and does not saves it !! in this case, the new value is not transmited to PAGE2.HTM because now we´re on client side.
    This is the code that creates the input field:
          tag_if  = cl_htmlb_inputfield=>factory( id = s_id
                                                 value = fieldname
                                                 visible = isvisible
                                                 disabled = isdisabled
                                                 isappendunit = 'True'
                                                 showhelp = dfies-f4availabl
                                                 dovalidate = 'TRUE'
                                                 onvaluehelp = openf4code ).
    and as far as I know, input field supports no event.

  • Reading any value from table into a string (Especially date etc..)

    How would I read any value from a table into a string?
    Currently doing the following...
    data ret_val type string.
    select single (wa_map-qes_field) from z_qekko into ret_val
    where
    angnr = _angnr.
    When the source field is a date it bombs though.
    The result goes into a BDCDATA-fval.
    regards
    Dylan.

    Tried...
    1    DATA: lp_data TYPE REF TO DATA.
    2    FIELD-SYMBOLS: <value> TYPE ANY.
    3    CREATE DATA lp_data LIKE (wa_map-qes_field).
    4    ASSIGN lp_data->* TO <value>.
    5    SELECT SINGLE (wa_map-qes_field) FROM zquadrem_qekko INTO <value> WHERE angnr = _angnr.
    Complains that (wa_map-qes_field) is not defined in line 3.
    Think that the bracket thing is only available via SQL.
    What about CREATE DATA lp_data type ref to object. ?
    Would the above declaration work?
    regards

  • Can one field of a variant of an ABAP4 program takes value from a table ?

    When I run an ABAP4 program, there is one input field called Time Stamp.  If I run the program directly (without selecting a variant), this Time Stamp field is filled with a field value from a table called TVARVC, but if I select a variant of this program, this Time Stamp field is filled with another field value of the table TVARVC.  It seems that the variant value can be filled with a value in system table, am I right?  If this is the case, then how it is programmed?
    Thanks
    Message was edited by: Kevin Smith

    Hi Kevin
    In the table TVARVC you should insert a new record which name (field NAME) have to begin with SAP_SCMA_ and the type (field TYPE)is P for parameter or S for select-options and the values (field LOW and/or HIGH) are your value.
    So you have to create a variant and for input field Time Stamp set flag SELECTION VARIABLE and then push button SELECTION VARIABLES. Now you have to insert the name of your record of TVARVC.
    So when user choose this variant the input field Time Stamp is filled with value you have entered in TVARVC.
    Now in TVARVC you can insert another record (if you want it isn't avaible for SELECTION VARIABLE function in the variant, you should give it a name it doesn't begin with SAP_SCMA_) and put this value in the input field Time Stamp during INITIALIZATION event:
    INITIALIZATION.
    SELECT * FROM TVARVC WHERE NAME = ......
        Time Stamp = TVARVC-LOW.
    Max
    P.S. you have opened two post with the same problem, close older one.
    Message was edited by: max bianchi

  • How to get input text values from adf table - Urgent

    Hi Friends,
    This is my requirement. I designed customized master - detail - detail page. I customized the page in below format.
    1. Master Data Field (Input text,etc) .
    2. Detail in table format ( Rows are mapped to child table) and i given two buttons for to create row and delete row. I designed the table based on the example provided in forum for to create customized table. The input text component is mapped to the rows.
    Now i want to retrieve all the data's entered in the rows. The table is mapped to child table. When i read the values from the table its showing null.
    If any one faced this problem and fixed it, please send me the solution.
    Thanks & Regards
    VB

    Did you look into the valueChangeEvent?
    It has oldValue and newValue attributes.
    public void SaveMaterial(ValueChangeEvent valueChangeEvent) {
    Object oldVal = valueChangeEvent.getOldValue();
    Object newVal = valueChangeEvent.getNewValue();
    // check if you see what you are looking for.....
    getSelectedRow();
    SaveMaterial(material);
    }Timo

  • Unable to delete Flat Table Field in Products (Main) Table..!!

    Hi Friends,
    I have created a flat table and assigned it to the main table as a field. Later i added data and also removed. Now , when i am trying to delete that field in the main table then i am getting the below error
    "<i><b>The field cannont be deleted until references to in the Family Tree are removed</b></i>"
    I checked in the Families, i havent found any entry.  I am new to the MDM.. I am unable to find the solution.
    Thanks,
    Raags

    I am able to solve problem. In the datamanager i found that the partition is done on this field. i removed it from family mode.
    thanks,
    raags

  • How  to retrieve a column field value from an ADF table ?

    All,
    I have a backing bean where I have bounded a field of an ADF table.
    I would like, in the bean, to read the value of that field so that I can use it inside a task flow router.
    The question: how to read a value from a ADF table column field ?
    In the bean I have the getter and setter of the RichInputText ADF table field. But when I type:
    System.out.println("the name is: " + this.getName().getValue());
    or
    System.out.println("the name is: " + this.Name().getValue());
    I get a null pointer exception.
    Thanks in advance,
    Sergio.

    Thanks Marvin, but this is not really what I'm looking for. Or at least, it does not sounds like to be :)
    I need to get the value contained in a row cell of an ADF table.
    Let's say the table (two rows, three cells) contains these values:
    "table_A", "123", "John"
    "table_B", "456", "Peter"
    When I click on the first row, I need the value: "table_A". Once I got that value, I extract the last char, in this case: "A", and then I call a specific task flow from a task flow router (specified in the task flow router Cases property).
    When I click on the second row, the same process applies, only the router now points to another flow view.
    So to summarize, I need to get the value of a row cell in an ADF table. How to do that from within a javaBean in JDeveloper 11g Release 2 ?
    This is what I have in the bean; so far I've bounded the related row cell (herkunft) to the bean. Each time I select a row on the ADF table, the function setHerkunft() runs - I see that from within the JDeveloper console - but when I try to get its value, I get a null value - hence the surrounding if statement.
    package bean;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ValueChangeEvent;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    +public class taskFlowBean {+
    public RichInputText herkunft;
    public static String taskFlowView = "C";
    +public taskFlowBean() {+
    System.out.println("taskFlowBean constructor call");
    +}+
    +public void setHerkunft(RichInputText herkunft) {+
    System.out.println("set herkunft");
    this.herkunft = herkunft;
    if (this.getHerkunft().getValue() != null )
    System.out.println("herkunft is: " + this.getHerkunft().getValue());
    +//here taskFlowView will set accordingly with the herkunft value.+
    +}+
    +public RichInputText getHerkunft() {+
    System.out.println("get herkunft");
    return herkunft;
    +}+
    +public String getTaskFlowView() {+
    System.out.println("get taskFlowView ! : " this.taskFlowView);+
    return this.taskFlowView;
    +}+
    +}+
    Regards,
    Sergio.

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • Error while inserting value Qualified field in the main table

    Hello,
    I am trying to populate Qualified field in the main table when a new record is inserted in the Products Repository.
    The field is Reference Price and its a qualified lookup field. I am using the below code to create qualified lookup value and create qualified link values.
    QualifiedLookupValue qlvRefPrice = new QualifiedLookupValue();
    TableId qltabid = repSchema.getTableId("ReferencePrices");
    FieldId qlfieldid = repSchema.getFieldId("ReferencePrices","RP_ReferncePrices");
    RecordId rdRefPrice = getRecordId(connPool,session,"RP",qlfieldid,qltabid);
    HashMap map = new HashMap();
    map.put(repSchema.getFieldId("ReferencePrices","StartDate_ReferencePrice"),new DateTimeValue(cal));
    map.put(repSchema.getFieldId("ReferencePrices","EndDate_ReferencePrice"),new DateTimeValue(cal));
    map.put(repSchema.getFieldId("ReferencePrices","ListPrice"),new FloatValue(Float.parseFloat("123.3")));
    map.put(repSchema.getFieldId("ReferencePrices","Currency"),new LookupValue(getLookupRecordId(connPool,session,"Currencies","Currency_Currencies","EUR")));
    QualifiedLinkValue qlvLinkValue = MdmValueFactory.createQualifiedLinkValue(rdRefPrice,map);
    qlvRefPrice.addValue(qlvLinkValue);
    emptyRecord.setFieldValue(fieldIdRefPriceHistory,qlvRefPrice);
    However when the createrecord command is executed I get the following error.
    java.lang.RuntimeException: No matching validation Id 97. at com.sap.mdm.internal.validation.ValidationInfoHelper.retrieveValidations(ValidationInfoHelper.java:71) at com.sap.mdm.data.commands.CreateRecordCommand.execute(CreateRecordCommand.java:246) at com.alcatel_lucent.productdetail.ProductItemDetail_Comp.createProduct(ProductItemDetail_Comp.java:2927) at com.alcatel_lucent.productdetail.wdp.InternalProductItemDetail_Comp.createProduct(InternalProductItemDetail_Comp.java:656) at com.alcatel_lucent.productdetail.ProductItemAddView.onActionSave(ProductItemAddView.java:971) at com.alcatel_lucent.productdetail.wdp.InternalProductItemAddView.wdInvokeEventHandler(InternalProductItemAddView.java:662) at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:761) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:696) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73) at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:869) at com.sap.tc.webdynpro.portal.pb.impl.localwd.LocalApplicationProxy.sendDataAndProcessAction(LocalApplicationProxy.java:77) at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1356) at com.sap.portal.pb.PageBuilder.SendDataAndProcessAction(PageBuilder.java:327) at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:869) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:219) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)      
    I spoke to my MDM team and they say there is no validation which they have put for Reference Price field. I have tried inserting values in another field of type qualified lookup in the same main table and that works without any issue.
    The code is as below:
    QualifiedLookupValue qlvRating = new QualifiedLookupValue();
    TableId qlvtable = repSchema.getTableId("ProductRatings");
    FieldId qlvratinglink = repSchema.getFieldId("ProductRatings","RatingLink");                    
    RecordId rdidPR = getRecordId(connPool,session,"CI",qlvratinglink,qlvtable);
    wdComponentAPI.getMessageManager().reportSuccess("rdidPR "+rdidPR);
    HashMap mapPR = new HashMap();
    mapPR.put(repSchema.getFieldId("ProductRatings","AvailRating"),new LookupValue(getLookupRecordId(connPool,session,"AvailabilityRatings","AvailabilityRating_AvailabilityRatings","CI")));
    mapPR.put(repSchema.getFieldId("ProductRatings","EffectiveDate"),new DateTimeValue(cal));
    mapPR.put(repSchema.getFieldId("ProductRatings","FERAIndic"),new LookupValue(getLookupRecordId(connPool,session,"ReplacementIndicators","Code","FE")));
    mapPR.put(repSchema.getFieldId("ProductRatings","FERAOrdItem"),new LookupValue(getLookupRecordId(connPool,session,"ReplProducts","ProdID","100008200")));
    QualifiedLinkValue qlvLink = MdmValueFactory.createQualifiedLinkValue(rdidPR,mapPR);
    qlvRating.addValue(qlvLink);
    emptyRecord.setFieldValue(fieldIdRatingHistory,qlvRating);     
    I would really appreciate if someone can help in solving the issue.
    Thanks in advance,
    Aamod

    Hi Aamod,
    Sees that some validation/assignments are getting triggered as soon as you make changes to the record in MDM. Please check once after removing validations/workflow that you may have. This way you may debug the issue.
    Hope this helps!!
    Cheers,
    Arafat

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

Maybe you are looking for