Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on BADI to use 0CALDAY from cube

Former Member
0 Kudos

HI Gurus,

I want to calculate no of infractions. for that I need to create virtual key figure and I have to use "0calday - 179"( to get 180 days period).

I have created BADI but I don't know how to use 0CALDAY value from cube in BADI_COMPUTE.

below is the badi I have created.(BADI_COMPUTE)

Please help on this.

method IF_EX_RSR_OLAP_BADI~COMPUTE.

field-symbols <fs_0CALDAY> type any.

field-symbols <fs_ZINFCT180> type any.

ASSIGN COMPONENT P_CHA_0CALDAY OF STRUCTURE c_s_data TO <fs_0CALDAY>.

ASSIGN COMPONENT P_KYF_ZINFCT180 OF STRUCTURE c_s_data TO <fs_ZINFCT180>.

<fs_ZINFCT180> = .

endmethod.

Thanks

Shiv.

Please help on this

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

The BAdI name is RSR_OLAP_BADI and not BADI_COMPUTE, no, which replaces old Enhancement RSR00002.

Try something like

METHOD if_ex_rsr_olap_badi~compute.
  FIELD-SYMBOLS <fs_0calday> TYPE ANY.
  FIELD-SYMBOLS <fs_zinfct180> TYPE ANY.
  CASE i_partcube.
    WHEN 'cube1'.
      ASSIGN COMPONENT p_cha_0calday OF STRUCTURE c_s_data TO <fs_0calday>.
      CHECK sy-subrc EQ 0.
      ASSIGN COMPONENT p_kyf_zinfct180 OF STRUCTURE c_s_data TO <fs_zinfct180>.
      CHECK sy-subrc EQ 0.
      <fs_zinfct180> = <s_0calday> - 180.
  ENDCASE.
ENDMETHOD.     

Read also [SAP BW - Virtual Characteristic (Multiprovider & Infoset) - RSR_OLAP_BADI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90b2babc-15ad-2d10-c4b2-bd3af67d86b1?quicklink=index&overridelayout=true]

Regards,

Raymond

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

The BAdI name is RSR_OLAP_BADI and not BADI_COMPUTE, no, which replaces old Enhancement RSR00002.

Try something like

METHOD if_ex_rsr_olap_badi~compute.
  FIELD-SYMBOLS <fs_0calday> TYPE ANY.
  FIELD-SYMBOLS <fs_zinfct180> TYPE ANY.
  CASE i_partcube.
    WHEN 'cube1'.
      ASSIGN COMPONENT p_cha_0calday OF STRUCTURE c_s_data TO <fs_0calday>.
      CHECK sy-subrc EQ 0.
      ASSIGN COMPONENT p_kyf_zinfct180 OF STRUCTURE c_s_data TO <fs_zinfct180>.
      CHECK sy-subrc EQ 0.
      <fs_zinfct180> = <s_0calday> - 180.
  ENDCASE.
ENDMETHOD.     

Read also [SAP BW - Virtual Characteristic (Multiprovider & Infoset) - RSR_OLAP_BADI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90b2babc-15ad-2d10-c4b2-bd3af67d86b1?quicklink=index&overridelayout=true]

Regards,

Raymond

0 Kudos

Thank you very much Raymond. That really helped me a lor.