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

Assignment to a structure

Former Member
0 Likes
634

hi all,

i am using a user exit exit_saplveda_006.

Inside tthat i have this code

DXVBAK+63(1) = 'C'.

DXVBAK+65(4) = 'ZAMO'.

DXVBAK+107(4) = 'A001'.

DXVBAK+111(2) = '01'.

DXVBAK+113(2) = '01'.

DXVBAK+340(10) = 'J010301'.

where DXVBAK is a structure with various fields.

now the 1st and 2nd statement are executed properly

i.e. DXVBAK-vbtyp takes value 'c'

and DXVBAK-auart takes value A001

but during the execution of the 3rd statement it gives dump saying :

In Unicode-enabled programs, the offset and length declarations for

structures are limited to the length of the character-type initial part.

In this case, the offset declaration 109, in the structure "DXVBAK",

exceeds the length of the character-type initial part (=94).

have tried changing DXVBAK107(4)to DXVBAK108(4)

and also to DXVBAK109(4)and DXVBAK106(4)

but in vain

pls help,

regards,

Tarang

3 REPLIES 3
Read only

Former Member
0 Likes
510

Hi tarang,

1. in this exit fm,

some idoc data of structure type

EDIDD is passed.

2. now this EDIDD has the following kind of structure.

MANDT CLNT 3 Client

DOCNUM NUMC 16 IDoc number

SEGNUM NUMC 6 Number of SAP segment

SEGNAM CHAR 27 Segment type

PSGNUM NUMC 6 Number of the hierarchically higher SAP segment

HLEVEL NUMC 2 Hierarchy level

DTINT2 INT2 5 Length field for VARC field

SDATA LCHR 1000 Application data

3. Now u can see that

3 + 16 + ... 6 is 65.

(for character data)

4. further onwards, the data is of type LCHR,

which possibly cannot be modified directly,

using character data.

5. Hence, this error must be coming.

regards,

amit m.

Read only

0 Likes
510

Thanx amit ,

so what is the solution now , how can i assign the value

regards,

Tarang

Read only

0 Likes
510

Hi again,

1. first u should know what is the

actual structure with the field names.

2. suppose its t001.

3. then declare :

data : itab like t001.

itab-field1 = 'xyz'.

itab-field2 = 'xyz'.

DXVBAK-SDATA = ITAB.

regards,

amit m.