DI + UDO
I created two table for Purchase Requisition @OPRE and @PRE1, and I register them to an object.
Can I use DI to insert / delete / update these table? Just like doing it in system table?
Ken
What you need to do is this:
If using UI API:
Add a button to your form (not id 1 or 2)...
Or if you are using any other application...
From this button (or application) call a routine that reads your text file into a DataSet or RecordSet, then you have to go through this data making inserts for each line... something like this
Dim strQuery as String = ""
Dim intLastEntry as Integer = 0
Dim intLastLine as Integer = 0
Dim rs as RecordSet as SapBobsCOM.RecordSet
rs = CompanyObject.GetBusinessObject(SapBobsCOM.oRecordSet)
strQuery = "SELECT MAX(DocEntry) as Last FROM [@OPRE]"
rs.DoQuery(strQuery)
If rs.RecordCount > 0 Then
intLastEntry = CInt(rs.Fields.Item("Last").Value) + 1
Else
intLastEntry = 1
End If
For i as integer = 0 to DataSet.Table("@OPRE").Rows.Count - 1
strQuery = " INSERT INTO @OPRE (DocEntry, Columns) " + _
" VALUES (" + intLastEntry.ToString() + ", " + _
DataSet.Table("@OPRE").Rows(i).Colums + ")"
'//This next line Make the insert in the master table.
rs.DoQuery(strQuery)
intLastEntry += 1
For j as integer = 0 to DataSet.Table("@PRE1").Rows.Count - 1
intLastLine = j + 1
strQuery = " INSERT INTO @OPRE (DocEntry, LineNum, Columns) "
" VALUES (" + intLastEntry.ToString() + ", " + _
intLastLine.ToString() + ", " + _
DataSet.Table("@PRE1").Rows(j).Colums + ")"
'//This next line Make the insert in the detail table.
rs.DoQuery(strQuery)
Next j
Next i
Hope it helps
GAB
Similar Messages
-
How to mapp in UDF column of MasterData & Master Data Rows UDO add time?
Hi all ,
I have one MasterData(A) & 3 MasterData Rows(B&C) table
A (Code ,Name ,U_SKU,U_AName,U_AID) Master table
B(Code ,Name ,U_SKU,U_BName,U_BID) Child table
C(Code ,Name ,U_SKU,U_CName,U_CID) Child table
Now tables are automatic Mapped with Code UDO Creation time but i want to mapping with U_SKU column
please help how to mapp MasterData(A) and 3 MasterData Rows(B&C) table with UDF Column
Thanks in Advance
Surajit kunduin the start routine of transformation from 0MAT_SALES_ATTR to znewmat do the following:
select materials from /BIC/PZNEWMAT into i_mat
for all entries in source_package where material eq source_package-material.
loop at source_package.
p_ind = sy-tabix.
read table i_mat with key material = source_package-material.
if sy-subrc ne 0.
delete i_mat index p_ind.
endif.
this way you'll only update records that have previously been loaded by 0MATERIAL_ATTR DS
loading sequence:
first load ZNEWMAT from 0MATERIAL_ATTR. then activate ZNEWMAT. then load 0MAT_SALES_ATTR to ZNEWMAT.
M. -
Opening a Crystal Report in B1 8.8 in a User Defined Form representing UDO
Hi Experts,
Is it possible to open a Crystal Report from a User Defined Form representing my UDO?
I had developed a 'Vendor Quotation' UDO and its User Defined Form
I wanted to show the report while clicking the Preview menu in SAP B1 8.8 toolbar.
I have created the Crystal report and used the record selection as {@OVQT.DocEntry} = {DocKey@}
Please help
Also, is it possible to add Print layout and assign a default Print layout to this User Defined Form?
Thanks in advance
Regards
ArunHi,
I also face the same problem. I make a master type using UDO. But i want to print it.
In my opinion ( i haven't tried this way ). If we make a UDO ( master or document type ) , we will find the docentry and object field in our UDT. Both of these will connect between SAP form and Crystal report. In crystal report we select the tmsp_doclinetypelayout. It is a store procedure which will connect between SAP form and CR. Before that try to modify this SP by adding the udo object.
Fyi, if i'm not mistake dockey is connected to docentry SAP form.
Thanks
regards
bodhi86 -
View Crystal Report Layout for my UDO Form
Hi all,
I try to view a report created for my UDO form. I set all settings in Administration -> Setup -> General -> Report and Layout Manager. Now I wonder what should be assigned to eventInfo.LayoutKey. I tried assigned report's DocCode from RDOC, DocEntry of my UDO object or UDO Code but nothing works. Always get an error: Incorrect format of argument or something like that - I didn't get an error in English so I tried to translate it.
How to show a report layout for my UDO form?
Regards
Szymon LipnickiHi and thanks for Your reply.
Help file contains example how to open report layout prepare in Crystla Reports designer for UDO form.
//Add Layout Key Event Handler
SBO_Application.LayoutKeyEvent += new SAPbouiCOM._IApplicationEvents_LayoutKeyEventEventHandler(SBO_Application_LayoutKeyEvent);
void SBO_Application_LayoutKeyEvent(ref SAPbouiCOM.LayoutKeyInfo eventInfo, out bool BubbleEvent)
BubbleEvent = true;
if (eventInfo.ReportTemplate == "A001" && eventInfo.ReportCode == "A001001")
eventInfo.LayoutKey = 1; //Set the key of the layout
I am using SAP 8.81.
Regards
Szymon -
Hi,
Can we design report with print layout designer for UDO forms?
If yes, how do we accomplish this?
If not, is there any other alternative?
I am using 2004B. Thanks.I use the iTextSharp project to create PDF's (http://itextsharp.sourceforge.net/)... its free and it works (A little hard to use, but it works). A more simple PDF-project are SharpPDF (http://sharppdf.sourceforge.net/). This is also free and very easy to use, but not that many features.
-
How to create one form for two Udo object
Hy ,
I have two Object Udo (header and line)
How we created a form to manage these two files (UDO)
ThanksThank you janos
it works, I put the code to other developers for information
Shared Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_application.ItemEvent
If ((FormUID = "SIR001_") And (pVal.ItemUID = "add") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
Dim oDS As SAPbouiCOM.DBDataSource
oDS = SBO_application.Forms.Item(FormUID).DataSources.DBDataSources.Item("@SIR_LOTL")
oDS.InsertRecord(oDS.Size)
oDS.Offset = oDS.Size - 1
oform = SBO_application.Forms.Item(FormUID)
oMatrix = oform.Items.Item("mtx_0").Specific
oMatrix.AddRow(1)
End If
If ((FormUID = "SIR001_") And (pVal.ItemUID = "del") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
oform = SBO_application.Forms.Item(FormUID)
oMatrix = oform.Items.Item("mtx_0").Specific
For index As Integer = oMatrix.RowCount To 1 Step -1
If oMatrix.IsRowSelected(index) = True Then
oMatrix.DeleteRow(index)
oform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
End If
Next
End If
End Sub -
Using a Single Registered UDO for multiple Transactions
Dear Experts,
We are developing a Expense Booking System by using SAP B1 SDK. in .NET
The scenario is like this.
Need to book the expenses independently by using an Expense Booking Screen, and also from a Transaction screen (Sales) where the user enters the expenses details incurred during the sales activity.
Data from both the screens should be saved in a single User defined table.
ie, The Expense Booking Screen uses the table for direct saving and the Sales screen uses the same table as the child table of the transaction where the parent (header) table holds the details of Sales activity.
The table object is registered for the Direct Expense Booking screen.
Can I use the same object for the Sales Expense booking screen?
Is it possible?
If so, how can I implement it?
Please advice..
Thanks in advance
Regards,
TomsSure
Generic services are using to maintain UDO table using SDK. You no need to assign values to datasource items. You can simple collect the values from the form items / user data sources and update the UDO table accordingly.
First you go to this link
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d04b34b5-68cf-2b10-bc98-806feb4299ba
and download the DI GENERAL SERVICE SAMPLES
Applications with full source code is available for
1. Master Data UDO maintenance
2. Master Data UDO + Child Tables Maintenance
3. Document Data UDO maintenance
4. Document Data UDO + Child Tables Maintenance
Thank you
Anoop -
How to bind data for a UDO table..on to MATRIX
hi
i have created a Master Data Table(Video) and also created UDO object...
i designed a form with 2 controls as text boxes and a matrix with some coloums.........
the functioality of the form is ..when i enter some values in those controls...it should get data from DB table and should be displayed in matrix on my form. based on condition what i have entered on form controls...
i have done the same scenario successfully when i'm dealing with other controls like textboxes...by binding data to the controls from DB..
But i dont know how to deal this scenario where i'm populating data to matrix from DBi have used DataTables as u said...but still i'm getting an Exception called " Public MEmber 'Data Table" on type IMatrix not found"
this is following code i have written in my program...
plz give me the solution.....and code...
Try
oitem = oform.Items.Item("7")
omatrix = oitem.Specific
ocolumns = omatrix.Columns
oform.DataSources.DataTables.Add("[@VIDS]")
' odbdatasource = oform.DataSources.DBDataSources.Add("[@VIDS]")
omatrix.DataTable = oform.DataSources.DataTables.Item("[@VIDS]")
'// Ready Matrix to populate data
omatrix.Clear()
omatrix.AutoResizeColumns()
'// Querying the DB Data source
odbdatasource.Query()
'// setting the user data source data
omatrix.LoadFromDataSource()
ocolumn = ocolumns.Item("V_5")
ocolumn.DataBind.SetBound(True, "[@VIDS]", "Code")
ocolumn = ocolumns.Item("V_4")
ocolumn.DataBind.SetBound(True, "[@VIDS]", "Name")
ocolumn = ocolumns.Item("V_3")
ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_CardCode")
ocolumn = ocolumns.Item("V_2")
ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_ShelfNumber")
ocolumn = ocolumns.Item("V_1")
ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_SPACENumber")
ocolumn = ocolumns.Item("V_0")
ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_RentedAvailable")
Catch ex As Exception
SBO_Application.MessageBox(ErrorToString)
End Try -
How to browse data in a from which is connected to UDO
Hi all
i've created a from using screen painter on 2005 version. i connected the form to a UDO object. i want to enable the form to navigate over the table which the UDO object is connected to by using the navigation buttons on the toolbar .
How can i achieve that?Hi Yechiel Schusseim,
I think, you need to use this TAG.
<DataBrowser BrowseBy="UID" />
With Regards
B.Ravi Shankar -
How to add a customer field or extn coll in the tab1&2&3..of a UDO doc?
Hi Experts,
Does anybody know how to add a customer field or extn collection in the unused tabs like tab1&2...in a UDO document?
Thanks for your reply in advance.
Thanks & Regards,
DavidHi Subhasini - <br><br>
It seems you have discovered that adding an extension field to the Project Suppliers collection is not possible; many of the collections in E-Sourcing do not support extensions and, even when they do, typically, the table view of the data cannot be changed to show the extension value (it would only show on a "details" page, for example.<br><br>
The solution that you have proposed may work, although I think there is a slight mistake in your logic. I believe you are saying that the script would take data from the newly created extension collection and populate data in the out-of-the-box vendor collection. <br><br>
In thinking about your solution, I believe the benefit is that any logic and reporting based on the standard collection continues to function correctly (e.g., creating an RFx from the Project will use the out-of-the-box vendor collection).<br><br>
That being said, I generally am reluctant to do a "replace" of a standard collection with an extension collection as you propose. My recommendation is that you challenge the customer on the importance of this requirement. For example, could the code be maintained on the vendor record? Why is it maintained in Projects? If it is maintained in the vendor record, could you just populate a read only collection the Projects that shows the vendor and code? Could a report be written that can be launched from within the Project to show the values? How does the customer intend to use this field? Could the display name of the vendor object be the right place for it?<br><br>
I hope these ideas are helpful.<br><br>
Regards,<br><br>
Rob<br><br> -
SQL Error when adding data with UDO + Form
Good morning, friends.
Initially, I apologize for any mistakes in my English.
I am developing an addon for a client and now I came across a problem that started happening about 5 days ago:
I customized a MasterData postcodes in B1, I created a UDO (oCNSTCEP) and bind to a form created by the Screen Painter. It is noteworthy that this program has been operating without any problems in the customer environment for at least 3 months. Finally, for reasons unknown to the system now has to give the following message when I insert a new record:
[Microsoft] [SQL Server Native Client 10.0] [SQL Server] Conversion failed When converting the nvarchar value 'oCNSTCEP' to data type int. (CINF)
The strange thing is that the record is written into the UDT corresponding to the UDO. But the error message is given, giving the user the impression that the routine was not completed successfully.
Yesterday you told me what is happening the same error in another form, ie, the way any given recording through UDOs are giving problem.
I searched for this post in SDN and the maximum that I discovered is that it could be happening because of the variable @ object_type in SBO_Notification be as int instead of being as nvarchar (20). I checked the stored procedure and @object_type is nvarchar(20) type.
I would like to help for a solution to this problem. Since now, thank you!
Sincerely,
JuniorThe error is coming from the stored procedure and is easy to fix,
Anywhere where you check the @object_type, you need to put the value in single quotes.
e.g if your stored proc includes both of these:
IF @object_type = 17
IF @object_type = 'oCNSTCEP'
It will fail with the error you mentioned. But if you have:
IF @object_type = '17'
IF @object_type = 'oCNSTCEP'
It will work. -
Hello everyone,
I have a problem with the launch of the report from a user Form.
I created a layout for my UDO, I created a Form for UDO and I connected the layout to the mask.
The report parameter is a standard SAP token (DocKey@).
When I launch the preview is returned the error "Format of the input string is incorrect." if I insert the parameter in Crystal Report mask that appears after, the printing is working properly.
In the attachment post is said that taking away the value of the ObjectType defined for the form,the report should work; unfortunately this is not a solution because doing it SAP can not handle events, and the mask is no longer possible to navigate between documents.
[View Crystal Report Layout for my UDO Form]
I'm doing something wrong or is it a bug? Do you know any case where there is a workaround?
I work with SAP 8.81 PL04
Thanks,Enrico.hi,
check the JSP file name "Sample.jsp", "s" caps or small.
In portlapp.xml file give same name for <component name="<b>Sample</b>"> and
<property name="com.sap.portal.reserved.layout.TemplateFile" value="<b>sample</b>.jsp"/>. Component name & jsp file name should be same...
Regards,
Senthil K. -
Error while Importing Data in UDO.
Hello,
I had created one User defined table with Master Datatype.
I register this Table and creating Master type of UDO.
I created template for this UDO throgh DTW.
I am using Following Filed in the template.
Code, Name, Field 1 and Field 2.
While i am importing data using this template through DTW using, i got following error.
Master Data Type user Table can not add row65171.
Regards,
Arpit ShahDear,
Please see the Note 804685 for information about how to
import data into user defined tables linked to an object type.
It is not possible to import data into UDO tables via the DTW.
Regards
Apple -
Error message Entry already exists in UDO
I am working with SAP B1 Release 2005B. The software was working fine for more than 11 months. Now suddenly from last 2 days no entry is getting saved into an UDO. the error message displayed is
' This Entry already exists in the table '(@CREQ) (odbc-2035)
I found the same problem addressed in the forum many times but no solution
Kindly help . The data entry into the system is not taking place
ByeHi,
for me this sounds like the Numbering File got damaged.
Administration -> Utilities -> Restore -> Restore Numbering File
lg David -
Copy data from a UDO form to Goods Receipt PO using UI API
Hi, all
I tried to copy data from a UDO form to Goods Receipt PO using UI API through following codes.
It works fine while copying to a Item-type Goods Receipt PO.
But when the doctype is set to service, I got errors.
I use for-loop to copy two items, Description and LineTotal, into the matrix of Goods Receipt PO form, but both failed.
any suggestion?
Edited by: Chao-Yi Wu on Aug 25, 2009 5:50 AMHi Chao-Yi Wu ,
SBO_Application.ActivateMenuItem("2306")
Dim oFormGR As SAPbouiCOM.Form = SBO_Application.Forms.ActiveForm
Dim omtxIQC, omtxGR As SAPbouiCOM.Matrix
Dim oedIQC, oedGR, oed As SAPbouiCOM.EditText
Dim ocbIQC, ocbGR As SAPbouiCOM.ComboBox
oFormGR.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE
oedIQC = oFormIQC.Items.Item("13").Specific
oedGR = oFormGR.Items.Item("4").Specific
oedGR.Value = oedIQC.Value
oedIQC = oFormIQC.Items.Item("21").Specific
oedGR = oFormGR.Items.Item("24").Specific
oedGR.Value = oedIQC.Value
oedIQC = oFormIQC.Items.Item("edComments").Specific
oedGR = oFormGR.Items.Item("16").Specific
oed = oFormIQC.Items.Item("3").Specific
oedGR.Value = oedIQC.Value + ", Goods Recript PO:" + oed.Value
ocbIQC = oFormIQC.Items.Item("cbDocType").Specific
ocbGR = oFormGR.Items.Item("3").Specific
If ocbIQC.Selected.Value = "I" Then
ocbGR.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
Else
ocbGR.Select(1, SAPbouiCOM.BoSearchKey.psk_Index)
End If
omtxIQC = oFormIQC.Items.Item("mtx_0").Specific
For i As Integer = 1 To omtxIQC.RowCount
omtxGR = oFormGR.Items.Item("38").Specific
If ocbIQC.Selected.Value = "I" Then
oedIQC = omtxIQC.Columns.Item("c_ItemCode").Cells.Item(i).Specific
oedGR = omtxGR.Columns.Item("1").Cells.Item(i).Specific
oedGR.String = oedIQC.String
oedIQC = omtxIQC.Columns.Item("c_AQty").Cells.Item(i).Specific
oedGR = omtxGR.Columns.Item("11").Cells.Item(i).Specific
oedGR.String = oedIQC.String
oedIQC = omtxIQC.Columns.Item("col_19").Cells.Item(i).Specific
oedGR = omtxGR.Columns.Item("14").Cells.Item(i).Specific
oedGR.String = oedIQC.String
Else
omtxGR = oFormGR.Items.Item("39").Specific
oedIQC = omtxIQC.Columns.Item("c_Descrp").Cells.Item(i).Specific
oedGR = omtxGR.Columns.Item("1").Cells.Item(i).Specific
oedGR.String = oedIQC.String
oedIQC = omtxIQC.Columns.Item("col_16").Cells.Item(i).Specific
oedGR = omtxGR.Columns.Item("12").Cells.Item(i).Specific
oedGR.String = oedIQC.String
End If
Next
for items the matrix is 38 and for service the matrix is 39
Rgds
Micheal -
Error when open UDO form generator
when i try to open udo form gen .the following error arises.
ERROR The Type initializer for 'B1 Wizard.Globals' threw an exception
Pls tell me how to resolve itHave you searched the forum?
You may check this first: ERROR: The type initializer for B1Wizard.Globalsu2019 threw an exception.
Thanks,
Gordon
Maybe you are looking for
-
i have all the issues stated in my question as of this morning. they werent there last night. WTF happened to my beloved firefox? BTW, I got an amd dual core 4000, nvidia gtx 9800, 4 gigs ram, running on windows xp sp3. BTW, windows updated last nigh
-
Checking for a field in tables
Hi All, This Quiery is regarding searching for a field via where used list.Now we can search for a single field ..in which table that field is being used.... 1) Can we make search still specific ..like in which tables that field used as primary
-
10.4.9 broke my mabcbook
I tried to update to 10.4.9 via Software Update. It downloaded the whole update file and then i got an error mesage saying that the update was not expanded correctly and the package file for it appeared in Trash. I tried to download the update manual
-
Recording in f4v format at FMS and then republishing to another server?
My data path looks like this: Live Stream Encoder====>My FMS (my own server) republish to======>CDN======>Viewing Client I want to archive the live stream at the first stop, my FMS. Adobe live docs say if I want the recorded file to be of format F4V
-
What name of program that in front of buildings tells you info of them?
Need to know the nae of a program that ids the building infront by using camara on iphone or ipad