10-07-2008 5:09 PM
Hi All,
We have a program not working in ECC 6.0.
data: begin of itab occurs 0.
include structure rku01ja.
data: end of itab.
loop at itab.
write 😕 itab.
endloop.
Now it says itab cannot be converted to character-type field
Please help
10-07-2008 5:17 PM
10-07-2008 5:19 PM
10-07-2008 5:23 PM
You can use FIELD-SYMBOLS.
A better approach might be to decide which fields you really want to see and print only those.
Rob
10-07-2008 5:26 PM
Thanks Rob, I was thinking of fetching all the fields of the structure included and then loop through those and print individual element...Something like dynamic table..
10-07-2008 5:20 PM
Hello Reena
Apparently you cannot WRITE a structured variable under Unicode. Instead you need to move the structured contents to an unstructured C-container, e.g.:
data: begin of itab occurs 0.
include structure rku01ja.
data: end of itab.
DATA: ld_string TYPE string.
DATA: ls_record LIKE LINE OF itab.
loop at itab INTO ls_record.
CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = ls_record
* IMPORTING
* ex_container = ld_string
* EXCEPTIONS
* illegal_parameter_type = 1
* others = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write 😕 ld_string.
endloop.
Regards
Uwe
10-07-2008 5:27 PM