cancel
Showing results for 
Search instead for 
Did you mean: 

Problem In Copying Item data

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Smruti,

Refer the method CL_CRM_ADMINH_RUN_BTIL->COPY_HEADER.

This is the method used by one order framework to copy the transactions. This is the method called via

the statement

lr_result = lr_entity->execute( iv_method_name = 'copyHeader' ).

as you can see in most of the one order transactions.

Regards,

Leon