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

Using Field symbol to fetch data from another program

Former Member
0 Likes
1,800

I have a requirement where i need to fetch value of a field from one of the function pool so i have written a sample progam to check the logic but its doest seems to work its giving dump.

Basically i want to know how to use <programname><fieldname> with fieldsymbol.

REPORT ztest1.

DATA test(25) VALUE 'ggg'.

submit ztest.

report ztest.

constants: lv_memory(25) type c value '(ZTEST1)TEST'.

field-symbols: <fs2> type char25 .

assign (lv_memory) to <fs2>.

write : <fs2>.

I am getting same field symbol assignment dump

6 REPLIES 6
Read only

MarcinPciak
Active Contributor
0 Likes
1,122

This is not possible to access data of other program like this.

The reason is that both programs run in different internal sessions which are exclusive for each of them.

You can try this trick to some function modules you call, as this one is called within same internall session where the program runs, but for two separate programs you will need to use ABAP memory to exchange data.

Regards

Marcin

Read only

Kanagaraja_L
Active Contributor
0 Likes
1,122

Check the below piece for ZTEST

CONSTANTS: lv_memory(25) TYPE c VALUE '(ZTEST1)TEST'.
FIELD-SYMBOLS: <fs2> TYPE char25  .
ASSIGN lv_memory TO  <fs2>.
WRITE : <fs2>.

Close the thread if answered

Read only

Former Member
0 Likes
1,122

Hi Rahul,

You can use this concept in between the FUNCTION MODULES where both are

under same FUNCTION GROUP ( as both the FM's have same global memory area ).

And also if you are calling an FM or method from your program ,you can have the data of the calling program in that called FM or METHOD.

Hope this may help you.

Regards,

Smart Varghese

Read only

0 Likes
1,122

This message was moderated.

Read only

0 Likes
1,122

Nice explanation. BTW are you a proof reader for SAP online documentation.

I find the same wording here: [http://help.sap.com/abapdocu_70/en/ABAPASSIGN_MEM_AREA_DYNAMIC_DOBJ.htm#!ABAP_ALTERNATIVE_1@1@|http://help.sap.com/abapdocu_70/en/ABAPASSIGN_MEM_AREA_DYNAMIC_DOBJ.htm#!ABAP_ALTERNATIVE_1@1@]

Cheers,

Suhas

Read only

0 Likes
1,122

Abaper13 has been informed that copy and paste of other people's work is not permitted