UDT updations

Hi SAP B1 experts,
i am trying to update an UDT through a query
i have values for the fields that i have defined.
but, how & with what value to update the default fields 'Code' & 'Name' ?
i tried to supply values for those fields also. but, here again, i am facing a problem.
i thought, 'Code' must be the primary key, mandatory & unique.
but, it seems, even the 'Name' must be unique!
even though the value for 'Code' is unique, it is not allowing to insert a duplicate 'Name' !
is there any system variable like 'row-id' (current record number) with which i can update the default field 'Code' ?
Thanks & Regards,
Raghu Iyer

Hi Jeyakanthan,
first i tried:
insert into [dbo].[@BinStock] (U_Wh_Code, U_Item_code, U_St_Bin, U_Qty_Bal)
values ('CTRM', 'SAMPLE002', 'BIN002', 200)
this created a record with 'CTRM' pushed to 'Code', 'SAMPLE002' to 'Name', 'BIN002' to 'U_Wh_Code' and 200 to 'U_Item_code'
then i supplied the values for 'Code' & 'Name'
insert into [dbo].[@BinStock] (code, name, U_Wh_Code, U_Item_code, U_St_Bin, U_Qty_Bal)
values (2, ' ', 'CTRM', 'SAMPLE002', 'BIN002', 200)
it worked, but, i am required to supply unique value for 'Code' and unique value for 'Name' also.
is there a way to auto generate values for those two system fields ('Code' & 'Name') ?
note : for testing, i tried with constant values, once i get to know how this works, i will be using select satement to insert values.
Thanks & Regards,
Raghu

