Welcome to the SAP BPC and HANA blog

Welcome to the SAP BPC and HANA blog On this site, I will publish the contents of my book on Implementing SAP BPC and HANA. It is a compr...

Lecture 6 Characteristic Relationships

Lecture 6

In this lecture, we are going to create two Characteristic Relationships, one as an attribute lookup and one as a class. The code for the CR is included in the downloadable materials.






Code for Characteristic Relationships

 constants:
      l_c_sold_to    type string value 'SOLD_TO',
      l_c_salesorg   type string value 'SALESORG',
      l_c_distr_chan type string value 'DISTR_CHAN',
      l_c_division   type string value 'DIVISION',
      l_c_cust_group type string value 'CUST_GROUP',
      l_c_sales_off  type string value 'SALES_OFF'.

    field-symbols:
      <sold_to>    type any,
      <salesorg>   type any,
      <distr_chan> type any,
      <division>   type any,
      <cust_group> type any,
      <sales_off>  type any.

    assign component l_c_sold_to     of structure c_s_chas to <sold_to>.
    assign component l_c_salesorg    of structure c_s_chas to <salesorg>.
    assign component l_c_distr_chan  of structure c_s_chas to <distr_chan>.
    assign component l_c_division    of structure c_s_chas to <division>.
    assign component l_c_cust_group  of structure c_s_chas to <cust_group>.
    assign component l_c_sales_off   of structure c_s_chas to <sales_off>.

    "pricing Unit is the Base UoM of the material.
    select sales_off, cust_group
    from /bi0/mcust_sales
    where cust_sales  = @<sold_to>
    and salesorg    = @<salesorg>
    and  distr_chan = @<distr_chan>
    and division    = @<division>
    and objvers     = 'A'
    into @data(s_cust_sales).
    endselect.

    "dont redervice existing value.
    if sy-subrc = 0.
      <sales_off>  = s_cust_sales-sales_off.
      <cust_group> = s_cust_sales-cust_group.
    endif.

1 comment:

  1. Hi Marc

    Videos are not available from Inproviders - would you please upload all the videos?

    Thanks

    ReplyDelete