on 03-24-2008 6:58 AM
Hi,
Iam getting this Error When i test the mapping at Mapping Test tab.
RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /WPUTAB01/IDOC/E1WPZ01/E1WPZ02/ZAHLART. The message is: Exception:[com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: A condition specified dynamically has an unexpected format.] in class com.sap.xi.tf._MM_POS_PaymentType_IB_ method
I have used the RFCLookup in the mapping.
Iam pasting the sample code here have a look at and reply back with valuable ans
com.sap.mw.jco.*;
-
public void myproglkp(String[] tabname,String[] sourcefld,String[] fldvalue,String[] sourcefld2,String[] fldvalue2,String[] lkpfld,ResultList result,Container container){
-
//write your code here
//write your code here
String DBTABLE = tabname[0];
String lookUpField = lkpfld[0];
String WHERE_CLAUSE = sourcefld[0]" = ""'"fldvalue[0]"'" + "AND" + sourcefld2[0]" = ""'"fldvalue2[0]"'";
String sapClient = "500";
String hostName = "Xi Hostname";
String systemNumber = "00";
String userName = "User name";
String password = "pwd";
String language = "EN";
JCO.Repository mRepository;
JCO.Client mConnection = JCO.createClient(
sapClient,
userName,
password,
language,
hostName,
systemNumber );
// connect to SAP
mConnection.connect();
// create repository
mRepository = new JCO.Repository( "GenericRFCMappingLookup", mConnection );
// create function template to select data from any table
JCO.Function function = null;
IFunctionTemplate ft = mRepository.getFunctionTemplate("RFC_READ_TABLE");
function = ft.getFunction();
// Obtain parameter list for function
JCO.ParameterList input = function.getImportParameterList();
// Pass function parameters
// set import parameters table name and RFC
input.setValue( DBTABLE, "QUERY_TABLE");
input.setValue( "," , "DELIMITER");
//Fill the where clause of the table
JCO.ParameterList tabInput = function.getTableParameterList();
JCO.Table inputTable = tabInput.getTable("OPTIONS");
inputTable.appendRow();
inputTable.setValue(WHERE_CLAUSE,"TEXT");
mConnection.execute( function );
//Find the position of the field that has to be lookedUp
JCO.Table lookupFieldPos = function.getTableParameterList().getTable("FIELDS");
int pos = -1;
for (int i = 0; i < lookupFieldPos.getNumRows(); i++)
{
lookupFieldPos.setRow(i);
if (lookupFieldPos.getString("FIELDNAME").equals(lookUpField))
pos = i;
}
//Get the exact lookupvalue from the position obtained above
JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
for (int i = 0; i < valueSet.getNumRows(); i++)
{
valueSet.setRow(i);
String resultSet [] = valueSet.getString("WA").split(",(?=(?:[\"]*\"[\"]\")(?![^\"]*\"))");
result.addValue(resultSet[pos]);
}
mConnection.disconnect();
Regards
Bopanna
Ans
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
String WHERE_CLAUSE1 = sourcefld[0]" = ""'"fldvalue[0]"'" ;
String WHERE_CLAUSE2 = sourcefld2[0]" = ""'"fldvalue2[0]"'" ;
...............
inputTable.setValue(WHERE_CLAUSE1,"TEXT");
inputTable.setValue(WHERE_CLAUSE2,"TEXT");
please check the code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabriel,
Thanks for your valuable response.
We tried this .But the thing is it is giving the success but it is not placing the condition for both fields.
its taking the value with respect of the second field and the first field it ignores and not checking
By writing the code as u said , i thought that here we are not doing any condition check for both the fields combindly
\Please let me know the way to achieve
Regards
Bopanna
Edited by: BOPANNA B on Mar 26, 2008 6:59 AM
Hi,
If i check the condition by passing a single parameter means its giving the success. like the code will be like this
public void Payment_Method_Lkp(String[] tabname,String[] sourcefld,String[] fldvalue,String[] lkpfld,ResultList result,Container container){
String WHERE_CLAUSE = sourcefld[0]" = ""'"fldvalue[0]"'" ;
If i check the condition by passing two parameters means i am getting that error.the code i used here to check the condition on two fields is
public void Sample(String[] tabname,String[] sourcefld,String[] fldvalue,String[] sourcefld2,String[] fldvalue2,String[] lkpfld,ResultList result,Container container){
String WHERE_CLAUSE = sourcefld[0]" = ""'"fldvalue[0]"'"+ "AND" + sourcefld2[0]" = ""'"fldvalue2[0]"'" ;
Is there any problem in checking the condition on two fields. Is there any syntax error on this WHERE CLAUSE.
Regards
Bopanna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Now this time iam getting this error
Source code has syntax error: /usr/sap/SXD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapdb774b00f9d911dcc50e0003ba2ce5c5/source/com/sap/xi/tf/_MM_POS_PaymentType_IB_.java:207: ';' expected String WHERE_CLAUSE = sourcefld[0]" = ""'"fldvalue[0] "'"+ "AND" + sourcefld2[0]" = ""'"fldvalue2[0]"'" ; ^ 1 error
Regards
Bopanna
Hi,
This syntax is working fine when iam passing one parameter to check the condition
String WHERE_CLAUSE = sourcefld[0]" = ""'"fldvalue[0]"'" ;
According to this please make the WHERE_CLAUSE condition for Two fields
and iam sure that iam getting the error in this WHERE_CLAUSE only.
Regards
Bopanna
Hi,
According to this blog she used one field and did the condition , accordng to that she fetched the corresponding value from the mapping table.
But in my case i want to put the condition on two parameters.
I changed in the code WHERE_CLAUSE .and i passed the parameters according to the inputs. is there any place to change some thing else when we are passign two parameters.???
How to do this by WHERE CLAUSE. please construct the CLAUSE and send me
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
Regards
Bopanna
Hi,
No Gabriel, if i mention the code given by you means iam getting the same error which i have posted in my previous post.
If you observe the code given in the Sravya's blog. she has given for one field can u please make the condition for two fields???
the code which u have given is giving the error
Source code has syntax error: /usr/sap/SXD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map37ab5520f9e311dcaa680003ba2ce5c5/source/com/sap/xi/tf/_MM_POS_PaymentType_IB_.java:208: ';' expected String WHERE_CLAUSE = sourcefld[0]" = ""'"fldvalue[0]"' AND " + sourcefld2[0]" = ""'"fldvalue2[0]"'"; ^ 1 error
Regards
Bopanna
please visit the article which may help you.......
No Gabriel,
This is talking abt the other type of java code.
Can you please have a look at the code which i implemented for this RFC Lookup
And can you say how to check the codition on two fields
If we know where to change the code modification for that type of condition means our work is done.
Regards
Bopanna
public void Payment_Method_Lkp(String[] tabname,String[] sourcefld,String[] fldvalue,String[] lkpfld,ResultList result,Container container){
String WHERE_CLAUSE = sourcefld[0]" = ""'"fldvalue[0]"'" "+ "AND" + sourcefld[1]" = ""'"fldvalue[1]"'" ;
Hi you can passing two parameters by this way...........
Hi gabriel,
here in the arguments u have passed only for fieldname and fieldvalue but i want two more field like fieldname2 and fieldvalue2 inorder to check those fields in WHERE_CLAUSE
and here u are doing like this
String WHERE_CLAUSE = sourcefld[0]+" = ""'"fldvalue[0]"'" " "AND" + sourcefld[1]" = ""'"fldvalue[1]"'" ;
What is the meaning of this. but in the arguments u havent passed any thing for field2
Regards
Bopanna
Edited by: BOPANNA B on Mar 26, 2008 8:19 AM
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.