10-17-2016 1:21 PM
Hi experts,
I want that a file has exactly the same lenght in every line so that, I have to insert blank spaces when a line doesn't have the right lenght. I've already use:
g_space = cl_abap_conv_in_ce=>uccp( '00A0' ).
But when I open it in AL11 it has got "#" symbol in those positions. The point is that this document will be processed by other entity and there must be blank spaces not "#" or other symbol.
Do you know any solution?
Thank you in advance,
Pablo
10-17-2016 1:57 PM
Dear Pablo,
In the method call cl_abap_conv_in_ce=>uccp importing parameter needs to be 00A0 instead of OOAO. OOAO returns '#'. Check if this change works in your case.
BR,
Arun.
10-17-2016 1:57 PM
You could have the valid character on the fle. It is just that the SAP Gui is showing a '#'.
10-17-2016 1:58 PM
You know that # is just what is displayed when SAPGui finds an undisplayable character. It's not # in the file (if you were, for example, to check the file in a text editor).
10-17-2016 2:03 PM
Hi
I don't know which system has to read your file, but you need to consider it's impossible to place blank spaces at the right of a record, but it usually needs to use a end pf record character: this is a special not printable chararter and the system shows it as #
So for me it's ok you see #, 00A0 is line feed
Max
10-17-2016 2:38 PM
Pablo,
Please save your file in ASCII mode in AL11, Bin mode always do have # at the end of each line.
BR,
Arun.
10-17-2016 2:40 PM
Pablo,
In the method call cl_abap_conv_in_ce=>uccp importing parameter needs to be 00A0 instead of OOAO. OOAO returns #. Check if the change work in your case.
BR,
Arun.
10-17-2016 3:23 PM
In your 'TRANSFER dobj TO dset.' statement use a STRING type, so trailing blanks won't be deleted.
Hint: find the difference between space, ' ' and ` ` (or read Character Literals)
Regards,
Raymond
10-17-2016 7:21 PM
If the "transferred" data object is of type C (or a flat-character-like structure), then you may use TRANSFER dobj TO dset LENGTH the_right_length.
10-27-2016 10:33 AM
Hi Pablo,
SAP trunks blanks from the end of record.
If you want to still add, cl_abap_conv_in_ce=>uccp( '00A0' ) will add. it as that is space equivalent character. It will not show in text editor.
If you want it in-between you can use SPACE keyword.
I was also having similar requirement, As 3rd party will read details from generated file for internal purpose. After a long waste of time we ended up with mutual decision i.e. 3rd party will treat cl_abap_conv_in_ce=>uccp( '00A0' ) (Hexa - 00A0, decimal - 160, char - á) as space.
Please update if any alternative available.
with regards,
Pramod Kumar Mandal.
12-12-2016 11:12 AM
Finally, I used:
blank = CL_ABAP_CHAR_UTILITIES=>CR_LF, and I declared blank as type C of 1 lenght so I just get the CR.
Thank you very much