Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning Complete Table Structure to a Charcter field.

Former Member
0 Kudos

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.

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos
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

Former Member
0 Kudos

Hi

Use assign instead of equal operator.

Thanks

Sandeep