Add Records to UDO Table

Hai,
I want to add records to the UDO table through vb.net coding. How to achieve it?
Thanks in advance!!!

Please check the GeneralService Object in the SDK help file. For example:
Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As SAPbobsCOM.GeneralData
Dim oChild As SAPbobsCOM.GeneralData
Dim oChildren As SAPbobsCOM.GeneralDataCollection
Dim oGeneralParams As SAPbobsCOM.GeneralDataParams
'Get GeneralService (oCmpSrv is the CompanyService)
Set oGeneralService = oCmpSrv.GetGeneralService("MainUDO")
'Create data for new row in main UDO
Set oGeneralData = oGeneralService.GetDataInterface(gsGeneralData)
oGeneralData.SetProperty "Code", "First"
oGeneralData.SetProperty "U_Data", "my data"
'Create data for a row in the child table
Set oChildren = oGeneralData.Child("ChildUDO")
Set oChild = oChildren.Add
oChild.SetProperty "U_Data", "child data"
oChild.SetProperty "U_Type", 6
'Add the new row, including children, to database
oGeneralService.Add oGeneralData
See the documentation for the GeneralService methods Add, Cancel, Close, Delete, GetByParams, GetDataInterfaceFromXMLFile, GetDataInterfaceFromXMLString, GetList, InvokeMethod and Update for more code samples

