Johan van Zijl

Mostly SAP related…
  • rss
  • Home
  • About

Vendors in the Sales Document

August 10, 2009

I recently had a requirement were a vendor had to be replicated as partner function from a CRM Sales Order to an SD Sales Order.

At first I thought there wasn’t going to be any problem as it seems this is fully supported by customizing. The mapping between partner functions in ERP and CRM can be maintained respectively as shown below. In my case I wanted to replicate a Carrier(Partner function SP in German…it displays as CR in English). Also, note that partner function

IMG: Customer Relationship Management -> Basic Functions -> Partner Processing -> Data Transfer -> Distribution of Partner Functions from SAP ECC into CRM

erp2crm

The above setting will cause partner function SP to be remapped to my new partner function ZR in CRM.

Next you must maintain the mapping from CRM, back to ERP. This table you must always maintain even if you only want to download partner functions as the download from ERP reads the upload table as well(…makes sense right?).

IMG: Customer Relationship Management -> Basic Functions -> Partner Processing -> Data Transfer -> Distribution of Partner Functions from CRM into SAP ECC

crm2erp

What is important to note is the last column which indicates that this is a vendor mapping, and you would think the system would take that into account when uploading/downloading the Sales Order.

Unfortunately this didn’t work, which then prompted a Notes Search which produced Note 1303575. The gist of the note is:

Symptom: Partners of the type “LI” are not supported in the CRM sales document.

Solution: There is none.

Now, lets recap a couple of things:

1. Vendors can be downloaded to CRM using Middleware as described in Note 883162.

2. BP Relationships for Vendors can be downloaded as per Note 975195.

3. Customizing indicates the partner function is a vendor, so why not just map to a vendor instead of a customer?

Lets just say I will reserve my opinion of on the above note.

Anyway the fix is relatively simple. You create an implementation of CRM_DATAEXCHG_BADI in SE19.

To upload the Vendor Partner Function to ERP implement the code below method crm_dataexch_after_bapi_fill.

crm-to-erp

Next to download the partner function implement the following code in method crm_dataexch_r3d_mbdoc_fill.

erp-to-crm

The text of the code is available here…hope it helps.

<-Updated 05.09.2009 – Corrected some errors in published code->

method if_ex_crm_dataexchg_badi~crm_dataexch_after_bapi_fill.

field-symbols: <fs_parnr3> type bapiparnr3.

data: lv_partner_guid      type bu_partner_guid,
lv_vendno            type crmt_bu_map_vendor_number.
**  make sure plant info is not return to ERP as a Partner
delete ct_bapiparnr3 where partn_role = ‘ZP’.

read table ct_bapiparnr3 assigning <fs_parnr3>
with key partn_role = ‘SP’.
if sy-subrc = 0.
lv_partner_guid  = <fs_parnr3>-partn_guid.
select single vendor_no into lv_vendno
from crmm_but_vendno
where partner_guid = lv_partner_guid.
if sy-subrc = 0.
<fs_parnr3>-partn_numb = lv_vendno.
clear <fs_parnr3>-partn_guid.
endif.
endif.

endmethod.

Comments
1 Comment »
Categories
ABAP Code, Middleware, SAP CRM, Sales Documents
Comments rss Comments rss
Trackback Trackback

Passing Custom Fields to Lean Order API

March 31, 2009

I recently started working on the ERP Sales Order functionality in the CRM 5.0 WebClient. This is essentially a WebClient view which uses the ERP 6.0 Lean Order API(LORD) to perform all sales order functionality directly in the backend. The benefit is no messy replication of CRM Sales Orders, Config, Pricing and Enhancements.

The problem is that as with all ERP systems customers enhance VA01 over time and the Lean API does not cater for all scenarios, such as additional fields appended to VBAK which must be filled by the user. (UPDATE – See Note 1078575 for restrictions)

The problem is that there seems no(to my knowledge) way to extend the structures of the API to carry these from CRM to ERP in any traditional(i.e. passing parameters) way.

Then this SDN thread prompted me to investigate the innovative implementation of the Lean Order API and I learned something new: Global variables in SAP Programs are externally accessible!

