Mostly SAP related…
Posts tagged Sales Organization
Determining BP Sales Area Data
Sep 26th
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.