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: 

Casting problem

Former Member
0 Kudos

Hi all!

I want to know the content of a field from another program, I have tried something like this but it doesn't work:

FIELD-SYMBOLS: <fs_wa> TYPE syucomm.

DATA: var_name(50) TYPE c.

var_name = '(PROGRAMNAME)VALUE'.

ASSIGN (var_name) TO <fs_wa>.

The program is a 'Z' program.

I have to use the code in a BADI, so passing the content is not an option.


1 ACCEPTED SOLUTION

former_member289261
Active Contributor
0 Kudos

Hi,

The method you are using is possible only when the data objects are in same session memory i.e ( as you said you have to write the code in the BADI ) the badi and the zprogram needs to be in the same program flow else it will not work.

Therefore, use EXPORT TO MEMORY or SET PARAMETER options.

Regards,

Ashish

5 REPLIES 5

yogendra_bhaskar
Contributor
0 Kudos

Hi Jonas ,

Try ABAP memory concept

EXPORT TO MEMORY & IMPORT FROM MEMORY can help a lot here

Regards

Yogendra Bhaskar

0 Kudos

Okay will have a look at it, but I prefer the way I'm trying with my code...

0 Kudos

Have you tried using RTTI, search in SCN for cl_abap_structdescr.

former_member289261
Active Contributor
0 Kudos

Hi,

The method you are using is possible only when the data objects are in same session memory i.e ( as you said you have to write the code in the BADI ) the badi and the zprogram needs to be in the same program flow else it will not work.

Therefore, use EXPORT TO MEMORY or SET PARAMETER options.

Regards,

Ashish

0 Kudos

Thank you very much!