‎2007 Feb 20 12:00 PM
Hi all,
I have to make a unicode check for all our old reports. There I got a problem with
the following statement:
DATA:
*--- Internal table Cust master gen data
t_kna1 TYPE kna1 OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF t_inrec OCCURS 0,
rec_typ_ind(1) TYPE c, "H, D or T Literals
kunnr(10) TYPE c, "Customer #
tabname(30) TYPE c, "SAP R/3 table segment name
tabdata(1500) TYPE c, "SAP R/3 table data
END OF t_inrec.
LOOP AT t_inrec WHERE rec_typ_ind = c_rec_ind.
CASE t_inrec-tabname.
WHEN 'KNA1'. "Create table t_kna1
MOVE t_inrec-kunnr TO t_kna1-kunnr.
MOVE t_inrec-tabdata TO t_kna1+13. <-----error
endloop.
Thanks
-Sikha
‎2007 Feb 20 12:29 PM
Hi,
You cannot directly move data to a offset on a table.
When you want the tabdata field to be distributed into the fields of kna1, you can move each field by providing offset on tabname
ex. t_kna1-name1 = t_inrec-tabname+0(35).
t_kna1-name2 = ...
or, create a workarea containing the fields in KNA1 ( from position 13 onwards ) you wish to populate and move t_inrec-tabname to wa_kna1_new
Then, do a move-corresponding to move the values from wa_kna1_new to t_kna1.
Either way, make sure the date field (ERDAT) and any non char/numc fields are populated correctly.
Regards,
Anil.
Message was edited by:
Anil
‎2007 Feb 20 12:04 PM
u shud move th value t_inrec-tabdata to some field of internal table t_kna1.
like
MOVE t_inrec-kunnr TO t_kna1-kunnr.
‎2007 Feb 20 12:05 PM
try out this tabdata(1500) to tabdata(500)... the length may be exceeding....
‎2007 Feb 20 12:29 PM
‎2007 Feb 20 12:06 PM
t_kna1+13. <-----error
mention the field name into which you are passing the value
‎2007 Feb 20 12:28 PM
‎2007 Feb 20 12:29 PM
Hi,
You cannot directly move data to a offset on a table.
When you want the tabdata field to be distributed into the fields of kna1, you can move each field by providing offset on tabname
ex. t_kna1-name1 = t_inrec-tabname+0(35).
t_kna1-name2 = ...
or, create a workarea containing the fields in KNA1 ( from position 13 onwards ) you wish to populate and move t_inrec-tabname to wa_kna1_new
Then, do a move-corresponding to move the values from wa_kna1_new to t_kna1.
Either way, make sure the date field (ERDAT) and any non char/numc fields are populated correctly.
Regards,
Anil.
Message was edited by:
Anil
‎2007 Feb 20 1:01 PM
Hi,
Offset u have to specify as
<b>MOVE t_inrec-tabdata TO t_kna1-xxxx+0(13)</b>. <-----error
Specif the field name. But the above doesnot work.
tabdata(1500) the field u r moving should contain 1500 length.
You can move 13 to 1500 not the reverse.
<b>MOVE t_inrec-tabdata+0(13) TO t_kna1-xxxx</b>.
Try this.
If u want to move this as a whole to kna1, then
MOVE t_inrec-tabdata TO t_kna1.
APPEND t_kna1.