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

Unicode error: "REPLSET" must be a character-type data object (data type C, N, D, T, or STRING).

Former Member
0 Likes
3,777

Hi All,

I am doing UCCHECK for the custom programs.

There is a statement OVERLAY B0005 WITH SREP ONLY REPLSET which is causing error.

Error description is  "REPLSET" must be a character-type data object (data type C, N, D, T, or STRING).

I tried to solve my self and searched in google also but no luck.

data declaration is as follows.

DATA: BEGIN OF REPLSET,

      LINE0(16) TYPE X VALUE '000102030405060708090A0B0C0D0E0F',

      LINE1(16) TYPE X VALUE '101112131415161718191A1B1C1D1E1F',

      LINE2(02) TYPE X VALUE '2227',

      LINE7(01) TYPE X VALUE '7F',

      LINE8(13) TYPE X VALUE '8182838485868788898B8D8E8F',

      LINE9(14) TYPE X VALUE '909192939495969798999B9D9E9F',

      LINEA(11) TYPE X VALUE 'A0A4A6A8A9AAABACADAEAF',

      LINEB(15) TYPE X VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',

      LINED(01) TYPE X VALUE 'DF',

END OF REPLSET.

DATA: BEGIN OF B0005 OCCURS 5,

        ART(1) TYPE C,

        TABNAME LIKE DD03L-TABNAME,

        LANGFIELD LIKE DD03L-FIELDNAME,

        TABNAMETEXT LIKE DD03L-TABNAME,

        LANGFIELDTEXT LIKE DD03L-FIELDNAME,

        LIMIT(20) TYPE N,

        GEN(100) TYPE C,

        MIN(1) TYPE C,

        CLI(1) TYPE C,

        BC(1) TYPE C,

        DV(1) TYPE C,

        FSD(1) TYPE C,

        AGF(1) TYPE C,

        SDV(18) TYPE C,

        STAB(18) TYPE C.

DATA: END OF B0005.

DATA: SREP(4000) TYPE C,

Can anyone help me to solve this.

Regards

Raj

Hi All,

I am doing UCCHECK for the custom programs.

There is a statement OVERLAY B0005 WITH SREP ONLY REPLSET which is causing error.

Error description is  "REPLSET" must be a character-type data object (data type C, N, D, T, or STRING).

I tried to solve my self and searched in google also but no luck.

data declaration is as follows.

DATA: BEGIN OF REPLSET,

      LINE0(16) TYPE X VALUE '000102030405060708090A0B0C0D0E0F',

      LINE1(16) TYPE X VALUE '101112131415161718191A1B1C1D1E1F',

      LINE2(02) TYPE X VALUE '2227',

      LINE7(01) TYPE X VALUE '7F',

      LINE8(13) TYPE X VALUE '8182838485868788898B8D8E8F',

      LINE9(14) TYPE X VALUE '909192939495969798999B9D9E9F',

      LINEA(11) TYPE X VALUE 'A0A4A6A8A9AAABACADAEAF',

      LINEB(15) TYPE X VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',

      LINED(01) TYPE X VALUE 'DF',

END OF REPLSET.

DATA: BEGIN OF B0005 OCCURS 5,

        ART(1) TYPE C,

        TABNAME LIKE DD03L-TABNAME,

        LANGFIELD LIKE DD03L-FIELDNAME,

        TABNAMETEXT LIKE DD03L-TABNAME,

        LANGFIELDTEXT LIKE DD03L-FIELDNAME,

        LIMIT(20) TYPE N,

        GEN(100) TYPE C,

        MIN(1) TYPE C,

        CLI(1) TYPE C,

        BC(1) TYPE C,

        DV(1) TYPE C,

        FSD(1) TYPE C,

        AGF(1) TYPE C,

        SDV(18) TYPE C,

        STAB(18) TYPE C.

DATA: END OF B0005.

DATA: SREP(4000) TYPE C,

Can anyone help me to solve this.

Regards

Raj

17 REPLIES 17
Read only

FredericGirod
Active Contributor
0 Likes
2,745

hi,

what did you do with this structure ?  a CONCATENATE ?

maybe the issue it's not the declaration, but the statement used this structure.

regards

Fred

Read only

0 Likes
2,745

Actually the coding looks like below..

 

DATA: BEGIN OF B0004 OCCURS 1,
CHECKTABLE
LIKE DD08VV-CHECKTABLE,
FORTABLE
LIKE DD08VV-FORTABLE,
FORKEY
LIKE DD08VV-FORKEY.
DATA: END OF B0004.

