Skip to Content
author's profile photo
Former Member

Need advice with a Characteristic Relationship implementation

How would I go about implementing the following in BW 3.5 using BPS characteristic relationships?

We have a BPS layout with a characteristic "Business Planning Code" (<b>BPC</b>) as a user-input variable in the header. Our input layout has two lead columns "Sales District" (<b>SD</b>) and "Sales Employee" (<b>SE</b>) for which we are trying to predetermine valid combinations. Combinations are deemed "valid" when they show up in a master data table /bic/msipslrep as a unique combination of those three characteristics, e.g. <b>SELECT * FROM /bic/msipslrep WHERE BPC = 'PP'</b>.

If the user's header variable input on BPC was 'PP' then we would like the characteristic relationships to only propose combinations that are listed in a <b>SELECT * FROM /bic/msipslrep WHERE BPC = 'PP'</b> query.

<u>Sample Data</u>

SD         BPC       SE 
100300     CN        00131784  
100300     PP        00131784  
100300     BM        00114218  
100300     PP        00131787

Using the sample data above and the user input of <b>BPC = 'PP'</b> the following two rows should be our results.

<u>Desired results</u>

100300     PP        00131784  
100300     PP        00131787

Thanks,

Daniel Pritchett

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 14, 2007 at 08:44 PM

    You can try without chars relationships.

    Option1 : In lead column, check " all characteristic combinations".

    Option 2: Define 3 variables on each of your chars. WIth the header chars, you can derive the other variables values thru exits.

    For both options, you need to make sure the master data is maintained perfectly.

    Ravi Thothadri

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Clarification to my preceding post:

      Our BPS variables worked properly in the debugger - they exported <b>ETO_CHARSEL</b> as a list of valid combinations. Unfortunately, when the variables created on SD and SE were used as lead columns for our input layout instead of displaying all matches for our SD and SE variables we only got the first match for the SD variable and then its first SE match.

  • author's profile photo
    Former Member
    Posted on Aug 14, 2007 at 08:50 PM

    DId you check " all chars combinations" in the lead columns? Can you try to keep all the 3 chars in lead columns and try "with all chars combinations".

    Ravi Thothadri

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Another point: The SD, BPC, and SE master data are not associated with the /bic/msipslrep table referenced above. There is nothing inherent in the BW master data to infer these relationships, we must read them by querying the /bic/msipslrep table.

  • author's profile photo
    Former Member
    Posted on Aug 14, 2007 at 09:31 PM

    What I meant was to include SD and SE as compounded chars in the object BPC.

    And then, try " all chars combinations in the layout"

    Ravi Thothadri

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 14, 2007 at 09:16 PM

    You can compounnd them together and try chars combinations.

    Ravi Thothadri

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ravi: Could you be more specific about how I would do that in the given scenario? Our first attempt to use a function module for Combination Proposals did not work for us. The only whtiepaper we found explaining characteristic relationships focuses on derivation which I do not think we need since we don't want to exclude BPC/SD/SE from our planning level and layout.

  • Posted on Aug 14, 2007 at 11:09 PM

    Hello Daniel,

    you need an exit char.relationship. BPC is source char, SD and SE are target char. Here's some sample coding.

    FUNCTION Z_BPS_CHECK_SD_SE.
    *"----------------------------------------------------------------------
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
    *"     REFERENCE(IS_CHAS) TYPE  ANY
    *"     REFERENCE(ITO_CHA) TYPE  UPC_YTO_CHA
    *"     REFERENCE(ITO_CHASEL) TYPE  UPC_YTO_CHASEL
    *"  EXCEPTIONS
    *"      INVALID
    *"----------------------------------------------------------------------
    
      FIELD-SYMBOLS: <bpc>  TYPE ANY,
                     <sd> TYPE ANY,
                     <se> TYPE ANY.
    
    * if we don't have BPC we can not perform any check
    * -> we don't care and accept the record
      READ TABLE ito_cha WITH TABLE KEY chanm = 'ZBPC'
                         TRANSPORTING NO FIELDS.
      CHECK: sy-subrc = 0.
    
      ASSIGN COMPONENT 'ZBPC' OF STRUCTURE is_chas TO <bpc>.
      CHECK: sy-subrc = 0.
    
    * check if SD and SE are contained
      READ TABLE ito_cha WITH TABLE KEY chanm = 'ZSD'
                         TRANSPORTING NO FIELDS.
      CHECK: sy-subrc = 0.
    
      ASSIGN COMPONENT 'ZSD' OF STRUCTURE is_chas TO <sd>.
      CHECK: sy-subrc = 0.
    
      READ TABLE ito_cha WITH TABLE KEY chanm = 'ZSE'
                         TRANSPORTING NO FIELDS.
      CHECK: sy-subrc = 0.
    
      ASSIGN COMPONENT 'ZSE' OF STRUCTURE is_chas TO <se>.
      CHECK: sy-subrc = 0.
      
    * now check if combo is valid
      SELECT * FROM /bic/msipslrep WHERE ZBPC = <bpc> and ZSE = <se> and ZSD = <sd>.
      IF sy-subrc <> 0.
          MESSAGE e001(ZZZ) WITH <bpc> <sd> <se> RAISING invalid.
      ENDIF.
    
    ENDFUNCTION.
    

    If you have many records and performance becomes an issue, you should buffer the master data table in an internal hashed table.

    Regards,

    Marc

    SAP NetWeaver RIG

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Daniel,

      I don't have to time to provide a complete and working implementation. Sorry.

      The select statement should have been SELECT SINGLE *... and the table needs to be mentioned in a TABLE statement (so you don't need the INTO clause).

      If you want to use the combination proposal i.e. you have no previous data combinations, then you have to implement a different function module (interface). The implementation is a bit more complicated. You can find an example in the system in function UPF_TIME_EXIT_FISC_CREATE.

      However, you should check if you can use a char.relationship based on a hierarchy for example. Then you would not need to code anything.

      Regards,

      Marc

      SAP NetWeaver RIG

  • author's profile photo
    Former Member
    Posted on Aug 14, 2007 at 11:45 PM

    Marc,

    Daniel says he does not maintain the relationship between the chars in BW.

    I suggested him to compound all the three and use BPS variables and read the value of SD snd SE from BPC or use all of them in the lead columns and use " for al chars combinations". With this config, I feel it should work. Your opinion pl?

    Ravi Thothadri

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Ravi,

      compounding assumes that there is top down relationship:

      char 1 > char 2 > char 3

      Char 2 and char 3 are not independed anymore. So for all values of char 3 you must specify char 1 and char 2 as well. For example it's impossible to run a query or layout by specifying the value for char 3 only.

      Unless there's a true dependency between the characteristics, do not model them with compounding.

      Char.relationship address exactly the need to model relationships between technically unrelated characteristics.

      Regards,

      Marc

      SAP NetWeaver RIG

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 01:57 AM

    Thanks Marc for the clafification.

    But we do configure char relationship for entities like sales org - company code, cost centre - company code. These entities are related too as attribute of another.

    Ravi Thothadri

    Add comment
    10|10000 characters needed characters exceeded