Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need help on BADI to use 0CALDAY from cube

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

Former Member
replied

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 View this answer in context
Not what you were looking for? View more on this topic or Ask a question