Customer exit in APO for current month in query

Hi,
I need to create a customer exit which automatically restricts 0calmonth on the current month in a query.
How should I do this APO?
Most important, Which table should I use to find the input, i.e current month and year?
If possible please provide some code to show the solution.
Best regards,
Sebastian

Use the standard SAP exit 0I_CLMTH.

Similar Messages

  • Customer exit code to populate three month's fiscal period

    Dear frns,
    I need an ABAP customer exit code to populate three month's fiscal period.
    Please update on this...thanks
    Cheers! Shana

    Dear,
    Thank u for all replies.
    My requirement is simple.
    Rows:
    Fiscal Year
    Columns
    GR Value
    Filters
    Material Number
    Input Paramters:
    Material No.
    Fiscal Year
    Using customer exit if we populate current fiscal year in the selection screen output be like this....
    FISCAL YEAR    GR Value(in crores)
    2009                     4000
    2008                     3000
    2007                     2000
    2006                     1000
    The cube name Custom Cube ZBBP_C03.
    But I dont have time char 0FISCYEAR in my Cube.In my cube avaiable chars are Calender Year,Calender Year/Month,Calender Year/Quarter,Fiscal Period
    Please let me know if you need any information.
    Waiting for replies,
    Thanks & Regards,
    Praveen.K

  • SapExit for Current month

    Hi,
    We have a scenario where we run the query monthly, expectation is the query should automatically default to using the current month. So do we have any sap exit for current month.
    Regards,
    Ravi

    Hello Please refer the following code
    MTD / MTM(For current default Month)
    Variable: ZP_X_09 For enetered month (on 0CALMONTH)
    For current Month by default or for any given Month (For full month)
    e.g. If current month/given month is 15.08.2009. It will give Aug-09.(200908)
      WHEN 'ZP_X_09'.
        IF i_step = 1.
          w_fm_month = sy-datum.
          CLEAR l_s_range.
          l_s_range-low    = w_fm_month.
          l_s_range-sign   = 'I'.
          l_s_range-opt    = 'EQ'.
          APPEND l_s_range TO e_t_range.
          CLEAR : w_fm_month.
        ENDIF.
        IF i_step = 2.
          LOOP AT i_t_var_range INTO loc_var_range
            WHERE vnam = 'ZP_X_09'.
            CLEAR l_s_range.
            l_s_range-low    = loc_var_range-low.
            l_s_range-sign   = 'I'.
            l_s_range-opt    = 'EQ'.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
          CLEAR : w_fm_month.
        ENDIF.
    Regards,
    Krunalkumar Rathod

  • Sales report for current month and year a go month

    i could you please guide me builting report for current monthwise for current month and year a ago month
    report parameter month_year='06-2010'
    tables = sales and below are the table fields
    customer_id
    invoice_dt
    invoice_am
    thanks
    nhm

    Okay, Still you did not mention how you will pass value in report while generating.
    Anyway the query with UNION ALL will work. For Example.
    I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
    SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
    FROM
    SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
    FROM sales
    WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE  -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
    AND  -- Any Condition goes here...
    GROUP BY customer_id
    UNION ALL
    SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
    FROM sales
    WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
    AND -- Any condition goes here...
    GROUP BY customer_id
    GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
    -Ammad
    Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
    added GROUP BY

  • Parameter for Current Month and Previous Month

    I'm trying to create a parameter for current month and previous month based on the ex_date, but not sure what i'm doing wrong. 
    where ex_date = @SelectDate
    I created a second dataset below for the values in the parameters.
    SELECT Month(CURRENT_TIMESTAMP) AS 'Month', 'Current Month' as 'Current Month'
    union all
    SELECT Month(CURRENT_TIMESTAMP)-1 AS Month, 'Previous Month' as 'Previous Month'
    Results
    Month Current Month
    3 Current Month
    2 Previous Month
    Once I preview it I get "Conversion failed when converting date and/ or time from character string" I changed the data type to "date/Time" but that did not make a difference. The date is convert (varchar(10), ex_date, 101) so looks like
    11/12/2014. 
    I've also tried expressions like =month(now()) to pull current month with same error so i'm not sure what i'm doing wrong. Any ideas?

    i tired this real simple report
     in the first dataset - my main report query - select name from sysdatabases where month(crdate())=@month
    in the second dataset - select month(getdate()) as Month1
    in the parameters - choose int data type and available values - select the second data set
    in the first data set- add this parameter..( i am assumming you know this, since you have done)
    in the preview you should get the drop down with current month number - 3
    and if you run the report, it will display the database names that were created in march. remember we are no checking year, so will get all that were created in march across the years.
    Hope it Helps!!
    I'm looking to have the dropdown say "Previous Month" and "Current Month" as a option. I know how to get the information in SQL, but not sure how this translates or put into a parameter.
    Current Month
    list_date BETWEEN
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
    AND
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
    Previous Month
    list_date between
    CONVERT(varchar,dateadd(d,-(day(dateadd(m,-1,getdate()-2))),dateadd(m,-1,getdate()-1)),106) /* Last Month */
    and
    CONVERT(varchar,dateadd(d,-(day(getdate())),getdate()),106)

  • Report for getting an oppotunity for current month

    Please tell what can be a filter or function for getting an oppotunity for current month , i have the field as "Opportunity created date" so what function or SQL expression can b eused to get created date = current month's date

    Thanks..i'll do taht
    Edited by: user1074008 on Sep 28, 2010 3:11 AM

  • Can i add data for current month only

    can I add data for current month only?

        Knowing your plan options is important marlingut! So that we are able to provide correct information, what make and model phone are you trying to add data too? Is this device already activated on your account?
    Thank You,
    MichelleL_VZW
    VZW Support
    Follow us on Twitter @VZWSUPPORT

  • Showing Calendar for Current Month

    Dear Forum,
    I intend to display calendar in corner region of my home page for current month, and also want to highlight dates in calendar based on certain parameter or query output.
    How should i accomplish this in HTMLDB?
    Regards,
    Manpreet Johal

    Sir,
    Please answer to this problem asap.
    Regards,
    Manpreet Johal

  • Customer Exit Variable on Cal Year/Month Error

    Hi Experts
    My requirment is to develop a Restricted Keyfigure...
    The restriction is based on 0Calmonth (Calendar Year/Month)
    The sales from beginning of calendar year up to last "closed" month in a Calendar.
    Ex: in June i want to see 01.01.2009 to 31.05.2009 data.
    in October i want to see 01.01.2009 to 30.09.2009 data.
    When user execute the report
    in Jan 2010 i want to see 0 as there is no closed month in that particular year.
    in Fed 2010 i want to see 01.01.2010 to 31.01.2010 data.
    For that purpose i created a variable
    Customer Exit on calendar Year/Month
    Variable represents : Interval
    Variable is : Mandatory
    Variable is Ready for Input (Uncheck)
    in CMOD...i had written The below Code
    WHEN 'ZYCCM' . "Current Year Culm. to Last Closed Month
    DATA :Month(2) type c,
    Start_Month like rsd_c_timnm-calmonth,
    End_Month like rsd_c_timnm-calmonth.
    Month = sy-datum+4(2).
    if Month = '01'.
    Start_Month = '000000'.
    End_Month = '000000'.
    Else.
    concatenate sy-datum(4)'01' into Start_Month.
    End_Month = sy-datum(6) - 1.
    Endif.
    CLEAR L_S_RANGE.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    L_S_RANGE-LOW = Start_Month.
    L_S_RANGE-HIGH = End_Month.
    When i execute the report i am getting an error
    "No Value Could be determined for Variable ZYCCM"
    Please update what went wrong and how to Correct error

    Hi
    Thanks for the update..
    Modified code as below
    WHEN 'ZYCCM' . "Current Year Culm. to Last Closed Month
    DATA :Month(2) type c,
    Start_Month like rsd_c_timnm-calmonth,
    End_Month like rsd_c_timnm-calmonth.
    Month = sy-datum+4(2).
    if Month = '01'.
    Start_Month = '000000'.
    End_Month = '000000'.
    Else.
    concatenate sy-datum(4)'01' into Start_Month.
    End_Month = sy-datum(6) - 1.
    Endif.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = Start_Month.
    L_S_RANGE-HIGH = End_Month.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND l_s_range TO e_t_range.
    But when i executed the report....the report is executed sucessfully but the restriction applied to only Jan 2009
    When i saw the KF definition in RSRT 
    I EQ JAN 2009
    I am expecting
    BT JAN2009 APRIL2009
    Please help
    Tahnks

  • Get data for current month in VC from query - Urgent

    Hi all,
    I have designed a query for cube FIAR_C03 for overdue items and query output contains customer, net due date, document date, fiscal year period and amount. I want a chart for that query in VC that only contains those items in which net due date is in current month. How can i do that?
    Where I can place the condition to display only those items in vc in which net due date is in current month and how ?
    Please respond.
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    Hi Aisha,
    It is possible to do with following steps:
    1. In Query Design make your field 'Net Due' filter with variable for date input (0CALMONTH for example where your date should be this format MMYYYY). Test your query and see if you input a month/year date it would would work;
    2. Build one table from output of your query (choose fields);
    3. In Visual Composer, drag your query into your board and from 'Varaiables' port  (NOT FROM INPUT) drag a line to create a Start point. As soon you realease to create 'Start' a box will ask which fields you want. Choose your date as field;
    4. Select the line between Start point a query. In Input Field assigned the following formula (DSTR(NOW(),'MMYYYY') *
    5. Deploy your model
    at this formula I said: transform NOW(), current date, in Text with format MMYYYY (012002 for example).
    It works!
    Assigned points if was helpful.
    Kind Regards,
    Gilson Teixeira

  • Customer exit not working for variable

    hi ,  i have created the variable with customer exit,options for variable are optional and ready for input checked.when in debugging mode the value in exit i_vnam is having value of the variable but in the second time it dont have.so i cannot go the code after user inputs data. please solve.

    Hi vijay pilli,
    Custome exit means  by writing code you have to populate the value by specifying a value directly or from the user input.
    for example :
    when ever user runs the report he need to see only for that current year sales revenue.So, for this create a variable for 0calyear > customer exit> clear the ready for input>
    here based on sy-datum we will get the current year.
    when variable
    l_s_range-low = Sy-datum+0(4).
    l_s_range-sign = I.
    L_S_RANGE-OPT = EQ
    Append L_S_RANGE TO E_T_RANGE.
    Regards
    Sree

  • Customer Exit or BADI for PP61 (Shift Planning) for Saving action

    I have a requirement to enhance PP61 (shift planning). First of all this program accepts any update of attendance for values before than current date, i think it should not happen by default.  Thus we have to disable editing or display an error message when any user updates values for previous dates than today. I tried HRBAS00INFTY Badi but didn't get solution. Please give any Customer Exit or BADI name for this purpose.

    i have tried BADI - HRPAD00INFTY but it does not have sufficient parameters for this requirement. And i don't understand EXIT_SAPFP50M_001 or 002 use...can you expalin me how it will help out my problem?

  • How to write customer exit code to get current user as default in variable

    Hi guys,
           I design a query which has a variable called var_employee , I also set some default values for this variable in query designer. But I would like to set the current user account who logon on (who execute the query) in the dropdownlist as default user when the variable selection screen appear. of course after that he can choose other avaiable value.
          I look up some related threads, all says that this need some customer exit code, and they mention to use CMOD to create the customer exit , but I don't know the detail process, as I am pretty new on this.
         The attribute of the var_employee  variable is :  employee(defined info object by myself) characterstic value, customer exit.
         Can somebody show me the process to create the customer exit, and the apap code in detail if possbile. then I can try.
          Thanks a lot in advance.
    Best Regards,
    Ben

    Hi,
    Please have a look at:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d
    Krzys

  • Customer exit or BAPI for Loan Calculation repay

    hi All,
    I need to calculate the company loan repayments in a different way (which is out of the standard), Please let me know which customer exit or BAPI can make this possible.
    Scenario:
    Principal Amt = Rs. 10,000
    Interest rate = 8%
    Yearly Interest = 10,000 * 8% = 800
    Monthly Interest = (10,000 * 8%)/ 12 (months) = Rs. 66.67
    Now, if an Employee is asking for a 6 month period to pay-off the loan then the calculation will be :-
    Principal Instalment = Rs. 10,000 / 6 (months) = Rs. 1667
    Interest Instalment = Rs. 66.67 * 6 = Rs. 400
    Total Instalment to be paid each month = Rs. 1667 + Rs. 400 = Rs. 2067.
    Thanks in Advance
    Amol
    Edited by: Amolkumar Patil on Sep 17, 2010 11:38 AM

    Check the table V_506P_B with Interval option.
    If you are using payment type Loan Pament( Payroll)...check the table V_506P_B ..if you select Interval...... If you set this indicator for a payment type, the system also shows the column End Date in the Loans infotype (0045) on the Payments tab page. For the payment that you have specified with this payment type, this field End Date is ready for input. This means you can specify a start and end date for these payments. Within this interval system processes such a payment in each payroll period in the standard system.
    Mohan

  • Mobile Email not retrieving messages for current month

    I did a couple of quick searches on this problem, but I couldn't find any information if this is a known bug with the Mobile Email application.  For the last week or so, whenever I access Mobile Email on my LG enV Touch, the first page of emails shown are for the previous month, but the same day of the month (so today is August 16th, 2010, and the newest messages I can access are from July 16, 2010).  There is no software update available.  From the application's info page it seems like my version is 3.1.3.2.
    Also, the email address that is being accessed is for an @comcast.net account, but this setup has been working fine for over a year now, until this issue came up. When I access this account elsewhere, it does show messages for the current day, like normal.
    Has anybody seen a problem like this?  Any suggestions for next step on looking into this?
    Thank you.
    - Wes

    I do apologize that you are not able to retrieve any of the current months emails.from your device.However you may need to re download the mobile email application in order to get the emails to start coming through. Here are some steps to downloading the mobile email application from  your device. Hope this helps!
    From the main screen, select Menu.
    Select Media Center (Get It Now).
    Select Browse & Download (Tools on the Go).
    Select Get New Applications.
    Select Mobile Email.
    Select the purchase option.
    If prompted, select Yes to start the download.
    Select Yes.
    To continue the installation, review the Terms of Use, then select Accept.
    Select the desired email provider, then choose Select.
    If prompted, review the Terms of Use for the email provider, then select Accept.
    Enter the username and password, then select Sign In.
     Username and password are case sensitive

Maybe you are looking for

  • Default values for

    Hi, I am trying to load a datafile to a table using SQL*loader, how can I assign the default values for a coulmn in control file of sql loader, here are datafile and target table i am using datafile empid,empname,empdept 1001,clark,123 1002,Mike,123

  • How I make a boot disk

    Hello. I'm an absolut Linux beginner and I tried to install archlinux on an external HDD, because my internal windows drives are dynamic logical Volumes and this doesn't work with Linux. After the installation from the CD I noticed that I cannopt boo

  • Probably a noob question...swatches palette

    Hi all, I work for a magazine publisher and I have an ad that was originally a PDF from a client. They needed some changes made to text and other elements so I opened it in Illustrator CS4 and did most of the changes. However there are some spot colo

  • Restoring a new ipod touch to icloud

    hi, I am trying to restore a new ipod touch to icloud & it seems to have frozen, is it busted? what can i do to fix it?

  • Firefox won't download files

    Long story, short version: Problem is a progression from bad to worse. Firefox 33.3 won't download or save files (images, web pages, etc.). File picker doesn't open/ can't browse folders, etc. Tried troubleshooting including: reset firefox, safe mode