System variable in query

Hi, all-
I'm trying to set up a query for my users that don't have access to customer aging reports.  I need them to run this query to see how many days past due the customer is before we ship an order.
I think I need to add the system variable 65 (Days Overdue), but not sure how to add it to an SAP query.
Using 2007A patch 42.
thanks in advance,
Shelby

The system variables are accessible only in system defined forms. They are received from the program running in the background.
In the queries you write you can only access data base fields. And sometimes from these you can derive the same value that the system variable contains.

Similar Messages

  • Assigning System variables in query designer

    Hi all,
    My requirement is that For a field CALENDAR DAY, i Want to set the default values so that it displays the data for last seven days from the current system date by using sy-datum. This should be done without using customer exit logic.Can anyone tel me how can this be done in Bex query designer.

    Hi Imanik,
    I think using custom exit to arrive to a solution of your issue is the most efficient way as of now.
    Alternatively you can write a routine in ETL Where in you can check if  Sy-Datum - 7 <= Calday, then you can have a field Flag in Infoprovider which would be populated by X in this case. Later on in Bex you can have a filter on Calday  = X. But this scenario works only when you are doing:
    1. A full load.
    2. You are running the query on the same day you are doing this full load.
    Regards
    Raj

  • Using System Variables in a SQL Query

    Hi!
    I´m new to Oracle and SQL so i don´t know very much about it.
    There is miy Problem:
    Is there a way to Use the System Variable %USERNAME% in an SQL Query?
    I tried .... where table.shorttag = '%USERNAME%' ;
    but this doesnt work.
    Is Oracle able to handle Systemvariables? Or is there another way to use the current Windows User in an SQL Query.
    It is very Important to use the current Windows user and not the Oracle user.
    Thank you,
    Mfg

    Are you looking for something like this ?
    SQL> SELECT sys_context('USERENV', 'OS_USER') FROM dual;
    SYS_CONTEXT('USERENV','OS_USER
    SAUBBANE\IBM
    SQL> SELECT sys_context('USERENV', 'TERMINAL') FROM dual;
    SYS_CONTEXT('USERENV','TERMINA
    SAUBBANEAlso you can look at the dbms_application_info package.

  • System variable in a query

    Hi,
    I would like to use a system variable in a query in the where clause. How can i use it?
    Thanks in advance:
    Bianca

    Hi,
    840275 wrote:
    Several scripts need to use the same value so i have created a system variable for it.
    (some of these scripts are in oracle, some in Talend)
    select...
    from myTable
    where myColumn = mySystemVariable:
    Tha question is how can i reference a system variable from a query?
    Depending on exactly what you mean, the code you posted will work; just fill in the columns you want in place of "...".
    If I don't know where you're starting from, and I don't know where you want to go, then I can't give you very precise directions.
    Explain what you're trying to do.  Remember, the people who want to help you don't know what environment you're working in (e.g., SQL*Plus, PL/SQL, Apex, ...), they don't know anything about your application, and they don't exactly what you want.  The more you help them, the more they can help you.
    Why not post a question that really explains what you need to do?  For example: "I have a table like scott.emp, that has multiple departments.  Users will always be interested in only 1 departement at a time.  I would like them to run standard, fixed queries, such as ... but have the results only apply to the department they are interested in, as if they had executed ...  Several users may be on the system at the same time, and they won't necessarily be interested in the same department.  I'm doing this in SQL*Plus now, but I may want to do something similar in Apex.  My Orace version is ...".

  • System build-in or system variable to get number of records from a query

    Hi,
    Is there a system build-in or system variable to get number of records from a Oracle Forms query?
    Thank you

    Namely, when GO_BLOCK(BLOCK_NAME) EXECUTE QUERY finishes, is there a way directly get the number of the records?
    SYSTEM.COURSOR_RECORD = 1 tells this is the first record
    SYSTEM.LAST_RECORD = 'TRUE' tells this is the last record
    Thanks

  • System Date in Query Designer

    I have a characterstic 'Deadline Date'. I have to calculate a formula 'Days Left' which is equal to
    Deadline Date - System Current Date.
    How can i do that in query designer?? How can i get system date in query designer??
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    Hi Philip,
    Actually I needed the output on VC. so i simply created a date type variable and in VC ,  i mapped that variable to Now().
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

  • Document Date - System Variable - AP Checks?

    Hi Experts,
    I have searched for previous queries in the SDN B1 forum regarding my query.
    I need  to use a system variable in the cheque print area instead of posting date of documents the DOCUMENT DATE is required. I cannot find a  DOC. Date system variables
    Please can onyone highlight me if SAP has released a new System Variable list that include DOCUMENT DATE. The below links are what i had searched on.
    [PLD Check Print - System variable for document date and amount;
    [System variables in Check format;
    Is this an limitation on variables?
    Thanks,
    Raju

    Hi Raju,
    as a workaround you can do the following
    1. create a UDF in the Paid Document section, of a Date type
    2. create a user defined value :
    SELECT  case $[$20.45.1]
              when 18 then   (SELECT T0.[TaxDate] FROM   OPCH T0 WHERE
    T0.Docnum = $[$20.1.0])
              when 19 then   (SELECT T0.[TaxDate] FROM   ORPC T0 WHERE
    T0.Docnum = $[$20.1.0])
    end
    set the trigger to be when when field change: on customer / vendor code
    In the check PLD show this UDF. Use the table VPM2 : Outgoing payments - invoices, column : your UDF
    Hope this helps
    Chris

  • Systems variables

    what are systems variables ?
    Regards,
    Jagan

    ABAP system fields are always available in ABAP programs. The runtime system fills them according to context. They can then be used in programs to query the system status. System fields are variables but you should always treat them as though they were constants, and only read them. If you change their values, important information for the flow of the program may be lost. In exceptional circumstances, system fields may be overwritten in an ABAP program to control the system – for example, SY-LSIND (for navigating to a detail list).
    With one exception the names and data types of the system fields are stored in the ABAP Dictionary in the SYST structure and realized as components of the predefined structure SY in ABAP programs.
    The system field SY-REPID is not part of SYST or SY. Instead, every program contains the predefined constants SY-REPID and SYST-REPID, which both contain the name of the corresponding program. Furthermore, there are two predefined types of the same name, SY-REPID and SYST-REPID.
    All system fields are addressed using SY field name and their types using SYST field name.
    here is a list of some important system variables
    INDEX
    SYINDEX
    INT4
    10
    0
    Loops, number of current pass
    PAGNO
    SYPAGNO
    INT4
    10
    0
    List creation, current page
    TABIX
    SYTABIX
    INT4
    10
    0
    Internal table, current line index
    TFILL
    SYTFILL
    INT4
    10
    0
    Internal tables, current number of lines
    DBCNT
    SYDBCNT
    INT4
    10
    0
    DB operations, number of table lines processed
    FDPOS
    SYFDPOS
    INT4
    10
    0
    Character strings, offset in character string
    COLNO
    SYCOLNO
    INT4
    10
    0
    List creation, current column of list
    LINCT
    SYLINCT
    INT4
    10
    0
    List processing, page length of list
    LINNO
    SYLINNO
    INT4
    10
    0
    List creation, current line
    LINSZ
    SYLINSZ
    INT4
    10
    0
    List creation, width of list
    SUBRC
    SYSUBRC
    INT4
    10
    0
    Return value, return value after ABAP statements
    LILLI
    SYLILLI
    INT4
    10
    0
    List processing, current list line
    LSIND
    SYLSIND
    INT4
    10
    0
    List processing, details list index
    STEPL
    SYSTEPL
    INT4
    10
    0
    Screens, current table line index
    LOOPC
    SYLOOPC
    INT4
    10
    0
    Screens, number of lines visible in table
    LANGU
    SYLANGU
    LANG
    1
    0
    R/3 System, current language
    MANDT
    SYMANDT
    CLNT
    3
    0
    R/3 System, client number from logon
    DBSYS
    SYDBSYS
    CHAR
    10
    0
    R/3 System, name of central database system
    SYSID
    SYSYSID
    CHAR
    8
    0
    R/3 System, name of R/3 System
    SAPRL
    SYSAPRL
    CHAR
    4
    0
    R/3 System, system release
    TCODE
    SYTCODE
    CHAR
    20
    0
    ABAP program, current transaction code
    DATUM
    SYDATUM
    DATS
    8
    0
    Date and time, current (application server) date
    UCOMM
    SYUCOMM
    CHAR
    70
    0
    Screens, function code triggered by PAI
    UZEIT
    SYUZEIT
    TIMS
    6
    0
    Dat and time, current application server time
    UNAME
    SYUNAME
    CHAR
    12
    0
    R/3 System, user logon name
    MSGLI
    SYMSGLI
    CHAR
    60
    0
    Messages, message line
    TITLE
    SYTITLE
    CHAR
    70
    0
    Screens, title text
    LISEL
    SYLISEL
    CHAR
    255
    0
    List processing, contents of selected line
    ULINE
    SYULINE
    CHAR
    255
    0
    Constants, horizontal line with length 255
    MSGID
    SYMSGID
    CHAR
    20
    0
    Messages, message class
    MSGID
    SYMSGID
    CHAR
    20
    0
    Messages, message class
    MSGTY
    SYMSGTY
    CHAR
    1
    0
    Messages, message type
    MSGNO
    SYMSGNO
    NUMC
    3
    0
    Messages, message number
    MSGV1
    SYMSGV
    CHAR
    50
    0
    Messages, message variables
    MSGV2
    SYMSGV
    CHAR
    50
    0
    Messages, message variables
    MSGV3
    SYMSGV
    CHAR
    50
    0
    Messages, message variables
    MSGV4
    SYMSGV
    CHAR
    50
    0
    Messages, message variables
    VLINE
    SYVLINE
    CHAR
    1
    0
    Constants, vertical bar
    HOST
    SYHOST
    CHAR
    32
    0
    R/3 System, Name of application server
    the link is
    http://abaplovers.blogspot.com/2008/02/list-of-important-system-variables.html
    do reward if helpful

  • Oracle Forms System Variable

    Has anybody ever come across a system variable called TAB_PAGE_CHANGE_METHOD? What values can this variable take and how can i set it?

    Namely, when GO_BLOCK(BLOCK_NAME) EXECUTE QUERY finishes, is there a way directly get the number of the records?
    SYSTEM.COURSOR_RECORD = 1 tells this is the first record
    SYSTEM.LAST_RECORD = 'TRUE' tells this is the last record
    Thanks

  • How to view system variables

    hie im using oracle 10g and want to view and edit system variables on windows 2003 server that affect query performance. can someone help me pliz

    You should start here:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/toc.htm
    and here:
    http://www.oracle-base.com/articles/10g/PerformanceTuningEnhancements10g.php

  • Setting system variable in the Detailed Aging PLD report

    Does anyone know which variable I can use to get the FC value displayed on the Aged Debtors PLD detailed form?
    The current aging layout (in SBO) either shows it all in LC or in the currency you choose, but if you have a Business Partner who trades in different currencies and you have invoices raised in those different currencies you cannot see the value for each currency seperately, which is causing some distress.
    I was hoping that by some miraculous twist of fate I can include the FC value in the PLD report thereby saving the hassle of having to re-write the report. (I have checked the System Variable Excel spreadsheet but cannot find it in there.)
    Many thanks
    Hayden

    Hi Julie
    I wondered if you are able to help me get the foreign currency Code and Value into this query you did from a previous post.
    I'm getting odd results and I cant work out where I'm going wrong
    Many thanks
    Hayden
    /* SELECT FROM OINV T0 / declare @AgingDate DateTime / WHERE */ SELECT @AgingDate = GetDate()
    /* SELECT FROM OCRD T1 / declare @CustomerFrom nvarchar(20) / WHERE */ set @CustomerFrom  = ''
    /* SELECT FROM OCRD T2 / declare @CustomerTo nvarchar(20) / WHERE */ set @CustomerTo = ''
    /* SELECT FROM OCRD T3 / declare @OnHold nvarchar(20) / WHERE */ set @OnHold = 'N'
    /* SELECT FROM OSLP T4 / declare @SalesRep nvarchar(30) / WHERE */ set @SalesRep = ''
    IF @AgingDate = CONVERT(datetime, '', 112) set @AgingDate = GetDate()
    select
         JD.FCCurrency [Foreign Currency],
         ocrd.CardCode [BP Code],
         ocrd.CardName [BP Name],
         ocrd.FrozenFor [On Hold],
         @AgingDate [Aging Date],
         isnull(T7.[BalanceDue],0) [Balance],
         isnull(T7.[Current],0) [Current],
         isnull(T7.[30Days],0) [1 Month],
         isnull(T7.[60Days],0) [2 Months],
         isnull(T7.[90Days],0) [3+ Months],
         ocrd.CreateDate,
         T8.[Last Payment Date],
              (SELECT
                   SUM(T1.DocTotal)
              FROM ORCT T1
              WHERE T1.CardCode = T8.CardCode AND
                        T1.DocDate = T8.[Last Payment Date]) [Total Last Payment],
         oslp.SlpName [Sales Rep],
         ocrd.CntctPrsn [Key Contact],
         ISNULL(ocpr.Tel1, ISNULL(ocpr.Cellolar, ocrd.Phone1)) [Contact Phone]
    from ocrd left outer join
         ocpr on ocpr.Name = ocrd.CntctPrsn and
         ocpr.CardCode = ocrd.CardCode left outer join
         oslp on oslp.SlpCode = ocrd.SlpCode left outer join
              SELECT
                   T0.CardCode,
                   SUM(T1.Original-T1.Cleared) [BalanceDue],
                   SUM(CASE
                             WHEN T1.AgeDays < 0 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [Current],
                   SUM(CASE
                             WHEN T1.AgeDays BETWEEN 0 AND 30 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [30Days],
                   SUM(CASE
                             WHEN T1.AgeDays BETWEEN 31 AND 60 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [60Days],
                   SUM(CASE
                             WHEN T1.AgeDays > 60 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [90Days],
                   SUM(CASE
                             WHEN T1.AgeDays > 30 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [Overdue]
              FROM ocrd T0 LEFT OUTER JOIN
                   (SELECT
                        T1.CardCode,
                        T0.TransId,
                        T0.Line_ID,
                        DateDiff(m, T0.DueDate, @AgingDate) [AgeMonths],
                        DateDiff(d, T0.DueDate, @AgingDate) [AgeDays],
                        --Get standar Debit/Credit Col OR FCCredit/FCDebit columns for
                        --caluculations in outer query
                        ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Debit Else T0.FCDebit END )
                        ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Credit Else T0.FCCredit END ) [Original],
                        --T0.Debit-T0.Credit [Original],
                        SUM(ISNULL(T2.ReconSum,0)*     CASE T2.IsCredit WHEN N'C' THEN 1 ELSE -1 END) [Cleared],
                             ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Debit Else T0.FCDebit END )
                             ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Credit Else T0.FCCredit END )
                        + SUM(ISNULL(T2.ReconSum,0)* CASE T2.IsCredit WHEN N'C' THEN 1 ELSE -1 END) [Balance]
                        --(T0.Debit-T0.Credit) + SUM(ISNULL(T2.ReconSum,0)* CASE T2.IsCredit WHEN N'C' THEN 1 ELSE -1 END) [Balance]
                   FROM jdt1 T0 inner join
                        ocrd T1 on T1.CardCode = T0.ShortName left outer join
                        itr1 T2 on T2.TransId = T0.TransId and
                        T2.TransRowId = T0.Line_ID and
                        T2.ReconNum = (     select
                                                 T3.ReconNum
                                            from oitr T3
                                            where     T3.ReconNum = T2.ReconNum and
                                                      T3.Canceled = N'N' and
                                                      T3.ReconType = 7 and
                                                      T3.ReconDate <= @AgingDate)
                   WHERE     T0.RefDate <= @AgingDate and
                             T1.CardType = 'C' and
                             (T1.CardCode >= @CustomerFrom OR @CustomerFrom = '') and
                             (T1.CardCode <= @CustomerTo OR @CustomerTo = '')
                   GROUP BY T1.CardCode, T0.TransId, T0.Line_ID, T0.DueDate, T0.Debit, T0.FCDebit, T0.Credit, T0.FCCredit, T0.FCCurrency
    --                    ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Debit Else T0.FCDebit END )
    --                    ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Credit Else T0.FCCredit END ), T0.FCCurrency
                        --T0.Debit-T0.Credit
                   ) T1 on T1.CardCode = T0.CardCode
              WHERE T0.CardType = N'C'
              GROUP BY T0.CardCode ) T7 on T7.CardCode = ocrd.CardCode left outer join
                   (SELECT
                        T1.CardCode,
                        Max(T1.DocDate) [Last Payment Date]
                   FROM ORCT T1
                   WHERE     (T1.CardCode >= @CustomerFrom OR @CustomerFrom = '') and
                             (T1.CardCode <= @CustomerTo OR @CustomerTo = '')
                   GROUP BY T1.CardCode ) T8 on T8.CardCode = ocrd.CardCode
    --put this join to get the
    --currency symbol from Journal Row table
    Left Outer join JDT1 JD On OCRD.CardCode = JD.ShortName
    where ocrd.CardType = 'C' and
         --(oslp.SlpName = @SalesRep OR @SalesRep = '') and
         (ocrd.CardCode >= @CustomerFrom OR @CustomerFrom = '') and
         (ocrd.CardCode <= @CustomerTo OR @CustomerTo = '') and
         (ocrd.ValidFor <>'Y') and
         ( (ocrd.FrozenFor = @OnHold and (GetDate() Between isnull(ocrd.FrozenFrom, DateAdd(d,-1,GetDate())) and isnull(ocrd.FrozenTo, DateAdd(d,1,GetDate())))))
    order by ocrd.CardCode

  • Hidden System variable

    Dear all,
       On UK based localization , I found System Variable 490 (on Invoice Including Batch/SN (System)   template ) , which is used for printing serial number in comma separated string. I want to view this system variable (query or any logic to retrive serial numbers behind it) , can any one tell me how can I get it if it is hide on A/R Invoice form?
    Regards,
    Ghazanfar

    If u are using 2007A version,Check the document
    How To Use the PLD Variables File in Release 2007 A in the below link.
    Check this link https://websmp107.sap-ag.de/smb/sbocustomer/documentation

  • How to Find System Variables

    Hi All
    I need to Find the Hidden Variable i.e., System Variable in a Document like A/R Invoice,A/P Invoice etc
    how can we know the variable no.
    Thanks in Advance

    Hi madhu,
    Usually, the variable number is the only thing you do know. You can go about in two way to find out to what field it relates to
    1. Use the System Variables .xls file to know the field description(not the name). Then open PLD, in a report that uses the same table, and browse through the fields until you find a field with the same description. That field list also indicates the field´s name.
    2. Query the table in question and browse through the columns till you find the desired field.
    If there is a more direct way, I also would like to find out.
    Regards,
    Vítor Vieira

  • Doubt in system variable.

    hi,
    i want to know what is system.record_status and value like changed,insert,new,query and where all it is used.
    what is differnce between system.record_status and get_record_property.

    Hi
    A system variable_ is an Oracle Forms variable that keeps track of an internal Oracle Forms state. You can reference the value of a system variable to control the way an application behaves.
    Oracle Forms maintains the values of system variables on a per form basis. That is, the values of all system variables correspond only to the current form.
    SYSTEM.BLOCK_STATUS_ represents the status of a Data block where the cursor is located,or the current data block during trigger processing.
    The value can be one of three character strings:
    CHANGED     Indicates that the block contains at least one Changed record.
    NEW     Indicates that the block contains only New records.
    QUERY     Indicates that the block contains only Valid records that have been
    retrieved from the database.Regards,
    Abdetu...
    Edited by: Abdetu on Jan 23, 2011 11:19 PM

  • Error in using System Variable

    Dear all,
             I want to use System Variable 225 ( VAT percent (per VAT code) ) which is used in one of document i.e. "VAT Only Invoice".
    When I used it in my Invoice document the following error occurs:
    Printing Error : Invalid Variable number (RPT -6300)(Field:F_XXX) Variable 'XXX'
    Please help me to use this System Variable in my Invoice.
    Note: I have already read "How To Use the PLD Variables File in Release 2007 A" .pdf file.
    can any one tell the meaning of folowing which is in the sheet "vars utilisation" of PLD_Vars_march2007 xls file
    " it means that this variable can be used only under certain repetitive area exclusive numbers (109, 126, 132, 135, 139, 148, 149, 309, 316, 427, 502, 509, 686)
    Regards,
    Ghazanfar
    Edited by: Ghazanfar Ahmed on Jun 18, 2009 12:16 PM

    Hi,
    It is a special variable available for the VAT summary part, not to be used in the rows but in a separate repetitive area.
    To display the respective VAT rates in each row, create a database field instead: Tax Definition - Rate%. It will populate the VAT percentage for you.
    Regards,
    Nat

Maybe you are looking for

  • 160GB ipod classic 6th gen cant be recovered by itunes 12

    My 160GB iPod Classic (6th Generation) cannot be recovered by iTunes 12. I plug the iPod into my Macbook Pro and it shows up in Finder. Then an iTunes message appears: "iTunes needs to prepare your iPod for recovery. Please leave your iPod connected.

  • Can't install windows 8 on gpt partition

    Hi, my laptop came pre-installed with windows 8.1 and it did't allow Fifa13 to run, then I deleted the partition and tried to install windows 7 ultimate because it allows Fifa 13 to run. When installing windows 8.1 it displays "windows cannot be inst

  • Problem in z include in function exit

    hi to all sdners,                         in  a function exit exit_sapmf02d_001 when im trying a write a code in   z include im getting a information message that is used for customer function,therfore unable to write the code in it.please help me ou

  • Unfortunately messaging has stopped and not receiving text messages

    I, am also having issues with "unfortunately messaging has stopped", AND, NOT receiving text messages. I also have 2 other Droid Ultra's on my account doing the same thing. This is totally unacceptable!!! I am not paying $600 for a piece of crap phon

  • What is this SQL give us

    I am trying to understand the SQL...Can anyone tell me what is SQL do... SELECT *   FROM foms.inspection_task m WHERE type_check_code = 'P'    AND EXISTS (           SELECT 0             FROM foms.inspection_task X            WHERE X.TRIPPLANKEY = m.