Guid of target group

hi experts,
I need to fetch the targetgroup guid for a targetgruoup entity in seged_tg/ELTargetGroupItem but the bol entity is giving all details except the guid,please let me know if there is any FM to fethc the same,As i dont find any unique detail about the Targetgroup.
pls help
Reagards
Anu

Hi Anu,
The GUID is the key of the entity, so you can fetch it using the get_key() method of CL_CRM_BOL_ENTITY. This method delivers the GenIL key of the entity, you may have to convert it to the GUID via CL_CRM_GENIL_CONTAINER_TOOLS=>GET_KEY_FROM_OBJECT_ID. The importing parameter "OBJECT_NAME" of this method is in this case "SegTG" (You can use constant CL_CRM_SEG_IL=>SEGTG for that).
Hope taht helps!
-klaus

Similar Messages

  • Retreiving the guid for target group selected for trade promotion in CRM 7

    HI,
    I am working on building API for creating trade promotion. I need to find a way where I could retreive the GUID of the target group to be assigned to the trade promotion.
    Please share you thoughts on this. Let me know if we could use any standard function module or SAP class which could be used to achieve the objective.
    Awaiting your replies.
    Thanks

    Check this function module
    CRM_MKTTG_TG_H_GETLIST_OW

  • How to retrieve Business Partners Per Target group

    Hi experts!!!
    I am new to CRM development and i need to find the tables related to the target group.
    So far i have only found some tables that hold the T.G. GUID, but i cannot understand how these are connected among them.
    The requirement i have is to retrieve all the bussiness partners related to a specific target group.
    So in the selection screen i should use the target group. (Which field is that??)
    Please help!!!
    Thank u in advance!!!

    HI Grigoria,
    The tables that hold the information that you have requested for is as follows:
    Assuming you found the TG GUID for which you are trying to find the BP's inside it
    Go to Table CRMD_IM_ML_HEAD
    Paste the TG Guid value in the TARGETGRP_GUID field.This would return you "ML_GUID_H" value.
    Take this Guid value and go to table "CRMD_IM_ML_ITEM"
    Paste the ML_GUID_H value from the previous table in the field "ML_GUID_H" of the above table.
    This will return all the BP Guids associated in that TG , which you can convert into the BP # using an FM or from the table BUT000
    Hope this Help's
    Regards,
    Naveen

  • Creating a target group based on the BP email address only in CRM

    Hi there,
    I am currently trying to create a target group based on the business partner email address only.
    I have a list of over 1000 email addresses - these email addresses equate to a BP in our CRM system, however I do not have a list of the equivalent business partner numbers, all I have to work on are the email addresses.  With these 1000 BP email addresses I need to update the marketing attributes of each of these 1000 BP records in CRM.
    What I need is a method to find the 1000 BP numbers based on the email addresses and then use the marketing expert tool (tx. CRMD_MKT_TOOLS) to change the marketing attributes on all of the 1000 BPs.
    The issue I am having is how can I find the list of BP numbers just based on the BP email address, I tried creating an infoset based on table BUT000, BUT020 and ADR6 but I after creating attribute list & data source for this I am stuck on what to do next. In the attribute list the selection criteria does not allow me to import a file for the selection range.  I can only enter a value but I have 1000 email addresses and cannot possibly email them manually in the filter for the attribute list.   I also looked at imported a file into the target group but I do not have any BP numbers so this will not work.
    Does anyone know a method where I can create a target group based on the email addresses only without having to do any code?
    Any help would be most appreciated.
    Kind regard
    JoJo

    Hi JoJo ,
    The below report will return you BP GUID from emails that is stored in a single column .xls file and assign the BP to a target group.
    REPORT  zexcel.
    * G L O B A L D A T A D E C L A R A T I O N
    TYPE-POOLS : ole2.
    TYPES : BEGIN OF typ_xl_line,
    email TYPE ad_smtpadr,
    END OF typ_xl_line.
    TYPES : typ_xl_tab TYPE TABLE OF typ_xl_line.
    DATA : t_data TYPE typ_xl_tab,
           lt_bu_guid TYPE TABLE OF bu_partner_guid,
           ls_bu_guid TYPE  bu_partner_guid,
           lt_guids TYPE TABLE OF bapi1185_bp,
           ls_guids TYPE  bapi1185_bp,
           lt_return TYPE bapiret2_t.
    * S E L E C T I O N S C R E E N L A Y O U T
    PARAMETERS : p_xfile TYPE localfile,
                  p_tgguid TYPE bapi1185_key .
    * E V E N T - A T S E L E C T I O N S C R E E N
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_xfile.
       CALL FUNCTION 'WS_FILENAME_GET'
         IMPORTING
           filename         = p_xfile
         EXCEPTIONS
           inv_winsys       = 1
           no_batch         = 2
           selection_cancel = 3
           selection_error  = 4
           OTHERS           = 5.
       IF sy-subrc <> 0.
         CLEAR p_xfile.
       ENDIF.
    * E V E N T - S T A R T O F S E L E C T I O N
    START-OF-SELECTION.
    * Get data from Excel File
       PERFORM sub_import_from_excel USING p_xfile
       CHANGING t_data.
       SELECT but000~partner_guid FROM but000 INNER JOIN but020 ON
    but000~partner =
       but020~partner
         INNER JOIN adr6 ON but020~addrnumber = adr6~addrnumber INTO TABLE
    lt_bu_guid FOR ALL ENTRIES IN t_data WHERE adr6~smtp_addr =
    t_data-email.
       CLEAR: lt_guids,ls_guids.
       LOOP AT lt_bu_guid INTO ls_bu_guid.
         ls_guids-bupartnerguid = ls_bu_guid.
         APPEND ls_guids TO lt_guids.
       ENDLOOP.
       CALL FUNCTION 'BAPI_TARGETGROUP_ADD_BP'
         EXPORTING
           targetgroupguid = p_tgguid
         TABLES
           return          = lt_return
           businesspartner = lt_guids.
    *&      Form  SUB_IMPORT_FROM_EXCEL
    *       text
    *      -->U_FILE     text
    *      -->C_DATA     text
    FORM sub_import_from_excel USING u_file TYPE localfile
    CHANGING c_data TYPE typ_xl_tab.
       CONSTANTS : const_max_row TYPE sy-index VALUE '65536'.
       DATA : l_dummy TYPE typ_xl_line,
              cnt_cols TYPE i.
       DATA : h_excel TYPE ole2_object,
              h_wrkbk TYPE ole2_object,
              h_cell TYPE ole2_object.
       DATA : l_row TYPE sy-index,
              l_col TYPE sy-index,
              l_value TYPE string.
       FIELD-SYMBOLS : <fs_dummy> TYPE ANY.
    * Count the number of columns in the internal table.
       DO.
         ASSIGN COMPONENT sy-index OF STRUCTURE l_dummy TO <fs_dummy>.
         IF sy-subrc EQ 0.
           cnt_cols = sy-index.
         ELSE.
           EXIT.
         ENDIF.
       ENDDO.
    * Create Excel Application.
       CREATE OBJECT h_excel 'Excel.Application'.
       CHECK sy-subrc EQ 0.
    * Get the Workbook object.
       CALL METHOD OF h_excel 'Workbooks' = h_wrkbk.
       CHECK sy-subrc EQ 0.
    * Open the Workbook specified in the filepath.
       CALL METHOD OF h_wrkbk 'Open' EXPORTING #1 = u_file.
       CHECK sy-subrc EQ 0.
    * For all the rows - Max upto 65536.
       DO const_max_row TIMES.
         CLEAR l_dummy.
         l_row = l_row + 1.
    * For all columns in the Internal table.
         CLEAR l_col.
         DO cnt_cols TIMES.
           l_col = l_col + 1.
    * Get the corresponding Cell Object.
           CALL METHOD OF h_excel 'Cells' = h_cell
             EXPORTING #1 = l_row
             #2 = l_col.
           CHECK sy-subrc EQ 0.
    * Get the value of the Cell.
           CLEAR l_value.
           GET PROPERTY OF h_cell 'Value' = l_value.
           CHECK sy-subrc EQ 0.
    * Value Assigned ? pass to internal table.
           CHECK NOT l_value IS INITIAL.
           ASSIGN COMPONENT l_col OF STRUCTURE l_dummy TO <fs_dummy>.
           <fs_dummy> = l_value.
         ENDDO.
    * Check if we have the Work Area populated.
         IF NOT l_dummy IS INITIAL.
           APPEND l_dummy TO c_data.
         ELSE.
           EXIT.
         ENDIF.
       ENDDO.
    * Now Free all handles.
       FREE OBJECT h_cell.
       FREE OBJECT h_wrkbk.
       FREE OBJECT h_excel.
    ENDFORM. " SUB_IMPORT_FROM_EXCEL
    Just copy paste the code and run the report select any local xls file with emails and pass the target group guid.
    snap shot of excel file:
    Let me know if it was useful.

  • Enhance output of Target Group opened in segment builder

    Hello Experts,
    We are implementing SAP CRM Lean Marketing using CRM 7.0. Our business requirement is to do segmentation based on Company attributes and Relationship Category. The output of the target group should enlist the persons related to the Company based on the relationship category selected while doing the segmentation.
    Using standard InfoSet CORM_MKTTG_BP_ORG_CDE and while creating data source selecting BUT000_PER-PARTNER_GUID in the field business partner, we are able to get the list of persons matching the segmentation query (based on the relationship category e.g. Has Supplier, Has Contact Person, etc) . But the issue is , the output of the target group (shown as an ALV grid , when the target group is opened in segment builder) only enlists matching Persons, it does not enlist the related company ID /name in front of the Person ID in the output of the target group. And this Company BP ID is not available if I try to modify the output layout. So business is unable to understand the Person enlisted in TG belongs to which Company. Can we enhance this ALV grid output of the target group displayed in segment builder ? if yes , how can it be achieved ? If this is possible and we are able to add related company BP ID/ name in front of every person enlisted in the target group then our issue gets resolved. Or is there any alternative solution to resolve this issue ?
    Highly appreciate your early response in order to resolve this critical issue.
    Thanks and Regards
    Ambar
    Edited by: AMBAR ADHAV on Sep 10, 2011 11:52 AM
    Edited by: AMBAR ADHAV on Sep 10, 2011 2:21 PM

    Naresh,
    Thanks for the response.
    As per your suggestion I made additions to my z Infoset , and added all the fields you suggested.
    While creating the data source I selected following fields
    Business Partner: BUT000_PER-PARTNER_GUID (as my requirement is to return Persons and this field works with only GUID)
    Reference Object: BUT051-RELNR
    Reference Object Type:  BUT051-RELTYP
    Now when I create the target group with this data source unfortunately I am still not getting the the relationship number when I click in Show assigned Objects in the target group screen of web UI.
    Please suggest where I am going wrong
    Thanks
    Ambar

  • Enhance output of Target Group in segment builder

    Hello Experts,
    We are implementing SAP CRM Lean Marketing using CRM 7.0. Our business requirement is to do segmentation based on Company attributes and Relationship Category. The output of the target group should enlist the persons related to the Company based on the relationship category selected while doing the segmentation.
    Using standard InfoSet CORM_MKTTG_BP_ORG_CDE and while creating data source selecting BUT000_PER-PARTNER_GUID in the field business partner, we are able to get the list of persons matching the segmentation query (based on the relationship category e.g. Has Supplier, Has Contact Person, etc) . But the issue is , the output of the target group (shown as an ALV grid , when the target group is opened in segment builder) only enlists matching Persons, it does not enlist the related company ID /name in front of the Person ID in the output of the target group. And this Company BP ID is not available if I try to modify the output layout. So business is unable to understand the Person enlisted in TG belongs to which Company. Can we enhance this ALV grid output of the target group displayed in segment builder ? if yes , how can it be achieved ? If this is possible and we are able to add related company BP ID/ name in front of every person enlisted in the target group then our issue gets resolved. Or is there any alternative solution to resolve this issue ?
    Highly appreciate your early response in order to resolve this critical issue.
    Thanks and Regards
    Ambar
    Edited by: AMBAR ADHAV on Sep 10, 2011 11:53 AM
    Edited by: AMBAR ADHAV on Sep 10, 2011 2:22 PM

    Hello Experts,
    We tried implementing BADI CRM_MKTTG_SEG_MEM_EX in order to add Company ID/ Name , but the issue is the BADI gets Input as persons BP id, nothing else, due to this if a person is having relationships with multiple companies, the BADI is unable to identify which company to choose as Relationship Category is not available to the BADI. And further issue is if a Person is having same relationship category with 2 companies e.g. Supplier for company A and for Company B too , in this case too the BADI is unable identify correct Company to return to the target group output
    Is there someting in the Infoset that can resolve our issue ? How can I make available the fields in the infoset to the ALV output of the target group. Using SQ02 I am able to add fields to the field groups for selection in segmentation, but can anyone guide, how to make the field available in the output list ?
    Please provide your technical assistance
    Thanks
    Ambar

  • Target Group Creation

    Hi Experts
    How we create target group on the basis of Net value and Product. which tables required for creation of Infoset.
    Our requirement is who are buy the particular product more than xxxxx amount we need to make a target group and send the mails to them. anybody having idea on this issue plz share with me
    Help full answer i will give the full points
    Regards
    sreedhar

    Hi Manohar,
    You can use below methods
    1. Using BI query (BI Cube) :
    Create a BI query for the sales orders with value field and BP GUID and create a data source using the BI cube with BP as BP GUID.
    2. Using Marketing attribute:
    Create a Marketing attribute as Sales Volume (for exp) and update this marketing attribute with the total value of the sales order + exsting value in the marketing attribute which gives the total cumilative value of the sales done so far by that particular BP.
    To achieve this you may have use the breakpoint in the sales order and code for the updation of markeing attribute of sold party partner function BP.
    Create a data souce using the above attribute set.
    We have used 2nd method for our purpose.
    Please let me know if you have any further queries.
    Reward points if it helps.
    Regards,
    Madhu

  • Extension of target group member list

    Hi,
    does anybody know a guide or something else in which way i have to define additional fields for displaying target group member list?
    Thanks in advance
    Tobias

    solved by myself!

  • Using custom fields to create Target Groups?

    Hi Experts,
    I might be missing something but I couldn't find anything in the different help guides, so if anyone saw that please help!
    Do you know if it is possible to edit the available fields to search/filter Contacts, Accounts etc. when trying to add them to a Target Group?
    We are currently not really using any Marketing-related features but this will be a focus for us in a few months so we are having a closer look at this area. There might be some other settings in the Admin/Project Scope etc. that I am missing and need to check and activate.
    We have some custom fields integrated with our on premise SAP CRM system which are heavily used by our marketing departments for extracting Contact lists, this is why we would like to see how we could reproduce this in C4C.
    Thanks a lot in advance,
    JB.

    Hi JB,
    You can go to => Marketing => Target Groups => Your Group => Members => Personalize => Start Personalization => Add => Add Contacts => here you can select the field you want to change/hide, you can also drag and drop a field to change its order on the screen => Personalize => End Personalization.
    Please find attached file with only a few changes that I did on that screen.
    Best Regards,
    Cristiano Rosa

  • CRM Target Groups and Product Segments - BW and BPS settings

    Hi gurus,
    I have some questions regarding the CRM Target Groups and Product Segments as it relates to BW and BPS planning layouts.
    1. When a target group is created in CRM, is it supposed to also be create master data entry for the object 0TGGRP_ID in BW? If it is, what kind of settings need to be made to ensure that? When we create target groups in our CRM instance, we donu2019t see the master data being updated for the  0TGGRP_ID info object.
    2. Where exactly (in BW) is the relationship between the target group and the underlying customer/business partners  stored/updated? We have a requirement to use target groups for defining the trade promotions and still being able to explode and plan on (individual) customers in the embedded BPS Planning layout. I believe that we need to have target group and associated customer assignments stored somewhere (?) in BW and use BPS characteristic relationships to populate all the possible combinations for a target group ID being passed from CRM. Am I correct in my assumptions? Any ideas if SAP has already delivered something similar in the BPS business content for TPM? 
    3. We are planning to use product segments to define the trade promotions as well. I believe BW info object is 0CP_SEGMENT. Similar to what I mentioned in Question 1, I donu2019t see any master data being updated for 0CP_SEGMENT. Am I looking at a wrong BW object or missing some key settings?    
    4. Where is the relationship between a Product Segment and the associated products stored/updated in BW?  How do I create a trade promotion using a product segment and make the BPS planning layout populate individual products in the lead column?
    Thank you for your help

    Hi Anna,
    After reading your post, what i understand is that there is no existing relationship present in CRM system between the Org BP and the contact person BP.
    As per my Knowledge in order to create a Target group with Contact Persons you should have an active relationship persent in the CRM system bewteen the BP and the Contact person.Now as your sceanrio suggests that the Contact person's are present in the BW system but not in CRM, i would assume that the relationship also exsits in the BW . So if it does then your BW team should be able to help you in creating the necessary infocube with there analytical tools and you can then use there cube as the datasource and create the necessary Target Group with Contact persons.
    Comming to the second part of your question, your guess is absolutely right but to give you more detailed infomation , the BP ID is converted in a unique GUID and this is passed into the program to retrive the necessary information from the BP after the campaign is executed.
    Hope this helps!!
    Regards,
    Naveen

  • Function module to read the target groups associated to a profile

    Hi all,
    In a profile set, there can be number of profiles associated with  the profile set. FM BAPI_PROFILESET_GETDETAIL gives the list of description and guid of the profiles associated with the profile set. Now, a number of target groups can be associated with a profile. How can we get the list of target groups associated with a cretain profile? is there any standard function module to serve this purpose?

    Hi,
    you should use CRM_MKTTG_TG_GETLIST and fill the profile GUID as IV_PF_GUID.
    hope that helps
    --klaus

  • Creating the Target group

    Hi ,
    i would like to create the target group in segment builder.i got the list of business partners.how to create the target group using this list(excel sheet)
    your help would be appreciated.
    Thanks,
    kenny

    In CRM4, Segment Builder (CRMD_MKTSEG)
    Create New Profile Set
    Right click in main window area and select Create Target Group
    Right click on New Target Group, select Properties
    Click on the Load File and Create New Target Group tab
    Follow directions there:
    The file must contain a column with BP number or BP GUID.    
    The file must be an ASCII file (e.g. *.txt or *.csv).        
    The first line of the file must contain the column heading.  
    The columns must be separted with ; or ,                     
    The new target group receives inactive status.                                                                               
    BP Column                                                                               
    Action          1 Add Business Partner to Target

  • Table for Intersected Target Groups

    Hi,
    when intersecting two target groups one new target group is getting created. I am looking for the table that stores which target groups 1 and 2 were used to get the new target group 3.
    Any help is highly appreciated.
    Nicole Lange

    Hi Nicole,
    you will need the GUID of TG 3. Let's call it GUID3.
    DATA model_tg_3 TYPE crmd_mkttg_model.
    SELECT SINGLE * FROM crmd_mkttg_model
      INTO model_tg_3 
      WHERE object_guid = guid3
        AND reference   = space.
    yields the position of TG 3 in the model.
      DATA edges_to_parent TYPE crmt_mkttg_step_db.
      SELECT * FROM crmd_mkttg_step
        INTO TABLE edges_to_parent
        WHERE to_node = model_tg_3-node
          AND to_step = model_tg_3-step.
    yields the edges leading to the parents. Now you will have to read the parent nodes again from the node table:
      DATA parent_guids TYPE crmt_mkttg_guid_tab.
      IF edges_to_parent IS NOT INITIAL.
        SELECT object guid FROM crmd_mkttg_model
          INTO TABLE parent_guids
          FOR ALL ENTRIES IN edges_to_parent
          WHERE node = edges_to_parent-from_node
            AND step = edges_to_parent-from_step.
      ENDIF.
    Now parent_guids should contain the GUIDs of TG1 and TG2 (at least in theory - haven't tested it, but that's the way you do it normally).
    Hope that helps!
    --klaus

  • Target groups - Authorization

    Hi,
    We have requirement (implemented for two companies ( A & B ) in same system)  , if user of company A creates target group, the target group shouldn't be displayed to user of company B and vice versa. Found the authorization object for tagert group (RSCRM_TG) , the permitted activities are create/generate, change. ' Display ' is not available.
    Please suggest me to achieve the requirement.
    Regards,
    Brahmaji
    Edited by: brahmaji24 on Feb 14, 2012 7:09 AM

    Hi, brahmaji24.
    You can use the BAdI BADI_CRM_MKTTG_TARGET_GROUP (enhancement spot is BADI_CRM_MKTTG_TARGET_GROUP) and method CHECK_AUTHORITY.
    This method can achieve your issue. If the user don't have authorization on target group, raise the exception no_authorization.
    Example:
      select single created_by from crmd_mkttg_tg_h into lv_user where guid = iv_tg_guid.u2028
      if lv_user <> sy-uname.u2028      
       raise no_authorization.u2028   
     endif.

  • Target Groups, Infosets and Query

    Hi,
    Can anyone please guide me on what does target group mean in CRM?
    It would be helpful if you can share any documents on the same...
    Regards,
    Ravi.

    Hi Ravi,
    Target group is nothing but grouping of business partner based on some identical characteristic. These identical characteristics were defined in SAP CRM as 4 different types
    1. Marketing attributes like hobby
    2. Infoset like BP country
    3. From BW like sales volume
    4. Ay External list.
    You can avail more information from the following link http://help.sap.com/saphelp_crm40/helpdata/en/db/58963eac416f01e10000000a114084/frameset.htm
    Regards
    satish kumar

Maybe you are looking for