Application Development and Automation 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: 
Read only

Casting problem

Former Member
0 Likes
790

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
Read only

Former Member
0 Likes
760

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
Read only

yogendra_bhaskar
Contributor
0 Likes
760

Hi Jonas ,

Try ABAP memory concept

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

Regards

Yogendra Bhaskar

Read only

0 Likes
760

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

Read only

0 Likes
760

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

Read only

Former Member
0 Likes
761

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

Read only

0 Likes
760

Thank you very much!