on 07-06-2009 9:42 PM
Hi All,
From Idoc in one of the field, the value is coming like " 678" ( with preceding spaces) because it is declared it as INT4 in ECC. this is Zfield.
If the value is coming like this means whi generating the text file with fixed lengths, it is writing with " 678" which shld be like "678"
If i remove the spaces from WE19 and trigger means it is giving correctly only
How to do this
Regards
If I understand correctly replace string should work or you can use UDF to suppress spaces.
Use replacestring with one input as spcaes and another with nospaces
regards,
Satya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Using TRIM alone will work
rgds
srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vamsi,
Since you are writing a fixed length file two things you need to consider:
a) INT4 is 10 digit representations. So if the value is 678 then from SAP if it comes as leading seven spaces adn 678 then you need to first trim the spaces so that you have value as 678.
b) Now since you have 678 but in the fixed file it should be 10 digits. So if you send the output as 678 then it will fail in content conversion for receiver communication channel. So you may add seven spaces after 678. Now here the length is dynamic. So you need to write a UDF for adding the number of spaces in the end and make the length as 10.
If my understanding is correct and if you want the above approach then your mapping is:
input ---> trim ---> UDF1 --> target
UDF1:
Create a value udf with name as udf1 and one variable 'a'. Add this code:
int len = a.length();
for(int i=0;i<10-len;i++){
a=a+" ";
}
return(a);
I am assuming your lenght in input file is also 10. If not change this number in the 2nd line of the code.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The best solution would be to use TRIM function if you want to remove the spaces
Edited by: Ravi on Jul 6, 2009 5:29 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.