Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9090

Re: adding child item with higher line item number as that of parent item in Quote

$
0
0

Hi Dharmakasi,

 

Here is the code

 

LOOP AT lt_subitems INTO wa_subitems.

                       lv_chi_prod = wa_subitems-product.

                       lv_qty_req_c = wa_subitems-QUANTITYREQUESTED.

                       lv_qty_c = lv_con_qty * lv_qty_req_c .

                       lr_create1 ?= lr_btitems->create_related_entity( iv_relation_name = 'BTOrderItemAll' ).

                       IF lr_create1 IS BOUND.

                         CALL METHOD lr_create1->set_property

                           EXPORTING

                             iv_attr_name = 'ORDERED_PROD'

                             iv_value     = lv_chi_prod.

                         IF wa_subitems-JUNSPLITLINE = 'Y'.

                           lv_item1 = ( lv_num + 2 ) * 100.

                           CALL FUNCTION 'CRM_GUID_CREATE'

                             IMPORTING

                               EV_GUID = lv_guid2.

                           CALL METHOD lr_create1->set_property

                             EXPORTING

                               iv_attr_name = 'GUID'

                               iv_value     = lv_guid2.

                           CALL METHOD lr_create1->set_property

                             EXPORTING

                               iv_attr_name = 'NUMBER_INT'

                               iv_value     = lv_item1.

 

                         ELSE.

                           CALL METHOD lr_create1->set_property

                             EXPORTING

                               iv_attr_name = 'PARENT'

                               iv_value     = lv_guid1.

                         ENDIF.

                         CALL METHOD lr_create1->set_property

                           EXPORTING

                             iv_attr_name = 'ZZ_CONFIG_NAME'

                             iv_value     = wa_items-JUNCONFIGURATIONNAME.

                         CALL METHOD lr_create1->set_property

                           EXPORTING

                             iv_attr_name = 'ZZ_PROPOSAL_ID'

                             iv_value     = wa_items-JUNCONFIGURATIONID.

                         IF lv_config_nw is NOT INITIAL.

                           CALL METHOD lr_create->set_property

                             EXPORTING

                               iv_attr_name = 'ZZ_CNFIG_INST_ID'

                               iv_value     = lv_config_nw.

                         ELSE.

                           CALL METHOD lr_create->set_property

                             EXPORTING

                               iv_attr_name = 'ZZ_CNFIG_INST_ID'

                               iv_value     = wa_items-JUNCONFIGINSTANCEID.

                         ENDIF.

 

                         lr_prod1 ?= lr_create1->create_related_entity( iv_relation_name = 'BTItemProductExt' ).

                         IF lr_prod1 IS BOUND.

                           CALL METHOD lr_prod1->set_property_as_string

                             EXPORTING

                               iv_attr_name = 'PROCESS_QTY_UNIT'

                               iv_value     = 'EA'.

                         ENDIF.

                         lr_sched1 ?= lr_create1->create_related_entity( iv_relation_name = 'BTItemSchedlinExt' ).

                         IF lr_sched1 IS BOUND.

                           lr_sched1 lr_sched1->create_related_entity( 'BTSchedlinFirst' ).

                         ENDIF.

                         CALL METHOD lr_sched1->set_property

                           EXPORTING

                             iv_attr_name = 'QUANTITY'

                             iv_value     = lv_qty_c.

 

                         CALL METHOD lr_items_col->add

                           EXPORTING

                             iv_entity = lr_create1.

                       ENDIF.

                       CLEAR : lv_qty_req_c,

                               lv_qty_c.

                     ENDLOOP.



Regards,

Prathyusha.


Viewing all articles
Browse latest Browse all 9090

Trending Articles