Hello All,
I have created a field in Opportunity Page, Itemslist assignment block through AET.
In the GET method of that field i have written the following lines
to achieve my functionality.
DATA: v_profitability TYPE NUMC3,
v_expected_revenue TYPE CRMT_NET_VALUE_MAN,
v_expected_profitability type CRMT_NET_VALUE_MAN,
v_category_id TYPE COMT_CATEGORY_ID.
DATA: itab type table of ZSTCD_PRD_CATG,
wa type ZSTCD_PRD_CATG,
current1 TYPE REF TO if_bol_bo_property_access.
v_category_id = get_s_struct( attribute_path = 'STRUCT.PRODHIERARCHY' component = 'PRODHIERARCHY' iterator = iterator ).
v_expected_revenue = get_s_struct( attribute_path = 'STRUCT.NET_VALUE_MAN' component = 'NETVALUEMAN' iterator = iterator ).
TRANSLATE v_category_id TO LOWER CASE.
SELECT SINGLE PROFITABILITY FROM YSTC_FSCRM_PRFT INTO v_profitability WHERE PRO_CAT_ID = v_category_id.
v_expected_profitability = ( v_profitability * v_expected_revenue ) / 100.
IF sy-subrc = 0.
value = 100.
value = v_expected_profitability.
ELSE.
value = cat1.
endif.
Everything is working fine. I mean my requiremnt is done. However the value is not getting updated in the database table. I have selected context node as BTADMINI while creating the field. And the field is in the table CRMD_ORDERADM_I. Irrespective of Whatever the value i populate in my new field(according to my requiremnt) the value populated in the table is shown as 0.00. Could anyone throw some light on this. why is this happening? Do i need to do anything else?
Regards
Chandrakant Kulkarni