Skip to Content
author's profile photo Former Member
Former Member

How to hardcode 12 months for 0calmonth in BEX using customer exit?

Hi Experts,

I have done some coding in routines. But in Bex, I am completly new. I searched the forum but I find lot of examples for variables. I was unable to get an example on how to hard code the twelve months.

Can any one explain me the steps or show me some document on how to do it.

Thank you in advance.

With Kind Regards,

Kannan

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Jul 31, 2012 at 05:09 AM

    Hi

    Do you want to display 12 months even if the data is not available for those months? It is possible even without the coding at customer exit level. You can do it directly in BEX.

    You can create selections and restrict each one with different months and year can be a variable. This will give you the flexibility to see the 12 months data for which ever year you select.

    Regards

    Murthy

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 31, 2012 at 05:17 AM

    Hi Kannan,

    I hope this document will meet your requirement

    http://scn.sap.com/docs/DOC-11628

    Also search documents with title 'Using Customer Exit Variables in BW Reports Part 1-18' by Surendra Kumar Reddy Koduru. They may be useful.


    Regards

    Chandu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 03, 2012 at 07:26 AM

    Hello Kannan,

    the question is if you really want to code 12 variables as customer-exit variables or use one variable and work with offset in query-designer.

    i would suggest, to use ABAP Objects when implementing BEx-Variables: Easy implementation of BEx-Userexit-Variables

    Kind regards,

    Hendrik

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2012 at 12:41 PM

    HI,

    May be below customer exit helps you out.

    IF i_vnam CP 'ZX_CUSTVAR'. "Where ZX_CUSTVAR is customer exit variable on date"

    l_counter = 0.

    IF i_step = 2.

    READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZX_CALMONTH'. "Ur input calmonth variable"
    IF sy-subrc = 0.
    l_s_range-low = loc_var_range-low.
    ln_month = l_s_range-low+4(2).

    ln_value = l_s_range-low+4(2).

    lv_year = l_s_range-low+0(4).



    DO 12 TIMES.
    l_counter = l_counter + 1.
    CONCATENATE 'ZX_BILLDATE_' l_counter INTO lv_text.
    IF i_vnam EQ lv_text.
    IF l_counter > ln_value.
    l_s_range-low = '20000101'.
    l_s_range-high = '20000101'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    CLEAR l_s_range.
    ELSE.

    CONCATENATE lv_year l_counter '01' into lv_startdate.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
    EXPORTING
    day_in = lv_startdate
    IMPORTING
    last_day_of_month = lv_enddate.


    l_s_range-low = lv_startdate.
    l_s_range-high = lv_enddate.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    endif.
    endif.
    enddo.
    endif.
    endif.
    endif.

    But to use to use this exit u need to create 12 selection restricted with the date variables saying -

    ZX_CUSTVAR_01,ZX_CUSTVAR_02 .....ZX_CUSTVAR_12.

    Hope this fulfils your requirement.

    Regards,

    Shreya

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.