Defining a customized variable

Hi all,
I have a question here: how do I define a customized variable in a query. My requirement is for Calendar Day
1. If the current day is the first day of a month, the selection should be from the first day of the last month to the current day.
2. If the current day is not the first day of a month, the selection should be from the first day of the current month to the current day.
For example:
If it's 9/1, select 8/1 - 9/1
If it's 9/2, select 9/1 - 9/2
If it's 9/12, select 9/1 - 9/12
I found I may make use of the Customer Exit, but I have no idea how to.
Thanks and best regards,
Shawn

Hi,
Then your can follow this steps->
1) Create a variable with a customer exit as a processing type. The variable is based on the Info Object 0calday.
Set the following attributes:
Type of Variable: Characteristic Value
Variable name: ZVCQUA
Variable Description: day using Customer exit
Processing by: Customer Exit (Drop down combo box)
Characteristic: 0CALday
Press Next
Set the following attributes:
Variable Represents: inetrval value
Variable Entry is: Mandatory
Don’t Check out Ready for Input
And Press Next
Press Finish
2) Transaction CMOD
Create a new project, maintain the short text, and assign a development class.
(It’s better to ask somebody senior in our project about this, because every project have one main project and development class)
If you have project say Zproject. Choose option components. Click Change.
Double-click on EXIT_SAPLRRS0_001.Then double-click on ZXRSRU01.
Enter the coding.
Save and activate the coding.
INCLUDE ZXRSRU01 *
DATA: L_S_RANGE TYPE RSR_S_RANGESID. 'In global area
DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT. 'In global area
DATA: l_fpr1(2) TYPE c. 'month
DATA: l_fpr2(2) TYPE c. 'day
DATA: l_fpr4(4) TYPE c. 'year
DATA: l_fpr3(2) TYPE c. 'preivous month
CASE I_VNAM.
WHEN 'ZVCQUA'.
IF i_step = 2.
LOOP AT i_t_var_range INTO loc_val_range
WHERE vnam = 'zcalday'. 'your user define varibale
EXIT.
ENDLOOP.
IF sy-subrc EQ 0.
l_fpr1 = loc_val_range-low+4(2).
l_fpr2 = loc_val_range-low+6(2). "will take day
l_fpr3 = l_fpr1 - 1. 'previous month
l_fpr4 = loc_val_range-low(4). 'year
if l_fpr2  EQ '01'.
CONCATENATE l_fpr4 l_fpr3 '01' INTO l_s_range-low(8).
l_s_range-high = loc_val_range-low(8).
Else
CONCATENATE l_fpr4 l_fpr2 '01' INTO l_s_range-low(8).
l_s_range-high = loc_val_range-low(8).
endif.
ENDIF.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
ENDIF.
ENDCASE.
Activate the project. This is very important.
3) In your Query, Under Structure, Create a new Selection
drag this customer exit variable.and your keyfigure.
Save the query.
4) Go to tran code RSRT-> choose your query and execute.
if you have doubt in your code contact me.
Hope i m clear. Post your mail id. While send you a doc.
if you have doubt..plz revert back.
Regards,
San!
Message was edited by: San!

