cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to pass value to 'TYPE REF TO' variables in SRM

Former Member
0 Likes
634

Hi All,

I am new to SRM ABAP , can you please help out on how to pass value to a parameter

Interface : /SAPSRM/IF_PDO_DO_LIMIT

Method : ADD_ITEM_LIMIT

Data : lo_msg_consumer TYPE REF TO   /sapsrm/if_pdo_msg_consumer.

CALL METHOD me->add_item_limit

           
CHANGING

              ct_limit_item      = lt_limit_item

              co_message_handler = lo_msg_consumer.

Kindly let me know how to pass value to lo_msg_consumer.As during runtime its not accepting the BLANK value to lo_msg_consumer as its mandatory parameter and gives dump.

Thanks,

Nalini.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi All,

Can any SAP SRM developer help me out on above scenario plz !!

Thanks,

Nalini.

Former Member
0 Likes

Hi

Variable lo_msg_consumer is an instance of a class implementing the /SAPSRM/IF_PDO_MSG_CONSUMER interface. You have to create an object of a class that implements this interface. To create an object use statement

CREATE OBJECT lo_msg_consumer TYPE HERE_THE_CLASS_NAME.

To find all the classes that implement this interface go to SE24, enter the interface's name, press F7, then open the hierarchy tree on the left and there is a branch called "Implementing classes".

regards

Former Member
0 Likes

Hi Mateusz,

Class ZCL_IM_SBBP_CATALOG_TRANSF,Method IF_EX_BBP_CATALOG_TRANSFER~ENRICH_ITEM_DATA ,, "LO_MSG_CONSUMER" is not an object reference.  U can check the error 118.

Thanks,

Nalini.

Former Member
0 Likes

I think that this message has the solution you need:

regards

Former Member
0 Likes

Hi Mateusz,

In above post they are not filling lo_msg_consumer.

Thanks,

Nalini,

Former Member
0 Likes

Yes, they are:

"Get Instance of PO Change Version

        lo_pdo_po ?= /sapsrm/cl_pdo_factory_po_adv=>get_instance(

            iv_header_guid  = p_guid  " Document guid

            iv_mode         = /sapsrm/if_pdo_constants_gen_c=>gc_mode_edit

            iv_process_type = p_prctyp ). " Process type optional

         IF lo_pdo_po IS BOUND.

         

           "Get PO Header of Change Version

          lo_pdo_po->/sapsrm/if_pdo_bo_po~get_header_details(

            IMPORTING

              es_header            = ls_header

            CHANGING

              co_message_handler   = lo_msg_handler ).  

Former Member
0 Likes

Hi Mateusz,

I am not using change version of PO get , i am just getting catalog item details and updating to LIMIT item , so i am not using any GET INSTANCE in my scenario.

Thanks,

Nalini.

Former Member
0 Likes

I see.

I am not an SAP SRM developer and I have no place to check this. But, if you use ME->ADD_ITEM_LIMIT please check if maybe ME instance contain an instance of the Message Handler.

regards

Former Member
0 Likes

You could also try doing it like this:

lo_pdo_po ?= /sapsrm/cl_pdo_factory_po_adv=>get_instance(

            iv_header_guid  = p_guid  " Document guid

            iv_mode         = /sapsrm/if_pdo_constants_gen_c=>gc_mode_edit

            iv_process_type = p_prctyp ). " Process type optional

IF lo_pdo_po IS BOUND.

  lo_pdo_po->/sapsrm/if_pdo_bo_po~get_header_details(

            IMPORTING

              es_header            = ls_header

            CHANGING

              co_message_handler   = lo_msg_handler ). 

  CALL METHOD me->add_item_limit
           
CHANGING
              ct_limit_item      = lt_limit_item
              co_message_handler = lo_msg_consumer.

ENDIF.