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

assign FS to a variable in a different program

Former Member
0 Likes
1,035

Hi guys,

Let's say that program A calls program B then FM C is called... I want to retrieve in FM C a value from the still running program A. I think I have read that it is possible with field symbols. I would say that I have seen it somewhere but now that I need it I am not able to find it.

I think it is somehting like the following, but... it does not work. I dont know, maybe it is just not possible.


field-symbols: <rseg> type any table.
data name(20) value '(PROGRAM)T_DRSEG'.
assign (name) to <rseg>.

I have ckecked the demo programs DEMO_FIELD_SYMBOLS*, but it is not exactly what I am looking for.

Is it possible to do that? or am I just making up all this story ???

many thanks in advance!!!

6 REPLIES 6
Read only

Former Member
0 Likes
961

Hi Aaron,

Instead of using field symbols, you could do this EXPORT or IMPORT table values to SAP memory and call in another FM.

Hope it helps

Regards

Sarav

Read only

0 Likes
961

Hi,

Yes, indeed. But the original program ( the one that contains the info i need ) is standard. If I use export-import I need to modify ( enhancement point?) the standard program to export the data.

Thanks anyways!

Read only

0 Likes
961

Hi,

Here is the code you are looking for...


  FIELD-SYMBOLS:<lfs_xlips>       TYPE ANY.

  ASSIGN: ('(SAPMV50A)XLIPS[]')     TO <lfs_xlips>.

Here SAPMV50A is your standard program where you have the data.(Give the main program name, not the include program)

Thanks,

Vinod.

Read only

0 Likes
961

Hi Vinod,

Indeed this is what I wanted. Thanks a lot.

It is a pity because it does not work in my case. Probably the program with the data I need is "too far" in the process flow...

I have tried defining the FS as type any and as type any table. I have tried with the program control, the include and the program control of the program control...

Well, I will use export/import in this case. But it is good to know this technique!

Many thanks!

Aaron

Read only

0 Likes
961

Hi,

Just to add one more point....

Above logic works only if the program is available in the CALL STACK. You can check the stack by placing the break point in yourprogram and click on CALLS button duting debugging.

Thanks,

Vinod.

Read only

0 Likes
961

Hi Vinod.

I can see the program in the CALL STACK, but it does not work....

thanks anyways, with export/import is working already.