Skip to Content
0
Former Member
Jan 25, 2006 at 07:06 PM

Unable to instantiate class CL_CGPLP_PROJECT

54 Views

Hi All,

The requirement is to Release the Trade Promotion Mangement for settlement. For this there is a method of the class CL_CRM_MKTPL_COST_ASSIGNMENT=>RELEASE_FOR_SETTLEMENT which will release the TPM. But for this one of the arguments that you will have to pass is the instantiated object CL_CGPLP_PROJECT. To instantiate the CL_CGPLP_PROJECT I need to pass some attributes which I do but it ends up in a dump saying MISSING_OBJECT_MANAGER. Following is the code:

DATA: TPM TYPE REF TO CL_CGPL_PROJECT,

TPM_ATTR TYPE CRM_MKTPL_ATTR,

TRADE_SPEND TYPE CRMS_MKTPL_COST_TAB,

L_TRADE_SPEND TYPE LINE OF CRMS_MKTPL_COST_TAB,

L_TPM TYPE CGPL_PROJECT,

ID TYPE CGPL_PROJECT-EXTERNAL_ID,

L_REF_NUMBER TYPE CGPL_EXTID,

L_ATTR TYPE CGPL_R3_ATTRIBUT.

CLASS CL_CGPL_PROJECT DEFINITION LOAD.

  • Convert GUID to external TPM ID cos some of the tables access the

*External ID

CALL FUNCTION 'CONVERSION_EXIT_CGPLP_OUTPUT'

EXPORTING

INPUT = GUID

IMPORTING

OUTPUT = ID.

MOVE ID TO L_REF_NUMBER.

*Prepare to instantiate the object

SELECT SINGLE * FROM CGPL_PROJECT INTO L_TPM

WHERE EXTERNAL_ID = ID.

SELECT SINGLE * FROM CRM_MKTPL_ATTR INTO TPM_ATTR WHERE GUID = GUID.

SELECT * FROM CRMD_MKTPL_COSTA INTO TABLE TRADE_SPEND

WHERE PROJECT_GUID = GUID.

SELECT SINGLE * FROM CGPL_R3_ATTRIBUT INTO L_ATTR WHERE GUID = GUID.

*Instatiate the Project Object.

CREATE OBJECT TPM

EXPORTING

IM_ATTRIBUTES = L_TPM

IM_FETCH_TASKS = SPACE

  • IM_NEW_CREATE =

IM_R3_ATTRIBUTES = L_ATTR

  • IM_RAISE_EVENT = 'X'

IM_REF_NUMBER = ID

EXCEPTIONS

FAILED = 1

others = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

But once I try to instantiate the Project class it goes for a dump. Any help in this regard would be helpful.

Best Regards,

Sudhi