11-29-2007 5:27 PM
Hi Experts,
I am getting internal table's table fields into another internal table.
DATA: BEGIN OF itab OCCURS 10,
date TYPE sy-datum,
time TYPE sy-uzeit,
matnr TYPE mara-matnr,
END OF itab,
In another internal table i am getting values like below.
BEGIN of i_tabnam occurs 10,
fieldnam(15) type c,
end of i_tabnam,
values in i_tabnam are:
itab-date, itab-time,itab-matnr
Now i want to describe the field lengths of actual table itab-date, itab-time and itab-matnr using the above values which are in i_tabnam. by using DESCRIBE, STRLEN or by any other means like using field symbols.
Like DESCRIBE FIELD I_TABNAM-FIELD LENGH LEN. in place of I_TABNAM-FIELD i should get the value of itab-date dynamically.
I need this requirement as a part of developing a tool.
Please help me, give me your suggestions.
Thanks & Regards,
Poorna.
11-29-2007 5:40 PM
DATA: BEGIN OF itab OCCURS 10,
date TYPE sy-datum,
time TYPE sy-uzeit,
matnr TYPE mara-matnr,
END OF itab,
BEGIN of i_tabnam occurs 10,
fieldnam(15) type c,
end of i_tabnam.
data:wf_len type i.
i_tabnam-fieldnam = 'ITAB-DATE'.
append i_tabnam.
i_tabnam-fieldnam = 'ITAB-TIME'.
append i_tabnam.
i_tabnam-fieldnam = 'ITAB-MATNR'.
append i_tabnam.
field-symbols:
<fs> type any.
loop at i_tabnam.
assign (i_tabnam-fieldnam) to <fs>.
describe field <fs> length wf_len.
write 😕 wf_len.
endloop.
11-29-2007 5:40 PM
DATA: BEGIN OF itab OCCURS 10,
date TYPE sy-datum,
time TYPE sy-uzeit,
matnr TYPE mara-matnr,
END OF itab,
BEGIN of i_tabnam occurs 10,
fieldnam(15) type c,
end of i_tabnam.
data:wf_len type i.
i_tabnam-fieldnam = 'ITAB-DATE'.
append i_tabnam.
i_tabnam-fieldnam = 'ITAB-TIME'.
append i_tabnam.
i_tabnam-fieldnam = 'ITAB-MATNR'.
append i_tabnam.
field-symbols:
<fs> type any.
loop at i_tabnam.
assign (i_tabnam-fieldnam) to <fs>.
describe field <fs> length wf_len.
write 😕 wf_len.
endloop.
11-29-2007 6:32 PM
11-29-2007 5:46 PM
use STRLEN to define the field length or use describe table for lines.