on 11-18-2009 1:38 PM
Hello All,
I have receiver FCC and have requirement of Right padding strings and left padding numerics. FCC is of fixedLength.
String data type fields have to be end padded with " " e.g. "Data "
Numeric or Decimal data type have to be forward padded with "0" e.g. "000001234". Can we handle something like this in FCC itself. Is there any solution except writing and using UDF for each field.
Regards
Arpil
Hi,
For zero padding for numbers, you can use the Arithmetic Function "FormatNum". As for the spaces, I guess java mapping or xslt mapping would do. Let's wait for the other opinions.
Hope this helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As you mentioned it is fixedLength, so for data type there will be no problems.
The data will be written on file from it's initial position. e.g. suppose I have two fields, first one 15 char long and second one 10 char long. Now if in first field a value comes like "helloworld" (of length 10) and in second field it comes like "12345", then it will be written on file like this
helloworld-----12345-----
where "---" represents the spaces between field1 and field2.
So for Numeric value just use the standard function FormatNum to pad it with zeros and rest everything is going to be fine.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
String data type fields have to be end padded with " "
I don't think you need right padding as it is already fixed lenght FCC, the space will be added to the string if its shorter than the specified length.
To control this behaviour you can use NameA.fixedLengthTooShortHandling.
http://help.sap.com/saphelp_nw70/helpdata/EN/d2/bab440c97f3716e10000000a155106/content.htm
And for left padding zero's, you either need to use numFormat function as mentioned or write a udf. I dont think this can be handled in FCC.
Refer this link for UDF-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.