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

upgrade error: type x variables

Former Member
0 Likes
597

hi

in unicode system type x variables are giving syntax error: i have found replacements for few type x variable with value 09, 7c, od etc.. but i couldnt find replacements for the following

GCX_INTRO TYPE X VALUE '0D', " Enter

GCX_CR TYPE X VALUE '10', " Carriage return

GCX_VALIDATE(6) TYPE X VALUE '090D273B7C10'. " Invalid chars for field

kindly provide me with solutions

regards

mano

2 REPLIES 2
Read only

rainer_hbenthal
Active Contributor
0 Likes
446

type x is binary data and vlaues enclosed in apostrophes are string or chars.

use the constants declared in CL_ABAP_CHAR_UTILITIES eg:

CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

GCX_INTRO = CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

Read only

Former Member
0 Likes
446

Hi,

CONSTANTS:
  con_cret  TYPE x VALUE '0D', "OK for non Unicode
  con_tab   TYPE x VALUE '09'. "OK for non Unicode
 
*"If you have Unicode check active in program attributes then declare  *"constants as follows
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS:
 con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.  
                                       " Carriage Return and Line Feed
 con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab, " tab
                                       " Horizontal Tab Stop

Regards

Adil