Skip to Content
0
Nov 15, 2010 at 12:58 PM

Btadmini order pricing

40 Views

Hi,

i m implementing CRM_COND_COM_BADI for pricing. Since in the item structure there is not quantity i m trying to get it from BOL model

I wrote down this code

-


method IF_EX_CRM_COND_COM_BADI~ITEM_COMMUNICATION_STRUCTURE.

BREAK DOMINO.

data:

ZZMVGR1 type MVGR1,

ZZMVGR2 type MVGR2,

ZZMVGR3 type MVGR3,

ZZMVGR4 type MVGR4,

ZZKWMENG type KWMENG.

data:

LO_CORE type ref to CL_CRM_BOL_CORE,

LO_ENTITY type ref to CL_CRM_BOL_ENTITY,

LO_ACTIV type ref to CL_CRM_BOL_ENTITY,

LX_ROOT type ref to CX_ROOT,

LV_UCID type STRING,

LV_TYPE type STRING,

LS_ACTIV type CRMST_ACTIVITYH_BTIL,

LO_TRX type ref to IF_BOL_TRANSACTION_CONTEXT,

LR_COLLECTION type ref to IF_BOL_BO_COL,

CURRENT type ref to IF_BOL_BO_PROPERTY_ACCESS,

DREF type ref to CRMT_SCHEDLIN_QUAN.

BREAK DOMINO.

LO_CORE = CL_CRM_BOL_CORE=>GET_INSTANCE( ).

LO_CORE->START_UP( 'ONEORDER' ).

LO_ENTITY ?= LO_CORE->GET_ROOT_ENTITY( IV_OBJECT_NAME = 'BTAdminI'

IV_OBJECT_GUID = CS_ACS_I_COM-GUID ).

try.

LR_COLLECTION = LO_ENTITY->GET_RELATED_ENTITIES(

IV_RELATION_NAME = 'BTItemSchedlinExt' ).

CURRENT = LR_COLLECTION->GET_CURRENT( ).

if CURRENT is not bound and LO_ENTITY->IS_CHANGEABLE( ) = ABAP_TRUE.

CURRENT = LO_ENTITY->CREATE_RELATED_ENTITY( IV_RELATION_NAME = 'BTItemSchedlinExt' ).

endif.

catch cx_crm_genil_model_error cx_sy_ref_is_initial.

endtry.

-


but

LO_ENTITY ?= LO_CORE->GET_ROOT_ENTITY( IV_OBJECT_NAME = 'BTAdminI'

IV_OBJECT_GUID = CS_ACS_I_COM-GUID ).

is not getting value when I run UI.

The same code is running quite good (quantity is not update when i change values)

Any help???