Showing results for 
Search instead for 
Did you mean: 

Automatic assignment of service for service order

Former Member
0 Kudos

Hello Guys,

we need to fetch the item data using service order with help of process type.

i had done coding for the requirement but its is not dispaly it is getting null reference so pls help me regarding the issue.

code below

DATA : ls_params TYPE crmt_name_value_pair.
DATA : lt_params TYPE crmt_name_value_pair_tab.
DATA : lr_adminh TYPE REF TO cl_crm_bol_entity,
lr_itm TYPE REF TO cl_crm_bol_entity,
lv_object_id type string,
lr_itmcol TYPE REF TO cl_crm_bol_entity.

ls_params-name = 'OBJECT_ID'.
lv_object_id = zl_bt116it__genericitemel_impl=>zobjid.
APPEND ls_params TO lt_params.

DATA: lo_iterator TYPE REF TO if_bol_bo_col_iterator,
lo_current TYPE REF TO if_bol_bo_property_access,
lv_guid TYPE crmt_object_guid,
lt_guid TYPE crmt_object_guid_tab,
gt_orderadm_i TYPE crmt_orderadm_i_wrkt,
gs_orderadm_i TYPE crmt_orderadm_i_wrk,
gt_product_i TYPE crmt_product_i_wrkt,
gs_product_i TYPE crmt_product_i_wrk,
gt_pricing_i TYPE crmt_pricing_i_wrkt,
gs_pricing_i TYPE crmt_pricing_i_wrk,
gt_schedlin_i TYPE crmt_schedlin_i_wrkt,
gs_schedlin_i TYPE crmt_schedlin_i_wrk,
ls_product TYPE ztab000019,
lv_process_type TYPE crmd_orderadm_h-process_type,
lv_product TYPE COMT_PRODUCT_ID ,"crmd_orderadm_i-product,
lv_product_string TYPE string.

lo_iterator ?= me->typed_context->btadmini->collection_wrapper->get_iterator( ).
clear lv_guid.
select single guid from crmd_orderadm_h into lv_guid where object_id = lv_object_id

SELECT * FROM ztab000019 INTO ls_product WHERE object_id = lv_guid.
IF ls_product IS NOT INITIAL.

SELECT SINGLE process_type
FROM crmd_orderadm_h
INTO lv_process_type
WHERE guid EQ lv_guid.

IF ls_product-zzfld00001f IS NOT INITIAL.

SELECT SINGLE product FROM zproduct
INTO lv_product
WHERE process_type EQ lv_process_type
AND pro_type EQ ls_product-zzfld00001e
AND plo_type EQ ls_product-zzfld00001f.
* ELSEIF ls_product-zzfld00001e EQ '2'.
SELECT SINGLE product FROM zproduct
INTO lv_product
WHERE process_type EQ lv_process_type
AND pro_type EQ ls_product-zzfld00001e.


IF lv_product IS NOT INITIAL.
lv_product_string = lv_product .
*lo_current->set_property_as_string( iv_attr_name = 'ORDERED_PROD' iv_value = lv_product_string ).

at set property i am getting error its is not dispalying

Accepted Solutions (0)

Answers (3)

Answers (3)

Active Contributor
0 Kudos

Hi Krishna,

It seems that you don't have LO_CURRENT object instantiated, so can you try the following before making that call:

lo_current = lo_iterator->get_current( ).

Kind regards,


Former Member
0 Kudos

Hello Mark,

Thanks you for your response .

We are getting proper product in lv_product according to service order - process type .

But whenever we are trying to display that product we are getting dump i.e. in line,

lo_current->set_property_as_string( iv_attr_name = 'ORDERED_PROD' iv_value = lv_product_string ).

I attached screenshot of that

Active Contributor
0 Kudos


Hi. It seems you have an ABAP type of question tied to Service Orders. It is assume that you know how to debug in SE37 by adding breakpoints to your code to understand the values returned by each of your properties when you view them in debug mode. Double check for syntax error or at least check the values returned by any of the previous query in the statement above. You may use the typical go into or step into of debugging.

Best Regards,

SAP Support