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
Similar Messages
-
How to retrieve the data from MDM hierarchy table using MDM Java API
Hi,
I had a hierarchy table in MDM. This table had some column say x. I want to retrieve the values of this x column and need to show them in a drop down using MDM Java API.
Can anyone help me to solve this?
Regards
VallabhaneniHi,
Here is your code...
TableId Hier_TId = repository_schema.getTableId(<hierarchy table id>);
java.util.List list = new ArrayList();
ResultDefinition Supporting_result_dfn = null;
FieldProperties[] Hier_Field_props =rep_schema.getTableSchema(Hier_TId).getFields();
LookupFieldProperties lookup_field = null;
TableSchema lookupTableSchema = null;
FieldId[] lookupFieldIDs = null;
for (int i = 0, j = Hier_Field_props.length; i < j; i++) {
if (Hier_Field_props<i>.isLookup()) {
lookup_field = (LookupFieldProperties) Hier_Field_props<i>;
lookupTableSchema =repository_schema.getTableSchema(lookup_field.getLookupTableId());
lookupFieldIDs = lookupTableSchema.getFieldIds();
Supporting_result_dfn = new ResultDefinition(lookup_field.getLookupTableId());
Supporting_result_dfn.setSelectFields(lookupFieldIDs);
list.add(Supporting_result_dfn);
com.sap.mdm.search.Search hier_search =new com.sap.mdm.search.Search(Hier_TId);
ResultDefinition Hier_Resultdfn = new ResultDefinition(Hier_TId);
Hier_Resultdfn.setSelectFields(rep_schema.getTableSchema(Hier_TId).getDisplayFieldIds());
ResultDefinition[] supportingResultDefinitions =
(ResultDefinition[])list.toArray(new ResultDefinition [ list.size() ]);
RetrieveLimitedHierTreeCommand retrieve_Hier_tree_cmd =
new RetrieveLimitedHierTreeCommand(conn_acc);
retrieve_Hier_tree_cmd.setResultDefinition(Hier_Resultdfn);
retrieve_Hier_tree_cmd.setSession(Auth_User_session_cmd.getSession());
retrieve_Hier_tree_cmd.setSearch(hier_search);
retrieve_Hier_tree_cmd.setSupportingResultDefinitions(supportingResultDefinitions);
try {
retrieve_Hier_tree_cmd.execute();
} catch (CommandException e5) {
// TODO Auto-generated catch block
e5.printStackTrace();
HierNode Hier_Node = retrieve_Hier_tree_cmd.getTree();
print(Hier_Node,1);
//method print()
static private void print(HierNode node, int level) {
if (!node.isRoot()) {
for (int i = 0, j = level; i < j; i++) {
System.out.print("\t");
System.out.println(node.getDisplayValue());
HierNode[] children = node.getChildren();
if (children != null) {
level++;
for (int i = 0, j = children.length; i < j; i++) {
print(children<i>, level);
//end method print()
Best regards,
Arun prabhu S
Edited by: Arun Prabhu Sivakumar on Jul 7, 2008 12:19 PM -
Retrieving lookup field values from a main table using MDM JAVA APIs
Hi all,
am trying to retrieve the main table data...., i could able to retrieve all the data except lookup field values..., iam facing some runtime exceptions and i dont know why exactly it is throwing this exception..., i pasted piece of code where exactly the error is and the exception also.
in the below sode i set some result set definitions and passing them to retrieveLimitedRecordsCommand. it is showing some exception at retrieveLimitedRecordsCommand.execute(); command.
//*** Code ***//
supportingMainResultDefinitions = new ResultDefinition[] { rdQual ,rdFlat, rdqFlat };
retrieveLimitedRecordsCommand.setResultDefinition(rd);
retrieveLimitedRecordsCommand.setSearch(new Search(tableId));
retrieveLimitedRecordsCommand.setSession(sessionId);
retrieveLimitedRecordsCommand.setSupportingResultDefinitions(supportingMainResultDefinitions);
try {
retrieveLimitedRecordsCommand.execute();
PrintRecords.toConsole(retrieveLimitedRecordsCommand.getRecords());
} catch (CommandException e) {
e.printStackTrace();
//*** Below is the Exception raised ***//
java.lang.UnsupportedOperationException: Unexpected field type -1
at com.sap.mdm.internal.schema.PropertiesHelper.createField(PropertiesHelper.java:274)
at com.sap.mdm.internal.schema.PropertiesHelper.convertFrom(PropertiesHelper.java:281)
at com.sap.mdm.internal.data.RecordMetadata.<init>(Unknown Source)
at com.sap.mdm.internal.data.RecordsLoader.<init>(Unknown Source)
at com.sap.mdm.internal.data.RecordsLoader.<init>(Unknown Source)
at com.sap.mdm.internal.data.RecordResultSetHelper.convertFrom(Unknown Source)
at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(Unknown Source)
at com.sap.mdm.apitutorial.lesson2.RecordsDisplay.getDisplayRecords(RecordsDisplay.java:303)
at org.apache.jsp.Sample_jsp._jspService(Sample_jsp.java:190)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
If anyonw worked on this concept..., please provide me the solution
Regards
Praveen kWhich version are you using? Can you please try and narrow down to the offending field? You can do this by limiting the fields you provide to ResultDefinition.
-
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 -
Read data from MDM For Lookup and Flat table using MDM ABAP API
Hi,
I have requriment to read data from MDM from FLAT and Lookup table using MDM ABAP API. My design is like this ,
I have one ITEMS (Main table in MDM) and inside that i have one Lookup flat table ITEM_TYPE , my requriment is to read Item number and its related Item type.
From ABAP.
Please help if any body has any idea.
Regards,
ShyamHI Guys,
I found my solution by myself. Below is the solution , hope this will help others:-
Retrieve data from MDM using MDM ABAP API.
Step- 1. Create structure in SAP with the same name as that of MDM field code for MDM Main table.
Step-2. Create another structure in SAP having all lookup fields of MDM , fieldname in ECC must be same as that of MDM field
code.
Step-3.Create structure in SAP for individual lookup field(Single Field only) with the same name as MDM Field code.
Step-4.
DATA: IT_QUERY TYPE STANDARD TABLE OF MDM_QUERY, "MDM_QUERY_TABLE,
WA_QUERY TYPE MDM_QUERY,
WA_CDT_TEXT TYPE MDM_CDT_TEXT,
IT_RESULT_SET_KEY TYPE MDM_SEARCH_RESULT_TABLE,
WA_RESULT_SET_KEY TYPE MDM_SEARCH_RESULT,
WA_STRING TYPE STRING.
DATA:<Internal table> TYPE STANDARD TABLE OF <SAP Str Having all LOOKup Fields>
DATA: :<Internal table>TYPE STANDARD TABLE OF <SAP Str one LOOKup field>,
<Workarea> LIKE LINE OF :<Internal table>.
*PASS LOGICAL OBJECT NAME.
V_LOG_OBJECT_NAME = 'Logical object name defined in Customization'.
Define logon language, country & region for server
WA_LANGUAGE-LANGUAGE = 'eng'.
WA_LANGUAGE-COUNTRY = 'US'.
WA_LANGUAGE-REGION = 'USA'.
TRY.
CREATE OBJECT LR_API
EXPORTING
IV_LOG_OBJECT_NAME = V_LOG_OBJECT_NAME.
ENDTRY.
CONNECT to repository. Apply particular logon language info
CALL METHOD LR_API->MO_ACCESSOR->CONNECT
EXPORTING
IS_REPOSITORY_LANGUAGE = WA_LANGUAGE.
*NOW PASS ITEM NO AND GET KEY FROM MDM.
CLEAR WA_QUERY.
WA_QUERY-PARAMETER_CODE = <MDM FIELD CODE>. "Field code
WA_QUERY-OPERATOR = 'EQ'. "Contains
WA_QUERY-DIMENSION_TYPE = 1. "Field search
WA_QUERY-CONSTRAINT_TYPE = 8. "Text search
WA_STRING = <Field Value>.
GET REFERENCE OF WA_STRING INTO WA_QUERY-VALUE_LOW.
APPEND WA_QUERY TO IT_QUERY.
CLEAR WA_QUERY.
*PASS ITEM NUMBER AND GET RELATED KEY FROM MDM.
TRY.
CALL METHOD LR_API->MO_CORE_SERVICE->QUERY
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Main Table>
IT_QUERY = IT_QUERY
IMPORTING
ET_RESULT_SET = IT_RESULT_SET_KEY.
CATCH CX_MDM_COMMUNICATION_FAILURE .
CATCH CX_MDM_KERNEL .
CATCH CX_MDM_NOT_SUPPORTED .
CATCH CX_MDM_USAGE_ERROR .
CATCH CX_MDM_PROVIDER .
CATCH CX_MDM_SERVER_RC_CODE .
ENDTRY.
Pass record id into keys.
LOOP AT IT_RESULT_SET_KEY INTO WA_RESULT_SET_KEY.
WA_KEYS = WA_RESULT_SET_KEY-RECORD_IDS.
ENDLOOP.
WA_RESULT_SET_DEFINITION-FIELD_NAME = <Look field name>.
APPEND WA_RESULT_SET_DEFINITION TO IT_RESULT_SET_DEFINITION.
CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Main Table>
IT_RESULT_SET_DEFINITION = IT_RESULT_SET_DEFINITION
IT_KEYS = WA_KEYS
IMPORTING
ET_RESULT_SET = IT_RESULT_SET.
LOOP AT IT_RESULT_SET INTO
WA_RESULT_SET.
*PASS KEYS INTO MAIN TABLE TO GET Structure for FALT or Look up Table
TRY.
CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Main Table>
IT_KEYS = WA_KEYS
IMPORTING
ET_DDIC_STRUCTURE =<SAP Strct having all Look up fileds of MDM>
ENDTRY.
LOOP AT <SAP Strct having all Look up fileds of MDM> INTO <Work area>.
CLEAR WA_KEYS.
APPEND <Work area>-field name TO WA_KEYS.
CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
EXPORTING
IV_OBJECT_TYPE_CODE = <MDM Lookup table name>
IT_KEYS = WA_KEYS
IMPORTING
ET_DDIC_STRUCTURE = <Single Structure in SAP For Lookup field>.
READ TABLE <Single Structure in SAP For Lookup field>. INTO <Work Area> INDEX 1.
Here you can get the value of realted lookup fields associated with main table data.
ENDLOOP.
ENDLOOP.
LR_API->MO_ACCESSOR->DISCONNECT( ).
Edited by: Shyam Babu Sah on Nov 24, 2009 4:52 AM -
How to populate boolean fields using MDM Java API's
Hi Experts!
I am trying to populate Boolean fields in main table of my repository using MDM JAVA API SP 05 patch 2.
Problem is i am geting syntax error for any value that i try to put in.
Please provide me sample code for the purpose.
Thanks in advance!Hi,
Here is the code snippet to populate boolean values from Main Table in the Repository:
Populating boolean values from Main Table in the Repository:
wdContext.currentNodeElement().setABC(Boolean.valueOf((strABC).toString()).booleanValue());
Putting boolean values in the main table:
Record objEmptyRecord = RecordFactory.createEmptyRecord(new TableId(strTableId));
boolean bFieldValue = ((Boolean)strABC).booleanValue();
objEmptyRecord.setFieldValue(new FieldId(strFieldId),new
BooleanValue(bFieldValue));
Hope this helps.
Regards
Neha Sharma -
How to access the SAP MDM destinations using mdm java api in 7.1
hi,
I have SAP MDM 7.1 SP11 and SAP Portal 7.3 and developing the custom webdynpro application using the JAVA MDM API. I want configure the SAP MDM destinations in SAP Portal .
How to access the MDM destinations in java code using API? and how to create the connection with MDM using the MDM destinations.
Please provide the code for access the SAP MDM destinations in java code using MDM java api and creating the connection to MDM.
ThanksJun,
Thanks for the reply and api information.
I have got this api information from the following sap documentation. But i am looking for the code by implementing this class and creating the mdm connection.
Creating an MDM Connection Using Java Code - SAP NetWeaver Master Data Management (MDM) - SAP Library
if any thing can you share it.
Thanks -
Attachments using MDM java API
Hi
How to store attachments in MDM repository using MDM java API.
Could you please suggest us.
Thanks
SowmyaHi Sowmya,
You can store attachments using MDM Java API. You can use the following piece of code.
BinaryBlobRecord record2 = RecordFactory.createEmptyBinaryObjectRecord(tableID);
//Attachment to be saved
String filePath = wdContext.currentContextElement().getVa_Resource().getUrl(0);
IWDResource resource = wdContext.currentContextElement().getVa_Resource();
FileInputStream stream = (FileInputStream)resource.read(true);
int length = 0;
while(stream.read() != -1)
length++;
byte[] b = new byte[(int) length];
stream.read(b);
stream.close();
record.setName(new StringValue("filename"));
record.setOriginalName(new StringValue("filename"));
record.setHasOriginal(new BooleanValue(true);
RetrieveGroupTreeCommand groupTreeCommand = new RetrieveGroupTreeCommand(wdContext.currentContextElement().getVa_ConnectionStr());
groupTreeCommand.setSession(wdContext.currentContextElement().getVa_SessionID());
groupTreeCommand.setGroupType(GroupTypes.DATA_GROUP_TYPE);
groupTreeCommand.execute();
//Set data location and data group ID
record.setDataLocationId(new GroupNodeId("GN2"));
record.setDataGroupId(new GroupNodeId("GN2"));
record.setBinary(new BinaryValue(b));
CreateRecordCommand createRecComm =
new CreateRecordCommand(wdContext.currentContextElement().getVa_ConnectionStr());
createRecComm.setSession(wdContext.currentContextElement().getVa_SessionID());
createRecComm.setRecord(record);
createRecComm.execute();
//Link this record to the main table record
Record QRec = RecordFactory.createEmptyRecord(mainTable);
//Setting the above created record in main table record object
QRec.setFieldValue(attachmentField, new LookupValue(record.getId()));
CreateRecordCommand createRecComm =
new CreateRecordCommand(wdContext.currentContextElement().getVa_ConnectionStr());
createRecComm.setSession(wdContext.currentContextElement().getVa_SessionID());
createRecComm.setRecord(QRec);
createRecComm.execute();
Now the main table record is created with an attachment.
Hope this helps you.
Regards,
Sruti -
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,
NirajHi 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 -
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); -
Search on a Qualify Table using MDM Webservices
Hello
I´m trying to use the standard MDM 7 webservice to search records in a Qualify Table and I´m having some problems.
When I try to search records in a non-qualify table, it works perfectly, but when I search on a qualify table, I get the following result:
repository_3001-Error executing Search Records on repository MY_REPOSITORY, error code , caused by Qualifier values are not part of a qualified lookup record
I´m filling the following fields:
parameters/query/criteria/manufacturer/LogicalOperation: AND
parameters/query/criteria/manufacturer/constraint/element1/value: (blank to return all records)
parameters/query/criteria/manufacturer/constraint/element1/expression Operation: CONTAINS
parameters/resultDefinition/fieldListType: ALL
..and the repository information...
Thanks.
Vitor ZaninottoSolved..
I cannot use parameters/resultDefinition/fieldListType: ALL, I must set the non-qualifier fields only. -
Use MDM java Api for saving an image to mdm image table
Hi experts
I want to save an image from web dynpro java to MDM image table using java Api's
Can anyone provide a code snippet .
I am using MDM 7.1 sp6.
Thanks and regards
SureshHello Suresh
Unfortunatly, this is no possible, i mean, to load images to mdm repository through JAVA API.
Sure you can do it directly to database ( but for that you need to do saome investigation)
Here you can found JAVA API classes for MDM:
http://help.sap.com/javadocs/MDM71/
Next two classes are working with BLOBs (pdf, images, video, etc.) in MDM repository:
com.sap.mdm.blobs
com.sap.mdm.blobs.commands
Regards
Kanstantsin chernichenka
Edited by: kanstantsin_ch on Sep 8, 2011 2:36 PM -
How to access records of a table using index?
Hi,
I am having two subforms. Now i want to fill these 2 subforms using data from a table in dataview based on some condition by looping through this table data. Is this possible using javascript? If possible please let me know.
Thanks & Regards,
Mahidhar.Hi muralikrishna kaipha,
I can't believe this.
TOP-OF PAGE page is triggered before the first line is written to a page. That means TOP-OF PAGE is triggered by first write statement in program. INITIALIZATION is normally not used to write anything.
You must avoid to write more than one page during TOP-OF PAGE event because this will trigger TOP-OF PAGE recursively endless.
Think about it.
Regards,
Clemens -
How to read "Customixed Information" in UME using WebDynpro Java APIs
Dear All
In our Portal UME we have defined 3 custom fields that appear in the "Customized Information"
tab in the standard Portal "Identity Mangagement" application ie:
krb5principalname :
How can I retrieve the custom fields and values using WebDynpro APIs?
I have the following basic code to retrieve the standard user session information, but
do not know how to extend it to extract the values of the custom fields.
Full points will be awarded to whoever answers question with suggestion that works.
Many thanks in advance
MikeHi Mike,
Following code is for just one custom attribute <custom attribute>
String namespaces[] = umeUser.getAttributeNamespaces();
String ns = null;
for (int i = 0; i < namespaces.length; i++) {
if (i > 0)
ns = namespaces[ i ];
String attrNames[] = umeUser.getAttributeNames(ns);
if (ns != null){
if(ns.equals("<name-space>")){
for (int j = 0; j < attrNames.length; j++) {
if(attrNames[j].equals("<custom attribute>")){
Object attr[] = umeUser.getAttribute(ns, attrNames[j]);
for (int k = 0; k < attr.length; k++){
if(!(null == attr[k])|| !(attr[k].toString().length() == 0)){
//attr[k].toString() has the custom attribute value
break;
}else
continue;
}else
continue;
Where <name-space> is the same value you set in config tool or on portal UME configuration.
Config Tool: Global Service Configuration>services->com.sap.security.core.ume.service>ume.virtual_groups.user_attribute.namespace
Portal
System Administration>System Configuration>UME configuration> User Admin UI tab>
Custom attributes of the user profile
Administrator-Managed Custom Attributes: add ;<name-space>:<custom-attribute>
Hope this helps -
While creating connection to MDM repository using MDM JAVA API
I am getting the following error message:
Unexpected field type 28
I am able to debug that this error message is being displayed after executing the following line of code:
/** Get the Repository schema */
GetRepositorySchemaCommand repositroySchemaCommand =
new GetRepositorySchemaCommand(simpleConnection);
repositroySchemaCommand.setSession(repositorySession);
repositroySchemaCommand.execute();
Now can anyone please explain how to resolve this error?
Thanks in Advance.
Rajatpublic void getRepositoryConnection(
java.lang.String hostName,
java.lang.String repositoryName,
java.lang.String userId,
java.lang.String passWord) {
//@@begin getRepositoryConnection()
try {
if (simpleConnection == null) {
simpleConnection =
SimpleConnectionFactory.getInstance(hostName);
// Establish TCP Connection to the server
if (simpleConnection != null) {
// wdComponentAPI.getMessageManager().reportSuccess("Got Connected");
/** Establish a repository session with the respository */
//Set the region properties
RegionProperties dataRegion = new RegionProperties();
/** Set region code for the session */
dataRegion.setRegionCode("engUSA");
/** Set the locale on data region */
dataRegion.setLocale(new Locale("en", "US"));
/** Set the name of data region */
dataRegion.setName("US");
// Createa repository identifier
RepositoryIdentifier repositoryID =
new RepositoryIdentifier(
repositoryName,
hostName,
DBMSType.MS_SQL);
/** Create the User Session */
CreateUserSessionCommand createUserSessionCommand =
new CreateUserSessionCommand(simpleConnection);
/** Set the repository identifier (mandatory)*/
createUserSessionCommand.setRepositoryIdentifier(
repositoryID);
/** Set the region properties for the session (mandatory) */
createUserSessionCommand.setDataRegion(dataRegion);
createUserSessionCommand.execute();
/** Get the session identifier */
this.userSession =
createUserSessionCommand.getUserSession();
AuthenticateUserSessionCommand authenticateUserSessionCommand =
new AuthenticateUserSessionCommand(simpleConnection);
/** Set session identifier (mandatory)*/
authenticateUserSessionCommand.setSession(userSession);
/** Set id of repository user(mandatory) */
authenticateUserSessionCommand.setUserName(userId);
/** Set password (mandatory)*/
authenticateUserSessionCommand.setUserPassword(passWord);
/** Establish the session */
authenticateUserSessionCommand.execute();
SetUnicodeNormalizationCommand unicodeNormalizationCommand =
new SetUnicodeNormalizationCommand(simpleConnection);
unicodeNormalizationCommand.setSession(userSession);
unicodeNormalizationCommand.setNormalizationType(
SetUnicodeNormalizationCommand.NORMALIZATION_COMPOSED);
unicodeNormalizationCommand.execute();
CreateRepositorySessionCommand repositorySessionCommand =
new CreateRepositorySessionCommand(simpleConnection);
/** Set the repository identifier */
repositorySessionCommand.setRepositoryIdentifier(
repositoryID);
/** Obtain repository session */
repositorySessionCommand.execute();
/** Store the session id into the variable repositorySession */
this.repositorySession =
repositorySessionCommand.getRepositorySession();
/** Authenticate the users session */
AuthenticateRepositorySessionCommand authenticatedRepositorySession =
new AuthenticateRepositorySessionCommand(simpleConnection);
/** set the session id */
authenticatedRepositorySession.setSession(
repositorySession);
/** set id of the repository user */
authenticatedRepositorySession.setUserName(userId);
/** set password */
authenticatedRepositorySession.setUserPassword(passWord);
authenticatedRepositorySession.execute();
/** Get the Repository schema */
GetRepositorySchemaCommand repositroySchemaCommand =
new GetRepositorySchemaCommand(simpleConnection);
repositroySchemaCommand.setSession(repositorySession);
repositroySchemaCommand.execute();
this.schema = repositroySchemaCommand.getRepositorySchema();
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportException(
e.getMessage(),
true);
//@@end
Maybe you are looking for
-
My ipod nano (3rd gen) will not turn on at all.
I have hooked it up to all the power adapters and tried resetting it but nothing has been able to turn it on....it was working just fine before I didnt do anything to it....it just stopped working....it kept saying that is was dead and needed to be c
-
No audio on ipod touch 4th generation when recording videos
no audio on ipod touch 4th generation when recording videos
-
AcrobatActiveXVB SDK Sample - Links in PDF Not working
Hi, I am trying to create an application in VS.net (similar to AcrobatActiveXVB SDK Sample) to display PDF files in my application. PDF file opens fine. But external links in PDF file are not working. I trying to display a main index pdf file, whi
-
GAP on credit control very important & tricky
1. Create a sales order with quantity 1 2. Order is blocked because of credit limit check. 3. Release sales order and delivery is created 4. Change order amount on VA02 for this sales order as 10.000 Displays the following warning m
-
Having trouble syncing new shuffle with my itunes
This is getting really annoying, it keeps doing the autofill. I use it only to workout with, so I made a workout mix. On my 4th gen I have no problem setting it to only update certain playlists but I can't seem to do that with my shuffle. Is there an