Similar Messages

  • Add row in a usertable

    Hello.
    I have this code from the only example in SDK Help but it does not work:
    oRegHist = oCompany.UserTables.Item(1)
    oRegHist.GetByKey("RGST")
    'Set default, mandatory fields
    oRegHist.Code = "RGST"
    oRegHist.Name = "Historico"
    'Set user field
    oRegHist.UserFields.Fields.Item("U_FECHA").Value = datFecha
    oRegHist.UserFields.Fields.Item(intIndice + 1).Value = 1
    intResult = oRegHist.Add()
    but since the example does not explain anything clearly I do not understand what Item(1) is, wht exactly oRegHist.Name or Code are and I am getting an error "-1 Documente UserTable can not add row".
    What am i doing wrong?
    Thanks a lot

    Hi,
    i think you missunderstood something.
    how you name the Object is up to you
    look at my sample how i add a new row to a usertable  - i named the object "UDT":
    SAPbobsCOM.UserTable UDT
    UDT=Company.UserTables.Item("TableName")
    UDT.Code ="newCode"
    UDT.Name ="newName"
    UDT.UserFields.Fields.Item("U_UDF").Value ="Value"
    ErrCode=UDT.Add()
    GetByKey you need to Update a existing record !
    SAPbobsCOM.UserTable UDT
    UDT=Company.UserTables.Item("TableName")
    UDT.GetByKey("newCode")
    UDT.UserFields.Fields.Item("U_UDF").Value ="NewValue"
    ErrCode=UDT.Update()
    i hope it helps you
    lg David

  • DI API Deadlocks in SQL 2005 database server

    Hello All,
    I have an Issue, which is coming on large databases ( > 50GB) and number of users >  20.
    I have read the following notes
    1269591, 1489753, 1318311, 1231444 , 1344641 , 1316554
    also contributed in the following thread:
    Workaround:
    Each SAP B1 Client is using an addon, which do a WM (Warehouse management) based on WHSE Journal. Until upgraded to 2007 version, this was working fine, no issue came up only system was slow.
    Process with pseudo code like this
    'incoming cases - when an item is entering into the warehouse
    Add Logistics documents (action success = true)
    - start transaction
      - check Warehouse journal
      - record changes done by this document (based on oinm) into (UDT)
    - finish transaction
    'outgoing cases - where an item is carried out from the warehouse - create a self pick list example: sales order:
    start transaction
    - loop on every rows of the sales order
      - read ordered quantity
      - look for place where it is stored,
    - if found make  a reservation in (UDT)
      - add position to self created pick list  (UDT)
    finish  transaction
    'release from warehouse
    start transaction
      - look for pick list position (UDT)
      - reduce stock value (UDT)
      - update pick list  with packed quantity (UTD)
      - create delivery note
    finish  transaction
    Depending from activity the users receive various error messages like Could not commit transaction / Deadlock ...  / -2038 Internal error xxxx messages, when trying to access to UDT-s or any marketing documents, and the system is frozen. I go to activity monitor, and check and tell them which client is causing dead locks, they log off ,and can continue work or if the process runs to timeout, it sends the error message to SAP B1 Client.
    Also we have an addon which reads (only reads) data from database from OITM / OITW / and one of these UDT above. (queries against stock value from UDT). here we receive 2 type of error messages
    - Deadlock
    - Timeout
    I know these messages are coming from: other computers /Users are issueing documents in transaction.
    Any ideas to resolve this issue / has anybody happened this issue ?
    Every ideas, comments are welcome.
    The system is b1 2007 SP 01 PL 10. Average document position between 50-100.
    Solution Architect team? Any workaround?
    Regards
    János

    HI Janos,
    I also faced little bit same type of Issue in one of the project.
    Please look
    Link: [Large data processing Issue | SAP Hanging Problem using Transactions;
    After applying this my issue was resolved.
    regards:
    Sandy
    Edited by: Sandeep Saini | Roorkee | India on Sep 6, 2010 7:16 PM

  • Update UDT

    Hi Experts,
    I want to protect my udt using VB.net and SDK code so that the user can update it. The udt can only be updated by a certain super user i.e. manager.
    Please help me to provide the code. I will appreciate it so much.
    Rgds,
    John

    Hi
    Try this
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Try
                Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.Item(FormUID)
                If (FormUID = "yourformuid") Then
                    If (pVal.Before_Action = False) Then
                        If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then
                            'Here write your code
                            'if the user is not a super user then just disable all the controls in the form and set form mode to ok mode
                              Dim oSQLRS As SAPbobsCOM.Recordset = SBO_Application.diCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
                    Dim SQLString As String
                    SQLString ="SELECT T0.UserID FROM OUSR T0 WHERE T0.SUPERUSER = 'Y' "
                    if  oSQLRS.DoQuery(SQLString) = SBO_Application.Company.UserName  then
                  else
                          DisableForm(oForm)
                         oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE
                     end if
                        End If
                    End If
                End If
            Catch ex As Exception
            End Try
        End Sub
    Public Function DisableForm(ByVal _form As SAPbouiCOM.Form) As Boolean
                Try
                    Dim itemCollection As ArrayList
                    itemCollection = getItems(_form)
                    Dim oItem As SAPbouiCOM.Item
                    _form.Freeze(True)
                    For Each tempLoopVar_oItem As SAPbouiCOM.Item In itemCollection
                        If tempLoopVar_oItem.Type = BoFormItemTypes.it_FOLDER Or tempLoopVar_oItem.Type = BoFormItemTypes.it_STATIC Or tempLoopVar_oItem.Type = BoFormItemTypes.it_LINKED_BUTTON Then
                            oItem = tempLoopVar_oItem
                            oItem.Enabled = True
                        Else
                            oItem = tempLoopVar_oItem
                            'for excluding button 1, 2 and txtTemp
                            If oItem.UniqueID = "1" Or oItem.UniqueID = "2" Or oItem.UniqueID = "txtTemp" Then
                                If oItem.UniqueID <> "txtTemp" Then
                                    oItem.Enabled = True
                                End If
                            Else
                                oItem.Enabled = False
                            End If
                        End If
                    Next
                    _form.Freeze(False)
                    Return True
                Catch ex As Exception
                    MessageBox.Show(ex.ToString())
                    _form.Freeze(False)
                    Return True
                End Try
            End Function
    Public Function getItems(ByRef _form As SAPbouiCOM.Form) As ArrayList
                Try
                    Dim oItemCollection As New ArrayList()
                    Dim oItem As SAPbouiCOM.Item
                    For Each tempLoopVar_oItem As SAPbouiCOM.Item In _form.Items
                        oItem = tempLoopVar_oItem
                        oItemCollection.Add(oItem)
                    Next
                    Return oItemCollection
                Catch ex As Exception
                    MessageBox.Show(ex.ToString())
                    Return Nothing
                End Try
            End Function
    for this code to work correctly place an edittext box in to your form with unique id txtTemp and set its width and hieght to 0
    Regards
    Arun

  • How to update correctly a UDT at FORM_DATA_ADD

    Hi,
    When adding an item marketing document, my add-on has to update a UDT with all the lines in the document.
    I have placed the update of this UDT in the BeforeAction == false and ActionSuccess is true on et_FORM_ADD_DATE.
    But what if an error message appears when updating this UDT, how can I prevent that the document is not added in SBO either. If the update of the UDT fails for any reason I don't want to let the user to update the UDT.
    What is the best practice in this case?
    Thank you,
    Irina

    Irina,
    even if you happen to know at the before action true event that the update process generates an errror, you will not be able to roll back ( or make bubble event false)  the actual document creation . it is going to happen anyway .
    or you are getting at something else?
    Binita

  • DTW update UDT fields - Version 88.0.10

    Hello,
    I have already searched this forum for similar issues, but they only fit to older DTW-versions or UDO (masterdata or forms)
    We created an UDT (no object) with one UDF (text). So we kept our testenviroment as small as possible.
    Import runs without problems:
    Code;Name;U_toll
    1;1;blabla
    2;2;test
    But update doesnt work - DTW returns error message: "Can not find this object in B1Application-defined or object defined error65171":
    Code;Name;U_toll
    1;1;zzz
    2;2;ggg
    We also tried to update with LineNum (or #) and/or RecordKey:
    RecordKey;LineNum;Code;Name;U_toll
    1;1;1;1;zzz
    We also tried to update without Name or Code, nothing works.
    Does anyone have an idea, how to update data in UDT?
    Please note: DTW Version 88.0.10
    We use UDT (no object)
    We use .csv (same as import)

    Issue solved. Update of UDT data works correctly with DTW version 2005.0.19 !!!
    Older DTW-version works better than newer one (8.8).
    VERY annoying

  • How to update existing data of specific UDF at UDT?

    Hi Experts,
    I have a UDT with one of the UDF, status. I would like to update the udf, status of the document after i converted it to other documents. So tat I can filter out the selection at the query data. How can i do tat?
    Thanks and appreciate it.
    Regards,
    George
    Edited by: George Shii on Jun 29, 2009 10:57 AM

    Thanks Yatsea.
    Can I have some sample code for updating child table? I try but seems like something is missing in between.
    Problem solved. Thanks everone, appreciate it.
    'Get GeneralService - Main UDO - Retrieve the relevant service
    oGeneralService = oCmpSrv.GetGeneralService("G_OBCA")
    'GetByKey
    oGeneralParams = oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)
    'Child Order Key
    oEditTextcolumn = oGrid.Columns.Item(12)
    oGeneralParams.SetProperty("DocEntry", oEditTextcolumn.GetText(Count2))
    'Create data for new row in main UDO
    oGeneralData = oGeneralService.GetByParams(oGeneralParams)
    'Get GeneralService - Child UDO
    oChildren = oGeneralData.Child("G_BCA1")
    'Child Line Number
    oChild = oChildren.Item(oGrid.DataTable.GetValue(13, Count2) - 1)
    oChild.SetProperty("U_iStatus", "C")
    oGeneralService.Update(oGeneralData)
    Edited by: George Shii on Jun 30, 2009 5:43 AM
    Edited by: George Shii on Jun 30, 2009 6:18 AM

  • Asking about query update sql to UDF or UDT

    Hi experts,
    Is it possible to do a query update/ insert SQL to  UDT or UDF in SP notification ? I don't touch any core SAP's table. Just to UDF of UDT that i create  myself. Is it possible ?
    thanks in advance
    regards
    KK

    To Rahul,
    Thanks For your answer . So what is differences between SBO_SP_PostTransactionNotice and SBO_SP_TransactionNotification ? Usually i use SBO_SP_TransactionNotification for blocking some document or alert. So how about SBO_SP_PostTransactionNotice ?
    Please tell me. I'm new in this.
    To Gordon ,
    So can i just make a query insert sql to UDT in SBO_SP_TransactionNotification ?
    Thanks in advance
    Regards
    KK

  • How to update an UDT with B1if ?

    Hi every body,
    I would like to synchronize a UDT between 2 company DBs.
    Thanks to a gentleman, I succeed to export the content from the UDT (using a SAP Business One component and choosing the SQL object type) by a SQL query.
    But unfortunately, I don't understand how to insert data in the UDT. I have chosen as outbound
    SAP Business One
    SQL
    But I understand which nodes I have to put into the XSL file to run the update queries.
    Does anyone know how to do that?
    Thank you for your help! :o)

    Hi Damien,
    I selected the in the OutBound, Database and used the following code. Make sure your SLD is of JDBC type.
    I am updating the SAP table ITM1, all you have to do is change the table name and sql select/insert/update statement.
    <xsl:template name="transform">
    <DBout xmlns="" type="sql">
    <xsl:for-each select="$msg/row[position()&gt;0]">
    <sql>UPDATE [ITM1] SET Price =  <xsl:value-of select="col[10]"/>, U_ORCFU_Date = CAST(&apos;<xsl:value-of select="col[8]"/>&apos; AS date), U_ORCFU_Time = REPLACE(&apos;<xsl:value-of select="col[9]"/>&apos;, &apos;:&apos;, &apos;&apos;) WHERE ItemCode = &apos;<xsl:value-of select="col[6]"/>&apos; AND PriceList = (SELECT ListNum FROM [OPLN] WHERE ListName = RTRIM(&apos;<xsl:value-of select="col[1]"/> &apos;) +  LTRIM(&apos; <xsl:value-of select="col[3]"/>&apos;))</sql>
    </xsl:for-each>
    </DBout>
    </xsl:template>
    Good Luck,
    Mike
    Edited by: Mike Hardwick on Feb 9, 2012 9:17 PM

  • Is it allowed to update UDT or UDF directly?

    Hi,
       I am having an issue using the DI to import into UDT and I was wondering if I can insert/update directly to UDF or UDT in SAP B1.
      Please let me know
    Thanks
    Hector

    Hi Hector,
    You can insert/update into UDT. It's your table.
    For UDF, it seems to be good to use the DI object to insert or update.
    Example :
    - Update an user fields in Quotations Object.
    oQuotations.Lines.UserFields.Fields.Item("U_IFC_SEL").Value = oEdit.Value;
    int ret = oQuotations.Update();
    - Insert data in UserTable :
    SAPbobsCOM.UserTable UT;
    UT = SBO_Company.UserTables.Item("IFC_AFF_TMP");
    UT.Code = oEd_DocEntry.Value + iLineNum.ToString() + i.ToString();
    UT.Name = oEd_DocEntry.Value + iLineNum.ToString() + i.ToString();
    int ret = UT.Add();           
    Hope i help you.
    Michael
    Edited by: Michael LECLERCQ on May 29, 2008 5:35 PM
    Edited by: Michael LECLERCQ on May 29, 2008 5:39 PM

  • DTW update deletes UDT fields values

    hello
    i work with sap 2007A 8.00.242 sp:01 pl 15, dtw version 2005.0.31 api version 8.0.242
    and i have a special user tables ordered from a sap partner company that replaces several excel files in our company.
    i tried to import data into them using DTW, but the import erases all the fields that i left blank in the csv, i even tried to delete all the blank columns from the csv but it didnt help.
    im importing into udt table found under "user defined data" > tables(UDT) > U_PASSPORT(**my table) using "update existing data" option.
    this table is the big part of a window with several tabs - each tab is a different table(U_example) and it gets data from items(OITM) so i dont think that filling all the blank csv columns is the answear because can affect child tables in this window as well as production order and customer orders.
    when i tried to update fields in OITM it was doing great.
    what can i do?
    mickel

    hey gordon thanks for the fast reply
    yes i can add new records.
    the main issue is that i want to make the transfer from execl documents with its simple data insertion, as smooth as it can be as my colleagues are very afraid from the sap and the time that it will steal from them.
    i want to make them a simple template with an XML and a batch file so they only have to insert data into csv and press a windows shortcut without going through the DTW annoying wizard every time.
    can i change the values at the second row of the template into a caption i choose?
    mickel

  • How can i update system form udf based on udt add event

    hello experts,
    i require small functionality on customized form add event,one of the system form udf value at row level should be update for particular row on based on the values on the customized form.
    so it should go like this on add event of customized form system form's row level udf should be update
    Regards,
    Bhavank

    Hi
    Are you opening your customised form with reference to any system form or it works alone?
    If it works alone then on the add event of customized form you haveto use update query with reference to the system form
    Regards

  • Formatted Seach does not update on UDT

    Hello Experts,
    One of our client is using a third party add-on for their rental business. On the rental document lines the formatted search does not automatically update rental warehouse field when exiting or field changed ( Item No). What could be the problem? When manually clicked on the globe icon it works.Here is the formatted search. SAP B1 8.8 PL15
    Select Case $[@BIZ_ORDR.U_RenWhse]
    When '22' Then '02'
    When '11' Then '01'
    When '33' Then '03'
    End
    Any help would be appreciated.

    Based on the UDF code, it seems that the UDF is located in the document header meanwhile the itemcode is in the document line. I think that's why it is not updated eventhough the itemcode is changed by user
    JimM

  • I dont know how to update a already defined UDT?

    I have a User defined field attached to a menu named customer equipment card, i need to change the objects and add a few more to it how can i do it, help me out with this problem

    Click on iTunes at the top of this page.
    Download the installer.
    Run the installer.

  • Using UDT's for passing rows to a PL/SQL procedure

    I'm trying to get a list of rows into a procedure...
    With ODP 11 - I thought that I would simply need to create a UDT of an object (i.e. user_id, first_name, last_name) and - then type which is a collection of that object.
    Then - using that object type collection as a parameter in my procedure - pass the numerous rows from .NET in.
    I've found a examples with varray's, nested varrays etc... but - nothing straight forward with passing a collection of rows.
    Does anyone know of any online examples that illustrate this?
    Thanks for your help!

    Hi,
    A BLOB variable is just a pointer to binary data and you are passing a text string to your procedure which is why you have the error. So to write a blob into a table in a procedure you need something like this:
    CREATE OR REPLACE PROCEDURE testone(
    V_TEXT IN VARCHAR2
    AS
    V_SIGIMG BLOB;
    BEGIN
    insert into sin_image values(empty_blob())
    returning blobcol into V_SIGIMG;
    -- then copy the text as binary data, this does not convert the text to binary data
    DBMS_LOB.WRITE(V_SIGIMG,1,LENGTH(V_TEXT),v_TEXT);
    commit;
    END;
    /However, if you want to upload images into the table it is easier to use the Apex functionality to upload the image into the APEX_APPLICATION_FILES table then move the blob into your table using an INSERT or UPDATE.
    Rod West

Maybe you are looking for

  • Pages document is too old to open???

    I bought a new Macbook Air and loaded Pages 5.01 which i think is latest version (sometimes called 09 (????) ). When I attempt to open a Pages document created in an older version of Pages I get an error message saying that the document can't be open

  • BI Query - Date Selction- week starts Tuesday

    Gurus, We have EP, BI ABAP and JAVA systems on Nw7. All end user executes queries trough EP. There are few BI queries where users need to enter date for execution of query. For execution of such query user is entering date using F4 (search). Select v

  • Problems with concat-function in xdofx-paragraph

    hi their, i have a problem with the concat-function in xdofx-paragraph. i fill variable with the decode-function and i will these evaluate in if-then-else-statement. it must be nested. now i would like to bring together element tag(field) with variab

  • Cannot forward. Writer or Stream already obtained.

    hi Friends, had a small doubt to clarify I am using jsp:include tag to include a jsp page within a jsp <jsp:include page="../includes/empHeader.jsp" flush="true"> <jsp:param name="empid" value="<%=empid%>"/> </jsp:include> <jsp:include page="../leave

  • Query on Co-ordination Operation -Go_Record

    I've a Master database block and it is having only one record.For the Master Block,Details block was created with the Co-ordination Property-Defered:NO and Automatic Query:NO. After using POST command,I'm using GO_BLOCK and GO_RECORD on master block