Similar Messages

  • How to add record in Qualified table using MDM Java API

    Hi experts,
    I am trying to add a record into a Table.
    but I am facing the problem in setFieldValue method.
    //Getting Field-ID to pass in setFieldValue() method.
    FieldId[] fields = new FieldId[6];
              fields[0] = repSchema.getFieldId("GTINs", "Description");
              fields[1] = repSchema.getFieldId("GTINs", "Unit_Descriptor");
              fields[2] = repSchema.getFieldId("GTINs", "GTIN");
              fields[3] = repSchema.getFieldId("GTINs", "Alternate_Item_Classifications");
              fields[4] = repSchema.getFieldId("GTINs", "Country_Of_Origin");
              fields[5] = repSchema.getFieldId("GTINs", "Bar_Coded");
    Record rec = RecordFactory.createEmptyRecord(mainTableId);
    rec.setFieldValue(fields, );
    but I am not getting how to assign the value to these fields using MDMvalue Interface.
    Can anyone provide me the code sample or Code flow so that I can do this.
    Plz help me it'll be great help for me.
    Thanks
    Tarun
    Edited by: Tarun Sharma on Feb 4, 2008 11:39 AM
    ==========================================================================================
    Hi Gurus
    I found the way to add the MDMValue in setFieldValue Method.
    we can set like this:
    setFieldValue(<fieldId object like fieldId[], <MdmValue like this> new StringValue("ABC"));
    Now I am facing problem in adding value to lookup flat table.
    According to the setFieldValue method we can assign the loookup like this:
    setFieldValue(<fieldId[0]>, new LookpValue(<here we have to pass the recordID of lookup table>);
    so I want to know how I can pass the recordId of lookup table here.
    Please suggest.
    Thanks
    Tarun Sharma
    Edited by: Tarun Sharma on Feb 4, 2008 3:15 PM
    Edited by: Tarun Sharma on Feb 4, 2008 3:25 PM
    Edited by: Tarun Sharma on Feb 8, 2008 6:58 PM

    Hi Andrea,
    I tried your suggestion but now i am getting Type Mismatch Error.
    Please suggest me what I can do?
    //TableId for Lookup[Flat].
    TableId lookupTableId = repSchema.getTableId("Return_Goods_Policies");
    FieldId[] ReturnGoodsPolicyTableIdFields = new FieldId[1];
    ReturnGoodsPolicyTableIdFields[0] = repSchema.getFieldId("Return_Goods_Policies", "Name");               
    Record recLookup = RecordFactory.createEmptyRecord(lookupTableId);
    try{
    recLookup.setFieldValue(ReturnGoodsPolicyTableIdFields[0], new StringValue("New_Brand"));
    }catch(Exception ex){
    System.out.println(ex);
    //Creating Record in Qualified Table - Request Details
    CreateRecordCommand createLookupcommand = new CreateRecordCommand(simpleConnection);
    createLookupcommand.setSession(session);
    createLookupcommand.setRecord(recLookup);
    createLookupcommand.execute();     
    //Getting the recordId of Lookup record.
    RecordId lookupRecordId = createLookupcommand.getRecord().getId();
    //Table Id for Qualified table.
    TableId  qualifiedTableId = repSchema.getTableId("Ext_Hardlines");
    FieldId[] ExtHardlinesFields = new FieldId[3];
    ExtHardlinesFields[0] = repSchema.getFieldId("Ext_Hardlines", "Name");//Text
    ExtHardlinesFields[1] = repSchema.getFieldId("Ext_Hardlines", "Pieces_Per_Trade_item");//Integer
    ExtHardlinesFields[2] = repSchema.getFieldId("Ext_Hardlines","Return_Goods_Policy");
    Record recQualified = RecordFactory.createEmptyRecord(qualifiedTableId);
    try{
    recQualified.setFieldValue(ExtHardlinesFields[0], new StringValue("Qualified Value"));
    recQualified.setFieldValue(ExtHardlinesFields[1], new StringValue("Qualified Description"));
    recQualified.setFieldValue(ExtHardlinesFields[2], new LookupValue(lookupRecordId));
    }catch(Exception ex){
    System.out.println(ex);
    //Creating Record in Qualified Table - Request Details
    CreateRecordCommand createQualifiedCommand = new CreateRecordCommand(simpleConnection);
    createQualifiedCommand.setSession(session);
    createQualifiedCommand.setRecord(recQualified);
    createQualifiedCommand.execute(); I am getting this Type match here, but i m not getting what mistake i did.     
    RecordId qualifiedRecordId = createQualifiedCommand.getRecord().getId();
    //Adding to Main Table
    TableId  mainTableId = repSchema.getTableId("GTINs");
    FieldId[] gtinsFields = new FieldId[1];
    gtinsFields[0] = repSchema.getFieldId("GTINs","Ext_Hardlines");
    Record recMain = RecordFactory.createEmptyRecord(mainTableId);
    //Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
    QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();
    qualifiedLookupValue.createQualifiedLink(qualifiedRecordId);
    try{
    recMain.setFieldValue(gtinsFields[0], new QualifiedLookupValue(qualifiedLookupValue));
    }catch(Exception ex){
    System.out.println(ex);
    CreateRecordCommand createCmd = new CreateRecordCommand(simpleConnection);
    createCmd.setSession(session);
    createCmd.setRecord(recMain);
    createCmd.execute();
    Could you help me out?
    Thanks
    Tarun

  • SBO2005SP01PL04: Inserting records into UDO - Tables

    Hi
    We need to fill up some values into UDO - tables. I know that there exists an method that uses a file at a specific place but our needs maybe need more flexibility because :
    - we will fill the values via Button that can be pressed whenever the user wants.
    - existing records with same "Code" shouldn't get overwritten.
    Thanks

    See Re: SBO2005SP01PL04: Copy UDO's of Type Masterdata from one DB to another

  • Add record in a table

    Hi,
    I have below requirement:
    If data value for for one record is -ve in a table, I need to add another record in the same table, same values as the original record for all columns and set data value as +ve.
    Is it possible to insert record in a table dynamically based on data value.
    I do not have any code at this moment to share with. Just want to know your thoughts.
    Thanks in advance

    Hi,
    Yes, that's possible.
    If you have any unique columns (and every table usually has a primary key), you won't be able to copy that value, of course, but there's no problem with doing a SELECT on a table, and INSERTing all the values you find back into the same table.
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to add record to DBA_JOBS tables

    Hi:
    I would like to know how can I insert a new record to DBA_JOBS table ?
    Thank you for your time!

    I want to assing following update statemtnet and schedule it.. Should I create a SP for this update (Ex: MY PROCEDURE), and then passs it to the dbms_job.submit ?
    update rte_note set record_mode_code ='OFFICIAL'
    where record_mode_code = 'WIP' and sys_create_time + 1 <=sysdate;
    exec dbms_job.isubmit(784, 'MY PROCEDURE', SYSDATE);

  • Add Record to UDO Doc and Doc Rows

    Good day, people.
    I have created a UDO of Document type and i also have the document rows. I have created a custom form using screen painter that is similar to say A/R invoice. Now i need to add a document and the document rows just like A/R invoice does.
    How do i do this via DI API?

    Hi,
    In help file for UDO you have this:
    Connect the user form to your UDO as follows:
    Set the FormCreationParams.ObjectType property to the Unique ID of your object. Sample
    To activate the navigation buttons in the application toolbar for your UDO, use the property DataBrowser.BrowseBy. Sample
    To support the Add, Update, and Find services in the user form, add an item of it_BUTTON type with unique ID '1' to the form object. Sample
    Best Regards.

  • Howcan we add records in fields in table"CRMD_PERS_LIST"and"CRMC_LISTCOLC"?

    Hi frnds,
    I have a problem in account application of our PCUI portal.
    In PCUI we personalize the fields that are returned in the search functionality by clicking the "Personalize" Tab under Accounts.
    In our case one of the user is getting differrent optons in the personalize popup than other , i debugged the class "CL_CRM_BSP_LIST_PERS" and found that the column list is comming from table "CRMD_PERS_LIST".
    If there is no records present in this table for a pirticular user it is picking form table "CRMC_LISTCOLC.
    The records from these table are fetched using the user name,View & Field group.
    Can any body tell me how we can add records in the table "CRMD_PERS_LIST" and  "CRMC_LISTCOLC" for pirticular user.
    Do we have any kind of customization ( in spro or blueprint) for maintaining data in these tables.
    Regards,
    Sandipan jena

    resolved my self

  • To add new record into the table Data Service client

    When I am trying to add new record into the table Employeedetails using Data Service client it is giving a sql exception: "java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1."
    Code:
    DataService ds=DataServiceFactory.newDataService(getInitialContext(),"EmplDetApp","ld:EmplDetAppDataServices/EmployeeDetails");
    EmployeeDetailsDocument edoc=EmployeeDetailsDocument.Factory.newInstance();
    edoc.addNewEmployeeDetails();
    //here I set the primary key value empid
    edet.setEmpid("1212");
    edet.setEmpname("manu");
    ds.submit(edoc);
    Error
    EmpName 5 java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1
    com.bea.ld.dsmediator.DataServiceException: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1
         at com.bea.ld.dsmediator.update.JDBCAdaptor.save(JDBCAdaptor.java:247)
         at com.bea.ld.dsmediator.update.DataServiceMediator.submit(DataServiceMediator.java:528)
         at com.bea.ld.dsmediator.update.DataServiceMediator.submit(DataServiceMediator.java:245)
         at com.bea.ld.ServerBean.submit(ServerBean.java:529)
         at com.bea.ld.Server_ydm4ie_EOImpl.submit(Server_ydm4ie_EOImpl.java:910)
         at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:492)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:435)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:430)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
         at java.lang.Thread.startThreadFromVM(Unknown Source)
    Caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1
         at weblogic.jdbc.mssqlserver4.TdsStatement.processWarning(TdsStatement.java:1178)
         at weblogic.jdbc.mssqlserver4.TdsStatement.parseMsWarning(TdsStatement.java:1089)
         at weblogic.jdbc.mssqlserver4.TdsStatement.getMoreResults(TdsStatement.java:756)
         at weblogic.jdbc.mssqlserver4.TdsStatement.execute(TdsStatement.java:210)
         at weblogic.jdbc.mssqlserver4.TdsStatement.executeUpdate(TdsStatement.java:97)
         at weblogic.jdbc.mssqlserver4.TdsStatement.executeUpdate(TdsStatement.java:1455)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:147)
         at com.bea.ld.dsmediator.update.JDBCAdaptor.save(JDBCAdaptor.java:151)
         ... 15 more
    But I am not sure why it is giving an exception as Violation of PRIMARY KEY.
    The update method works fine for the same client.
    The exception only happens when I am trying to insert a new record.
    Please help me to figure out this problem.

    If you are absolutely sure that you do not have such a row already in your table, open a case with customer support and reference CR321312. I believe the work-around is to put ld-server-core.jar in your client classpath.
    Correction: put ld-server-app.jar in the client classpath
    Edited by mreiche at 09/17/2007 3:28 PM

  • Add records in table ACCESS from labview by ActiveX

    I try to add records in table of database ACCESS by an ActiveX from labview but my programme doesn't work ...
    What is the problem ?
    I have attached my VI
    Thanks in advance
    hasna
    Attachments:
    base1.vi ‏35 KB

    On Thu, 11 Jul 2002 08:13:48 -0700 (PDT), Lab Viewer
    wrote:
    >I saw your previous posts related to ActiveX/Access. I once had the
    >same kind of problems. It's not an easy task (without a toolkit)
    >because you have to learn the "interface" provided by Access/DAO in
    >order to manage what you are trying to do.
    >In my case, the best solution it was to follow the Visual Basic for
    >Applications examples included in MS Access. Even though you don't
    >know VB, don't be afraid. Important is to figure out from that example
    >what methods/properties you need to use, the proper order to call them
    >and eventually some parameters. You are dealing with the same
    >methods/properties in LabVIEW, the difference is that you have them in
    >a graphical format instead of text
    .You can find these examples by
    >going to MS Access help > Index and type DAO objects and then choose
    >one to start with (Database, recordset, field =85).
    >
    >Hope this helps
    The examples on NI's website were originally written using the DAO
    model, but the latest one was written using the ADO model.
    However, I am unable to find either example LLBs on their website
    anymore. Maybe they're trying to push their SQL Toolkit.
    Along with the VBA help in MS Access, I *highly* recommend the book
    ADO Programming for Dummies. Wonderful book. Helped me understand the
    VBA help. :-)
    Again, if anyone is intersted in VIs using ActiveX that works. He/she
    is welcome to email me.
    Linda

  • Add a new record in database table without using table maintance generator

    Hi Expart ,
                  Plz. tell me how to add new record in database table without using table maintance ganerator ....give me one ex.
    Regards
    Bhabani

    Hi,
    The other way to safely handle the modification of tables is through is by programs that can be done with SE38 or SE80.
    To insert into database table we use INSERT statement :
    1. To insert a single line into a database table, use the following:
    INSERT INTO <target> VALUES <wa>.
    INSERT <target> FROM <wa>.
    2. To insert a several lines into a database table, use the following:
    INSERT <target> FROM TABLE <itaba>.
    Or even we can use MODIFY statementas this single statement is used to insert as well as update the records of database table.
    MODIFY <target> FROM <wa>.
    or MODIFY <target> FROM TABLE <itab>.
    thanx.
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:25 PM
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:30 PM

  • ESS - add a new column to Record Working Time table

    Hello all,
    My client would like to add a column to the Record Working Time table in ESS. They would like to add a column for Activity Name next to Activity Number. Can anyone tell me where this can be congured? Or would this be something I would need to hard-code in the ess~cat source code?
    Thanks,
    -Kevin

    I have figured out the 2 step process needed for this, involving Modifiable and Influencing. So I am able to add new fields. The only issue I am running into now appears to be dependant on the field name.
    I can add CATSD-VORNR
    But I cant add CATSDB-LTXA1
    I have tried a few variations and it seems i can add fields from CATSD but not from CATSDB?
    Has anyone else seen this or know what steps must be taken to display CATSDB-LTXA1?
    Thanks,
    -Kevin

  • Urgent: how to add additional records to hashed table

    Hi,
    I want to add records to a hashed table.
    my code is:
    data: ipn_pc_zoba type hashed table of tpn_pc_zoba with unique key vbeln.
    loop at izoba into wzoba.
    clear wpn_pc_zoba .
    read table ipn_pc_zoba into wpn_pc_zoba with key vbeln = wzoba-LS_KDAUF.
    if sy-subrc ne 0.
    wpn_pc_zoba-vbeln = wzoba-LS_KDAUF.
    append wpn_pc_zoba to ipn_pc_zoba.
    endif.
    endloop.
    The Error is :    You cannot use explicit or implicit index operations on tables with types "HASHED TABLE" or "ANY TABLE". "IPN_PC_ZOBA" has the type "HASHED TABLE". It is possible that .
    How to solve this?
    Please reply ASAP.
    Regards,
    SRI

    In your code you should use
    INSERT WPN_PC_ZOBA INTO IPN_PC_ZOBA.
    This is the only way to append data to a hashed table. It will also only work as long as wpn_pc_zoba-vbeln is unique in the hashed table.
    If you are getting an error, what does the error say?
    Michael

  • Is it possible to add records to tables using Enterprise Manager?

    Can we add records to tables using Oracle Enterprise Manager web interface instead of the sqlplus commands ? if not, is there any easy way to insert data into table using a graphical interface?

    You may consider using iSQL*Plus.
    Check http://www.oracle.com/technology/obe/obe10gdb/install/isqlplus/isqlplus.htm
    Thanks,

  • Add records to table T180a

    Godd morning
    I'm not able di add records at table T180a.
    I'm not do "append t180a".
    tables: T180A.
    DATA:lw_file  type string.                        " File Path
    DATA:  BEGIN OF t_itab OCCURS 0.
    INCLUDE STRUCTURE T180A.
    data: end of t_itab .
    lw_file = 'X:\Dokumente und Einstellungen\users\Desktop\t180a.TXT'.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                                      = lw_file
          FILETYPE                                   = 'ASC'
          HAS_FIELD_SEPARATOR           = 'X'
        tables
          data_tab                                      = t_itab
    loop at t_itab.
    move-corresponding t_itab to T180a.
    endloop.
    leave program.

    Do you have any idea what you are trying to do here? Looking at your code, I don't think you do since it's really bad!!! Sorry, but there is no other way to put this.
    What gave you the idea that table T180a would be updated using MOVE-CORRESPONDING??

  • Add records to the physical table from Internal table

    Hello,
    I am trying to insert the records from IT table to physical table. But, its not inserting. Please let me know how do I add the records to the table zebp_iv_cf_log.
    I have used only few fields for example *
    After looping I get about 800 records in it_non_ebp tab *
    loop at non_ebp_inv.
        it_non_ebp-zspgrv = non_ebp_inv-spgrv.
        it_non_ebp-zspgrq = non_ebp_inv-spgrq.
        it_non_ebp-zspgrs = non_ebp_inv-spgrs.
        it_non_ebp-inv_ref_num = non_ebp_inv-xblnr.
        it_non_ebp-zspgrc = non_ebp_inv-spgrc.
        it_non_ebp-zlifnr = non_ebp_inv-lifnr.
        append it_non_ebp.
        endloop.
        insert   zebp_iv_cf_log from table it_non_ebp[] accepting duplicate keys .
    I also tried inserting one by one by putting insert syntex within a loop but, it takes keeps processing.
    Shall appreciate the response.
    Thks & Rgds,
    Hemal
    Edited by: hemalgandhi on Jun 12, 2009 6:27 PM

    Hi,
    for the internal table you are using for appending , you must declare it with the header line option
    as
    data it_non_ebp type table of zebp_iv_cf_log with HEADER LINE.
    or else you can have a separate workarea of type zebp_iv_cf_log
    as
    data wa_zebp_iv_cf_log type zebp_iv_cf_log.
    then the code should be like :
    loop at non_ebp_inv.
    wa_zebp_iv_cf_log -zspgrv = non_ebp_inv-spgrv.
    wa_zebp_iv_cf_log -zspgrq = non_ebp_inv-spgrq.
    wa_zebp_iv_cf_log -zspgrs = non_ebp_inv-spgrs.
    wa_zebp_iv_cf_log -inv_ref_num = non_ebp_inv-xblnr.
    wa_zebp_iv_cf_log -zspgrc = non_ebp_inv-spgrc.
    wa_zebp_iv_cf_log -zlifnr = non_ebp_inv-lifnr.
    append wa_zebp_iv_cf_log to it_non_ebp.
    clear wa_zebp_iv_cf_log .
    endloop.
    and use 
       modify zebp_iv_cf_log from table it_non_ebp accepting duplicate keys .
    instead of
       insert zebp_iv_cf_log from table it_non_ebp[] accepting duplicate keys .
    Please try out and let me know of you face any problem

