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: 

convert Type X value To char value (Or used in translate keyword) in unicod

Former Member
0 Kudos

hi all ,

i need to convert type X value in Char format.

DATA: TR(14) TYPE X VALUE '092086E58FC591E692C69BF89DD8'.

Or any other solution for this

i just want used this value in following code .

TRANSLATE ESATZ USING TR.

if i m not changing this statement in ecc 6.0 system it will give error

"TR" must be a character-type data object (data type C, N, D, T type)

where data declaration part is

DATA: BEGIN OF ESATZ,

MATNR(08),

SEP01(01),

CHARG LIKE MCHA-CHARG,

SEP02(01),

BTCHT(72),

SEP03(01),

FLD04(18),

END OF ESATZ.

DATA: TR(14) TYPE X VALUE 092086E58FC591E692C69BF89DD8'.

please reply

3 REPLIES 3

Former Member
0 Kudos

Hello,

Move TR to a character variable using WRITE syntax and then use the char variable for TRANSLATE.

DATA: TR(14) TYPE X VALUE '092086E58FC591E692C69BF89DD8'.

DATA: V_CHAR(14).

DATA: BEGIN OF ESATZ,

MATNR(08),

SEP01(01),

CHARG LIKE MCHA-CHARG,

SEP02(01),

BTCHT(72),

SEP03(01),

FLD04(18),

END OF ESATZ.

WRITE TR TO V_CHAR.

TRANSLATE ESATZ USING V_CHAR.

Former Member
0 Kudos

hi,

DATA: TR(14) TYPE X VALUE '092086E58FC591E692C69BF89DD8'.

DATA : TP TYPE CHAR30.

DATA: BEGIN OF ESATZ,

MATNR(08),

SEP01(01),

CHARG LIKE MCHA-CHARG,

SEP02(01),

BTCHT(72),

SEP03(01),

FLD04(18),

END OF ESATZ.

WRITE TR TO TP.

TRANSLATE ESATZ USING TP.

Pls reward if helpful.

Thanks,

Deepa

Former Member
0 Kudos

Hi,

Plz try the function HR_KR_XSTRING_TO_STRING with IMPORT parameter of TYPE XSTRING and EXPORT parameter of TYPE STRING.

Then use your required operation.

Reward if Helpful.