on 06-01-2006 7:55 PM
Hi
I am getting a string from SAP of field length '10'. Now I have to write it to the <b>fixed length file</b>. Now if I am getting the value for this as "ABC" then in the fixed length file it should be "ABC " ie., ABC 3 characters and rest 7 should be spaces. For this to achieve I think we have to make left justification in message mapping. Can you guys help me out in achieving this requirement?
---Satish
When you use "fieldFixedLengths) in the content conversion of the file adapter, you need not provide the data with that length. It is OK, when the strings or shorter. Just do not provide strings, that are longer.
On the other side, when you have a sender file adapter with content converion, the fields become trimmed by default.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Left or Right Justification is depends on the Business Requirements/process . You can not generalize for each fields saying that Left Justififation/right... Because for the currency etc right justification , but for the strings it depends. so first identify this..
Just write one User Defined function , to check the string length, based on that , add/concate that many spaces to the string..then pass it. You need to do for each field..
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Krishna
What you have told is absolutely right. Here in my scenario I need to write a user defined function. I will try to write the code for this. But if you already have the code can you please give me the code. If I write this then i think I can resolve my earlier issue also which is given in the thread
Regards,
---Satish
Hi Satish...
you do not need to write a user defined function for this ...this can be achieved using standard fucntions itself....supposing you want the string to be 10 characters long with spaces at the end...you achieve by doing the following...
input_str -- trim
concat -- substring(0,10)---output
/
Constant(10 spaces)
output is what you want....
Thanks,
Renjith
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.