How to create a customer-exit to calculate a week from a date

Hi my Guru's,
I actually try to implement an Exit variable to calculate a week number from a characteristic date (0FINISHDATE) in my BEX report. Does anyone has an example of customer-exit which calculate a week number after giving a date in the popup.
What I really need is how to initialize the OFINISHDATE value in my Exit.
Any help will be appreciate,
Cheers,
MK2

Hi,
I  donot know this following workaround works properly are not. we have to wait for Our BW gurus' suggestions.
1) Create a formula variable with 'Replacement path' as processing type on Characterstic 0FINISHDATE.
2) Create one more Formula variable with 'customer exit' as processing type .
3) In Cmod
DATA: l_s_range type rsr_s_rangesid.
DATA: datein like sy-datum. "la caractéristique date
DATA: date2 like SCAL-WEEK. " déclaration de Résultat
DATA : NUMB1(2) TYPE N.
CASE i_vnam.
when 'FORMULA_VARIABLE2'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'FORMULA_VARIABLE1'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW(8) = LOC_VAR_RANGE-LOW(8)
datein(8)  = L_S_RANGE-LOW(8).
here we are finding the Week no user entered date.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = datein
IMPORTING
WEEK = date2.
numb1 = date2+4(2)
CLEAR L_S_RANGE.
L_S_RANGE-LOW  = numb1.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT  = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDCASE.
With rgds,
Anil Kumar Sharma .P
Message was edited by: Anil Kumar Sharma

