‎2007 Mar 21 8:40 AM
Hi all,
I enhanced the BW datasource 0EMPLOYEE_ATTR and making code changes to EXIT_SAPLRSAP_002.
I enhanced the structure 0EMPLOYEE_ATTR to include a 40 character field at the end (data component STEXT). I am trying to move a variable <i>l_jobfamilytext</i> of type <i>STEXT</i> into this field of the datasource.
However, when writing directly to the internal table header using either one of the following methods:
MOVE l_jobfamilytext TO I_T_DATA+186(40).I_T_DATA+186(40) = l_jobfamilytext.results in the following error.....
Short text
Offset specification for a structure too large
Error analysis
In Unicode-compatible programs, the offset and length specifications
for structures are limited to the length of the character-type initial
part.
In this case, the offset specification 372 for the structure "I_T_DATA"
exceeds the length of the character-type initial part (=208).Yes I know that I did not specify "372" as an offset ANYWHERE in my code.
Does anyone know what is wrong?
Message was edited by:
Kevin Wong
‎2007 Mar 21 9:03 AM
Hi
i_t_data is of type BIW_MARA_S....
and you r specifying the offset from 186th character onwards... means it goes to different fields.... i mean the data goes into more than one field FERTH, FORMT ....
Check the same.....
ALso coming to offset error
I checked with the code...
MOVE 'agfghhjjkjkkjkj' TO I_T_DATA+186(40).
I_T_DATA+186(40) = 'agfghhjjkjkkjkj'.
NO ERROR
‎2007 Mar 21 8:47 AM
Hi Kevin,
i tnink , in programs with an active Unicode check, assignments, operand checks, and accesses using offset and length are also affected and problems can arise For example, if a purely character-type structure is enhanced by inserting numeric or deep components, it can lose its character-type nature.
rgds
Deepak.
‎2007 Mar 21 9:03 AM
Hi
i_t_data is of type BIW_MARA_S....
and you r specifying the offset from 186th character onwards... means it goes to different fields.... i mean the data goes into more than one field FERTH, FORMT ....
Check the same.....
ALso coming to offset error
I checked with the code...
MOVE 'agfghhjjkjkkjkj' TO I_T_DATA+186(40).
I_T_DATA+186(40) = 'agfghhjjkjkkjkj'.
NO ERROR
‎2007 Mar 21 9:15 AM
Hmm,
Perhaps here's a better picture, please view the attachments for my settings in RSA6 and SE11.
‎2007 Mar 21 4:01 PM
I realize something, for example if my internal table I_T_DATA (with header line) was based on a structure that looked like this...
Type Size Decimal Text
CHAR 2 0 Pay Scale Level
DEC 5 2 Capacity Utilization Level
CURR 15 2 Annual salary
CUKY 5 0 Currency Key for Annual Salary
DEC 5 2 Employment percentage
CHAR 1 0 Employment Status
DATS 8 0 Entry Date
CHAR 2 0 Pay Grade Type
I would only be able to do an offset..
i.e.
MOVE xxx TO I_T_DATA+0(2) "To change pay scale level...up to the point where it changes from CHAR to something
else like DEC. Once the offset goes beyond a field that is not of type CHAR (in the structure) the program throws a dump.
Hence doing something like MOVE xxx TO I_T_DATA+2(5) will throw a dump.
This means that the last field (i.e. Pay Grade Type) cannot be written to using MOVE and offset. Simply because not all the types before this field in the structure are CHAR.
Does anyone understand what I'm saying?
Message was edited by:
Kevin Wong
Message was edited by:
Kevin Wong
Message was edited by:
Kevin Wong
‎2007 Mar 21 4:33 PM
something like this
DATA: BEGIN OF ls_data,
field1 (of CHAR 2 0 Pay Scale Level),
field2 (of DEC 5 2 Capacity Utilization Level)
field3 (of CURR 15 2 Annual salary)
field4 (of CUKY 5 0 Currency Key for Annual Salary)
field5 (of DEC 5 2 Employment percentage)
field6 (of CHAR 1 0 Employment Status)
field7 (of DATS 8 0 Entry Date)
field8 (of CHAR 2 0 Pay Grade Type)
DATA: END OF ls_data.
ls_data = i_t_data.
MOVE 'abc' TO ls_data-field8.
i_t_data = ls_data..
If this doesn't work, then you will have to work with field symbols.
‎2007 Mar 22 4:02 AM
Hi Srinivas,
Thanks for your help, I tried it but still does not work, the 2 are not convertible.
Could you provide me with an example using field symbols?
Thanks!
Kevin
‎2007 Mar 21 4:28 PM
You define a local work area just like your internal table structure and move IT_DATA to that work area. After that you can work with the individual fields.