Characteristic Relationship derivation issue in IF_RSPLS_CR_METHODS~DERIVE
Here is a requirement ,
I have to Copy a characteristic value from Char 1 to Char 2.
I am able to succesfully copy that using Characteristic relationship Source and target and writing a code under "IF_RSPLS_CR_METHODS~DERIVE" .
But it working only when i copy from 0Comp_Code to 0Profit_Center.
But when i am trying to copy from ZMATERIAL TO 0STKEYFIG which is SAP defined characteristic i am having problem.
ZMATERIAL is custom defined and 0STKEYFIG is SAP defined.
field-SYMBOLS: <l_chavl> type any. FIELD-SYMBOLS: <l_chavl_comp_code> TYPE ANY. DATA: t1 TYPE c LENGTH 10 VALUE '000000'. ASSIGN COMPONENT 'COMP_CODE' OF STRUCTURE c_s_chas TO <l_chavl_comp_code>. ASSIGN COMPONENT 'PROFIT_CTR' OF STRUCTURE c_s_chas TO <l_chavl>. CONCATENATE t1 <l_chavl_comp_code> into <l_chavl> .
Code which is not working
FIELD-SYMBOLS: <l_chavl_zmaterial> TYPE ANY. ASSIGN COMPONENT 'ZMATERIAL' OF STRUCTURE c_s_chas TO <l_chavl_zmaterial>. ASSIGN COMPONENT 'STKEYFIG' OF STRUCTURE c_s_chas TO <l_chavl>.
What i noticed here is when ever i give custome defined object which preceede with Z in ASSIGN COMPONENT syntax... it is not recognising it but is recognising in case of 0STKEYFIG.
It (ASSIGN COMPONENT ) syntax is accepting only STKEYFIG insted of 0STKEYFIG (with out '0' infront of STKEYFIG) , but it is not accepting ZMATERIAL or MATERIAL .
Can any one suggest me on how to Assign Componet syntax works when i have to assign 'Z..." infoobject.
Hope i am clear
You can find it out by debugging the code and looking at the structure of c_s_chas.