cancel
Showing results for 
Search instead for 
Did you mean: 

Update Marketing Attributes via FB CRM_MKTBP_ASSIGN_ATTRIBUT_TAB

Former Member
0 Kudos
187

Hello SDN Members,

I have written a BSP where I try to update Marketing Attributes via the function module CRM_MKTBP_ASSIGN_ATTRIBUT_TAB. Unfortunately the update via the BSP does not save the data. When I call the function module in Transaction SE37 it works perfect. Any suggestions?

Regards

Gregor

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gregor,

What is the sy-subrc value after the function call?

Can you also do a commit work after the function call? Let me know how it goes.

Regards, Debasish

gregorw
Active Contributor
0 Kudos

Hello Debasish,

the sy-subrc is 0 after the call. I think a commit work is not needed because the function module has a parameter iv_commit wich is set to X. I have seen that the BAPI_TRANSACTION_COMMIT is called in the module when this parameter is set.

Regards, Gregor

gregorw
Active Contributor
0 Kudos

Hello Debasish,

I also tried now to do a extra call of BAPI_TRANSACTION_COMMIT but the result is still the same. For clarification here is the used source:

OnInputProcessing:

* event handler for checking and processing user input and
* for defining navigation
  DATA: it_partner TYPE TABLE OF crmt_mktbp_partner_tab,
        wa_partner LIKE LINE OF it_partner.

  DATA: it_attributes TYPE TABLE OF crmt_mktpfchr_attribute_line,
        wa_attributes LIKE LINE OF it_attributes.

  DATA: assign_return LIKE lt_return.
*
* Partnertabelle füllen
*
  wa_partner-partner      = '1010115'.
  wa_partner-partner_guid = '7200EBF9DDB8E742942410CC501CB956'.

  APPEND wa_partner TO it_partner.
*
* Attributstabelle füllen
*
  wa_attributes-atname = 'A-KONTAKTPROFIL'.
  wa_attributes-atvalue = 'AKZEPTIERT EMAIL HTML'.
  wa_attributes-datatype = 'M'.
  APPEND wa_attributes TO it_attributes.

  wa_attributes-atvalue = 'AKZEPTIERT EMAIL NUR TEXT'.
  APPEND wa_attributes TO it_attributes.
*
* Merkmalswerte schreiben
*
  CALL FUNCTION 'CRM_MKTBP_ASSIGN_ATTRIBUT_TAB'
    EXPORTING
      iv_attribute_set = 'KUNDENPROFIL'
      iv_msa           = ' '
      iv_commit        = 'X'
      iv_obtyp         = 'BUT000'
    TABLES
      it_partner       = it_partner
      et_return        = assign_return
      it_attributes    = it_attributes.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
   EXPORTING
     wait          = 'X'
*   IMPORTING
*     RETURN        =
            .

  APPEND LINES OF assign_return TO lt_return.

Layout

<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>

<htmlb:content design="design2003">
  <htmlb:page title = "Startseite ">
    <htmlb:form>
      <%
  if lt_return is not initial.
      %>
      <htmlb:group title="Meldungen" >
        <htmlb:groupBody>
          <htmlb:tableView id    = "table"
                           table = "<%= lt_return %>" >
          </htmlb:tableView>
        </htmlb:groupBody>
      </htmlb:group>
      <%
  endif.
      %>
      <htmlb:button id      = "save"
                    onClick = "save"
                    text    = "Speichern"></htmlb:button>
    </htmlb:form>
  </htmlb:page>
</htmlb:content>

Regards

Gregor

gregorw
Active Contributor
0 Kudos

Hi Everybody,

I solved this problem on my own by using the Function Module CRM_MKTBP_CHANGE_BP.

Regards

Gregor

Answers (0)