05-09-2007 11:01 AM
Hi All,
I am working on Upgrade prof (From 4.6b to ECC6.0).
I have one doubt to ask you.
The Data Declaration is as follows.
Data: Data (4000) type c.
Data: IMARA like MARA.
Data = IMARA.
In the above code "Data" is the field in another table.
And the error that I am getting is that
<b>"Data & IMARA are not mutually convertible in Unicode Program.</b>
How do I assign the values of IMARA to Data Field?
Please help / guide me in this regard.
A sample code would be of great help.
Thanks & Regards
Jitendra Gujarathi.
05-09-2007 11:03 AM
Hello Jitendra
You can use the static methods of class <b>CL_ABAP_CONTAINER_UTILITIES</b> to move data between structured and unstructured data variables. In your case use method FILL_CONTAINER_C.
Regards
Uwe
05-09-2007 11:06 AM
Hi,
this problem will come only when if u have any currecy/quantity fields in that table.otherwise u can do like that.
for that go for field-symbols.
field-symbols:<fs> type any.
assign i_mara to <fs> casting.
rgds,
bharat.
05-09-2007 11:07 AM
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE IMARA TO <fs>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
concatenate DATA <FS> into DATA.
ENDDO.
write : / data.
Message was edited by:
Chandrasekhar Jagarlamudi
05-09-2007 11:15 AM