Skip to Content
0
Former Member
Feb 20, 2012 at 06:06 AM

Problem In Copying Item data

46 Views

Hi,

I have Enabled the Copy Quotation in ERP_H... The problem is i am able to copy the Header data.. But i am not able to do For Item details

Below is the code which i used please tell me where i am wrong..

lr_collect = lr_ent2->get_related_entities( iv_relation_name = 'ERPItemAdminI' ).

CLEAR: wl_header-vbeln.

lr_ent = lr_entity->get_related_entity( iv_relation_name = 'ERPOrderHeader' ).

CALL METHOD lr_ent->if_bol_bo_property_access~set_properties

EXPORTING

is_attributes = wl_header.

lr_ent = lr_ent->get_related_entity( iv_relation_name = 'ERPHeaderItems' ).

lr_collect1 = lr_ent->get_related_entities( iv_relation_name = 'ERPItemAdminI' ).

lr_ent2 ?= lr_collect->get_first( ).

WHILE lr_ent2 IS BOUND.

CALL METHOD lr_ent2->if_bol_bo_property_access~get_properties

IMPORTING

es_attributes = wl_item.

CLEAR: wl_item-handle.

CALL FUNCTION 'CRM_GUID_CREATE'

IMPORTING

ev_guid = l_guid.

wl_item-handle = l_guid.

lr_ent3 = lr_ent2.

CALL METHOD lr_ent3->if_bol_bo_property_access~set_properties

EXPORTING

is_attributes = wl_item.

lr_collect1->add( lr_ent3 ).

lr_ent2 = lr_collect->get_next( ).

ENDWHILE.