2019 Aug 06 4:14 PM
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 ?
2019 Aug 06 6:44 PM
This syntax:
{O:279*\FUNCTION-POOL=MMPUR_ME2ON\CLASS=LCL_FACTORY}-MT_STOCKis 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.
2019 Aug 06 6:44 PM
This syntax:
{O:279*\FUNCTION-POOL=MMPUR_ME2ON\CLASS=LCL_FACTORY}-MT_STOCKis 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.
2019 Aug 07 8:20 AM
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.
2019 Aug 07 1:14 AM
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.