Q: variable 0CWD / SAP exit program code

hi guys, actually i want to create a variable like 'last work day'. my idea is to look up in the SAP-Exit coding how 0CWD (current workday) is being processed. can someone please give me directions where i should start exploring? programs sth. like the custom user exit, or some special function module? have already spent some time searching. 
any contribution is highly appreciated, THX! Harald

All standard SAP exit variable, have their respective function modules…
For example consider standard variable exit 0P_COAPP.
Then in se37 search for RSVAREXIT_* (* = 0P_COAPP).
Similarly we can search for other relevant standard variables with exit. From the description in the search, you can look for the exit that you want.
Hope this helps.
Awarding points on SDN is a way of saying thanks!
Prakash

Similar Messages

  • Webi  Bypassing BEx Authorization Variable with SAP Exit

    BEx query has Hierarchy Node Variable with Authorization as processing type. Its set as User Input ready
    When the Webi report is refreshed, the LoVs appear as per the Authorization. However, if user doesn't select any value (pushes from right to left in variable screen) he gets NOT_AUTHORIZED error. Which is not intended, it should check the authorization in the background via SAP exit and populate the result. This is how it runs inBEx query.
    However, in Webi it's giving NOT_AUTHORIZED error? This is how the product is designed to work or is it a bug.
    I see several forum threads and SAP KBAs/notes but they are not answering my question. Could anyone please help.
    I am ready to provide more details on this error.
    Thanks,
    Tilak

    Hi,
    this is how authorization variable would work in any of the clients and not just Web Intelligence.
    You created an authorization variable which is configured as "read for input", so the user is getting prompted.
    So In Web Intelligence the LoV shows up.
    if the user does not select a value, then you are not sending a value, so you basically asking for all data and you are not allowed to see all data and therefore you are getting the message "no authorization".
    if you are making authorization variables as ready for input then the user needs to select the proper values - regardless of the BI tool.
    if you want the authorization to be check in the background then the authorization variable should be configured to not have ready for input.
    regards
    Ingo Hilgefort

  • Formula Variable with customer Exit (ABAP Code)

    Hi Experts,
    Please advise me wether i am going in the right way to achieve my requirment else please advise me any alternate approach and update me with the abap code for my customer exit as i am not familiar with ABAP.
    My Requirment:
    Data :
    Emp_ID----Start_Date(DATS)---End_Date(DATS)
    I had a user entry (intreval) VARIABLE created on Start_Date
    User will enter the date intreval he want to analyze...
    Ex: 01.01.2008 to 01.02.2008
    Now i want to use the No of Days between user entered date intreval in my calculaction of a keyfigure
    In the above example it is 31 days
    So i created a Formula Variable of Customer Exit now i need a code that will
    pass the user entered dates to
    FM: FIMA_DAYS_AND_MONTHS_AND_YEARSImport parameters Value
    I_DATE_FROM 01.01.2008
    I_DATE_TO 01.02.2008
    I_FLG_SEPARATE ' '
    Export parameters Value
    E_DAYS 31
    E_MONTHS 1
    E_YEARS 1
    and need to pass the E_DAYS (31) to the result of formula
    User Entry Variable (Intreval) : ZST_VAR
    Formula Variable (Customer Exit) : ZND_EXIT
    Code
    WHEN 'ZND_EXIT'.
        DATA: low_date2 TYPE d,
        high_date2 TYPE d,
        num_days TYPE N,
        new_low_date2 TYPE d.
        IF i_step = 2.
          LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
            CLEAR l_s_range.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            ls_varrange-low = low_date2.
            ls_varrange-high = high_date2.
    CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      EXPORTING
        I_DATE_FROM          = low_date2
        I_DATE_TO            = high_date2
        I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = NUM_DAYS
      l_s_range = NUM_DAYS.
      APPEND l_s_range TO e_t_range.
      EXIT.
      ENDLOOP.
      endif.

    Hello,
    Before the WHEN statement it shoud have a CASE statement. In the user exit coding place your WHEN statement anywhere between CASE...ENDCASE statement.
    your code should look like
    DATA: low_date2 TYPE d,
    high_date2 TYPE d,
    num_days TYPE N,
    new_low_date2 TYPE d.
    Case i_vnam.
    WHEN 'ZND_EXIT'.
    IF i_step = 2.
    LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
    CLEAR l_s_range.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    low_date2 = ls_varrange-low.
    high_date2 = ls_varrange-high.
    CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    EXPORTING
    I_DATE_FROM = low_date2
    I_DATE_TO = high_date2
    I_FLG_SEPARATE = ' '
    IMPORTING
    E_DAYS = NUM_DAYS
    l_s_range-low = NUM_DAYS.
    APPEND l_s_range TO e_t_range.
    EXIT.
    ENDLOOP.
    endcase.
    Thanks
    Chandran

  • Current Year Formula Variable with SAP-Exit

    Hi Experts ,
    Is there any SAP Exit Formula Variable avaliable that we can use in BEX which gives us the Current Calander Year?
    I am able to find the current fiscal period ie "0F_CUFPE" which provides the current posting period/month.
    On similar basis, I need a FV which provides me the Current Calender Year.
    Please note that I do not need Characteristic Variables for Fiscal Year .
    Regards
    Dipali

    Hi,
    If you're refering to the InfoObject 0CALYEAR, there is an exit variable available called: 0CYEAR - Current Calendar year
    Which will filter on the current year.
    br
    Mikael

  • Text Variable With Customer Exit ABAP Code

    Hi Experts,
    Could you please help me with the Logic/Code that i need to use in Calculacting The TEXT Variable Using CUSTOMER EXIT
    I had a rolling report in which there are 14 Calculacted Keyfigures (Not Restricted KF),Which are
    M-1,M-2,M-3,M-4,M-5........M-14
    My requirment is to get the MMM.YYYY based on Sy Date as a title of the column
    In MAY2009
    M-1 represents (Current Month -1) APR2009
    M-2 represents (Current Month -2) MAR2009
    M-3 represents (Current Month -3) FEB2009
    M-4 represents (Current Month -4) JAN2009
    M-5 represents (Current Month -5) DEC2008
    M-6 represents (Current Month -6) NOV2008
    M-7 represents (Current Month -7) OCT2008
    M-13 represents (Current Month -13) APR2008
    M-14 represents (Current Month -14) MAR2008
    In JUNE2009
    M-1 represents (Current Month -1) MAY2009
    M-2 represents (Current Month -2) APR2009
    M-3 represents (Current Month -3) MAR2009
    M-4 represents (Current Month -4) FEB2009
    M-5 represents (Current Month -5) JAN2009
    M-6 represents (Current Month -6) DEC2008
    M-7 represents (Current Month -7) NOV2008
    M-13 represents (Current Month -13) MAY2008
    M-14 represents (Current Month -14) APR2008
    Currently the Description of CKF is named as M-1,M-2..M-14.My requirment is to develop Text Variables that displays the description as MMMYYYY

    Amrit I think u72720 wanted to know how to get MMYYYY in the column headings.
    this can be achieved using text variable easily.
    steps
    1. Right click and go to properties and click the button next to description box.
    2. Add any existing text var from the list
    3. now right click on this var in the desription box and select 'new variable'
    4. give var name description
       processing type ->replacement path
       replace with char-> fiscal period (or calmonth if that is what restricted in your column)
       select value as 'Key'
    finish creation and use this var in all the selection column headings (remove M-1, M-2 etc)
    you will get mmyyyy decriptions for every column depending on month of that column

  • SAP Script Program Code

    Hello,
    I want to write a patch of code in SAP SCript which will fetch multiple lines of data(no of lines fetch is unknown). How can I do it? I tried Perform Endperform but it had limit to the varibales it can send back. I don't know the line items(values) it will return.
    i cannot modify print program? How can I do it?
    Thanks,
    Amol..

    If you do not want to modify the standard program and achive to display you can use sub-routine calls... firstly, you should identify the element that is displaying the line items and use your sub-routine call inside that element and display all the required fields.
    Note: you there is no element which call for line items, I guess there is no other alternative then modifying the driver program.
    Regards,
    SaiRam

  • How to Find Code for SAP Exit variables.....

    Gurus:
    The SAP Business Content Query "0FIAR_C03_Q0005" uses several BC variables of 'SAP Exit' type for determining "Date" values. I would like to see the code used in these variables. Can anyone please suggest how I can find it?
    For examople, the variable on Posting Date is "0P_KEYD2". What is the ABAP code for this? Please give me the Steps..!
    Thanks in Advance......PB

    Generally SAP doesn't give access to the code behind SAP exit variables, but you can find what the variable is doing using help documentation. Here is some info i saw on SAP help for your variable
    0CWD Current workday
    0DAT Current calendar day
    0P_KEYDT Key date of due date
    0P_KEYD2 Key date of posting (from key date of due date)
    0P_KEYD3 Key date of clearing (from key date of due date)
    0P_KEYD4 Key date of posting (posting date)
    0P_KEYD5 Key date of clearing (from key date of posting)

  • SAP Exit Variables changes using FM RREX_VARIABLE_EXIT

    Hi BW Group:
                I am trying to made some modifications on Dates fields and for that I created variables as SAP Exit.
    In the code of the standard FM RREX_VARIABLE_EXIT appear a part to include the code for the new variables as RSVAREXIT_XXX_YYY.
    Does any one in the group use a SAP Exit variable before? Do you need to code in this FM?
    Thanks in advance.
                      Norge

    Hi,
      Please chk this URL , hope it may help u .
    http://help.sap.com/saphelp_bw21c/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/content.htm

  • Find SAP Exit code for Variable '0CMONTH '

    I am trying to fnd the SAP exit code for variable 0CMONTH so I can create a customer copy and make the variable 'ready for input'. Any ideas where I can find the code or a simple way to effectviely copy the delivered variable.
    I have tried looking in SE37 and then RSVAREXIT* but cannot seem to find the specific code I need.
    Thanks
    Steve

    Hi,
    Search the technical name for the variable in metadata repository and try to find the program where it is declared.  Then i hope u can go the code where it is written.
    Cheers.
    Ranga.

  • How to see the ABAP Code behind SAP Exit Variables.

    Hi Everyone.
    I was wondering if anyone could help me with the steps to see the ABAP Code behind a SAP Exit Variable.
    Sometime back I remember of going to Transaction SE37 - Function Module and give the Variable name,
    Eg: 0F_ADAY, Hit F4 or something like that and was able to see the ABAP Code/Function Module/Exit written for that Variable.same
    But today I tried to do the same thing to see the code for Variable 0P_FVAEX but I was NOT able to see it.
    I think I am missing something.
    Can someone help me recollect what I am missing.
    Thank You for your time
    NOVICE

    Hi bi novice,
    big sorry for the late reply!
    The following variables are defined in function module RREX_VARIABLE_EXIT as case statement:
    '0CMONTH', '0CWEEK', '0CYEAR', '0CQUART', '0DAT', '0CWD', '0FYEAR', '0FPER', '0FYTCFP',
    '0FYTLFP', '0FYTCD', '0CYTCM', '0CYTLM', '0CYTCD', '0LYTCLD', '0CMONTHT', '0CWEEKT', '0CYEART', '0CQUARTT', '0DATT', '0FYEART', '0FPERT'
    Best regards,
    Andreas

  • Abap code for sap exit variables?

    Hi,
    i) Where can I find the abap code for SAP exit variables
    OP_KEYDT used for the net due date
    OP_KEYD2 used for the posting date
    OP_KEYD3 used for the clearing date, which are used in FI AR aging report(0FIAR_C03).
    Based on the Net Due Date, which  is key date(0NETDUEDATE),  entered by the user at runtime, the posting date and celaring date are populated.
    II) The problem is we want to simulate a similar scenario, but with key date, which user enters is based on the custom  Net Due Date(ZNETDUEDATE).And this date is populated to posting date and  clearing date variables.
    How do we acheive that.
    Thanks.

    Please tell how u solved ur issue i have the same scenario to be do.

  • Where to find code of SAP-exit variables?

    Hi all,
    SAP is delivering SAP-exit variables like 0P_PPER3 (Last fiscal period) and so on.
    I'm wondering where to find the code of these kind of exits.
    As these are not part of enhancement assignment RSR00001 and then in the include ZXRSRU01 where the customer exit variables are maintained.
    Kind regards, Harjan

    Hi,
    These variables are not exactly the variables which use any particular coding. These are variables that use predefined replacement paths to derive the values. Please see the below documentation for same.
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a5702e09411d2acb90000e829fbfe/content.htm

  • Current Workday SAP EXIT variable not aligned with correct work days

    Hello,
    I am trying to use the Current Workday variable within a report so that the data will only be refreshed when the calendar day is Monday - Friday. Users look at this report every day, but when they get the report on Monday we would like for the date to be restricted to the previous Friday, and then switch back to Monday's date when they view the report on Tuesday. In order to do this we have placed the Current Workday variable from the Calendar Date characteristic with an offset of negative 1, but it is showing Sunday's date when they look at the report on Monday.
    My questions are:
    -Does this variable use the factory calendar that can define the work days?
    -If so, which Factory calendar does it use? I have gone to the Tcode SCAL but I can see there are many different factory calendars and I have no idea which calendar this variable pertains to. I have also transferred the global settings for the factory calendar from the source system, and I see no change within the variable.
    -How can I see the program name behind this SAP Exit variable? My thinking is that I could at least look at the code to see if perhaps I can find out the factory calendar ID the variable refers to from there.
    Any help on this would be greatly appreciated! Until this is fixed I have to manually adjust this report every Monday and Tuesday morning!! Not ideal.

    Hi Kelly,
    I am not sure whether this can be done by an SAP Exit variable.
    But you may try this using a Customer exit variable by using the Function module DATE_COMPUTE_DAY.
    The function module "DATE_COMPUTE_DAY" will return the day by 1 to 7 when you input date.
    Monday : System will return value = 1
    Tuesday : System will return value = 2
    Wednesday : System will return value = 3
    Thursday : System will return value = 4
    Friday : System will return value = 5
    Saturday : System will return value = 6
    Sunday : System will return value = 7
    So input sy-datum to this FM and find the number of day. If it is Monday, the number will be 1.
    If output is 1, then offset date by -3 to that of Friday, else offset by -1 to previous day.
    Hope this helps,
    Regards,
    Hari

  • Customer Exit Variable in SAP BI

    Hi to all,
    Please can any body tell me , What is Customer Exit Variable in SAP BI , how to use it , why we use it.
    please also sned any website link , or any PDF or DOC file that have example to explain Customer Exit Variable in SAP BI.
    I shall be thankfull to you for this.
    Regards
    PAVNEET RANA

    Hi,
    Customer Exit Variable in SAP BI : is used to calculata MTD,YTD, and some other calculations.
    You can define variables with Customer Exits and then write code in CMOD. See the Article/Blogs in the same
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    CHeck the Following Articles.
    Customer Exit Variables in BW/BI Reports
    Using Customer Exit Variables in BW or BI Reports Part - 1
    https://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.pdf
    How to use Customer Exit Variables in BW Reports: Part - 2
    https://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.pdf
    Using Customer Exit Variables in BW/BI Reports Part - 3
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10fc4382-afa6-2c10-1380-fa224fe4324f&overridelayout=true
    Using Customer Exit Variables in BW/BI Reports: Part - 4
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0fefc77-40e3-2c10-8da3-d4bfcb013387?quicklink=index&overridelayout=true 
    Calculating the Ageing of the Materials
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/a-c/calculating%20the%20ageing%20of%20the%20materials.pdf
    Thanks
    Reddy

  • Variable required for 0DOC_DATE, same as the SAP exit variable 0P_KEYDT

    Hi Gurus,
    I am currently trying to create a query based upon the InfoProvider -  FIAP: Line Item (0FIAP_C03).
    For the Characteristic Net Due Date (0NETDUEDATE) there is a SAP exit variable called Key Due Date (0P_KEYDT).
    I need to replicate this variable for 0DOC_DATE, which is what I need to use in this query.
    I do not have any knowledge of ABAP therefore could you please advise;
    1) Whether this variable can be replicated for 0DOC_DATE so that it defaults to system date - 1 day
    2) What steps I need to take to create this variable
    3) What is the exact ABAP code that I will need to do this.
    If there is a variable that already exists for 0DOC_DATE that acts in the same way as 0P_KEYDT then please let me know.
    Thanks
    Nate

    Hello,
    1&3) goto CMOD - create e.g. ZBWVARS. Add RSR00001enhancement. Modify ZXRSRU01 include.
    You need developer key to do that.
    CASE i_vnam.
    WHEN 'ZDOC_DATE,'.
        IF i_step EQ '2'.
          CLEAR l_s_range.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          l_s_range-low = sy-datum - 1.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    ENDCASE.
    2) In Query Designer create customer-exit variable ZDOC_DATE.
    BR
    Ondrej

Maybe you are looking for

  • Memory Upgrade on Macbook 13" Mid 2010

    Hi, Reviewed the forums regarding upgrading from 4GB to 8GB on a Macbook 13" (mid-2010). It appears many have had success with QWC.  I just wanted to run this by folks to get any feedback. I was at BestBuy this evening and picked up some PNY memory (

  • Invoice verification(MIRO) for blanket purchase order

    Dear All, I am tring to enter invoice via. MIRO againest a blanket purchase order. The blanket purchase order is a Frame workorder  with account assignment category 'U' & item category 'B'. I am getting error 'Enter G/L Account'  while entering invoi

  • My new 13 inch Macbook Pro and FCP and FCS 2

    Until today I thought I could not run FCP and FCS 2 Full Suite because of my graphics card in my base, stock, 13" Macbook Pro. -- I'm being told that my 9400M with 256 shared memory will run these applications. That's good news to me if it's true. Wh

  • Cover Art refresh from files

    I store all my music on an external disk. A few days ago I started iTunes without that disk attached. I have around 3000 albums/50,000 tracks - 98% of which have album art. With that restart though, all of the album art disappeared leaving me just th

  • I forgot my restriction how can i rest it back

    i forgot my restriction how can i rest it back