on 07-13-2006 3:51 PM
we are using ISR in combination with adobe forms. we managed to get the data elements dynamic. But now I want to get the data fields end values and safe them in SAP.
the code i am using is:
try {
IPublicISR_Form.IMappedFieldsElement field =
wdContext.createMappedFieldsElement();
Y_Tf_Change_Isr_Input input1 =
new Y_Tf_Change_Isr_Input();
input1.setNotification_No("000600001055");
input1.execute();
Iterator it = input1.getResult().iterator();
while (it.hasNext()) {
Yisr_Special_Data_Get_Output output = (Yisr_Special_Data_Get_Output)it.next();
Iterator records = output.getSpecial_Data().iterator();
while(records.hasNext()) {
Qisrsspecial_Param record = (Qisrsspecial_Param )records.next();
String fieldname = record.getFieldname();
String fieldvalue = record.getFieldvalue();
try {
Method method =
fieldvalue.getClass().getMethod(
"get" + fieldvalue,
new Class[] {});
record.setFieldvalue((String)method.invoke(fieldvalue, new Object[] {}));
} catch (SecurityException e) {
logger.catching(e);
} catch (IllegalArgumentException e) {
logger.catching(e);
} catch (NoSuchMethodException e) {
logger.catching(e);
} catch (IllegalAccessException e) {
logger.catching(e);
} catch (InvocationTargetException e) {
logger.catching(e);
}
}
}
this.wdContext.nodeMappedFields().bind(field);
} catch (Exception e) {
logger.catching(e);
}
//@@end
}
try to replace
Method method =
field.getClass().getMethod(
"get" + fieldname,
new Class[] { String.class });
method.invoke(field, new Object[] );
Make it this
Method method =
field.getClass().getMethod(
"get" + fieldname,
new Class[] {});
record.setFieldvalue((String)method.invoke(field, new Object[] {}));
Depents on the BAPI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try {
AbstractList inputRecords = new Qisrsspecial_Param_List();
IPublicProcess_Status_Cust.IMappedFieldsElement mappedFieldsElement =
wdContext.currentMappedFieldsElement();
Yisr_Special_Data_Get_Input inputIsr =
new Yisr_Special_Data_Get_Input();
String isrNr =
wdContext.currentYtf_Process_LogProsElement().getIsr_Number();
inputIsr.setNotification_No(isrNr);
inputIsr.setDo_Not_Read_Linked(true);
inputIsr.execute();
Iterator it = inputIsr.getResult().iterator();
while (it.hasNext()) {
Yisr_Special_Data_Get_Output output =
(Yisr_Special_Data_Get_Output) it.next();
Iterator fieldNameRecords = output.getSpecial_Data().iterator();
while (fieldNameRecords.hasNext()) {
try {
Qisrsspecial_Param fieldNameRecord =
(Qisrsspecial_Param) fieldNameRecords .next();;
String fieldName = fieldNameRecord.getFieldname();
// retrieve value from Abobe form
Method method = mappedFieldsElement.getClass().getMethod("get" + fieldName, new Class[] {});
String fieldValue = (String)method.invoke(mappedFieldsElement, new Object[] {});
Qisrsspecial_Param inputRecord = new Qisrsspecial_Param();
inputRecord.setFieldname(fieldName);
inputRecord.setFieldvalue(fieldValue);
inputRecords.add(inputRecord);
} catch (SecurityException e) {
logger.catching(e);
} catch (IllegalArgumentException e) {
logger.catching(e);
} catch (NoSuchMethodException e) {
logger.catching(e);
} catch (IllegalAccessException e) {
logger.catching(e);
} catch (InvocationTargetException e) {
logger.catching(e);
}
}
}
Y_Tf_Change_Isr_Input inputQuery = new Y_Tf_Change_Isr_Input();
inputQuery.setNotification_No(isrNr);
inputQuery.setSpecial_Data(inputRecords);
inputQuery.execute();
} catch (WDDynamicRFCExecuteException e) {
// TODO write proper error handling code
logger.catching(e);
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.