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: 

Data transfer between two non compatible structures

0 Kudos

Hi,

I have structure A and proxy generated structure B. Since B is a proxy generated structure, there is a different data type for B when compared to A.

Basically i am trying to pass data in A to a Function Module which is proxy generated one.

So in turn, the Input parameter for FM is B (Again a proxy generated one as mentioned above) which has some prefix.

Say if A has datatype as ABCD, B has datatype as /ZZ/ABCD (Which happens in proxy generation - You have to definitely provide the prefix).

The fields present in both the structures are same except the data type. I mean the domain are the same.

So my query here is how can i be able to transfer data of A to B, so that i wont be getting any dump.

Are there any conversion rules in place for this particular scenario?

Kindly provide your valuable inputs on this issue.

- Venkat

6 REPLIES 6

Former Member
0 Kudos

Hi Jothi,

Declare a local variable (B_LOCAL) for structure B (Import Parameter for your FM).

Move values of structure from A to B.

Then use B_LOCAL in your Function call and pass the value. Program will not dump.

Best Regards,

Ram.

0 Kudos

Hi,

Thanks for the immediate response.

I've done that, moving the values from local structure to the other one might not be easy.

Because what ever we are talking about is the data transfer between two deep structures.

Can you give me some more insight into how to move the values between these two deep structures?

Venkat

0 Kudos

Hi Venkat,

When i said that you can define a local structure, i meant referring to the deepest structure.


Data: lt_struct type ref to toplevelstruct-nextlevel-lastlevel.

Doing the definition in the above mentioned way, you would be referring to the deepest structure, that would actually contain the field definitions.

for e.g.


Data: lt_struct type ref to Proxy-nextlevel-lastlevel.

When ever you refer to the field in a proxy structure, you would be referring it this way.


ltstruct-field

Hope you got my point.

Best Regards,

Ram.

Edited by: ram Kumar on Dec 12, 2008 10:42 AM

Edited by: ram Kumar on Dec 12, 2008 10:43 AM

Former Member
0 Kudos

You could run transaction BDBS to move data from A to B. It would give you a converssion rule.

0 Kudos

Hi,

Thanks for your response. But in Tx you have mentioned i think they are talking about internal and external structures.

But i'm talking about two structures with in the code. One is local structure.

Venkat

Former Member
0 Kudos

hi,

diefine a dummy variable with string.

use cl_abap_container_utilities->fill_container _c to get data from structure into dummy

use cl_abap_container_utilities->read_container_c to get data from dummy to ur structure