Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

File with control characters in Unicode

Former Member
0 Kudos
487

Hi All,

I have a peculiar problem.

I have to prepare 6 files in SAP to be sent to the Mainframe server(legacy system) which sends the FAX to the clients.Now,these files should contain the hexadecimal characters like '1A', along with a lot of normal data.

For the rest of the data,I have defined the Standard texts and defined the Text symbols and it is done.

But at the end of each line,I have to insert the hex 1A.

This is because the mainframe will understand this hexadecimal and it is mandatory to insert it.

I have checked the character value of hexadecimal 1A which is 'Substitute'.

I have no clue as to how to insert this control character along with the rest of the data.

A quick response will be highly appreciated.

Regards,

Puneet Jhari.

6 REPLIES 6

Former Member
0 Kudos
143

data: begin of hex_eof,
eof type x value '1A',
end of hex_eof.

Just concatenate the structure (not the variable) to the end of the line

0 Kudos
143

Hi Ramiro,

Thanks for the quick response.

But I am working on ECC 6.0 and the moment you try to concatenate the char with a hexadecimal,it throws an error message "EOF must be a character type data object".

I have already tried this.

It was possible in 4.7 and below.

Regards,

Puneet Jhari.

Former Member
0 Kudos
143

hi ,

delcaring 1A type X is ok but concatenating this value dosent make sense as it can be done with a character only.

declare 1A type x

there is a function modue in ecc6 hrconverthextostring make a search of this in se37 and this will allow u to

convert the hexa value into char format

im not in front of this system so cannot give u the correct name .

for this fm

i/p ---> xstring

o/p--->string

now the output contains the string value of your hexa value

now concatenate ur value with this string and transfer it to the mf server .

just check if this works for u .

br,

<vijay

0 Kudos
143

Hi Vijay,

I agree that the hexadecimal and char can not be concatenated in ECC.

But my requirement is, that before this file is sent to the mainframe,it would be formatted using the DCF(Data Composition Facility) format.Once it is opened with DCF,the hex characters should be shown as it is as I have tried to develop them in SAP.

Say,for ex,

If I have tried to write a hex value for '1A' in SAP,once it is opened in DCF,it should be represented as the same hex value or the symbol for it and should not be displayed in the char format.

I doubt that if I convert the hex to char and then transfer,once it is opened at the target system,it would not be represented as a hex but something else,lets say #.

I hope you are getting what I am trying to explain.

I know the requirement is peculiar,but this is how it is(Client's demands).....

If not,then let me know.

Regards,

Puneet Jhari.

Former Member
0 Kudos
143

Hi,

Declare as follows:

DATA: ws_nline TYPE c VALUE cl_abap_char_utilities=>cr_lf.

Use this character symbol i your text.

Regards,

Subramanian

0 Kudos
143

Hi,

you can define your internal table as follows:

data: begin of ws_itab ,

f1 type string,

ws_nline TYPE c VALUE cl_abap_char_utilities=>cr_lf,

end of ws_itab.

data: itab like standard table of ws_itab.

Just fill only the field f1. ws_nline is always set as the EOL char.

Regards,

Subramanian