on 12-16-2008 10:05 AM
Hi All,
I am using UDO(UserObjectsMD), which is bound with three tables
1. MK_OCRD (Master Table)
2. MK_OCPR (Master Data Rows)
3. MK_CRD1 (Master Data Rows)
in my application done in SAP 2007.
In this project I am implementing the same functionality of the 'Contact Person' Tab in 'Business Partner Master Data'. for which i am using child table MK_OCPR.
How can i insert the contact person details(MK_OCPR) using UDO?
Pradeep.
Thirdwave Business Systems
Edited by: pradeep k on Dec 16, 2008 11:12 AM
Hi..
ur form load matrix initialization after that
give omatrix.addrow()
Regards.
Billa 2007
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think the way i made the UDo is not correct. I have created the UDO as follows. Please point out the errors in it, if any (Especially when I create child tables)
private void CreateUDO()
{
SAPbobsCOM.UserObjectsMD oUDOMarketing = (SAPbobsCOM.UserObjectsMD)oCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD);
try
{
oUDOMarketing.Code = "Marketing";
oUDOMarketing.Name = "Customers";
oUDOMarketing.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData;
oUDOMarketing.TableName = "MK_OCRD";
oUDOMarketing.ChildTables.TableName = "MK_OCPR";
oUDOMarketing.ChildTables.Add();
oUDOMarketing.ChildTables.TableName = "MK_CRD1";
oUDOMarketing.ChildTables.Add();
SAPbobsCOM.BoYesNoEnum tNo = SAPbobsCOM.BoYesNoEnum.tNO;
oUDOMarketing.CanCancel = tNo;
oUDOMarketing.CanClose = tNo;
oUDOMarketing.CanCreateDefaultForm = tNo;
oUDOMarketing.CanDelete = tNo;
oUDOMarketing.CanFind = SAPbobsCOM.BoYesNoEnum.tYES;
oUDOMarketing.CanLog = SAPbobsCOM.BoYesNoEnum.tYES;
oUDOMarketing.LogTableName = "AMK_OCRD";
oUDOMarketing.CanYearTransfer = tNo;
oUDOMarketing.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES;
oUDOMarketing.FindColumns.ColumnAlias = "Code";
oUDOMarketing.FindColumns.ColumnDescription = "Customer";
oUDOMarketing.FindColumns.Add();
oUDOMarketing.FindColumns.ColumnAlias = "Name";
oUDOMarketing.FindColumns.ColumnDescription = "Name";
oUDOMarketing.FindColumns.Add();
oUDOMarketing.FormColumns.FormColumnAlias = "Code";
oUDOMarketing.FormColumns.FormColumnDescription = "Code";
oUDOMarketing.FormColumns.Add();
oUDOMarketing.FormColumns.FormColumnAlias = "U_CardCode";
oUDOMarketing.FormColumns.FormColumnDescription = "Card Code";
oUDOMarketing.FormColumns.Add();
oUDOMarketing.FormColumns.FormColumnAlias = "U_Phone1";
oUDOMarketing.FormColumns.FormColumnDescription = "Phone1";
oUDOMarketing.FormColumns.Add();
int iRet = oUDOMarketing.Add();
if (iRet != 0)
{
string sMsg = oCmp.GetLastErrorDescription();
//throw new Exception(sMsg);
}
int gh = oUDOMarketing.ChildTables.Count;
}
catch (Exception ex)
{
throw ex;
}
finally
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDOMarketing);
oUDOMarketing = null;
GC.Collect();
}
}
Edited by: pradeep k on Dec 18, 2008 10:40 AM
Hi Pradeep,
- Create a custom UI Form for your Tables/UDO (you can use 'UDO Form Genrator' tool for this or Screen Painter)
- Connect the form to UDO by setting FormCreationParams.ObjectType property
- Use data binding to bind the form fields to Data Sources.
- Your Form should have a button with Unique ID "1" which acts a Add/Update/Find/OK button (part of UDO services)
- Use this button to add data to UDO (also into child table)
Refer to SDK Help -> Customization Tools -> User-Defined Objects -> Using Custom UI Form
Here is a thread that might help you
Regards
Aravind
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
111 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.