Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create object - class CL_SCMG_CASE_API

Former Member
0 Likes
1,402

hi all,

I have to create one object corresponding to the class CL_SCMG_CASE_API.

Trough the patern, I have the code below.

DATA: RE_VALUE Type STRING,

go_myrecord TYPE REF TO CL_SCMG_CASE_API.

TRY.

CREATE OBJECT GO_MYRECORD

EXPORTING

IM_POID = <<<<<***********HOW CAN I GET IT ? *************************

IM_CASE_GUID = 'FED30C4C107E8C1DE1000000AC1D4CB3'

  • IM_UPDATE_TASK = IF_SRM=>FALSE

.

CATCH CX_SRM_INITIALIZATION .

CATCH CX_SRM_POID .

CATCH CX_SRM_REGISTRATION_DATA .

CATCH CX_SRM_CONNECTION .

CATCH CX_SRM_SP_RECORD .

CATCH CX_SRM_GSP_BACK .

ENDTRY.

Can somebody tell me what does it mean the IM_POID parameter and how can I get it ?

Thank you very much.

Regards

Alejandro

5 REPLIES 5
Read only

Former Member
0 Likes
1,113

Hi,

i don't know the class so its just a suggestion.

But since the class is called an API and the Paramete is ending ID i would assume its the ID of the object the API works on.

POID - I would guess its something like Purchase Order ID or similar and the API probably has some way of a friend or other means to get hold of this object through the ID.

Maybe check the Inheritance tree and the F1 Help.

greetings

Read only

Former Member
0 Likes
1,113

Hi Alejandro,

From the Technical aspect of the Class, I can see that the constructor of the class is expecting the Mandatory parameter IM_POID which is a data type of interface.

IM_POID Type Ref To IF_SRM_POID POID of Case

I'm not aware of the functional aspect of this. But I guess you need to create an local interface of the type mentioned.

Hope this will help.

Thanks,

Samantak.

Read only

gerd_rother
Active Participant
0 Likes
1,113

Hi,

I am not familiar with that class, but this parameter is an interface IF_SRM_POID. There is one public class implementing this interface, it is CL_SRM_POID. The constructor of this class takes no parameter so you might try:


dota: go_myrecord             TYPE REF TO CL_SCMG_CASE_API,
         poid type ref to cl_srm_poid.

create object poid.
TRY.
  CREATE OBJECT GO_MYRECORD
   EXPORTING
     IM_POID                  =          poid
     IM_CASE_GUID             = 'FED30C4C107E8C1DE1000000AC1D4CB3'

Note: this is just a guess, no guarantee at all.

Regards, Gerd Rother

Read only

Former Member
0 Likes
1,113

Thanks all, I'm going to try to apply your suggestions.

You were very kind

Read only

0 Likes
1,113

Hi,

I've recently replied to thread to same question. Maybe it was even you. This method has Instantiation set to Private (check tab Properties). It means that you can't directly call constructor. You have to use factory method which will create a object for your and it will return a reference. In this case it looks like you need to call static method IF_SCMG_CASE_API~OPEN_CASE. This a standard pattern in OO. It allows you change logic without changing API.

Cheers