DATA:TRANSSEP(1) TYPE C VALUE '''',

 

DATA: TRANSREC(4000) TYPE C.

LOOP AT B0004.
OVERLAY B0004 WITH SREP ONLY REPLSET.
CONCATENATE
B0004
-CHECKTABLE
B0004
-FORTABLE
B0004
-FORKEY
INTO TRANSREC
SEPARATED BY TRANSSEP 

.ENDLOOP.

  So in the OVERLAY statement it is giving error as

"REPLSET" must be a character-type data object (data type C, N, D, T, or STRING).

Regards

Raj

Read only

venkateswaran_k
Active Contributor
0 Likes
2,745

Hi

What is that...in structure....          LIMIT(20) TYPE N,    is it C or N ?

REgards,

Venkat

Read only

Former Member
0 Likes
2,745

are you moving something to internal table,

Please check below tag may useful..

Moving contents from one structure to another

      Before Unicode:

    SRTFDLOM = XSRTFDLOM.

      Resolution:

CLASS CL_ABAP_CONTAINER_UTILITIES DEFINITION LOAD.
DATA: LV_TAB(1000) TYPE C.
CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C
EXPORTING
IM_VALUE                = XSRTFDLOM
IMPORTING
EX_CONTAINER            = LV_TAB

CALL METHOD  CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C
EXPORTING
IM_CONTAINER       = LV_TAB
IMPORTING
EX_VALUE                = SRTFDLOM.

OR

Before Unicode:

wa_test = upload.

Resolution:

data:    cbin  TYPE REF TO cl_abap_conv_out_ce,
                    buffer  TYPE xstring,
                    conv  TYPE REF TO cl_abap_conv_in_ce,
                    view1  TYPE REF TO cl_abap_view_offlen,
                    view2  TYPE REF TO cl_abap_view_offlen,
                    view  TYPE REF TO cl_abap_view_offlen.


    cbin  = cl_abap_conv_out_ce=>create(  ).
    view1  = cl_abap_view_offlen=>create_legacy_view( upload ).
    conv  = cl_abap_conv_in_ce=>create(  ).
    iew2  = cl_abap_view_offlen=>create_legacy_view( wa_test ).

    Try . 
     cbin->convert_struc( EXPORTING data = upload view = view1
                      IMPORTING buffer = buffer).
     conv->convert_struc( EXPORTING input = buffer view = view2
                      IMPORTING data = wa_test ).

              CATCH CX_SY_CODEPAGE_CONVERTER_INIT .
       CATCH CX_SY_CONVERSION_CODEPAGE .
       CATCH CX_PARAMETER_INVALID_TYPE .
       CATCH CX_PARAMETER_INVALID_RANGE .
    ENDTRY .

Note that in the above resolution FILL_CONTAINER_C can be used to convert contents of
a structure to string/character array and READ_CONTAINER_C can be used to move
the contents of a string to a structure. Also the convert class methods
can be used in a similar fashion by creating shown below:

Read only

arindam_m
Active Contributor
0 Likes
2,745

Hi,

Change X to Xstring that might help.

Cheers,

Arindam

Read only

Former Member
0 Likes
2,745

Hi,

XSTRING is not allowed like error is coming.

Regards

Raj

Read only

Former Member
0 Likes
2,745

Hi ,

Any clues guys.

Regards

Raj

Read only

0 Likes
2,745

In Unicode environment every variable of the OVERLAY statement MUST now be character type.

What is the purpose of the concatenated field ?

- If it is a binary string, you have to replace the OVERLAY statement with some loop, find and move statement

- if it is a text, character string, you have to convert it to Unicode char (first replace your one byte ASCII values with two bytes UNICODE values) then use ASSIGN CASTING to link this area initialized with binary values to a char type field symbol, use this one in the OVERLAY statement.

Regards;

Raymond

Read only

Former Member
0 Likes
2,745

Hi Raymond,

Thanks for the reply.

The part where is the error is coming is for the below code . 

 

LOOP AT B0004.
OVERLAY B0004 WITH SREP ONLY REPLSET.
CONCATENATE B0004-CHECKTABLE B0004-FORTABLE B0004-FORKEY INTO TRANSREC
SEPARATED BY TRANSSEP.
PERFORM TRANS.
ENDLOOP.

And error description is "REPLSET" must be a character-type data object (data type C, N, D, T, or String)

And the purpose of concatenated field(TRANSREC) is to transfer the contents to variable FILEB3 which is also of character type.

 

DATA: FILEB3(400) TYPE C 

TRANSFER TRANSREC TO FILEB3

And when i check the structure of B004 it contains the fields of all character type only as shown below.

  

DATA: BEGIN OF B0004 OCCURS 1,
CHECKTABLE
LIKE DD08VV-CHECKTABLE,
FORTABLE
LIKE DD08VV-FORTABLE,
FORKEY
LIKE DD08VV-FORKEY.
DATA: END OF B0004.

And variables TRANSREC ,TRANSSEP is also charcter type as shown below.

DATA: TRANSREC(4000) TYPE C.

DATA:TRANSSEP(1) TYPE C VALUE '''',

