REG:PEFORM IN SCRIPT

HAI,
HOW CAN I USE PERFORM IN SAP SCRIPT.
HOW TO RETURN A VALUE FROM SUBROUTINE AND <u><b>HOW WILL I PRINT IT IN SCRIPT.</b></u>EXPLAIN WITH EXAMPLE. IS IT REQ A 'WRITE_FORM" FUNCTION.
THANK YOU
ASHOK KUMAR

hi..
  You need not to write 'WRITE_FORM' for your requirement.
Calling ABAP Subroutines: PERFORM 
You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM.
The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.
Definition in the SAPscript form:
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
Coding of the calling ABAP program:
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY ‘PAGE’.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = ‘|’. "First page
ELSE.
OUT_PAR-VALUE = ‘||’. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
regards,
veeresh

Similar Messages

  • Reg: root.sh script in grid instillation

    Hi,
    Oracle Version : 11.2.0.1
    Operating system : CentOS
    Here i am installing 11gR2 rac with 4-nodes every thing went fine but when i execute the below script
    /u01/11.2.0/grid/root.sh I am getting this below error.
    [root@drc3s5 bin]# /u01/11.2.0/grid/root.sh
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
        ORACLE_OWNER= grid
        ORACLE_HOME=  /u01/11.2.0/grid
    Enter the full pathname of the local bin directory: [/usr/local/bin]:
    The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying dbhome to /usr/local/bin ...
    The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying oraenv to /usr/local/bin ...
    The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying coraenv to /usr/local/bin ...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    2012-08-24 22:55:41: Parsing the host name
    2012-08-24 22:55:41: Checking for super user privileges
    2012-08-24 22:55:41: User has super user privileges
    Using configuration parameter file: /u01/11.2.0/grid/crs/install/crsconfig_params
    LOCAL ADD MODE
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    Adding daemon to inittab
    CRS-4123: Oracle High Availability Services has been started.
    ohasd is starting
    CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node drc3s4, number 1, and is terminating
    An active cluster was found during exclusive startup, restarting to join the cluster
    CRS-2672: Attempting to start 'ora.mdnsd' on 'drc3s5'
    CRS-2676: Start of 'ora.mdnsd' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.gipcd' on 'drc3s5'
    CRS-2676: Start of 'ora.gipcd' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'drc3s5'
    CRS-2676: Start of 'ora.gpnpd' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'drc3s5'
    CRS-2676: Start of 'ora.cssdmonitor' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.cssd' on 'drc3s5'
    CRS-2672: Attempting to start 'ora.diskmon' on 'drc3s5'
    CRS-2676: Start of 'ora.diskmon' on 'drc3s5' succeeded
    CRS-2676: Start of 'ora.cssd' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.ctssd' on 'drc3s5'
    CRS-2676: Start of 'ora.ctssd' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.drivers.acfs' on 'drc3s5'
    CRS-2676: Start of 'ora.drivers.acfs' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'drc3s5'
    CRS-2676: Start of 'ora.asm' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.crsd' on 'drc3s5'
    CRS-2676: Start of 'ora.crsd' on 'drc3s5' succeeded
    CRS-2672: Attempting to start 'ora.evmd' on 'drc3s5'
    CRS-2676: Start of 'ora.evmd' on 'drc3s5' succeeded
    PRKO-2190 : VIP exists for node drc3s5, VIP name drc3s5-vip
    add vip -n drc3s5 -k 1 -A drc3s5-vip/255.255.255.0/eth0 on node=drc3s5 ... failed
    Configure Oracle Grid Infrastructure for a Cluster ... failed
    Updating inventory properties for clusterware
    Starting Oracle Universal Installer...
    Checking swap space: must be greater than 500 MB.   Actual 20002 MB    Passed
    The inventory pointer is located at /etc/oraInst.loc
    The inventory is located at /u01/app/oraInventory
    'UpdateNodeList' was successful.
    [root@drc3s5 bin]#Please help me solve my problem.
    Thanks & Regards,
    S.V.Poorna Prasad.

    S V,
    Looking at the output given by you, seems there is some issue with network configuration. But still you may need to dig it further.
    When you run root.sh it configure the CRS on nodes and the logs get created under "$GRID_HOME/log/<node name>/" and the filename would be alert<node name>.log.
    Please refer the log file and share if you see any errors there.
    Regards
    Narendra

  • Reg: UNIX shell script at File Adapter

    Hi all,
    I am doing a File to file scenario and using command line arguments in Sending file adapter. I am using UNIX shell script ".sh" file for executing the command.
    I gave the following path at "Run OS command before message processing" parameter:
    /temp/xidelivery/send/FILOSC004_shell.sh
    and this file contains following code:
    <b>#!/user/bin/sh cp /temp/xidelivery/send/FILOSC004_in.txt /temp/xidelivery/send/FILOSC004_input_copy4.txt</b>
    I put the source file, FILOSC004_in.txt and shell script files at the respective paths.
    If I give "cp" command directly in command line it is working fine. But I could not execute this with shell script. Can any body give me the reason where I gone wrong.
    Regards,
    Pavani.

    Hi,
    can you try this,
    bash /temp/xidelivery/send/FILOSC004_shell.sh
    let me know.
    hey you can check the blog below to catch the OS errors,
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Prasad Babu.
    Message was edited by:
            PrasadBabu Koribilli

  • Reg:MDX in Script Logic

    Hi Experts,
                      I have a scenerio is that i have to collect selected basemembers and store in a variable and use that one in allocation.
    Can anyone give me idea how to use MDX in grouping all members to a variable
    Some thing like this.
    *SELECT(%NOPLAN%,"[ID]","PROFIT_CTR","[ DONTPLAN = 'Y']" )
    *FOR %NOPLAN1% = %NOPLAN%
    [#MEMBERS] = %NOPLAN1%
    *NEXT
    Is there any variable concept in nw 7.5
    i need all the members to be present in #members and i can use it in allocation.
    Regards
    Vinoth

    Hi nilanjan,
                      Thanks for you reply .
                      My scenerio is a bit more complex,which i explained above is  a small part .
                     The exact scenerio what i am trying to achive is that the allocation is done by Profit center groups individually.
                     They maintain some profit center property as DONTPLAN so that they are not needed for planning.
                    so in the datamanager package they will select on top hier node for their individual profit center group and run.
                    I have to get all the base memeres of the particular group and omit all the profit centers which has 'Y' in the profit center property DONTPLAN. Collect all the members and use only those members in allocation.
                   i tried script code but i cant any clue of achieving this scenerio so i am trying to use MDX or any other way..
    Regards
    Vinoth

  • Reg: Selectively Commenting Script Logic

    Dear Experts,
    I have a situation where in the Default Logic file comprises of Allocation Logic and Currency Translation Logic, and it works fine.
    But for just one of my reports I have created an Data manager package for Allocation as it uses a different Dimension (Datasource dim instead of Product dim) when compared with the others (which are allocated based on Product).
    The allocation logic works fine if and only if i comment the Allocation Logic present in the Default logic file but this will prohibit the allocation in the remaining reports.
    Is there a way i can restrict the Allocation present in default logic and run only the manually triggered allocation without commenting in default logic so that it works fine for other reports as well.
    Please advice.
    Rgds,
    Rizwan

    I'm a little confused by your use of the word "reports." In BPC, I use the word "report" to mean something very simple -- a view into the data that is stored in the database.
    Any script logic that calculates values (for example, allocations or currency conversion) will post its results to the database. Once those results are in the database, any and all reports which point to those values will retrieve the same result. So it's not possible to have one report retrieve values that are impacted by a data manager package, while other reports ignore that data manager package.
    (However, as soon as I say that, I'll disagree with myself and say, yes of course it's possible -- in the most extreme case, create separate applications for the different business requirements. Or more frequently, use different members in datasrc or some other dimension to isolate the different values.)
    To solve your problem, you need to approach it in terms of the cube (OLAP) data structure, and then your final reports need to either include or exclude, as appropriate, the allocation results. I would recommend you not think in terms of making the code branch in different directions (based on some or other reports). Instead, the logic runs all the time, and the question should be, where do the logic results post to?
    For a very simple example, the currency conversion results always post to USD, EUR, etc. members of the RptCurrency dimension. This logic will never change the original (LC) values.
    For your allocation logic, the same approach can apply. Obviously you wouldn't use the RptCurrency dimension to differentiate the results, but perhaps a datasrc dimension (or something similar) can achieve the result you need.
    For instance think of a datasrc dimension which looks like this, one parent and two children:
    AllDatasrc
    -- InputData
    -- AllocResult
    The allocation logic only considers data in InputData, and posts the results to AllocResult. The other reports (which should not reflect the allocation) are focused on InputData, while the allocation report looks at AllDatasrc, or possibly even all 3 members to show the "before and after"
    Once you make that change, you need to decide how it impacts everything else in the application. The currency conversion logic, perhaps should now include both InputData and AllocResult. That's up to you to decide.

  • Reg: Uploading the script to a Z Script

    Hi all,
    I have successfully downloaded the script through program RSTXSCRP and saved it in the presentation server with name for example TEST.
    now i need to upload the same content to my new script. i have simply created a zscript and saved and activated it...but when i try to upload i am getting a error like ZMEDTUCK IS NOT AVAILABLE.
    can any one please tell me the procudure to uplolad the downloaded contents of script.
    Tnx,
    Joe

    Hello.
    Its from different servers i have xported and its in my presentation server now..my question is how to import it in the another server??
    i have created a script name zmedruck and simply activated it and for import i hae given the name ZMEDRUCK.
    but i am getting a reply like ZMEDRUCK is not available but there is a script name called MEDRUCK.
    Can any one temme how to import the downloaded  contents of script in the presentation server??
    tNX,
    Joe

  • Reg : Need sample scripts -

    Hi Experts,
    I'm going through this wonderful white paper on XML DB. http://www.oracle.com/technetwork/database-features/xmldb/xmlqueryoptimize11gr2-168036.pdf
    There are numerous code samples present in it but the problem is I don't have the sample scripts to practically test them out.
    SELECT li.description ,li.lineitem
         FROM purchaseorder T,
              XMLTable('$p/PurchaseOrder/LineItems/LineItem'
                   PASSING T.X AS “p”
                   COLUMNS
                        lineitem NUMBER PATH '@ItemNumber',
                        description VARCHAR2(30) PATH 'Description',
                        partid NUMBER PATH 'Part/@Id',
                        unitprice NUMBER PATH 'Part/@UnitPrice',
                        quantity NUMBER     PATH 'Part/@Quantity'
                        ) li
    WHERE li.unitprice > 30 and li.quantity < 20);Can anybody please tell me where to get these scripts?
    Help much appreciated.
    Thanks,
    Ranit

    Hi,
    Check out "INTRODUCTION_11.2.0.3.0.zip" in the XML DB Sample code page.

  • Reg: Unix shell scripts

    Hi all,
    Can any body tell me
    1) How to get file creation time and
    2) whether the file exists or not in UNIX shell scripts
    Regards,
    Pavani

    Hi Pavani,
    Go through this blog, and as mentioned use "Add Time Stamp" to get the file creation time.
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    Regards,
    Sarvesh

  • Reg : logo in script

    hi,
    Iam uploading logo using RSTXLDMC prg and iam  selecting BCOL option.
    (for color)
    when  I execute  and check ....the logo is in black and white.
    why is it not appearing in colour??
    regards
    Arjun

    Hi
    i had not uploaded through RSTXLDMC but through se78 so many times
    what ever it may be what you uploaded it should display
    check the priview there itself after uploading in se78 this option there but
    i don't know where the option is there in RSTXLDMC or not
    then check in your form whether you assigned the same logo or not
    check the size also if you increase the size it decreases the logo vice versa
    i never face problem with colour check it once whether you properly uploaded & assigned
    Regards,
    Phani

  • How to call driver program internal table in a form

    how to call driver program internal table in a form? Given below is my code
    TABLES: VBRK,VBAK,ADRC,KNA1,VBRP,VBAP,J_1IMOCOMP.
    DATA: BEGIN OF IT_CUST_ADD OCCURS 0,
    STREET LIKE ADRC-STREET,
    NAME LIKE ADRC-NAME1,
    POST_CODE LIKE ADRC-PSTCD1,
    CITY LIKE ADRC-CITY1,
    CUST_TIN LIKE KNA1-STCD1,
    END OF IT_CUST_ADD.
    DATA: BEGIN OF IT_IN_DA OCCURS 0,
    VBELN LIKE VBRK-VBELN,
    FKDAT LIKE VBRK-FKDAT,
    END OF IT_IN_DA.
    now suppose these are my internal table. what should i write in FORM INTERFACE (associated type)

    Hi Sashi, this will solve ur problem.
    Check the below link.
    REG:PEFORM IN SCRIPT
    kindly reward if found helpful.
    cheers,
    Hema.

  • Please assist with modifying this script to read in a list of servers and output results to excel

    Hello,
    I have an excellent script written by Brian Wilhite to gather the last logged in user using Powershell.
    http://gallery.technet.microsoft.com/scriptcenter/Get-LastLogon-Determining-283f98ae/view/Discussions#content
    My Powershell Fu is stumbling to modify this script to the following requirements:
    Currently the script must be loaded first into Powershell, then it can be executed.  I would rather edit the script in my Powershell ISE, add the .txt file to the script itself that gives a list of the servers I need to scan.  Then when I
    press Run Script in my ISE it executes.
    I would also like to output the results of the file to excel (.xls or .csv will do).  Currently the results look as follows:
    Computer : SVR01
    User : WILHITE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    I would prefer it shows up like so:
    Computer User SID Time Currently LoggedOn
    SVR01 WILHITE\BRIAN S-1xxx 9/20/2012 1:07:58 PM FalseSRV02 WILHITE\BRIAN S-2xxx 9/26/2014 10:00:00 AM True
    Any help you can provide would be greatly appreciated.  I'll add the full script to the end of this post.
    Thank you.
    Function Get-LastLogon
    <#
    .SYNOPSIS
    This function will list the last user logged on or logged in.
    .DESCRIPTION
    This function will list the last user logged on or logged in. It will detect if the user is currently logged on
    via WMI or the Registry, depending on what version of Windows is running on the target. There is some "guess" work
    to determine what Domain the user truly belongs to if run against Vista NON SP1 and below, since the function
    is using the profile name initially to detect the user name. It then compares the profile name and the Security
    Entries (ACE-SDDL) to see if they are equal to determine Domain and if the profile is loaded via the Registry.
    .PARAMETER ComputerName
    A single Computer or an array of computer names. The default is localhost ($env:COMPUTERNAME).
    .PARAMETER FilterSID
    Filters a single SID from the results. For use if there is a service account commonly used.
    .PARAMETER WQLFilter
    Default WQLFilter defined for the Win32_UserProfile query, it is best to leave this alone, unless you know what
    you are doing.
    Default Value = "NOT SID = 'S-1-5-18' AND NOT SID = 'S-1-5-19' AND NOT SID = 'S-1-5-20'"
    .EXAMPLE
    $Servers = Get-Content "C:\ServerList.txt"
    Get-LastLogon -ComputerName $Servers
    This example will return the last logon information from all the servers in the C:\ServerList.txt file.
    Computer : SVR01
    User : WILHITE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    Computer : SVR02
    User : WILIHTE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 12:46:48 PM
    CurrentlyLoggedOn : True
    .EXAMPLE
    Get-LastLogon -ComputerName svr01, svr02 -FilterSID S-1-5-21-012345678-0123456789-012345678-012345
    This example will return the last logon information from all the servers in the C:\ServerList.txt file.
    Computer : SVR01
    User : WILHITE\ADMIN
    SID : S-1-5-21-012345678-0123456789-012345678-543210
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    Computer : SVR02
    User : WILIHTE\ADMIN
    SID : S-1-5-21-012345678-0123456789-012345678-543210
    Time : 9/20/2012 12:46:48 PM
    CurrentlyLoggedOn : True
    .LINK
    http://msdn.microsoft.com/en-us/library/windows/desktop/ee886409(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/library/system.security.principal.securityidentifier.aspx
    .NOTES
    Author: Brian C. Wilhite
    Email: [email protected]
    Date: "09/20/2012"
    Updates: Added FilterSID Parameter
    Cleaned Up Code, defined fewer variables when creating PSObjects
    ToDo: Clean up the UserSID Translation, to continue even if the SID is local
    #>
    [CmdletBinding()]
    param(
    [Parameter(Position=0,ValueFromPipeline=$true)]
    [Alias("CN","Computer")]
    [String[]]$ComputerName="$env:COMPUTERNAME",
    [String]$FilterSID,
    [String]$WQLFilter="NOT SID = 'S-1-5-18' AND NOT SID = 'S-1-5-19' AND NOT SID = 'S-1-5-20'"
    Begin
    #Adjusting ErrorActionPreference to stop on all errors
    $TempErrAct = $ErrorActionPreference
    $ErrorActionPreference = "Stop"
    #Exclude Local System, Local Service & Network Service
    }#End Begin Script Block
    Process
    Foreach ($Computer in $ComputerName)
    $Computer = $Computer.ToUpper().Trim()
    Try
    #Querying Windows version to determine how to proceed.
    $Win32OS = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Computer
    $Build = $Win32OS.BuildNumber
    #Win32_UserProfile exist on Windows Vista and above
    If ($Build -ge 6001)
    If ($FilterSID)
    $WQLFilter = $WQLFilter + " AND NOT SID = `'$FilterSID`'"
    }#End If ($FilterSID)
    $Win32User = Get-WmiObject -Class Win32_UserProfile -Filter $WQLFilter -ComputerName $Computer
    $LastUser = $Win32User | Sort-Object -Property LastUseTime -Descending | Select-Object -First 1
    $Loaded = $LastUser.Loaded
    $Script:Time = ([WMI]'').ConvertToDateTime($LastUser.LastUseTime)
    #Convert SID to Account for friendly display
    $Script:UserSID = New-Object System.Security.Principal.SecurityIdentifier($LastUser.SID)
    $User = $Script:UserSID.Translate([System.Security.Principal.NTAccount])
    }#End If ($Build -ge 6001)
    If ($Build -le 6000)
    If ($Build -eq 2195)
    $SysDrv = $Win32OS.SystemDirectory.ToCharArray()[0] + ":"
    }#End If ($Build -eq 2195)
    Else
    $SysDrv = $Win32OS.SystemDrive
    }#End Else
    $SysDrv = $SysDrv.Replace(":","$")
    $Script:ProfLoc = "\\$Computer\$SysDrv\Documents and Settings"
    $Profiles = Get-ChildItem -Path $Script:ProfLoc
    $Script:NTUserDatLog = $Profiles | ForEach-Object -Process {$_.GetFiles("ntuser.dat.LOG")}
    #Function to grab last profile data, used for allowing -FilterSID to function properly.
    function GetLastProfData ($InstanceNumber)
    $Script:LastProf = ($Script:NTUserDatLog | Sort-Object -Property LastWriteTime -Descending)[$InstanceNumber]
    $Script:UserName = $Script:LastProf.DirectoryName.Replace("$Script:ProfLoc","").Trim("\").ToUpper()
    $Script:Time = $Script:LastProf.LastAccessTime
    #Getting the SID of the user from the file ACE to compare
    $Script:Sddl = $Script:LastProf.GetAccessControl().Sddl
    $Script:Sddl = $Script:Sddl.split("(") | Select-String -Pattern "[0-9]\)$" | Select-Object -First 1
    #Formatting SID, assuming the 6th entry will be the users SID.
    $Script:Sddl = $Script:Sddl.ToString().Split(";")[5].Trim(")")
    #Convert Account to SID to detect if profile is loaded via the remote registry
    $Script:TranSID = New-Object System.Security.Principal.NTAccount($Script:UserName)
    $Script:UserSID = $Script:TranSID.Translate([System.Security.Principal.SecurityIdentifier])
    }#End function GetLastProfData
    GetLastProfData -InstanceNumber 0
    #If the FilterSID equals the UserSID, rerun GetLastProfData and select the next instance
    If ($Script:UserSID -eq $FilterSID)
    GetLastProfData -InstanceNumber 1
    }#End If ($Script:UserSID -eq $FilterSID)
    #If the detected SID via Sddl matches the UserSID, then connect to the registry to detect currently loggedon.
    If ($Script:Sddl -eq $Script:UserSID)
    $Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"Users",$Computer)
    $Loaded = $Reg.GetSubKeyNames() -contains $Script:UserSID.Value
    #Convert SID to Account for friendly display
    $Script:UserSID = New-Object System.Security.Principal.SecurityIdentifier($Script:UserSID)
    $User = $Script:UserSID.Translate([System.Security.Principal.NTAccount])
    }#End If ($Script:Sddl -eq $Script:UserSID)
    Else
    $User = $Script:UserName
    $Loaded = "Unknown"
    }#End Else
    }#End If ($Build -le 6000)
    #Creating Custom PSObject For Output
    New-Object -TypeName PSObject -Property @{
    Computer=$Computer
    User=$User
    SID=$Script:UserSID
    Time=$Script:Time
    CurrentlyLoggedOn=$Loaded
    } | Select-Object Computer, User, SID, Time, CurrentlyLoggedOn
    }#End Try
    Catch
    If ($_.Exception.Message -Like "*Some or all identity references could not be translated*")
    Write-Warning "Unable to Translate $Script:UserSID, try filtering the SID `nby using the -FilterSID parameter."
    Write-Warning "It may be that $Script:UserSID is local to $Computer, Unable to translate remote SID"
    Else
    Write-Warning $_
    }#End Catch
    }#End Foreach ($Computer in $ComputerName)
    }#End Process
    End
    #Resetting ErrorActionPref
    $ErrorActionPreference = $TempErrAct
    }#End End
    }# End Function Get-LastLogon

     This should work:
    Get-LastLogon -Computername (Get-content .\Servers.txt) | Export-CSV .\Output.csv -NoTypeInformation
    I just tested it on my test domain and it did the trick.

  • Consistently getting invalid URL error

    I'm consistently getting following with Safari 6.02.  The URLs I'm trying to go to are such uncommon web sites as facebook.com and ebay.com.  Seems once Safari sets it's mind to it there is no way around this "error"?  I've tried clearing history, closing/reopening safari...still no worky.
    The requested URL "/", is invalid.
    Reference #9.ac6d19b8.1359073068.1022326c

    you must install a peer id registration/lookup service compatible with VideoPhoneLabs' queries onto your web server.  a sample service is the "reg.cgi" python script included with VideoPhoneLabs. you must create the database it'll use according to the schema in the script comment and place the database (and the script) in your filesystem with appropriate permissions for your OS and web server. then you give the URL to that web service as the WebServiceUrl constant.

  • Unicode character issue

    I am facing a peculiar problem. I am testing a site in my Safari 2.0.3 browser. Some of the unicode characters are not recognized (ie) their unicode values are not properly displayed. Those characters are 'v','w','x','y' and 'z'. Has it got anything to do with Browser?
      Mac OS X (10.4.6)  

    This is the html which i am using in Safari browser
    <html>
    <head>
    <title>Sample Page </title>
    </head>
    <script language="javascript" type="text/javascript">
    function check()
    if ( 0 != sample.password.value.replace(/[\u0000-\u007F]/g, '').length )
    alert(sample.password.value);
    alert(sample.password.value.toUpperCase());
    alert('not an ascii value');
    alert(false);
    } else {
    alert(sample.password.value);
    alert(' ascii value');
    alert(test);
    function onKeyPressBlockNumbers(e)
    alert("KEY PRESSED EVENT");
    alert(e.keyCode);
    var key = window.event ? e.keyCode : e.which;
    var keychar = String.fromCharCode(key);
    alert("Entered Character* " + keychar);
    reg = /\d/;
    if (keychar == 'v'||'w'||'x'||'y'||'z')
    keychar= keychar.toUpperCase();;
    alert("Modified Character* " + keychar);
    keychar = keychar.replace(/^[\u0041-\u007A\u00C0-\u00FF\u0100-\u017F]/g, 'v');
    alert("replaced Character * " + keychar);
    return !reg.test(keychar);
    </script>
    <body>
    <center>Please enter your user name and
    password</center>
    <form name = "sample" action="process2.html" method = "post" onsubmit="return check()" >
    <center>username</center>
    <center><input type = "text" name=
    "username"></center>
    <center>password</center>
    <center><input type = "password" name =
    "password" ></center>
    <center><input type="submit" name="Submit"
    value="Login"></center>
    </form>
    </body>
    </html>

  • Getting Invalid URL error

    Hi all I am a new developer trying to make the Phone app work. when I try to run the app I get the invalid URL error. I am putting my domain name between the quoetes. Please help
    // please insert your web service URL here for exchanging peer ID
    private const   WebServiceUrl:String =""

    you must install a peer id registration/lookup service compatible with VideoPhoneLabs' queries onto your web server.  a sample service is the "reg.cgi" python script included with VideoPhoneLabs. you must create the database it'll use according to the schema in the script comment and place the database (and the script) in your filesystem with appropriate permissions for your OS and web server. then you give the URL to that web service as the WebServiceUrl constant.

  • How to delete a table type

    Hi,
    I've defined a
    type reg is table of mytable%rowtype INDEX BY BINARY_INTEGER;
    reg_tab  reg;
    In my script I load some data on reg_tab
    How can I delete the data from it? I mean I'd like to do something like delete from reg_tab; after finishing to work on reg_tab
    Thanks
    Edited by: Mark1970 on 1-lug-2010 3.23

    PL/SQL tables have the following attributes that could be used on them:
    • DELETE—Deletes rows in a table.
    • EXISTS—Return TRUE if the specified entry exists in the table.
    • COUNT—Returns the number of rows in the table.
    • FIRST—Returns the index of the first row in the table.
    • LAST—Returns the index of the last row in the table.
    • NEXT—Returns the index of the next row in the table after the specified row.
    • PRIOR—Returns the index of the previous row in the table be-fore the specified row.
    In your case, you could either use
    reg_tab.delete - to delete all rows
    reg_tab.delete (n) - to delete nth row.
    To delete all rows after inspecting them one by one ... you could use the COUNT attribute in a FOR loop similar to this...
    FOR idx in 1 .. reg_tab.COUNT
    LOOP
    -- do necessary checks
    -- reg_tab.delete (idx) ;
    END LOOP;

Maybe you are looking for

  • Printing to a PDF file directly Using Adobe's Printer driver and NO GUI

    We are on Oracle 10G running Oracle Forms/Reports 6i. I would like to be able to run Oracle Reports directly to a PDF file using Adobe's pdf driver and not oracle's pdf driver (not happy with it). (This can be done easily enough) using Adobe's PDF Co

  • Replace non ascii characters

    I have a person that is called "josée". I need "JOSEE" to be inserted into the database, not "JOSéE". I also have a person called "jürgen". I need "JURGEN" to be inserted into the database. Is there a way to do this ? (replace the non-ascii characte

  • Alarms stopped coming up

    Just recently (in the last couple of weeks), my alarms have stopped coming up. They are a message with sound, and have not come up when iCal is not open. I realised this today and started iCal, when I did this they all came up together, even though I

  • How to generate a circle of a fixed size

    I want to generate a circle of a specific size. What is the best way to do that? Also is there a good way to locate the center of an image? Thanks for any help!

  • Error message..hardware missing...agp graphics card??

    Just purchased a new iMac G5. I installed Final Cut v.4. Intallation was succesful, but when I try to run it, I get the error message Missing Hardware: AGP graphics card. Shouldn't the iMac have come with a graphics card? What's going on? iMac G5   M