Skip to Content
author's profile photo Former Member
Former Member

Function module to populate Marketting attributes

Hi,

I have a requirement where I need to populate the marketting attributes.

I am using the function module CRM_MKTBP_CREATE_LIST_BPS_OB.This is the code that I am using

x_alloclist-partner_guid = v_raw_bp_guid.

x_alloclist-profile_template_id = p_attset.

x_alloclist-allocvalues = i_allocvalues.

APPEND x_alloclist TO i_alloclist.

CALL FUNCTION ' CRM_MKTBP_CREATE_LIST_BPS_OB'

EXPORTING

ix_alloclist = i_alloclist

TABLES

et_return = i_return

EXCEPTIONS

communication_failure = 1 MESSAGE rfc_err

system_failure = 2 MESSAGE rfc_err.

IF sy-subrc NE 0.

***Exception raised.

  • RFC connection is down.

v_prob_cls = c_imp.

v_subobj = c_rfc.

MESSAGE e015(ysg) WITH rfc_err INTO g_dummy.

PERFORM write_log.

MESSAGE e019(ysg) WITH v_rfcdest.

ENDIF.

I am passing the attribute set in the parameter p_attset. I was expecting only the attributes which belong to this attribute set would get updated. But I found that it is updating the other MAs in i_alloclist which belong to some other attribute set.

Is this a standard behaviour of the function module? Or am I missing some parameters?

Can you please provide some solution to this?

Thanks,

Samrat.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jul 17, 2009 at 08:56 AM

    Hi Samrat,

    I have used FM CRM_MKTBP_ASSIGN_ATTRIBUT_TAB to assign marketing attributes to a BP and it worked for me.

    The advantage of using this FM is that you can pass the attribute set to be updated as the inout parameter.

    Check if this helps you.

    Regards,

    Saumya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2009 at 08:59 AM

    Hi,

    I have updated Marketing Attribute of a BP in CRM by following FM,

    DATA: lt_attr TYPE TABLE OF crmt_mktprof_comw,

    gt_attributes TYPE crmt_mktbp_char_tp,

    t_check TYPE crmt_mktprof_val_r_tab.

    CALL FUNCTION 'CRM_MKTBP_READ_CHAR_ALL_PFTPL' " FM to get Marketing Attribute of an Business Partner.

    EXPORTING

    iv_bp_guid = gs_final-partner_guid

    iv_unassigned_values = c_x

    iv_langu = sy-langu

    TABLES

    et_return = gt_return1

    et_allocvalues = gt_attributes.

    IF gt_attributes[] IS NOT INITIAL.

    READ TABLE gt_attributes INTO gs_attributes WITH KEY classname = c_mktatr_330.

    IF sy-subrc EQ 0.

    gt_check[] = gs_attributes-allocvalues. " Passing Marketing Attribute of a Business partner

    endif.

    endif.

    LOOP AT gt_check INTO gs_check.

    ls_attr-atname = gs_check-charact.

    ls_attr-atwrt = gs_check-value.

    ls_attr-changed_at = gs_check-changed_at.

    ls_attr-changed_by = gs_check-changed_by.

    APPEND ls_attr TO lt_attr.

    CLEAR ls_attr.

    ENDLOOP.

    IF lt_attr[] IS NOT INITIAL.

    CALL FUNCTION 'CRM_MKTBP_CHANGE_BP' " FM for Updating and Inserting Market attributes values

    EXPORTING

    iv_profile_template_id = l_atset

    iv_bp_guid = l_part_guid

    iv_fcode = 'C'

    iv_msa = 'X'

    iv_commit = 'X'

    iv_partner = l_partner

    iv_convert_values = 'X'

    TABLES

    it_imp_seltab = lt_attr

    et_return = lt_return.

    READ TABLE lt_return INTO wa_return WITH KEY type = 'E'.

    IF sy-subrc NE 0.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'.

    ELSE.

    Thanks and Regards,

    ShreeMohan

    Edited by: ShreeMohan Pugalia on Jul 17, 2009 11:04 AM

    Edited by: ShreeMohan Pugalia on Jul 17, 2009 11:07 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2009 at 09:03 AM

    Hi Samrat,

    Try this FM

    CRM_MKTBP_CHANGE_BP

    Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2009 at 09:10 AM

    Hi,

    In your code I do not see Fm,

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    Are you using it?

    If not Please use it after the FM CRM_MKTBP_CREATE_LIST_BPS_OB' .

    Thanks & Regards,

    ShreeMohan

    Edited by: ShreeMohan Pugalia on Jul 17, 2009 11:17 AM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi ShreeMohan,

      The function module has got a parameter CRM_MKTBP_CREATE_LIST_BPS_OB for passing the name of the attribute set. I am not understanding why then all the Marketting attributes are getting populated.

      Am I missing something while passing the parameters to the function module?

      Thanks,

      Samrat.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.