So all you need to do is create a Remote Function module like the one below in ERP.

FUNCTION ZZ_ERPORDER_TRANSFER_FIELD.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(IV_CONTACT_NAME) TYPE  ZZCONTACT DEFAULT 'My Abap Test'
*"----------------------------------------------------------------------

 field-symbols: <fs_vbak> type vbak.

 assign ('(SAPLSLS_LORD)VBAK') to <fs_vbak>.
 if sy-subrc = 0.
    <fs_vbak>-ZZCONTACT = IV_CONTACT_NAME.
 endif.

ENDFUNCTION.

The function module above accesses the global VBAK structure in Function Group SLS_LORD and updates it. This is riding rough shod over any concept of variable scope, so please think carefully before implementing this.

Now, all you need is to call the RFC Function Module from CRM. I used an implementation of BADI CRM_IC_ERP_BADI to accomplish this.

method IF_EX_CRM_IC_ERP_BADI~AFTER_CREATION.

call function 'ZZ_ERPORDER_TRANSFER_FIELD'
  destination cl_crm_erp_il=>gv_rfc
  EXPORTING
     IV_CONTACT_NAME = 'Contact Name'.

endmethod.
Comments
2 Comments »
Categories
ABAP Code, IC WebClient
Tags
ABAP Code, IC WebClient, Lean Order API, SLS_LORD
Comments rss Comments rss
Trackback Trackback

A Code dump

March 25, 2009

–Update– The code shown here is not 100% correct and reliable. I will probably fix at some point…

I haven’t posted in a long time, mostly because I have been doing everything except working on a SAP system. So, the first bit of code I have written in a while goes here.

Scenario: Its difficult for BW to create reports according the Category Hierarchy on CRM Service Tickets as maintained in the Category Modeller.

Quick Fix Solution: Append fields for Level 1,2 and 3 to CRMD_CUSTOMER_H using EEWB. Create initial load report and BADI implementation to fill these.

I am not going to explain in much more detail. Hopefully someone finds the code useful.

The code can be found here:  Category Update Code.

Comments
No Comments »
Categories
ABAP Code, CRM Service
Tags
ABAP Code, BW, Category Modeller, SAP CRM
Comments rss Comments rss
Trackback Trackback

Determining BP Sales Area Data

September 26, 2008

Here is some code that will help you to determine the Sales Areas assigned to a CRM Business Partner and also the sales area details maintained for the BP.

The variables you will need are provided below:

data: lv_partner_guid type  bu_partner_guid,
      lt_sales_areas  type  crmt_bus_sales_area_t,
      ls_data         type  crmt_bus_set0030,
      lv_owner        type  crmt_bu_set_owner,
      lt_return       type  bus_bapi-return_table,
      lv_error        type  bus_bapi-error.
field-symbols: <fs_sales_area> type  crmt_bus_sales_area.

Below is the code which allows you to retrieve the billing data tab(price group, currency, customer group, etc) .

    call function 'CRM_BUPA_FRG0030_GET_LIST'
      exporting
        iv_partner_guid = lv_partner_guid
      importing
        et_sales_areas  = lt_sales_areas.

    loop at lt_sales_areas assigning <fs_sales_area>.
      call function 'CRM_BUPA_FRG0030_GET_DETAIL'
        exporting
          iv_partner_guid = lv_partner_guid
          is_sales_area   = <fs_sales_area>;
        importing
          es_data         = ls_data
          ev_owner        = lv_owner
          et_return       = lt_return
          ev_error        = lv_error.
    endloop.

The export parameter ev_owner will contain an X if CRM is the owner of the set.

The function module CRM_BUPA_FRG0010* allows you to read the Sales Data tab and CRM_BUPA_FRG0020* allows you to read the Shipping Data tab on the BP.

Comments
No Comments »
Categories
ABAP Code, Business Partner, SAP CRM
Tags
Abap, BP, Sales Area, Sales Organization
Comments rss Comments rss
Trackback Trackback

Customer and BP Numbers

September 4, 2008

