# Having a problem with ConvertToString

**URL:** <https://techcommunity.softwareag.com/t/having-a-problem-with-converttostring/107870>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [May 14, 2003, 6:24am UTC](https://techcommunity.softwareag.com/t/having-a-problem-with-converttostring/107870 "2003-05-14T06:24:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![suda1234](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@suda1234](https://techcommunity.softwareag.com/u/suda1234)\
**Post date:** [May 14, 2003, 6:24am UTC](https://techcommunity.softwareag.com/t/having-a-problem-with-converttostring/107870/1 "2003-05-14T06:24:27Z")

</div>

Hello,  
i am creating a positional flatfile from 830 EDI using WMEdi package.  
i have created Flatile template(positional) as it says in userguide.  
first i am creating Flatile reocrd.  
in this record one of record has rightjustifed elements(example… say quantity = 3. i need to rightjustiy(5) this field .so now this value is 3(5 spaces beore).  
i can see that in Flatile record these field are right justifed(as i wanted).  
but when i am creating srting using convertToString service , the output string does not place these fields as right justified.  
i am passing the FFrec, and template obj inputs to the convertToString service.it is not putting these spaces beore these fileds.

can somebody tell me how can solve this problem.

Thanks,  
Rao.

---

<div class="post-metadata">

**Author:** ![bash](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@bash](https://techcommunity.softwareag.com/u/bash)\
**Post date:** [May 14, 2003, 5:26pm UTC](https://techcommunity.softwareag.com/t/having-a-problem-with-converttostring/107870/2 "2003-05-14T17:26:21Z")

</div>

Hello Rao,  
You need to pad the field with Zeros whenever you need to right justify the field.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [May 14, 2003, 6:22pm UTC](https://techcommunity.softwareag.com/t/having-a-problem-with-converttostring/107870/3 "2003-05-14T18:22:34Z")

</div>

Try to contact wm tech support they will provide some fix to ConvertToString service for the parameter (spacePad) which will have “donttrim” value in that check list.Finally it should result you having leading and trailing spaces as per the template positional.

since convertToString internally do some sort of Trimming before converting file to string.

Generally this fix was provided on our request for wmEDI 4.6 module ,not sure about 6.01.i believe you are using that…

HTH.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:04pm UTC](https://techcommunity.softwareag.com/t/having-a-problem-with-converttostring/107870/4 "2021-04-02T15:04:57Z")

</div>