Similar Messages

  • Defining an exit variable for a specific day based on Fiscal Period

    If I do not have Calendar Day time dimension available for reporting is it possible to define a customer exit variable for a specific day.  The days are the first and last day of the financial year?
    Example
    User Input for Fiscal Period: 2009004
    The exit is to define a value for 01.01.2009 and 31.12.2008 (end of last year)
    Thanks

    Hello Niten,
    yes it is possible. Procedure:
    - add a new column in the report structure
    - hide this column
    - create a new text variable in this column (for customer exit)
    - now you can fill this variable during query execution based on 0FISCPER
    You don't want to filter by this variable. Right?
    Buy,
    André

  • Customized variable for Bex

    Hi Gurus;
    I am using BI 7.0. My client wants a customized variable for 0CALMONTH with 2 dialog boxes in the selection screen saying "From month" and "To Month". When you input months, say; 06.2008 in "From Month" and 08.2008 in "To Month", the output which will come is data from all the months between 06.2008 and 08.2008. The 2 dialog boxes are important in this screen. I know. it can be done through interval option in BI 7.0, but the dialog boxes doesn't appear in the first screen of the Selection Screen (Like in 3.x).Is there a way to fulfill my client's requirement? Please provide me a step - by - step guide if possible.
    Regards;
    Sumanta

    Sumanta,
       Could you please clarify
    1 ] whether you are using BEx Analyser or Web queires to execute the report? Does your query has only the custom variable as it selection parmeter?
    2] Is your Custom variable(with Interval) for 0CALMONTH is defined as mandatory / optinal ?
      If you are using Web queries and you variable is defined as optional, then there is setting that you need to do on the web template that you are using.
    Choose you web template on the properties tab> Choose Web Template parameters>under the behaviour section ,choose check box for Display variable, as the default is off. This means that if you have Custom variables that are optional on you BI query will not be display as selection screen.
    Hope this help,
    Cheers,
    Balaji

  • Custom variables in PKGBUILDs

    I've read alot that the devs advise against defining your own custom variables in a PKGBUILD file incase the devs add a new variable to the internals of makepkg. But, what if there was an arch dev community supported convention about custom variable definition that was documentated? For example, the docs could say "All custom variables defined in a PKGBUILD should be prefixed with two underscores, e.g. __mycustomvar. This way, there could be custom vars and arch devs wouldn't use any __vars for new features of makepkg.
    Just an idea,
    -wd

    dp wrote:
    $origver or $__origver ?
    i dont think, it is needed to use non-human_readable__ for PKGBUILD, as it is really elementar (it's not OO for building a whole architecture on it)
    my suggestion would be to reserve some variables for some cases
    e.g. if pkgver is different than the original version of the tarball, then let's use origver to refer to the original version (the case, when tarball version is 1.0-beta3 and pkgver should be 1.0beta3)
    one other is origname where the original name of the pkg is meant (the one the tarball is called after it)
    I think that is a great idea, since those are the exact instances I run into regularly when creating my own packages, and spawned me to post.

  • How to add custom variable on approval form?

    Hi,
    I am tring to do multi-level approval for the role assignment using my custom approval form.
    For that i have created a WF and this workflow calls approval subprocess which intern uses the Custom Approval form.
    In WF i am passing newly selected role as variable to my Approval Subprocess. Now Approval Subprocess assigns this to the first level manager by displaying this new role on approval form. Manager1 is able to see this new role and approves role assignment.
    Now this Role has Approver(Which was defined during the role definition). so it automatically goes to RoleApprover for approval using custom Approval form. Now the problem is i am not able to see my custom variable value in the Approval form for RoleApprover. its showing it as null. But where is in case of manager approval it is showing.
    Can anyone through somelight on this to display a WF variable(newrole) in Approval form.
    The one reason that i could think of is RoleApprover approval process is triggered by Configurator as WFOWNER hence all the session variables are killed.Is there any workaround?
    I appreciate your help.
    Thanks
    Kris

    I got the solution, using the session. Thank you.

  • How to define a Custom Action in VC 6.0 ?

    Hi all
    I want to know how to define a custom action like for a check box UI Element, I want particular action to be performed when it is checked ? How can I achieve this in VC 6.0
    Please feel free to ask me if my question is unclear ?
    Regards
    Kapil

    Hi,
    Try adding an expression element on your form.
    Go to the Expression control properties and in the Expression attribute enter
    IF(@Selected==true,"X"," ")
    @Selected is the checkbox. For your function call input use the expression element and not the checkbox.
    Hope this helps. Let me know if it works.
    Thanks.

  • HP Officejet Pro 8600 Plus e-All-in-One Printer - N911g can not define a custom size paper.

    HP Officejet Pro 8600 Plus e-All-in-One Printer - N911g can not define a custom size paper.  I would like to have a custom size to work with a card making program.

    Can you help me out?
    I have an HP Officejet Pro 8600 N911a
    When I try to print to a custom print size (2.75" x 6" in my case), I get the same error everyone else is reporting: "Paper detected does not match paper size or type selected. Make sure the paper size or type is correct to continue the job."
    I am currently trying to print using Microsoft Word for Mac 2011 version 14.4.5, but I have the same problem with printing from Adobe Reader 9.8.5 or Preview 8.0.
    I am running OS X Yosemite 10.10.
    My printer's firmware is "up to date" as of 28-Aug-2014.
    This is what I did:
    1. Open System Preferences from the Apple menu.
    2. Click on the Printers & Scanners icon.
    3. Click on the + sign under the list of printers to add a printer
    4. Click on IP
    5. Enter my IP address in the Address field (verified as "valid and complete host name or address")
    6. Ignore Protocol field (default is Line Printer Daemon - LPD)
    7. Ignore Queue field (default is blank for default queue)
    8. Ignore Name field (default is IP address)
    9. Ignore Location field (default is blank)
    10. Under the Use dropdown menu, I select "Select Software"
    11. HP Deskjet 9800 is not an option.
    I searched for 9800, but there is no HP printer with that number in the options.
    I tried selecting "HP DeskJet 980C - Gutenprint v5.2.3" to see if that would work, but I received the same error message as above. I tried selecting other random HP printers, but so far I've had no luck.
    I've been googling about for a way to manually add a printer driver to this "Select Software" list, but I've found nothing (apparently, no one else wants to do this). I did not find a driver download for the HP DeskJet 9800 for OS X Yosemite 10.10 on the Drivers & Software section of the hp.com website.
    Additional details on settings for Microsoft Word for Mac 2011 version 14.4.5:
    Selected File > Page Setup from menu
    Under the Paper Size drop down menu, I selected manage custom size.
    - Click + to add a paper size
    - Enter "2.75" in width and "6 in" height in the paper size fields.
    - Enter "0 in" as the User Defined Non-Printable Area for top, left, right and bottom.
    - Double-clicked Untiled in the custom size list and rename the size as Receipt
    - Click OK to return to the Page Setup dialog box
    Under Settings: Page Attributes:
    - Format for "HP Officejet Pro 8600"
    - Paper size: Receipt
    - Orientation: "tall/portrait"
    - Scale: 100%
    - Click OK
    Select Format > Document and set all page margins to 0.25"
    Thank you. 

  • Error when a TS step has a condition to check for custom variable. Variable is set on the collection.

    SCCM Version = SCCM 2012 R2 CU3
    Background
    I would like to setup some sort of safety check to help prevent accidentally sending and OSD out to all the servers managed by SCCM. The solution I am trying to use is making the TS do a check for a custom variable. If the variable is NOT set to TRUE
    then it should reboot the machine back to the currently installed OS.
    The variable is called "AllowOSD"
    AllowOSD is set correctly on my "Test Servers" collection
    I'm using the built in "Reboot Computer" step in the TS
    The condition on the Reboot Computer step is very basic - "Task Sequence Variable AllowOSD is not equal TRUE".
    I am testing the TS on a VM guest (Hyper-V)
    I'm deploying via PXE for these tests...
    The Issue
    As soon as the TS starts I get the annoyingly generic 0x80004005 error - smsts.log posted on github -
    smsts.log-A
    Possibly related issue:
    I have a vbscript that prompts for, and sets, the computer name. This works fine if placed after the format disk step, but if I place it before the format disk step then I get error 0x800700A1. If I format the internal HD first then I don't get an error
    and it all works fine.
    smsts.log posted on github - smsts.log-B
    Be aware VM_1 and VM_2 have unformatted disks (vhdx). I don't want them to be formatted before checking that the task sequence should really be running in the first place. As already mentioned, I am trying to prevent someone wiping out a bunch of servers
    by accident.
    My Task Sequences are based on the defaults created by the wizard. Here are the step I'm using...
    * Reboot if AllowOSD is not TRUE
    Restart in Windows PE
    * set Computer Name
    Partition DIsk 0 - DIOS
    Partition Disk 0 - UEFI
    Install Operating System
    Apply Windows Settings
    Apply Network Settings
    Setup Windows and Config Manager
    * = steps I have created.
    All other steps are defaults as created by wizard.
    Please note the "Restart in Windows PE" step does a conditional check on "_SMSTSInWinPE" without any errors. it is looking like the use of custom variables is not supported until the local HD is formatted and mounted. Can
    anyone confirm this behaviour, or what I can do to get around this problem.
    I have tried using a vbscript but triggering a reboot from VB does nothing, hence using the Reboot Computer step in the TS.
    Thanks
    "Well I'm all out of ideas." - 85

    As others have stated, your options are limited the moment you rely on PXE and WinPE but I think all you need to do is refine your collection target a bit.
    Why not instead of deploying your TS to All Systems (which is what I'm guess you're doing) and trying to put a condition in, deploy to a collection that is based on a workstation collection then include unknown computers?  Then any "known workstation"
    will have a MAC stored and thus be permitted to use the TS, unknown machines will be as well ... but "known servers" will be blocked?
    COnsidering the PXE looks for permitted MAC addresses this should work (Ill try it in my own lab).
    Tested and verified:
    Simply create a collection with a parent collection of all systems.
    Add a workstation query:
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion LIKE "%Workstation%"
    Then "include" unknown computers.
    End result is any machine that has "server" in it's version that has already been deployed will not be able to use the deployment.  If you'd rather base existing computer on an OU or group membership just modify the first query how you see fit.
     This will let known workstations (or whatever) and unknown machines get deployed to ... but known machines NOT in that collection will be skipped.

  • Wildcard in SELECT statement defined as a variable

    Hi,
    The following query works in a PL/SQL procedure (it's defined in a variable because the WHERE clause will eventually be built at run time):
    l_select_statement VARCHAR2(4000) :=
    'SELECT XMLELEMENT (
    FROM WEB_VPREPARATIONS W WHERE CODE LIKE :code';
    I execute it via a cursor, like this:
    OPEN l_prod_cv FOR l_select_statement USING in_code;
    I would like to add the '%' wildcard on either side of ':code', but nothing that I've tried works (e.g., LIKE ''%:code%'' using two single quotes on either side). Any help would be greatly appreciated. Thanks,
    Chris.

    That was it! Thank you so much.
    I apologize to odie 63, but the "Correct" button disappeared once I had marked metzquar's...
    I prefer not to pass the wildcard via the variable, and keep it inside the query, just in case the query ever changes.
    Thanks to all who helped; response time was in the milliseconds!
    Chris.

  • Custom variable of filename, omitting certain characters

    I am interested in creating a custom variable where I can edit the document name.  For example, my document is called "Myfilename_001.indd".  I wish to omit everything except for the "001" because that is the version number of my file, and I want that to be the output.  Is this possible somehow?  Or would I need a script to help do this?  Ideally, it would be nice to do it in a way where only the last three characters of the document, sans extension, are the output (if this makes any sense)
    Thanks in advance
    -Tommy

    Hi Tommy,
    This is currently not possible via the Text Variables in InDesign.
    With scripting you can do it but it won't remain live, i mean it would work for the current name of the document, but if you change the document you might need to run the script again beacuse that way you would be putting plain text in there.
    WIl doing this just once solve your problem?
    -Javed

  • Problem with Customer variable

    hi
    from improper installation of coldfusion "Customer variable
    in the registry I changed the configuration to the cookies but I
    have error in event log
    "An I/O operation initiated by the Registry failed
    unrecoverably. The Registry could not read in or write out or flush
    one of the files that contain the system's image of the Registry. "
    and my registry is full, this key
    HKLM/Software/Macromedia/coldfusion/CurrentVersion/clients
    and each time you restart the coldfusion the old entered the
    back regitre
    thank for help
    patrick

    Could it be that the code doesn't find any value in ZCURR_PM_T table for the specified input region?

  • How can i define a boolean variable with the condition if i got a specific text on a selected column?

    How can i define a boolean variable with the condition if i got a specific text on a selected column?
    Example:
    my select results:
    [id = 102] [Company = 'Microsoft']
    If i got microsoft in 'Company' i want to my another table with the columnName "Microsoft" get "true".
    Can you help me?

    That is called 2-table UPDATE.
    Example:
    http://www.sqlusa.com/bestpractices2005/updatewithcorrelatedsubquery/
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How do I...Mimic Replacement Path with Query using Customer Variable Exits?

    Hello SDN:
    We are on BW 3.5 SP16.
    We are currently using a replacement path Query(RP) with variables
    to populate a variable in another Query(T).
    The problem we are having is with performance.
    The entry of variables in replacement path Query(RP) is optional (This is necessary there cannot be required values)
    When results from Replacement Path Query are small performance is fine. (e.g. 10 seconds)
    When results from Replacement path query are large performance suffers. (e.g. 1+ minutes)
    Users are free to leave the replacement path variables empty resulting in a large set of data to be replaced. This is the worst performance case.
    We would like to discover a way to conditionally execute the replacement path query. That is if users do not enter values for the replacement Query(RP) variables do not execute the replacement path query(RP).
    Does anyone know if this is possible within reason and in customer exit space?
    We have reviewed the situation from all angles and the requirement for the replacement path FUNCTIONALITY and the freedom for the user to leave variable values blank remains.
    I've been searching and reading SDN and SAP notes for about a week and do not find threads which address this situation.
    We are also exploring Customer variable exits to mimic replacement path functionality
    (different topic subject="How do I...Mimic Replacement Path with Query using Customer Variable Exits?")
    Any help will be appreciated
    Many thanks
    David Schuh

    My appologies-I posted this message with the wrong subject. I will repost it with appropriate subject.
    dave schuh

  • Portal: how to define new text variables for information broadcasting

    Hello everybody,
    I hope the post here is placed on the right position. If not, please try to advise me, where to ask to get answer on following question:
    -> In BI Portal -> tab Business Intelligence -> Bex Broadcaster -> it is possible to create PDF and post it somewhere into Portal or any other network drive. That's fact. I'm searching for possible enhancement of the F4 help next to the field "data name". There are available only following few variables <OBJECT_ID> <SETTING_ID> <OWNER_ID> <PROCESSED_BY_ID> <LANGUAGE_ID> <DATE_ID> <TIME_ID> <WEEK_ID> <MONTH_ID> <QUARTER_ID> <YEAR_ID>
    We are facing this issue: generated analysis file is valid for the period from month 01 to month actual-1. So therefore I would like to implement my own variable.
    Do you know guys, where to define this own variable with own logic?
    Could you please give me some hints how to create a new one and fill the logic?
    Thank you very much in advance
    Stan

    Not resolved. Life goes still on.

  • Custome variable exit for fiscal year/period

    Hello BW Gurus,
    Q1[1,2,3] Q2[4,5,6] Q3[7,8,9] Q4[10,11,12] quarterly periods
    I have a custom variable exit as shown for fiscal year period
           IF LOC_VAR_RANGE-LOW+4(3) =< '003'.
              L_S_RANGE-LOW+4(3) = '001'.
           ELSEIF LOC_VAR_RANGE-LOW+4(3) > '003' AND
                                              LOC_VAR_RANGE-LOW+4(3) =<'006'.
              L_S_RANGE-LOW+4(3) = '004'.
           ELSEIF LOC_VAR_RANGE-LOW+4(3) > '006' AND
                                                LOC_VAR_RANGE-LOW+4(3) =< '009'.
              L_S_RANGE-LOW+4(3) = '007'.
           ELSE.
              L_S_RANGE-LOW+4(3) = '010'.
           ENDIF.
    Now this works fine to give me the Current Quarter ....say if user puts 005/2007 i get the data Current quarter as [4+ 5] i.e. April and MAy data. Now for <b>Previous Period</b> I gave an offset as -3 to -1 inorder to get data for Q1[123] but the requirement is changed and I want the same time period i.e. [1+2] and not the entire quarter since the Current Quarter calculates only for 4 and 5.
    I hope u are getting my point....please give your suggestions will reciprocate with lots of points

    Hi gaurav,
    Basically If I am selecting period 005 I am getting the data for 4 and 5 as Current Quarter i.e. April is the starting period of that Q2.
    Similarly the previous Quarter should also give me data for period 1 and period 2.
    Right now the offset I gave is -3 to -1 on my custom variable so i am getting data for the entire previous quarter which is Q1[1,2,3] but in reality i just want data for period 1and period 2.
    Can you please help me in this
    Appreciate your concern
    Thanks

Maybe you are looking for

  • How do i sync my i-Pod to a new computer/music library?

    My i-Pod had been linked to a computer I no longer have. I've uploaded all of my songs (plus several new ones not on my i-Pod) onto a new computer with a new version of i-Tunes and now I want to sync up my i-Pod to this new computer. How do I do this

  • I have just downloaded the Mountain Lion Update and would like to put it on my macbook. How do I do that?

    How do I get Mountain Lion on my macbook after I have downloaded and installed it on my IMAC?

  • Help connecting BEFW11S4 to a WRT54G

    Wanted to try to get a BEFW11S4 to connect to my WRT54G that is already set up and working fine. Not sure if this is at all possible but it would help greatly if this would work and I didn't have to buy an extra thing to get all my stuff internet acc

  • Oracle 9i DBA

    For an Oracle 9i database: FOLLOWING ARE THE INITIALIZATION PARAMETERS SET AND THEIR VALUES: JAVA_POOL_SIZE=0 SGA_MAX_SIZE=54M db_block_size = 2048 DB_CACHE_SIZE=12M shared_pool_size = 16M log_buffer = 8192 When the following query is run SQL> SELECT

  • How to create a database sowtware in java

    which thing is required to develope a database other than jdk1.6 and also which other files are required for it plz help i am not understanding exactly what is required