on 01-27-2015 8:40 AM
Hi All,
I need to set values for tuple fields. How do I do that in webdynpro java?
Please help me on this. Your help is highly appreciated.
Thanks & Regards,
Manoj
HI Manoj,
Is this issue resolved?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok!
if its the same class cast exception, can you check if you are feeding a Tuple value instead of a multiValue.
in the above code I can see that the transactions with the Tuple and the MultiTuples are fine.
Can you also check the step where you set the value to the record?
record.setFieldValue(tableSchema.getFieldId(tupleName), multiTupleValue);
Hi All,
"Assumed Answered" was a mistake. Please ignore it and share your thoughts on this.
PS: I need to set values for tuples fields on Screen.
Thanks & Regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manoj,
maybe this can help you --> http://help.sap.com/saphelp_nwmdm71/helpdata/en/f9/ff1d5f39c048eaa6e1eb7012004c32/frameset.htm
[...]
MultiTupleValue phonesTuple = new MultiTupleValue();
// home phone
TupleValue phoneTuple = MdmValueFactory.createTupleValue();
phoneTuple.setFieldValue(numberFieldId, new StringValue("800-888-8888"));
phoneTuple.setFieldValue(descriptionFieldId, new StringValue("Home"));
phonesTuple.newTupleValue(phoneTuple);
// work phone
phoneTuple = MdmValueFactory.createTupleValue();
phoneTuple.setFieldValue(numberFieldId, new StringValue("800-999-9999"));
phoneTuple.setFieldValue(descriptionFieldId, new StringValue("Work"));
phonesTuple.newTupleValue(phoneTuple);
// set phone numbers to record
record.setFieldValue(phonesFieldId, phonesTuple);
}
[...]
Regards,
Tobias
Hi Manoj,
"record" is the mdm record you are working with.
What do you mean with "std one"? I didn't get that.
I cannot give you whole training here so i would suggest you to read through the documentation of using MDM Component / MDM API in WebDynpro Java
If you have a specific question, i can try to help you ofcourse.
Hope this helps.
Best Regards,
Tobias
Hi Tobias/All,
When I use "phonesTuple.newTupleValue(phoneTuple)", only the last tuple gets added into multi-valued tuple.
So I tried with "phonesTuple.addValue(phoneTuple)", it throws below exception
"Cannot cast class com.sap.mdm.internal.valuetypes.TupleValueImpl to class
com.sap.mdm.valuetypes.MultiTupleValue"
Please anyone explain this and how to add multiple tuple values into a tuple.
Thanks & Regards,
Manoj
Hi,
Here is what I am doing:
MultiTupleValue mtvTelephone = new MultiTupleValue();
TupleValue tvTelephone = MdmValueFactory.createTupleValue();
TupleValue tvTelephone2 = MdmValueFactory.createTupleValue();
FieldProperties[] mtFieldPropertiesForTelephone = schema.getTupleMemberFields("Telephone_Numbers");
TupleDefinitionProperties tdTelephone = schema.getTupleDefinition("Telephone_Numbers");
TupleDefinitionSchema tdsTelephone = schema.getTupleDefinitionSchema(tdTelephone.getId()) ;
tvTelephone.setFieldValue(tdsTelephone.getFieldId("Number_Types"), numberTypeValue);
tvTelephone.setFieldValue(tdsTelephone.getFieldId("Number"),new StringValue(wdThis.nullCheck(wdThis.wdGetGetDnBDetailsFromMDMCustController().wdGetContext().nodeResponse_1().nodeDUNS_Data().currentDUNS_DataElement().getTelephoneNumber())));
mtvTelephone.newTupleValue(tvTelephone);
tvTelephone2.setFieldValue(tdsTelephone.getFieldId("Number_Types"), numberTypeValue);
tvTelephone2.setFieldValue(tdsTelephone.getFieldId("Number"),new StringValue(wdThis.nullCheck(wdThis.wdGetGetDnBDetailsFromMDMCustController().wdGetContext().nodeResponse_1().nodeDUNS_Data().currentDUNS_DataElement().getFaxNumber())));
mtvTelephone.newTupleValue(tvTelephone2);
wdThis.wdGetCreateBPItemDetailInterface().setFieldValue("Telephone_Numbers",mtvTelephone);
But only the last tuple value is added onto the "Telephone Numbers" multivalued tuple.
Anything wrong in what I am doing, please let me know about it.
Thanks & Regards,
Manoj
Your code looks correct. Maybe there is a bug in SAPs MDM API. In this case you will need check for notes for the version your server is on or report a bug.
Have you tryed to set the values in a Array and use the "addValues" method. Don't think that it will change anything because that method should call "addValue" internal but this is SAP... you never know .
Regards,
Tobias
Hi Manoj,
you are right, it is "setValues". But as expected it does not work .
You can try search here https://websmp109.sap-ag.de/support under "Help & Support" if you can find any hints for mdm api / multituple / etc... In the note itself you can see for what version it applies so you can check if you are affected.
Best Regards,
Tobias
Hi Tobias,
As you suggested, I searched and found a note(1468379) with similar issue. The issue is fixed in 7.1 SP04 Patch13, but currently we are using 7.1 SP12.
Do you still think this could be a bug? A bug in WD framework component?
Please share your thoughts. Thank you very much for your time.
regards,
Manoj
Hi Manoj,
then this issue should be fixed in your version. I think you have no other choice than to open a product error via support portal. At least i have no other idea what could help you, sorry.
Please don't forget to mark answers as helpful if they were useful for you.
Best Regards & good luck,
Tobias
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.