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 {O:[NNN]*\FUNCTION-POOL…} shape in ABAP program

Former Member
1,613

Hello,

I'm trying to assign an internal table wich i got it form an upper programme, but in vain :

I tried with this code :

<code>data val TYPE string.
FIELD-SYMBOLS <fs_fact> TYPE any.

val2 = '{O:279*\FUNCTION-POOL=MMPUR_ME2ON\CLASS=LCL_FACTORY}-MT_STOCK'.

ASSIGN (val) to <fs_fact>.  "=> Sy-subrc = 4 

How can i fix it please ?

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
1,198

This syntax:

{O:279*\FUNCTION-POOL=MMPUR_ME2ON\CLASS=LCL_FACTORY}-MT_STOCK

is valid only for the debugger.

The only way to access it is to know a global reference variable or a public class reference attribute referring to this object (or possibly via methods, but I can't tell because I know nothing of the function group MMPUR_ME2ON); if a global reference variable exists and is named GO_REF then use:

ASSIGN ('(SAPLMMPUR_ME2ON)GO_REF->MT_STOCK') TO <fs_fact>.

But remember that this form of ASSIGN is "For internal use only". I personally prefer (if possible) to implement enhancement options to add custom procedures and transfer the variable via a parameter.

3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
1,199

This syntax:

{O:279*\FUNCTION-POOL=MMPUR_ME2ON\CLASS=LCL_FACTORY}-MT_STOCK

is valid only for the debugger.

The only way to access it is to know a global reference variable or a public class reference attribute referring to this object (or possibly via methods, but I can't tell because I know nothing of the function group MMPUR_ME2ON); if a global reference variable exists and is named GO_REF then use:

ASSIGN ('(SAPLMMPUR_ME2ON)GO_REF->MT_STOCK') TO <fs_fact>.

But remember that this form of ASSIGN is "For internal use only". I personally prefer (if possible) to implement enhancement options to add custom procedures and transfer the variable via a parameter.

Read only

0 Likes
1,198

IMPORTANT NOTE: as Quynh Doan Manh said, if the attribute is private or protected, you cannot directly read the attribute, so you may only try enhancement options.

Read only

DoanManhQuynh
Active Contributor
1,198

you need the program name of that method, that value is in debug screen only. but if that attribute is private or protected, i think it wont work.