Skip to Content
0
Feb 26, 2014 at 07:02 PM

Add Data into Collection wrapper ?

593 Views

HI Expert ,

I have an urgent requirement that I have to add data into Quotation under Item Assignment block .

like you are able to see data for product , Qty , Proposed price (I have to add data in these attribute only)

Note : I have to display data in this (ITEM assignment block ) view only not want to save data right now

Product QTY Proposed Price

ZCRM22 1.00

ZCRm51 2.00 .................etc etc


BSP COMPONENT :BT115QIT_SLSQ ,

View :BT115QIT_SLSQ/Items .

Fig 1. Quotation

I am writing code in Do_prepare_output method of view impl class .

Sol : I am able to add data in Product and Proposed Price but am getting issue when i have to add data in QTY .

1. What is did i am retrieving the context node consist of Quotation order information (Header )

coll_wrapper =

me->ztyped_context->btadminh->get_collection_wrapper( ).

TRY.
entity ?= coll_wrapper->get_current( ).
CATCH cx_sy_move_cast_error.
ENDTRY.

2. Then i am getting its related entities and creating new related entity

CALL METHOD entity->get_related_entity
EXPORTING
iv_relation_name = 'BTHeaderItemsExt'

RECEIVING
rv_result = l_role_entity_child.

CALL METHOD l_role_entity_child->create_related_entity
EXPORTING
iv_relation_name = 'BTBillReqAll'

RECEIVING
rv_result = l_role_entity_child1.


3. I am setting the properties


CALL METHOD l_role_entity_child1->if_bol_bo_property_access~set_property
EXPORTING
iv_attr_name = 'ORDERED_PROD'
iv_value = ls_data-PRODUCT_ID.

CALL METHOD l_role_entity_child1->if_bol_bo_property_access~set_property
EXPORTING
iv_attr_name = 'HEADER'
iv_value = lv_guid ."'472DE3537533517BE10000009F70041D'.

CALL METHOD l_role_entity_child1->if_bol_bo_property_access~set_property
EXPORTING
iv_attr_name = 'GUID'
iv_value = ls_item_data-guid.


4. Adding the entity in Context (because Item assignment block having BOL object " BtAdminI" )


ztyped_context->btadmini->collection_wrapper->add( l_role_entity_child1 ).

Now Issue is that Quantity attribute "QTY" is in not 'BTBillReqAll' . I have tried to get its related entity but i am not getting its relation and not able to add data in QTY .

CALL METHOD l_role_entity_child1->get_related_entity
EXPORTING
iv_relation_name = 'BTBillReqAll'
* iv_mode = NORMAL
receiving
rv_result = l_role_entity_childqnty


It would really be very helpful if any one having any idea like how to proceed further .

Regards ,

Rish Verma

Attachments