on 10-30-2008 2:40 AM
Hello Sdn
File to IDOC
In my file : i have a text field which will have a value : purchase order nuber is purchord;customer number is cust1;invoice number is inv1;account number is acct1
In my target i have an idoc and there is a segment E1EDK01. I have to create this segment only if text value in the file contains : "customer number is "
In other words ,if the text in the file contains : purchase order nuber is purchord;ivoice number is inv1;account number is acct1
Then in this case E1EDK01 should not be formed.
Thanks
Hi,
Try with the below mapping
src-->contain(udf)-->equalsS---->createIf--->E1EDK01
constant(exist)--->
UDF
use cache parameter context
public void contain(String[] a,ResultList result,Container container)
{
//write your code here
int i,pos;
for( i =0 ;i != a.length; i++)
{
pos = a.indexOf("customer number is ");
if(pos.equals("-1"))
result.addValue("does not exists");
else
result.addValue("exist");
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys for the responses.
Will award points and close the thread.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use the default function.. . creatIf node function...provide the condition and the node only be created if it satisfy the condition
http://help.sap.com/saphelp_nw04/helpdata/en/c8/98e7d5c1620642973565ea3dd319d1/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
If you have
purchase order nuber is purchord;customer number is cust1;invoice number is inv1;account number is acct1
always coming in this format.
then you can try with standard mapping functions
source -> Substring(33, 48) -> equalS(customer number) -> createif -> target node
if you are not sure of the position of customer number in the string then use this code
source -> UDF ParseLine -> = (function) "null" (constant) -> not -> createif -> Target
source code for ParseLine
String compare ="customer number";
int x = a.indexOf(compare);
if (x>0){
return a;}
else{
return "null";}
Thanks
Gaurav
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.