I often see systems where the consultant that implemented the solution, assumed that the Customer Number in the R/3 system would be exactly the same as the BP Number in CRM. In most cases this is true(and the system should be configured to map Customer numbers to BP numbers). However, this isn’t always true, especially when using multiple backends.

There are 2 function modules that provide the functionality to map between customer and BP numbers.

The code block below shows the variables that you would typically use when calling these function modules. Note that both the function modules will return the R/3 Account Group as well.

data: lv_partner  type bu_partner_guid,
      lv_customer type crmt_bu_map_customer_number,
      lv_accgroup type crmt_bu_account_group.

Function Module CRM_BUPA_MAP_CUSTOMER_TO_BP will map the CRM BP Number to a Customer Number.

call function 'CRM_BUPA_MAP_BP_TO_CUSTOMER'
  exporting
    iv_partner         = lv_partner
  importing
    ev_customer        = lv_customer
    ev_account_group   = lv_accgroup
  exceptions
    customer_not_found = 1
    others             = 2.

CRM_BUPA_MAP_CUSTOMER_TO_BP will map the R/3 Customer Number to CRM BP Number.

call function 'CRM_BUPA_MAP_CUSTOMER_TO_BP'
  exporting
    iv_customer       = lv_customer
  importing
    ev_partner        = lv_partner
    ev_account_group  = lv_accgroup
  exceptions
    partner_not_found = 1
    others            = 2.
Comments
2 Comments »
Categories
ABAP Code, Business Partner, SAP CRM
Tags
BP, Customer, Mapping
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Navigation

  • ABAP Code
    • Business Partner
    • Conversion
    • CRM Service
    • IC WebClient
    • Middleware
  • Basis
  • Browsers
  • BSP
  • CRM
    • Interaction Centre
  • General
  • HTML
  • SAP
  • SAP CRM
    • Sales Documents

Search

Recent Posts

  • 15 Years of SMS and SAP CRM still does not support it
  • Vendors in the Sales Document
  • The Stapler Interface
  • SAP IT Service Management 7.0
  • Useful notes for Variant Configuration

RSS CONSNET

  • Forrester: Smaller SAP implementation partners sometimes the best option
  • Explore New Possibilities with our Experts at Saphila
  • Business Managers Enterprise Mobility Breakfast
  • New Positions Available!
  • First Global CRM 7.0 Solution live in South Africa
  • Shared Service Contact Centre
  • Consnet wins SAP Partner Excellence Award

Popular Posts

  • Sending mail from SAP
  • SAP CRM 7.0 Due
  • Browser Support and SAP CRM
  • SAP Salary Survey SA
  • Browser Support and SAP CRM - Part 2

Links

  • LinkedIn Profile
  • My Company – consnet.co.za

SAP

  • Getting Technical
  • martinceronio.net
  • SAP CRM Nightmare

Tech Related

  • WordPress Plugins

Categories

  • ABAP Code (12)
    • Business Partner (2)
    • Conversion (2)
    • CRM Service (1)
    • IC WebClient (5)
    • Middleware (1)
  • Basis (3)
  • Browsers (2)
  • BSP (2)
  • CRM (2)
    • Interaction Centre (1)
  • General (6)
  • HTML (3)
  • SAP (9)
  • SAP CRM (11)
    • Sales Documents (1)

Tags

Abap ABAP Code Authorizations BP Broadcast Browsers BSP Business Transaction Search Consulting CRM Customer digiata E-mail Firefox HTML Tidy IC WebClient IE6 IE7 IE8 Inbox ITS JAVA Mapping Opera Postfix Profile Parameters Salary Sales Area Sales Organization SAP SAP CRM SAP CRM 7.0 scot SMTP South Africa spam SSO2 Standards support package Tickets Web Client Web Dynpro website design Web Standards Wordpress

Archives

  • October 2009 (1)
  • August 2009 (1)
  • June 2009 (1)
  • May 2009 (2)
  • March 2009 (2)
  • November 2008 (1)
  • October 2008 (2)
  • September 2008 (7)
  • June 2008 (4)
  • May 2008 (4)
  • April 2008 (1)
  • January 2008 (2)
  • November 2007 (1)
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox