Skip to Content
0
Former Member
Mar 03, 2009 at 11:32 AM

HR_INFOTYPE_OPERATION assign_casting_illegal_cast

538 Views

hi!

i using HR_INFOTYPE_OPERATION to insert/delete infotype 2001 data!

when run at ASSIGN record TO <record> CASTING TYPE (tabname). "XDP UniCode

will dump out ! ASSIGN_CASTING_ILLEGAL_CAST

error analyze

An exception occurred. This exception will be dealt with in more detail

below. The exception, assigned to the class 'CX_SY_ASSIGN_CAST_ILLEGAL_CAST',

was not caught, which

led to a runtime error. The reason for this exception is:

The error occurred in an

ASSIGN f TO <fs> CASTING.

ASSIGN f TO <fs> CASTING TYPE t.

or

ASSIGN f TO <fs> CASTING LIKE f1.

statement.

This error has two possible causes:

1. Either the field type f or the target type - specified by <fs>, t, or

f1 - contains data references, object references, strings, or internal

tables as components.

The offset and type of the components in each type must match exactly.

2. Either the declared type t or the type of f1 does not match the type

so simulate this case as follow:

field-symbols:<record> type any table.

DATA TABNAME LIKE DNTAB-TABNAME VALUE 'P2001'.

data: RECORD type table of p2001 .

tables:p2001.

p2001-pernr = '11000029'.

p2001-infty = '2001'.

p2001-subty = '0300'.

p2001-begda = '20090305'.

p2001-endda = '20090305'.

p2001-awart = '0300'.

append p2001 to record.

ASSIGN record TO <record> CASTING TYPE (tabname). "XDP UniCode.

when run ASSIGN will dump too!

but i don't how to do!

how to resolue it! thank you very much!