cancel
Showing results for 
Search instead for 
Did you mean: 

Flat file mapping problem.

Former Member
0 Kudos
62

we were doing Flat file to IDOC.

we were getting a field of length 12 from which we need to convert take first 10 values from left to right.

we used the sub string function till now...

functional team says...they might also send 5 digits number...so in that case...i need to take the 5 digits number along with the 5 spaces...how will i do that.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can be done with UDF.

Former Member
0 Kudos

can some one get me that .UDF

Former Member
0 Kudos

You an also use If-Else-if standard function for it.

Here is the UDF code.

String s = // assign your UDF variable here....
		if (s.length() ==12){
			System.out.println(s.substring(0,10));	//replace System.out.println with return in real UDF	
		}
		else if (s.length() <= 5){
			String temp = "     ";
			System.out.println(s.concat(temp));  //replace System.out.println with return in real UDF
		}

Edited by: Farooq Farooqui on Sep 4, 2008 12:38 AM

Answers (2)

Answers (2)

Former Member
0 Kudos

to be honest i am new....

please tell me step by step ..

field----ifelse-->receiver feild

can some one show me dramatically

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hey

Don't you think your answer is just a copy-paste of already posted code by Farooq?

Thanx

Aamir

Former Member
0 Kudos

Hi,

you can use this with the help of standard mapping too..

check this :

http://www.flickr.com/photos/30143464@N05/2825237039/

regards,

Venkat.

Former Member
0 Kudos

Hi Reddy,

Check the length of the field and use if-else accordingly.

Regards,

---Satish