Quantcast
Channel: SCN : Discussion List - SAP CRM: Sales
Viewing all articles
Browse latest Browse all 1559

Partner guid is not getting saved in the Competitor Products table

$
0
0

Hi,

Table COMM_IL_COMPET is for assigning own products to Competitor products.

But,

I am facing an issue in creating opportunity.

1. While creating Opportunity i was assigning items for that and for every item i was assigning one    competitor product.

2. In this case Opportunity is getting created with given items but not the competitor products.

3. I was using CRM_ORDER_MAINTAIN FM. In this FM there is import structure IT_PARTNER.

4. In that partner structure another is there COMPETITOR_PRODUCTS_COM.

    Through this structure i was passing competitor product for that item.

5. In this partner_guid is common field in partner(CRMD_PARTNER) and competitor(COMD_PARCOMP_PRD) tables.

6. Partner_guid is getting saved in CRMD_PARTNER table but not getting saved in table COMD_PARCOMP_PRD .

 

please see the below code.

 

  ls_comp_prod-ID                     = 'LCPCOM155' .            "Competitor Product .
  ls_comp_prod-PARENT_GUID  =  cw_orderadm_h-guid.  "Opportunity Header guid
  ls_comp_prod-PARENT_ITEM_GUID  =  ls_orderadm_i-guid . "Opportunity Item guid
  ls_comp_prod-MAIN_COMPETITOR =  'X'.
  insert ls_comp_prod into table lt_comp_prod . clear ls_comp_prod .

 

  wa_partner-REF_GUID                =    ls_orderadm_i-GUID .  "Opportunity Item guid

  wa_partner-REF_KIND                =    'B' .
  wa_partner-DISPLAY_TYPE        =    'BP' .
  wa_partner-NO_TYPE                 =    'BP' .
  wa_partner-PARTNER_FCT         =    '00000023' .                 " Competitor partner function
  wa_partner-PARTNER_NO          =    '119100123'.                 "Competitor partner number

  wa_partner-COMPETITOR_PRODUCTS_COM =    lt_comp_prod .

  insert wa_partner into table it_partner .

 


CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
         IT_PARTNER            = IT_PARTNER
  IMPORTING
        ET_EXCEPTION          = ET_EXCEPTION
  CHANGING
        CT_ORDERADM_H         = it_orderadm_h
       CT_ORDERADM_I         = it_orderadm_i
        CT_INPUT_FIELDS       = it_input_fields
  EXCEPTIONS
        ERROR_OCCURRED        = 1
       DOCUMENT_LOCKED       = 2
        NO_CHANGE_ALLOWED     = 3
        NO_AUTHORITY          = 4
       OTHERS                = 5.

 

Can you please check the code and help me in this issue.

 

Thanks & Regards

Suman


Viewing all articles
Browse latest Browse all 1559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>