Skip to Content
0
Former Member
Jul 20, 2009 at 03:29 PM

CRM_ORDER_READ in loop gives memory dump

210 Views

Hi,

I created one custom function module in which i am using CRM_ORDER_READ in the loop and reading the requested start date of the service order which is given by the user as a selection parameter.

LOOP AT t_itm_srvo INTO ds_itm_srvo. " this table contains the records of the crmd_orderadm_h

REFRESH lt_guid.

CLEAR: lt_guid ." ds_itm_srvo.

APPEND ds_itm_srvo-guid TO lt_guid.

REFRESH: lt_pricing_i, lt_partner, lt_appointment,lt_orgman,lt_status.

CLEAR: ds_pricing_i, ds_partner, ds_appointment,ds_orgman,ds_status.

CALL FUNCTION 'CRM_ORDER_READ'

EXPORTING

it_header_guid = lt_guid

  • it_item_guid = lt_guid

IMPORTING

et_pricing_i = lt_pricing_i

et_appointment = lt_appointment

et_partner = lt_partner

et_orgman = lt_orgman

et_status = lt_status.

LOOP AT lt_appointment INTO ds_appointment WHERE ref_guid = ds_itm_srvo-guid AND

appt_type = 'SRV_CUST_BEG'.

  • ( appt_type = 'SRV_CUST_BEG' OR

  • appt_type = 'VALIDFROM').

EXIT.

ENDLOOP.

IF sy-subrc = 0.

date_from = ds_appointment-date_from.

IF NOT r_st_date[] IS INITIAL.

IF ds_appointment-date_from NOT IN r_st_date.

CONTINUE.

ENDIF.

ELSE.

gs_result-valid_from = date_from.

ENDIF.

ENDIF.

ENDLOOP.

I don't have to consider those records where requested start date is not in selection parameter. This function module runs for ever and at the end it gives short dump TSV_LIN_ALLOC_FAILED.

Could anyone please suggest me why this is taking long time or is their any better alternative so that i can avoid using this FM.

Regards,

Kamesh Bathla