using customer exit variables in bw reports%3a part - 5

Upload: abhilash

Post on 25-Feb-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    1/15

    SAP COMMUNITY NETWOR SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 1

    Using Customer Exit Variables inBW/BI Reports: Part - 5

    Applies to:SAP NetWeaver Business Warehouse (Formerly BI), Will also work on SAP BI 3.5. EDW homepage .

    SummaryThis article gives clear picture about how to use Characteristic Customer Exit Variables in SAP-BW/BIReports.

    Author: Surendra Kumar Reddy Koduru

    Company: ITC Infotech India Ltd. (Bangalore/INDIA)

    Created on: 31 May 2011

    Author BioSurendra Kumar Reddy Koduru is a SAP BI Lead Consultant currently working with ITCInfotech India Ltd (Bangalore/INDIA). He has got rich experience and worked on variousBW/BI Implementation/Support Projects and he is the author for various Articles and Blogs(SAP-BW/BI) in SAP Community Network.

    http://help.sap.com/saphelp_nw70/helpdata/en/b2/e50138fede083de10000009b38f8cf/content.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/b2/e50138fede083de10000009b38f8cf/content.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/b2/e50138fede083de10000009b38f8cf/content.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/b2/e50138fede083de10000009b38f8cf/content.htm
  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    2/15

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    3/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 3

    Introduction:This article addresses the requirement of Customer Exit variables in BW/BI Reports; in this article Imexplaining the following scenario

    How to use the Characteristic Customer Exit Variables in BW/BI Reports, how to display the data for FiscalYear Period based on User Input Date.

    Live Scenario:In most of the SAP-BI/BW reports (Here I taken Sales example) users want to see the Sales revenue datafor Financial Year Period based on Users Input date.

    Steps:

    Create User Entry Variable ZDATE_M on 0CALDAY.

    For reference look into the following screens.

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    4/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 4

    Create Customer Exit Variable ZFYP_CE on 0FISCPER.For reference look into the following screens.

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    5/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 5

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    6/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 6

    Code:

    Goto CMOD TCode in SAP-BW/BI and then give your Project Name and click on Change button.

    Click on Components

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    7/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 7

    Double Click on EXIT_SAPLRRS0_001

    Double Click on INCLUDE ZXRSRU01 .

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    8/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 8

    Write the following Code in the ABAP Editor in ECC:

    *&---------------------------------------------------------------------* *& Include ZXRSRU01 *&---------------------------------------------------------------------*

    DATA : l_s_range TYPE rsr_s_rangesid,loc_var_range LIKE rrrangeexit,zbdatj LIKE t009b-bdatj,

    zbuper LIKE t009b-poper,zper LIKE t009b-poper,ZGJAHR LIKE T009B-BDATJ.

    DATA : ZDT TYPE SY-DATUM.

    CASE i_vnam.

    WHEN 'ZFYP_CE' .IF i_step = 2 .

    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDATE_M' .CLEAR: l_s_range.ZDT = loc_var_range-low.CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

    EXPORTING I_DATE = ZDT

    * I_MONMIT = 00 I_PERIV = 'V3'

    IMPORTING E_BUPER = ZBUPERE_GJAHR = ZGJAHR

    * EXCEPTIONS * INPUT_FALSE = 1 * T009_NOTFOUND = 2 * T009B_NOTFOUND = 3 * OTHERS = 4

    .IF SY-SUBRC 0 .

    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF .

    * CONCATENATE ZBUPER ZGJAHR into ZFYP. CONCATENATE ZGJAHR ZBUPER into l_s_range-low.

    l_s_range- sign = 'I' .l_s_range-opt = 'EQ' .

    APPEND l_s_range TO e_t_range.ENDLOOP.

    ENDIF .ENDCASE.

    Save and Activate the above code and project.

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    9/15

    Using Custom er Exi t Variables in BW /BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 9

    Code Explanation:

    The Function Module ' DATE_TO_PERIOD_CONVERT ' will take Date and Fiscal Year Variant,as input, and it will give Fiscal year period.

    Report Designer:

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    10/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 10

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    11/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 11

    In Filters:

    Drag & Drop 0FISCVARNT, 0CALDAY and restrict 0FISCVARNT with V3 (as per India) and 0CALDAY withUser Input Variable.

    In Rows:

    Drag and Drop Material and Plant.

    In Columns:

    Create New Selection and Drag and Drop Amount and 0FISCPER, restrict 0FISCPER with ZFYP_CEVariable like above.

    Save and Execute the Report :

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    12/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 12

    Selection Screen:

    Once you execute the report you can see the following selection screen:

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    13/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 13

    Report Result:

    See the following Report Result:

    Here the result is displayed for 010.2009 period, because 01.01.2010 means 010.2009.

  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    14/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2011 SAP AG 14

    Related ContentUsing Customer Exit Variables in BW Reports Part - 4

    Using Customer Exit Variables in BW Reports Part - 3

    How to use Customer Exit Variables in BW Reports: Part - 2

    Using Customer Exit Variables in BW or BI Reports Part - 1

    Using Text Variables with Customer Exits in Report Headings Using Text Variables with Customer Exits in Report Headings

    Variables of Type Customer Exit

    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0fefc77-40e3-2c10-8da3-d4bfcb013387http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0fefc77-40e3-2c10-8da3-d4bfcb013387http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0fefc77-40e3-2c10-8da3-d4bfcb013387https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/g-i/How%20to%20use%20Customer%20Exit%20Variables%20in%20BW%20Reports%3a%20Part%202.pdfhttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/g-i/How%20to%20use%20Customer%20Exit%20Variables%20in%20BW%20Reports%3a%20Part%202.pdfhttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/Using%20Customer%20Exit%20Variables%20in%20BW%20or%20BI%20Reports%20Part%20-%201.pdfhttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/Using%20Customer%20Exit%20Variables%20in%20BW%20or%20BI%20Reports%20Part%20-%201.pdfhttp://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13221http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13221http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13221http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13221http://help.sap.com/saphelp_nw70/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htmhttp://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13221http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13221https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/Using%20Customer%20Exit%20Variables%20in%20BW%20or%20BI%20Reports%20Part%20-%201.pdfhttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/g-i/How%20to%20use%20Customer%20Exit%20Variables%20in%20BW%20Reports%3a%20Part%202.pdfhttp://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0fefc77-40e3-2c10-8da3-d4bfcb013387http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0fefc77-40e3-2c10-8da3-d4bfcb013387
  • 7/25/2019 Using Customer Exit Variables in BW Reports%3a Part - 5

    15/15

    Using Custom er Exi t Variables in B W/BI Reports : Par t - 5

    SAP COMMUNITY NETWORK SDN d | BPX b | BOC b | UAC

    Disclaimer and Liability NoticeThis document may discuss sample coding or other information that does not include SAP official interfaces and therefore is n otsupported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

    SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,and anyone using these methods does so at his/her own risk.

    SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article orcode sample, including any liability resulting from incompatibility between the content within this document and the materials andservices offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of thisdocument.