on 03-08-2009 5:05 PM
Hi everyone,
I have an file - PI - IDOC scenario where i need to do graphical FRC Lookup in mapping (using BAPI_COMPANYCODE_GETLIST)to collect company codes and map it to DEBMAS06 IDOC.
I want to send all company codes within the intervall 1000 < company code < 2000. the result from the lookup contains also non-numeric data such as BD01 and so on;
I create an user defined function to do this jub but the result is <null>:
/*****************/
public void rfcLookupII(String[] cc, ResultList result, Container container) throws StreamTransformationException{
String code = "";
for (int i = 0; i < cc.length; i++) {
code = cc<i>;
if (code.matches("
d+")) {
int intCode = new Integer(code).intValue();
if (intCode >= 1000 && intCode <= 2000)
result.addValue(code); }
} }
/******************/
can anyone help me Please to fix this problem.....
I create an user defined function to do this jub but the result is <null>:
but where are you calling your RFC in this code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again and thanks for responsing.
No, i don't got any error. But the case is, my lookup works fine.
I did the lookup and the result from lookup is the comany codes i have registered on the table T001 in R3 system. But IDOC expects just the numeric value/numeric company codes which are between 1000 and 2000. thats why i am trying to 1) validate numeric values which comes from lookup. 2) filter out the values that are not within the value range i am interested in.
thats why i am trying to create a UDF to do this job for me...
Hi Naser,
I saw the code implemented by you, and I see few fundamental mistakes done in it.
The working code for the UDF should be as:
for (int i = 0; i < cc.length; i++) {
code = cc<i>;
//You have Assigned String array to String, if you do a check on the Message Mapping
//the above line should be shown in error
if(code.matches("\\d+")) // Change the regular expression
{
int comp = Integer.parseInt(code); // getInteger() is used for system properties
if(comp >=1000 && comp <= 2000)
{
result.add(comp);
}
}
}
Hope this helps.
Regards,
Alka Panday.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys and thanks for responses.
but my code works fine now for validating numeric value returned from RFC Lookup;
String code = "";
for (int i = 0; i < cc.length; i++) {
code = cc<i>;
if (code.matches("
d+")) {
int intCode = new Integer(code).intValue();
// if (intCode >= 1000 && intCode <= 2000) result.addValue(code);
if ((intCode > 999 && intCode <= 1000) || (intCode >= 1299 && intCode <=1999)) result.addValue(code);
}
}
the problem was in graphical message mapping. I did send an constant as in parameter, thats why the returned output was just the first element from the ResultList. Now I am sending root node (0:n) as in parameter for the RFC Lookup and the result is just what i was looking for.
but thanks anyway...
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.