But the problem is with  REPLSET actually the declaration is like this...

DATA: BEGIN OF REPLSET,

      LINE0(16) TYPE X VALUE '000102030405060708090A0B0C0D0E0F',

      LINE1(16) TYPE X VALUE '101112131415161718191A1B1C1D1E1F',

      LINE2(02) TYPE X VALUE '2227',

      LINE7(01) TYPE X VALUE '7F',

      LINE8(13) TYPE X VALUE '8182838485868788898B8D8E8F',

      LINE9(14) TYPE X VALUE '909192939495969798999B9D9E9F',

      LINEA(11) TYPE X VALUE 'A0A4A6A8A9AAABACADAEAF',

      LINEB(15) TYPE X VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',

      LINED(01) TYPE X VALUE 'DF',

END OF REPLSET.

How can I overide the error for the above

OVERLAY B0004 WITH SREP ONLY REPLSET. which is inside the loop .

 

Regards

Raj

 

Read only

0 Likes
2,745

As I wrote, you have to convert this values in an actual character string field, not a binary string nor a structure or such string.

- Check the values expected, as in Unicode most will extend to 2 bytes eg ' ' is now '0020' and no longer '20', you will have to change the constants

- Use an ASSIGN CASTING  like in

DATA hex  TYPE x LENGTH 20.
FIELD-SYMBOLS <char> TYPE any.
ASSIGN hex TO <char> CASTING type c.

Regards,

Raymond

Read only

PeterJonker
Active Contributor
0 Likes
2,745

REPLST is a structure with only fields type X.

The error message is quit clear in what is wrong.

What are you trying to do ?

You first concatenate two tabel names and a field name in a string.

The statement now translates as:

replace all the characters from this concatenated string with the ones in srep (what is in srep ?)position by position, but only for those characters (and they are letters here) which are the same as the hex values in replset.

That can never be right

Read only

0 Likes
2,745

Hi Peter,

SREP is also a string..

DATA: SREP(4000) TYPE C,

Regards

Raj

Read only

0 Likes
2,745

SAP does not support Overlay with byte strings. You need to convert them to Charcter and can use overlay. http://help.sap.com/abapdocu_70/en/ABENABAP_DATA_STRING.htm.I don't understand why you want to use overlay with type x values. Since your system is unicode your values in character field will be in Unicode format. Its better you declare the REPLSET field in characters.

character value '0'  = X Value '000102030405060708090A0B0C0D0E0F',

character value '1'  = X Value '101112131415161718191A1B1C1D1E1F',

character value '2' = X Value '2227',

character value '7' = X Value '7F',

character value '8' = X Value '8182838485868788898B8D8E8F',

character value '9' = X Value '909192939495969798999B9D9E9F',

character value 'A' = X Value 'A0A4A6A8A9AAABACADAEAF',

character value 'B' = X Value 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',

character value 'D' = X Value 'DF',

Read only

0 Likes
2,745

Hi All,

for this statement

 

DATA

DATA: BEGIN OF REPLSET,
LINE0
(16) TYPE X VALUE '000102030405060708090A0B0C0D0E0F',
LINE1
(16) TYPE X VALUE '101112131415161718191A1B1C1D1E1F',
LINE2
(02) TYPE X VALUE '2227',
LINE7
(01) TYPE X VALUE '7F',
LINE8
(13) TYPE X VALUE '8182838485868788898B8D8E8F',
LINE9
(14) TYPE X VALUE '909192939495969798999B9D9E9F',
LINEA
(11) TYPE X VALUE 'A0A4A6A8A9AAABACADAEAF',
LINEB
(15) TYPE X VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',
LINED
(01) TYPE X VALUE 'DF',
END OF REPLSET.

How i can replace X values with char values and use in the below statement which is giving error in UCCHECK.

OVERLAY B0004 WITH SREP ONLY REPLSET.

Regards

Raj

Read only

0 Likes
2,745

Hopefully, the ASCII and Latin-1 character sets were kept  for backward compatibility in Unicode, so multiply offset per 2 and just add leading 0 to convert to 2-bytes character. Then assign your structure to a character field as I already wrote...

Regards,

Raymond

Read only

former_member206575
Participant
0 Likes
2,745

Maybe you can use function module SCMS_BIN_TO_TEXT.

I took this from the following WIKI (contains more useful info on problems regarding UNICODE):

http://wiki.sdn.sap.com/wiki/display/si/uccheck%20(Unicode%20Complaince)%20-%20Common%20Errors%20and...

Cheers,

Edwin.

Read only

Former Member
0 Likes
2,745

Hi, i have same problem !! have you some idea?

Regards.

Marco.