2009 Mar 18 4:52 AM
Hi all,
I get a error while running UCCHECK for a custom program.
The error is : A internal table must have character-like row type (C,N,D,T, or STRING).
The internal table is declared of type BAPI1003_ALLOC_VALUES_NUM.The BAPI has two fields of type
FLTP.
The error is thrown in search statement.
Eg : DATA: alloc_valnum LIKE BAPI1003_ALLOC_VALUES_NUM
OCCURS 0 WITH HEADER LINE.
search alloc_valnum FOR 'M023_X_BC000021'.
Unicode conversion is done in ECC 6.0.
Any pointers or OSS notes to resolve the error would be of great help.
Regards,
Subasree
2009 Mar 18 5:02 AM
Hi,
You will have to change the internal table declaration.
types : begin of t_bapi,
CHARACT ATNAM(30) type c,
VALUE_FROM(22) type c,
VALUE_TO(22) type c,
VALUE_RELATION(1) type c,
.....
data: itab type standard table of t_bapi.
Best regards,
Prashant
2009 Mar 18 5:04 AM
Hello Subasree
You will find the answer to your question in the SAP online documenation:
[ABAP and Unicode: Processing Strings|http://help.sap.com/saphelp_nw04/helpdata/en/79/c55479b3dc11d5993800508b6b8b11/content.htm]
SEARCH:
"The arguments of these instructions must be single fields of type C, N, D, T or STRING or structures of character-type only. There is a syntax or runtime error if arguments of a different type are passed. A subset of this function is provided with the addition IN BYTE MODE for processing byte strings u2013 that is, operands of type X or XSTRING. A statement such as CONCATENATE a x b INTO c is thus no longer possible when a,b, and c are all character-type, but x is of type X."
Thus, you need to define your SEARCH statement differently, e.g.:
DATA: lt_alloc_valnum TYPE STANDARD TABLE OF BAPI1003_ALLOC_VALUES_NUM,
ls_alloc TYPE BAPI1003_ALLOC_VALUES_NUM.
"OCCURS 0 WITH HEADER LINE. <<< no header lines anymore !!!!
DATA: ld_datatype(1) TYPE c.
FIELD-SYMBOLS:
<ld_fld> TYPE ANY.
DO.
ASSIGN COMPONENT syst-index OF structure ls_alloc TO <ld_fld>.
IF ( syst-subrc NE 0 ).
EXIT.
ENDIF.
DESCRIBE FIELD <ld_fld> TYPE ld_datatype.
IF ( condition: datatype for SEARCH allowed ).
SEARCH <ld_fld> FOR 'M023_X_BC000021'.
ENDIF.
ENDDO.
Regards
Uwe