Maybe you are looking for

  • Urgent: dates calculation in alv

    hi, i am making ALV report in alv in whihc i ahve to dispaly the difference between two days i.e. DIFFERRENCE = 7 DAYS. CAN anybody provide me the example of it as it is urgent for me. points will be definately rewarded for correct awnser.

  • Insert and activate a phone number in a generated word document

    Hey guys, I would like to add a phone number to a word document that I generate using the mso api. In word, when one writes (Tel:00493298402938) and new line, the phone number is activated automatically. While trying to record the corresponding macro

  • Trouble installing Safari 4.0.5 on OS 10.5.8

    Trouble installing Safari 4.0.5 on OS 10.5.8 I downloaded an MP3 file and iTunes sad to upgrade QuickTime, which I did. Then it said to upgrade Safari to 4.0.3. I found my current OS would allow me to install 4.0.5, which I downloaded. When I tried t

  • Problem with iCal events after waking from sleep mode

    I have a daily iCal reminder that starts playing a playlist in iTunes at 6:00 am. However, if I leave the computer in sleep mode at night, and then manually wake the computer (BEFORE 6:00 am), the iCal event won't play on time...it's delayed 20-30 mi

  • Cannot Get Connection to Work, Please Help!

    I just signed up and got the 7500 wireless gateway, set up all the wiring as illustrated (double checked 4 times to be sure).  I have the E4 line going into my computer's jack and its supposed to provide wireless service anyway.  My computer says it