Adding batch records using DI API 6.7

I am trying to add multiple records to a UDT using the DI API. When I add the second and subsequent records and do not specify the values for certain of the fields, they contain the old values when I add the record to the table. I tried using "" as the value but this sets the char fields to empty strings and the numeric fields to 0's. I would like to have these values be null in the DB but the statement:
tbl.UserFields.Fields.Item(k).Value = System.DBNull.Value;
Does not work. Only the following seems to work but is not what I want.
tbl.UserFields.Fields.Item(k).Value = "";
Do I have to delete and recreate the tbl object for each record?

Hi Gary,
Unfortunately you are right and found a gap:
DI API does not support setting Value back to "empty"/"null"... - except for memo fields.
I.e. the only way to get this is currently to delete / recreate the tbl object for each record - or use a SQL statement in case this is not tolerable in terms of performance.
Regards,
Frank

Similar Messages

  • Audio recording using KinectStudio API

    Hi, I'm using KStudio APIs to record raw data from the kinect v2.
    I found some documents and I can now record the raw color and IR data. However, I cannot find a way to include the audio beam using EventStreamDataTypeIDs class. Would you let me know how to add audio in the recorded xef file?
    i am attaching a part of my code.
            private void InitKStudio()
                client = KStudio.CreateClient();
                client.ConnectToService();
                streamCollection = new KStudioEventStreamSelectorCollection();
                streamCollection.Add(KStudioEventStreamDataTypeIds.UncompressedColor);
                streamCollection.Add(KStudioEventStreamDataTypeIds.RawIr);
    Thank you in advance!

    see
    https://social.msdn.microsoft.com/Forums/en-US/b5aba44f-6928-4121-b500-52cdd5a92de1/record-data-depth-and-audio-kinect-for-windows-v2?forum=kinectv2sdk
    Carmine Sirignano - MSFT

  • Null Pointer Exception while Retrieving Records using Java API

    Hi,
        I am using the Class RetrieveLimitedRecords, to retrieve he records from the main table.
    While using this class I am getting an error Null Pointer Exception, when there are no records matching the search criteriea.
    Could anybody tell me how to ignore this error.
    Thanks,
    Priya.

    Hi,
    Thanks for the reply.
        There is no any class which automatically handles, so we should handle exceptions individually.
    Thanks,
    Priya.

  • Adding New Records Using BPC Data Manager

    Hi All,
    Thanks for reading my post.
    I have a requirement in which file format is as given below
    Account|Category|Time|RptCurrency|Amount|Quantity
    I am able to upload Amount into my application, I need to update Quantity into another account. I have tried options using *NEWCOL(A) with combinations of with and without Header file format. In case of without header my Transformation is as following:
    ============================================================
    *OPTIONS               
    FORMAT = DELIMITED               
    HEADER = NO               
    DELIMITER =                
    SKIP = 0               
    SKIPIF =               
    CREDITNEGATIVE=NO               
    VALIDATE_RECORDS=YES               
    *MAPPING               
    ACCOUNT = *COL(1)               
    CATEGORY = *COL(2)               
    DATASRC = *COL(3)               
    ENTITY = *COL(4)               
    RPTCURRENCY = *COL(5)               
    Time=*COL(6)               
    AMOUNT=*COL(7)               
    *CONVERSION               
    ============================================================
    I need to add another Mapping to read the Quantity coming in the file but moment I do that, BPC Transformation  reports error that Account dimension is already mapped and in second case when I have two columns in the file   with Header, Data manager reports error "DUPLICATE SIGNEDDATA"
    I may end up having another dimension to store quantity, will appreciate your comments which can be give me some hints to fix this issue. 
    Regards,
    Umesh

    Umesh,
    What you are trying to achieve is not standard possible. You have in fact two columns with measure data in it, this is not possible with some workarounds.
    One possibilitie is that you create a ssis package that in fact loads in the file twice, each go with each own transformation/conversion files, the first go will then load in the amounts, the second the quantity. You have to make sure that the second go is a merge instead of a clear and replace.
    Another possibilitie is that you create a ssis that  first load in the delivered file in a staging table, combine the amount and quantity table, dump the records to a tempfile and than load in this file using one transformation/conversion file.
    I have an example package that does the second possibilitie (never looked/used this package myself, just got it in my library), please drop me an email if you want this example.
    Alwin

  • Bug report (and solution): adding multiple records through Java API in bulk

    I have found some bugs in the Java API (version 4.1.25) that makes it impossible to add mulitple values in bulk to a RECNO database. The fixes are as follows:
    MultipleEntry.java, line 80:
    "DbUtil.int2array(curr_off, this.data, pos);"
    should be replaced by
    " DbUtil.int2array(recno, this.data, pos);"
    MultipleRecnoDatabaseEntry.java, line 130:
    "return append_internal(data, doff, dlen, recno);"
    should be replaced by
    "return append_internal(data, offset, len, recno);"
    Regards,
    Johan Walters

    Hello,
    It looks like there were some corrections to this area in the post 4.1 i.e. 4.2 release. And I do not see these same issues in the current 5.1.25 release. If you do find them in the current release, just let us know.
    Thanks,
    Sandra

  • How to create relationship between two records using MDM Java APIs

    Hi,
    I am trying to create relationship between two records using Java Apis. Please guide me in doing this.
    Regards,
    Niraj

    Hi Niraj,
    There is ModifyRelationshipsCommand:
    http://help.sap.com/javadocs/MDM/SP06/com/sap/mdm/data/commands/ModifyRelationshipsCommand.html
    Retrieve Relationship command:
    http://help.sap.com/javadocs/MDM/current/com/sap/mdm/schema/commands/GetRelationshipListCommand.html
    Also, please refer similar thread, MDM Java API and relationships.
    Hope it helps..
    Regards,
    Mandeep Saini

  • Need Sample Code for Vendor creation using JAVA API

    Hi,
    I have a scenario like Vendor creation using <b>Java API</b>.
    1.I have Vendors (Main) Table.
    2.I have <b>look up</b> tables like Account Group.
    3.Also <b>Qualifier table</b>(Phone numbers) too.
    Could you please give me the sample code which helps me to create Vendor records using Java API?
    <b>I need Code samples which should cover all of the above scenario.</b>
    <b>Marks will be given for the relevent answers.</b>
    Best Regards
    PK Devaraj

    Hi Devraj,
    I hope the below code might solve all your problem:-
    //Adding Qualified field
    //Creating empty record in Qualifed table 
    //Adding No Qualifiers
    Record qualified_record = RecordFactory.createEmptyRecord(new TableId(<TableId>));
    try {
    qualified_record.setFieldValue(new FieldId(<fieldId of NoQualifier), new StringValue(<StringValue>));//Adding No Qualifier
    catch (IllegalArgumentException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    catch (MdmValueTypeException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    //Creating Record in Qualified table
    CreateRecordCommand create_command = new CreateRecordCommand(connections);
    create_command.setSession(sessionId);
    create_command.setRecord(qualified_record);
    try
    create_command.execute();
    catch(Exception e)
    System.out.println(e.toString());
    RecordId record_id = create_command.getRecord().getId();
    //Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
    QualifiedLookupValue lookup_value = new QualifiedLookupValue();
    int link = lookup_value.createQualifiedLink(new QualifiedLinkValue(record_id));
    //Adding Yes Qualifiers
    lookup_value.setQualifierFieldValue(0 , new FieldId(<FieldID of Yes Qualifier>) , new StringValue(<StringValue>));
    //Now adding LookUP values
    //Fetch the RecordID of the value selected by user using the following function
    public RecordId getRecordID(ConnectionPool connections , String sessionID , String value , String Fieldid , String tableid)
    ResultDefinition rsd = new ResultDefinition(new TableId(tableid));
    rsd.addSelectField(new FieldId(Fieldid));
    StringValue [] val = new StringValue[1];
    val[0] = new StringValue(value);
    RetrieveRecordsByValueCommand val_command = new RetrieveRecordsByValueCommand(connections);
    val_command.setSession(sessionID);
    val_command.setResultDefinition(rsd);
    val_command.setFieldId(new FieldId(Fieldid));
    val_command.setFieldValues(val);
    try
         val_command.execute();
    catch(Exception e)
    RecordResultSet result_set = val_command.getRecords();
    RecordId id = null;
    if(result_set.getCount()>0)
         for(int i = 0 ; i < result_set.getCount() ; i++)
         id = result_set.getRecord(i).getId();     
    return id;
    //Finally creating the record in Main table
    com.sap.mdm.data.Record empty_record = RecordFactory.createEmptyRecord(new TableId("T1"));
    try {
         empty_record.setFieldValue(new FieldId(<FieldId of text field in Main table>),new StringValue(<StringValue>));
         empty_record.setFieldValue(new FieldId(<FieldId of lookup field in Main table>), new LookupValue(<RecordID of the value retrieved using the above getRecordID function>));
    empty_record.setFieldValue(new FieldId(<FieldId of Qualified field in Main table>), new QualifiedLookupValue(<lookup_value>));//QualifiedLookUp  value Retrieved above
    } catch (IllegalArgumentException e1) {
    // TODO Auto-generated catch block
         e1.printStackTrace();
    } catch (MdmValueTypeException e1) {
         // TODO Auto-generated catch block
         e1.printStackTrace();
    //Actually creating the record in Main table
    CreateRecordCommand create_main_command = new CreateRecordCommand(connections);
    create_main_command.setSession(sessionId);
    create_main_command.setRecord(empty_record);
    try
         create_main_command.execute();
    catch(Exception e)
         System.out.println(e.toString());
    Thanks
    Namrata

  • COEBR Unable to generate batch records - weird error!

    Hey Experts,
    I am trying to create Electronic Batch Records using COEBR. Unfortunately, I am getting a weird error. After a few batches get selected based on the selection criteria, when I click "Batch Record" I get the message "Unable to generate batch records". But when I reselect the same batch and click "Batch Record" again I get the following message: "Batch record(s) successfully generated". But actually no batch record gets created...SAP is lying to me!!!! The icing on the cake - no logs get created as well.
    The "Batch record required" indicator is set both on the Material Master (Work Scheduling) and the Order-Type dependant parameters.
    One more thing, I was able to generate one, just one Batch Record but thereafter the darn thing broke!!!
    I am stumped, really need some help.
    Thank you in advance.
    John
    Edited by: JohnS99 on Mar 18, 2010 11:35 AM

    Himani,
    If you want to just create PDFs from FM via the command line, then using one of the available FM batch utilities might be an easier route.
    Check out:
    DZbatcher at: http://www.miramo.com/english/overview/download.html
    runfm as part of mif2go and is fully functional in the mif2go demo. See: http://mif2go.com/xhtml/runfm_0002_363understandingrunfmcommandlinesyntax.htm#Rz134x44547

  • How to create a batch by adding a record to any Z Table

    Hi Experts,
    I am doing online billing info system. I need to quey the NAST table for unprocessed entries. One of the  requirement is to create a  batch  What is meant by creating a batch by adding a record to a Z Table?
    If anyone is aware, please tell me how to do it.
    Thanks
    Dan

    I think this is a question you should ask the person that gave you the specs.
    Rob

  • Iterate through all the records in a table using Java API

    Hi All,
    What is the easiest way to iterate through all the records in a given table using Java API? I cannot find any methods that will return all records in a table and the only way I can use is to perform a free form search with a condition that is always true. The code works but is pretty ugly. Is there an alternative to this approach?
    Thanks!
    Kenny

    Hi Kenny,
    You can construct a new Search object with your table's code name, a new ResultSetDefinition object for your table and just execute this search using the GetResultSet method of CatalogData.
    Please look at the following code:
    Search search = new Search(<code name of your table>);
    ResultSetDefinition rsd = new ResultSetDefinition(<code name of your table>);
    rsd.AddField<code name of a field>);
    rsd.AddField(<code name of a field>);
    String sortField = <code name of your sort field>;
    boolean sortAscending = true;
    int page = 0; //page number
    A2iResultSet rs = <your CatalogData object>.GetResultSet(search, rsd, sortField, sortAscending, page);
    for (int i = 0; i < rs.GetRecordCount(); i++)
        Value fieldValue = rs.GetValueAt(i, <code name of a field>);
    Hope this helps,
    Nir
    PS - I really recommend you to start using the new API, as it is much more efficient and straight-forward.

  • How to read records from Relationship table using ABAP API's

    Hi All,
    I need to retrieve the records from Relationship table. In Java API's I came to know there is an option to retrieve this. I could not find anything in ABAP API's. Is there any option in ABAP API's to do this.
    Please Suggest.
    Thank You,
    Gajendra.

    Hi Gajendra,
    You can mainly read records from MDM (in a DDIC structure) using ABAP API's using the following function modules/methods:
    1. RETRIEVE: This is used to generically retrieve records from tables. Attributes and Values can also be retrieved.
    2. RETRIEVE SIMPLE: Retrieve records from MDM in a simple way.( simple data types).
    3. RETRIEVE CHECKOUT: Retrieves all checked out ID's.
    4. RETRIEVE ATTRIBUTES: Retrieves attribute(s) from a Taxanomy table.
    You will find all these methods in the following interface
    Interface : IF_MDM_CORE_SERVICES
    Hope it helps.
    *Please reward points if found useful.
    Thanks and Regards
    Nitin Jain

  • Adding a record in a database using the jbutton

    hi i'm a newbie of jdeveloper.. i just wannna ask how to code adding a record in a database POSTGRESQL using the jbutton.. i already connected in the database but in the model form it has already navigation buttons.. but i want to learn how to code the jbutton in a form without using navigation buttons. THANKS..

    I guess you are talking about swing JButton.
    If I remember it correctly you need to have a listener to the JButton something like this:-
    http://www.javaworld.com/jw-03-2001/print/listing5.txt
    Where on the cick of the button you will call a method that fetches the records from your Table

  • Using Batch Record/Order Record for electronic Device History Record in PP

    We are evaluating the use of PP or PP-PI for production planning at a medical device company and one of the primary considerations is the ability to create an electronic Device History Record.  It looks like the Electronic Batch Record (COEBR) or Order Record (COPA) provides some of the capabilities required, but they do not appear to work with discrete PP.  While I realize that the differences in functionality between PP and PP-PI are small (and getting smaller), I am surprised that SAP would require medical device companies to use PP-PI to handle this business requirement?
    How have other companies dealt with the eDHR business requirement?
    Regards,
    N Powell

    Dear,
    This error occurred 
    If the 'Approved batch record required' indicator is set in the material master,
    Batch release with inspection lot from goods receipt for a process order (origin 04) is possible, providing that the batch record exists and it has already been approved.
          See error message:
          Create and approve batch record first (EBR015) or
          approve batch record first (EBR016)
    Please refer the OSS 152549 for details.
    Regards,
    R.Brahmankar

  • How to send records to the MDM workflow using Java APIs

    Hi All,
        Using Java APIs i want to send group/single records to the backend MDM workflows for further processing. Can this be acheived? Please provide me with some code samples if you have any
    Regards
    Suresh

    Hi,
    Just go through this URL
    https://help.sap.com/javadocs/MDM/current/index.html
    In this <b>com.sap.mdm.workflow.commands </b> will Provide u commands for managing workflows.
    I hope this helps you.
    Regards
    Nisha
    Message was edited by:
            Nisha Lalwani

  • Adding a db record using Statement

    Hi,
    I'm having trouble adding a record into a database. I keep getting the following error:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at clsDatabase.runQuery(clsDatabase.java:90)
            at frmAppointmentAdd.btnAddActionPerformed(frmAppointmentAdd.java:177)
            at frmAppointmentAdd.access$100(frmAppointmentAdd.java:12)
            at frmAppointmentAdd$2.actionPerformed(frmAppointmentAdd.java:75)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:5501)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
            at java.awt.Component.processEvent(Component.java:5266)
            at java.awt.Container.processEvent(Container.java:1966)
            at java.awt.Component.dispatchEventImpl(Component.java:3968)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
            at java.awt.Container.dispatchEventImpl(Container.java:2010)
            at java.awt.Window.dispatchEventImpl(Window.java:1778)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)...and here's my code. The variable criteria is set to "INSERT INTO Appointment VALUES '00-005','Test Inc.','000-0004','04/15/2006','4:00 PM'"
    Any ideas?
    int changed;
    changed = statement.executeUpdate(criteria);

    Any ideas?You have a null variable and the error message tells you the line:
    at clsDatabase.runQuery(clsDatabase.java:90)
    So look at all the variables referenced on that line and fix the problem.
    You use System.out.println(...) to display the variable and one of them will say "null".

Maybe you are looking for

  • IPhone constantly wants to 'set up' and restore a backup

    Hi all.  Have installed the iOS 5  in my iPhone and after restoring a backup so that my music appears again, whenever I connect said iPhone to iTunes all I ever get now is SET UP YOUR iPHONE This Computer has previously been synced with an iPhone or

  • PowerMac can't boot

    The computer will chime and will sit there for a minute and then a red light will appear inside the case. I had unplugged it for a while and it booted once, but shortly after, the fans whipped up and no response. Now the unplugging trick wont work an

  • LSMW for RFBIBL00

    Hello everyone, I am trying to post vendor postings for FI using LSMW and program RFBIBL00. I have to upload the withholding tax(TDS) for this postings. I am assigning 3 files 1) Header Data 2) Line item data and 3)Tax Data. All the files are read an

  • Export to Clip Notes

    Hi When I try to export to clip notes After Effects freezes and trying to select anything gives me the 'ping' noise.  The only way out of this is then to close the program down from the windows task list. Anything????? thanks

  • Unable to install KB2546951

    Getting a Code 84B30002. Yes I know, there already some threads that deal about this but Icouldn't find my answer.... From what I can understand, I'm trying to update a SQL SERVER 2008 SP3 patch on a SQL SERVER 2008 R2 SP3 which they are not compatib