Application Development and Automation 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: 
Read only

hexadecimal

Former Member
0 Likes
1,022

Hi Group,

How to write hexadecimal variable in the file on application server.

With Transfer statement its giving dump.

Hi Group,

How to write hexadecimal variable in the file on application server.

With Transfer statement its giving dump.

7 REPLIES 7
Read only

Former Member
0 Likes
962

I think write it to a character field and than transfer..

Read only

0 Likes
962

I transfer to string and write in to the file using transfer still its not writing .

data v_str type string.

types : begin of ty_sep,

str(1) type c,

vsep(2) type x,

end of ty_sep.

data wa_sep type ty_sep.

wa_sep-str = " ".

wa_sep-vsep = '12'.

v_str = wa_sep-vsep.

transfer v_sep to fname.

its writting as 1200 on application server instead of control L.

Read only

0 Likes
962

transfer v_str instead of v_sep and check the value in the output.

Also, note you dont need it to be string but of type Char with length twice that of the hex value.

Regards

Anurag

Read only

0 Likes
962

Sorry I trnasfered v_str only,I tried to transfer

the character value but its writting 12 on application server instead of writting hexadecimal equivalent.

Read only

0 Likes
962

In your example the hex value of the string was 12 and hence the output as 12. Do you mean that you have a numeric value which you wish to convert into hex and transfer it to dataset ?

lnum = '12'.

lhex = lnum.

lstr = lhex.

transfer lstr to dsn.

Regards

Anurag

Read only

0 Likes
962

it will be displayed in AL11 as #(any hexadecimal value) i guess.

have you defined that variable as X or not ??

like

data : v_hex <b>type x</b> value '09'.

Read only

Former Member
0 Likes
962

data : v_hex type x value '09'. "horizantal tab

CONCATENATE V_FIELD1

V_FIELD2

V_FIELD3

INTO V_STRING SEPARATED BY V_HEX.

TRANSFER V_STRING TO <FILENAME>.

This will works fine. in AL11,you can see '#' between the feilds.

Regards

srikanth