Similar Messages

  • HOW TO CREATE A CUSTOMER EXIT VARIABLE

    <Moderator Message: use lower case letters next time, we don't want you to shout. --> see rules of engagement>
    hi,
          How to create a customer exit variable..!
    in a query designer i  have created the customer exit variable ,in the cmod i have created the project
    for the exit rsap0001 and kept the break-point....but when i executing the query via BEX-Analyzer
    where control not stoping in the break-point..
    can any one help me ..what is the approch i need to do.because i new to BI..
    Regards,
    shahina.....!
    Edited by: Siegfried Szameitat on Dec 17, 2008 10:37 AM

    Hi Shahina,
    1. Create formula variable var1 from to date using replacement path.
    2. Create another formula variable var2 for current date using customer exit or you can use standard
    formula variable for current date
    3. Create calculate key figure ckf using var1 & var2.
    ckf = var1 - var2.
    Thanks == points
    Regards
    Sudheer
    Edited by: SUDHEER on Dec 17, 2008 10:41 AM

  • Regarding Customer exit to calculate fiscal week

    Hello All,
                 I have a requirement to calculate the fiscal week from fiscal period. Here i used the FM 'UMC_FISCPER_TO_CALWEEK' to calculate the fiscal week. But the problem here is i created variable on fiscal year /week so when i pass the fiscal period i should get fiscal week, here i am getting calweek which make no sence. Is there any function module to calculate the Fiscal week if we pass fiscal period.
    Thanx in Advance
    Anil

    We cant calculate fiscal week from just fiscal period. we need date or this.
    You can try this function  ZFI_GET_FISCAL_WEEK_QUARTER or some other similar function. However, the input should be a date.
    Looks like there is no funciton to calculate fiscal week. we may need to write our own code for this based on other FMs.
    Re: Get Week number in a particular Fiscal year
    ~ Arun KK
    Edited by: arun kk on May 8, 2008 10:22 AM

  • BI Routnie in DTP to calculate current week from current date

    Hello Team
    I want to write routinue to calculate current week based on date
    For eg, this week is
    201410, so the routine will get 201410 based on today’s date 4 Mar 2014.
    Can any1 please help
    Regards,
    Ankit

    I had written following code its giving error like
    E:Field "/BI0/9AVERSION" is unknown. It is neither in one of the
    specified tables nor defined by a "DATA" statement. "DATA" statement.
      data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = '/BI0/9AVERSION '.
      l_idx = sy-tabix.
    Data: Date Like scal-date.
    Data: week like scal-week.
    call function 'DATE_GET_WEEK'
    exporting
    date = sy-datum
    importing
    week = SOURCE_FIELDS-/BI0/9AVERSION
    exceptions
    date_invalid = 1
    others = 2.
    * Return code <> 0 means skip whole data package !!!
    returncode = 0.

  • How to create a custom Contacts list in SharePoint 2010 from accounts already in AD

    Hi folks,
    Newbie to SharePoint but not to being an Administrator.  Problem is that in my new functions I no longer am an Admin.
    I have been asked to post contact lists (Excel) on the SharePoint site.  (fairly easy to do)
    But I though....we already have these people in AD and the GAL
    Why can't I just import what I want only and display that in SharePoint.
    I assume this is possible?
    I do not have SharePoint designer nor any programming experience....so no coding for me.
    Running SharePoint 2010 and Outlook 2010
    Can anyone guide me or give me info on how to do this?
    I do not want everyone in the AD/GAL.  Just some specific names with their contact info

    Hi,
    Please check this
    http://beyondweblogs.com/update-user-profile-in-sharepoint-programmatically/

  • How to create a custom Button in a SNP planning book

    Hi Experts,
    I created my own Planning Book and Dataview in SNP with 3 Key Figures: KF1, KF2, KF3. Now I want to create one my own button with Macro so that when I press that button, the Macro will run to calculate: KF3 = KF1 + KF2.
    I know that I can drag this Macro to one of default events like: Default, Level Change, Start. But actually, I want to create my own button so that I can handle the event as I want.
    My question are:
    1. How to create a custom button on the toolbar of SNP Planning book and writing macro for the button?
    2. Please give me any document, material teaching about writing macro and relating to my above scenario.
    Thanks very much!
    Duyennx
    Edited by: xuanduyen on Sep 6, 2011 9:20 AM

    Hi,
    Access the transaction "/n/sapapo/advm". In the list select your planning book/ data view and click 'Start Macro Builder' button.
    In the Macro builder screen, drag and drop your macro from Macro depot to the work area.
    Right click on your macro name and select 'properties'. In the pop up, next to the Assigned Push button field, there is a button 'Choose'. Click that. It will display all the available icons. In standard system, it displays more than 1000 icon. Choose any one icon which is suitable for your macro function. Close the pop up and save the macro. This will assign a push button to your macro.
    In the Planning book tool bar, you can see the selected icon in the header tool bar. Just by clicking that icon, you can execute the macro interactively.
    And I don't know whether we can include/design our own icon. But there are already 1000+ standard icons to choose.
    Regards,
    Manimaran M.

  • HOW TO CREATE A USER-EXIT FOR MB31 GOODS RECEIPT

    Hy,
    <b>HOW TO CREATE A USER-EXIT FOR MB31</b>
    TO COMPARE ORDER QTY CONFIRMED AND GOODS RECEIPT QTY
    ( IF GR QTY GREATER THAN CONFIRMED QTY ERROR MESSAGE SHOULD COME AND NOT ALLOW TRANSCATION TO PROCEED).
    POINTS CONFIRMED.
    REGARDS,
    KARTIKEY.

    Hi Rawat,
       You Don't need to create User Exits,but you need to find user Exits.Below are list of user Exits for MB31.
    Use proper exit as per your requirement.
    Exit Name     Description
    MBCF0002     Customer function exit: Segment text in material doc. item
    MBCF0005     Material document item for goods receipt/issue slip
    MBCF0006     Customer function for WBS element
    MBCF0007     Customer function exit: Updating a reservation
    MBCF0009     Filling the storage location field
    MBCF0010     Customer exit: Create reservation BAPI_RESERVATION_CREATE1
    MBCF0011     Read from RESB and RKPF for print list in  MB26
    MB_CF001     Customer Function Exit in the Case of Updating a Mat. Doc.
    award points if ans is useful.
    Regards,
    Albert

  • How to Include in Customer Exit to select max of the date

    Hi,
    Every Employee will have a health Insurance Policy which is valid for 6 six months.
    From Source System i am getting
    Employee and his policy Start date,Based on Policy Start Date in Transformations i am calculacting the Policy Expiry date (Policy Start date + 6 Months)(Ex:If Policy Start Date is 01/Nov/2007 then Exp date is 01/May/2008)
    My report is to Show employees who doesn't had a valid policy on the day report executed (Sys Date)
    For that i created a Customer Exit Variable on Policy Expiry Date
    (If Policy Expiry date is < Sys Date)
    IF i_step = 2.
          CLEAR l_s_range.
          l_s_range-low = sy-datum.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'LT'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    Problem:
    Data in the cube
    Employee--Policy Start date-Policy Expiry Date
    1--01/01/2008-----30/06/2008
    1--01/07/2007-----31/12/2007
    1--01/01/2007-----30/06/2007
    When i execute the report i should expect the Emp 1 shouldn't be displayed as he had valid policy which is going to expir in June 2008....but the above exit is displaying the below 2 records
    Can i include any changes in the above exit that will select the Max Policy Expire date and then it will check with the Sys Date
    Please update me on how to proceed
    Thanks

    Hi thomos,
    Thanks for the update
    Bit Confused.....could you please explain me
    "Your variable (intervall) should be based on the Policy Expiry Date
    l_s_range-low = '10000101'.
    l_s_range-high = 'sy-datum - 1.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'
    How this is going to solve my problem....
    As i got 3 records on a employee one of which got expiry date greater tha sys date
    Thans

  • How to assign a Customer exit variable to Key figure

    Hi,
    I have created a Customer Exit variable to findout no. of days in the month. 
    But I dont know how to assign that variable to a Keyfigure value.  Can you please let me know how to assign it.
    Regards
    Sankar

    Hi Sankar,
    From what I could understand, you want to display the output of that key figure for some no. of days of a month (calculated in your customer exit variable)...right ???
    If that is the case then you can create a structure in columns. Create a new selection...include your key figure and that customer exit variable in it.
    That shall serve the purpose.
    Regards
    Shalabh Jain
    Edited by: Shalabh Jain on Dec 15, 2008 1:46 PM

  • How to use a customer exit in WebI

    Hi expert,
    I read from official SAP document that customer exit variable are supported within WebI query.
    I created an universe based on a query bex. In this query I use a variable exit for 0calmonth2.
    Within the WebI universe I don't see any variable.
    How can I use/build a customer exit variable in my WebI query?
    System feature: BO 3.1
    Many Thanks.
    Claudia

    Hi,
    I havethe same issue, even though I place the user exit variable in Filter section, its not working as expected in WEBI/crystal.
    the variable that i have created will assign default value as sysdate.its working fine BW.
    Are there any extra settings at BEX/BW level which have to be set before using user/sap exit variables in webi/crystal?
    How should the user/customer exit variables be defined in order to get them carried properly to webi or crystal, I mean what should be the properties set for these variables?

  • How to create/use SAP Exit variable of Query designer

    Hello experts,
    Can you please guide me on how to create/use SAP Exit variables ?
    Is there any way we can transport customer exit include in which we write all codes related to customer exit variables?
    Kindly provide your valuable inputs on this.
    Thanks,
    Mitesh

    Hello Gautam,
    I think you should first implement the user-exit via the transaction SMOD/CMOD and the SAP-Enhancement RSR00001 User-Exit ( BW Reporting )
    For the concrete implementation I would suggest to encapsulate the variables, as it is described here
    Easy implementation of BEx-Userexit-Variables
    and here: BEx-Userexits reloaded
    Kind regards,
    Hendrik

  • How to Create the Custom print Quote Report ?

    Hi All,
    I want to create the custom Print Quote report . I know the below details and referred the below metalinks .
    Note: 780722.1 - How to Create a Custom Print Quote Template in Oracle Quoting ?
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=780722.1
    Note: 392728.1 - How to Modify the data source for the XML version of the Print Quote report
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=392728.1
    Note: 468982.1 - How To Customize The Asoprint.Xsl
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=468982.1.
    Oracle Metalink:
    Note: To add a column to the print quote report, following files need to be updated:
    LinesVO.xml --- xml files containing the sql query and attribute definition
    LinesVORowImpl.class - public class extending the framework class OAViewRowImpl.
    This class contains the set and get for the attributes defined in xml file.
    ASOPRINT.xsl - this is the xsl stylesheet file used to describe the report layout.
    This file needs to be modified to include the new column being added to the report
    QUESTION :
    My question is,
    1. wether my approach (below iare the details)of trying to extend the PromptVO is the right way or is there any other way to add the new columns.
    I want to add new fields on to the report . When i looked into the it says the below
    Here we find that to add a new column, oracle says to update the LINESVO.xml, do they really mean to update the base files.
    This report uses following VO's
    PROMPTVO
    HEADERVO,
    LINESVO.
    To create new Headers & Prompts, i tried extending the PROMPTVO. Once the extended VO is substitued , i dont even get the data for standard oracle Prompts. is this the right way to add columns?
    Thanks

    Hi All,
    I want to create the custom Print Quote report . I know the below details and referred the below metalinks .
    Note: 780722.1 - How to Create a Custom Print Quote Template in Oracle Quoting ?
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=780722.1
    Note: 392728.1 - How to Modify the data source for the XML version of the Print Quote report
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=392728.1
    Note: 468982.1 - How To Customize The Asoprint.Xsl
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=468982.1.
    Oracle Metalink:
    Note: To add a column to the print quote report, following files need to be updated:
    LinesVO.xml --- xml files containing the sql query and attribute definition
    LinesVORowImpl.class - public class extending the framework class OAViewRowImpl.
    This class contains the set and get for the attributes defined in xml file.
    ASOPRINT.xsl - this is the xsl stylesheet file used to describe the report layout.
    This file needs to be modified to include the new column being added to the report
    QUESTION :
    My question is,
    1. wether my approach (below iare the details)of trying to extend the PromptVO is the right way or is there any other way to add the new columns.
    I want to add new fields on to the report . When i looked into the it says the below
    Here we find that to add a new column, oracle says to update the LINESVO.xml, do they really mean to update the base files.
    This report uses following VO's
    PROMPTVO
    HEADERVO,
    LINESVO.
    To create new Headers & Prompts, i tried extending the PROMPTVO. Once the extended VO is substitued , i dont even get the data for standard oracle Prompts. is this the right way to add columns?
    Thanks

  • How to create a custom function module with the records in SAP R/3?

    Hi All,
    How to create a custom function module with the records in SAP R/3? Using RFC Adapter I have to fetch the custom function module records.
    Regards
    Sara

    Hi
    goto se37...here u need to create a function group... then u need to create a function module. inside assign import/export parameters. assign tables/exceptions. activate the same. now write ur code within the function module
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
    Look at the below SAP HELP links, These links will show you the way to create a Function Module
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

  • How to create a custom layout set to display the KM folders...

    Could someone please tell me how to create a custom layout set to display the KM folders?
    Thanks,
    Sudha.

    Hi Sudha,
    Please check the following blogs whick will guide you step by step.
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/4123
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3071
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/c91b5610b65b4aa8204d09384d156b/frameset.htm
    If helps reward points
    cheers
    dev

  • How to create a custom task in SRM for the standard task

    Hi Gurus,
    How to create a custom task in SRM for the standard task  eg: TS10407929
    regards,
    George.

    from PFTC itself. Same.

Maybe you are looking for