Modify a script to reset fields selectively in a multiform document

The enclosed script allows to clear forms selectively page by page in a multiform document.
But the script is very limited because asks to change in each page where is inserted a new page number for the «resetFieldsOnpage(n) variable.
In a 100 pages document it is a a non-sense task, involving many steps:
go to page
touch the clear field
right mouse /properties
choose actions
select run a java script
edit the Java script
now change the number page
close
Perhaps it is possible to have a real script assigned to the same field (duplicated in all pages) that allows Acrobat understands that the button used is related to a specific page and the clearing will only affect that one.
Thanks.
function resetFieldsOnPage(p) {
    var fields = [];
    for (var i=0; i<this.numFields; i++) {
        var f = this.getField(this.getNthFieldName(i));
        if (f==null) continue;
        if (f.page==p)
            fields.push(f.name);
    this.resetForm(fields);
resetFieldsOnPage(0);

Hi, good point.
But, before, something happened here.
When I was testing the script and using it , immediately opens the script debugger window with a lot of stacks and info!
The form process is stopped.

Similar Messages

  • FIELD SELECTION KEY

    Hi,
           I have a query regarding Field Selection Key.
    I want to know the difference between Field Selection Keys AKTH, ME21, and ME21N.
    I have observed during Testing that, AKTH and ME21N are almost the same.
    But, I like to know the difference.
    Which is to be used when?
    Please give suitable suggestions in this regard.
    Thanks in advance.
    Thanks & Regards,
    Srinivasa M.S
    +91-9910077829

    Hi,
    Go through following information.
    Field selection key: -
    You should not delete the field selection keys listed below, which the dialog program uses for control purposes, otherwise the dialog may terminate during processing:
    1. Field selection key: transaction
    The field selection key that corresponds to the transaction code: for example, field selection key ME22 for the transaction "Change Purchase Order". For the Enjoy Purchase Order transactions (creating, changing, displaying), there is only field selection key ME21N.
    2. Field selection key: activity type
    Is set from the activity type as follows:
    AKTH    In creation mode
    AKTV    In change mode
    AKTA    In display mode
    AKTE    With PO extension
    You should note that you can also add items in change mode (for example, transaction ME22). Field selection key AKTH would be used for this item.
    3. Field selection key: purchasing document type
    The field selection key that you have assigned to the document type for the purchasing document. For example, field selection key UBF is assigned to document type UB, which is used for stock transfer orders (within a company code). In this key, the fields Price and Price unit are suppressed.
    4. Field selection key: item category/document category
    This is determined from the item and document categories as follows: The first two characters consist of the letters 'PT', the third character of the item category (internal representation), and the fourth of the document category:
    A   for RFQs,
    B   for purchase requisitions
    F   for purchase orders
    K   for contracts
    L   for scheduling agreements
    Accordingly, field selection key PT3F would be used for a subcontracting item in a purchase order.
    Field selection key: function authorization/release status
    Purchasing documents: Used for authorization control. If the user parameter EFB (function authorizations in Purchasing) has been assigned and a field selection key has been assigned to the relevant value, this field selection key is used. Otherwise, field selection key $$$$ is used if the user has insufficient authorization to display prices.
    Purchase requisitions: If the purchase requisition is subject to a release strategy and a field selection key has been assigned to the current release indicator, this field selection key is used.
    Field selection key: subitem/creation indicator
    Purchasing documents: Is only used in the case of subitems. The field selection key is put together in the same way as for the item categories (field selection key 4), with the string 'UP', the subitem category, and the document type.
    Purchase requisitions: the field selection key that is derived from the creation indicator in the purchase requisition, that is, ESTV, ESTF, or ESTD, is used in the case of purchase requisitions generated from within Sales and Distribution, from a production order, or through direct procurement.
    5. Field selection key: purchase requisition
    In addition to the available field selection keys, you can define a field selection key at function authorization level to influence the input characteristics of fields in the Enjoy Purchase Requisition.
    You can use this field selection key to set up groups of users that have certain restrictions when editing purchase requisitions.
    SAP Recommendation: -
    SAP recommends that you accept the settings defined in the standard system. In this case, no action is required on your part.

  • Field Selection Keys related to Purchase Order

    Hi,
           I have a query regarding Field Selection Key.
    When we go to Field Selection Screen connected to Purchase Order, we can find so many Field Selection Keys viz., $$$$, $$$2, AKTH, ME21N, etc.
    How to judge which is to be used when?
    I like to know how these Field Selection Keys are linked to Purchase Order Screen in the background.
    Please guide me in this regard by giving proper suggestions in this regard.
    Thanks in advance.
    Thanks & Regards,
    Srinivasa M.S
    +91-9910077829

    Hi Karthik,
                        Thanks for your valuable information.
    I like to know few more things.
    1) Is it possible to create our own Field Selection Key?
    2) If you observe the list of Field Selection Keys related to Purchase Order Screen, you can see that there are Field Selection Keys by name ME21N, ME21, AKTH, etc.
    If the Field Selection Keys are predefined by SAP, it is OK. But, if there is an option to create our own Field Selection Key, then what is the procedure to do the same?
    It seems that ME21N, ME21, and AKTH are used for Create Purchase Order Screen.
    There are also keys ME22N and ME23N used for Change Purchase Order Screen and Display Order Screen.
    I am little bit confused about this.
    We are linking the Field Selection Keys to the Document Types.
    But, I think it is only for create Purchase Order Screen. Please correct, if I am wrong.
    Also, I like to know how we are linking the Field Selection Keys related to Change Purchase Order Screen and Display Purchase Order Screen?
    Please clarify all my doubts by giving proper suggestions.
    Thanks in advance.
    Thanks & Regards,
    Srinivasa M.S
    +91-9910077829

  • Field selection issue in dev & quality server for PO

    Dear All,
    I have an issue regarding PO field setting in development and quality server.
    Requirement was that PO can not be created without PR (means PR is mandatory) for a particular document type ZDOM.
    So i have created new field selection filed by copying NBF field selection and assigned with document type ZDOM.
    So when i am testing this scenario in DEV server it is working fine but after transporting to Quality server, it is not working in q system.
    Again i reimpoted the same request but still it is not working. So what could be the reason?
    Pls refer the attached screen short.

    I don't know how your development is working..
    I have done the same settings in my development client. But I can still create PO without reference PR.
    Then I have tried parameter EFB. Then its working perfect..
    Use buyers authorization in OMET..
    Check the settings..
    Here untick the option W/o Reference..
    Then assign the profile to user id in SU3.
    Then try to create PO without PR.. You will receive a authorization error...
    But the problem is its user level not at client level..
    Test and revert back..

  • In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?

    In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?

    Thank you so much for your reply . . . but . . . I should have shared my original script with you -- it was a little more complicated than I led you to believer. I was triggering a group of text fields to become disabled as well as gray. Below is the original script so that when the checkbox is checked, it causes several "Co" fields to be disabled and gray.
    // Mouse Up script for check box 
    // If checked, certain fields should be disabled 
    var f_prefix = "Co"; 
    // Get a reference to all of the "Co" fields 
    var f = getField(f_prefix); 
    // Reset the Co fields 
    resetForm([f_prefix]); 
    if (event.target.value === "Off") { 
        // Enable the Co fields 
        f.readonly = false; 
        f.fillColor = color.transparent; 
    } else { 
        // Disable the Co fields 
        f.readonly = true; 
        f.fillColor = color.gray; 
    To recap -- my goal is to get those gray fields to revert to transparent if the form is reset. I'm willing to create my own custom "Reset Form" button but I'm not sure I understand how that would look. Wouldn't it be quite lengthy? I think I'm having a brain freeze -- can't figure it out!

  • Reset a select-person field?

    Reset a select-person field?
    We have a couple services where depending on the option chosen, a select person field appears and is mandatory. If they select a person, the form fields are populated. But when the customer changes to another option where the select person field is not needed. The problem arises...normally, I would hide the field and clear the vaules. But the value in a select person field is held by the information choosen from the Select Person Popup window.
    Any help would be appreciated.
    Thanks.

    Hi Tylor,
    Have you used ISF or DDRs in RC 2008 to be able set a Person-type field using a set or look-up?  I'm doing some noodling now to try and determine that and saw this article.  Looking at your comments above, you seem familiar with the person type fields!  Any advice you could give would be appreciated.
    I've tried setting the value to the RC database Person ID based on your comments above using DDR but with no luck.  We're trying to hook in to a remote Identity Management database to d

  • OPUK - Define Field Selection for WBS - diff bet. Modified and Influence

    Hi All,
    Kindly advise what is the difference between influencing and modifield field's for 'Project Systems > Structures > Operative Structures > Work Breakdown Structures (WBS) > Define Field Selection for Work Breakdown Structures (OPUK),
    Thanks!
    Regards,
    Vivian

    modified field is the field on which the impact is registered i.e hide, mandatoru etc
    Influence is the field that is the reason why the modified field needs to be changed
    for example if you have two project profiles
    then for one project profiel you can have say the resp cost centre mandatory and for the other you can have the resp cost centre hidden
    In this example the project profile is the influencing field and resp cost centre is the modified field

  • Modify field selection for field "Reservation/Purc.req"  RESBD-AUDISP

    I have alredy modify field in network using OPUA (field selection network header) and set the field "Reservation/Purc.req" CAUFVD-AUDISP make it to only display. But I need to set also the field "Reservation/Purc.req"  RESBD-AUDISP to make it display. How can I do that?

    Hi,
    Business functionality is switched off.
    Check this link:
    <link removed by moderator>
    and search OPS_PS_CI_1 under ENTERPRISE_BUSINESS_FUNCTIONS in SFW5 TCODE and check whether it is switched on or off.
    Regards,
    Harsh.
    Edited by: Virendra Pal on Oct 19, 2010 2:03 PM

  • 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.

  • How can I modify this script to return only certain rows of my mySQL table?

    Hi there,
    I have a php script that accesses a mySQL database and it was generated out of the Flex Builder wizard automatically. The script works great and there are no problems with it. It allows me to perform CRUD on a table by calling it from my Flex app. and it retrieves all the data and puts it into a nice MXML format.
    My question, currently when I call "findAll" to retrieve all the data in the table, well, it retrieves ALL the rows in the table. That's fine, but my table is starting to grow really large with thousands of rows.
    I want to modify this script so that I can pass a variable into it from Flex so that it only retrieves the rows that match the "$subscriber_id" variable that I pass. In this way the results are not the entire table's data, only the rows that match 'subscriber_id'.
    I know how to pass a variable from Flex into php and the code on the php side to pick it up would look like this:
    $subscriberID = $_POST['subscriberID'];
    Can anyone shed light as to the proper code modification in "findAll" which will take my $subscriberID variable and compare it to the 'subscriber_id' field and then only return those rows that match? I think it has something to do with lines 98 to 101.
    Any help is appreciated.
    <?php
    require_once(dirname(__FILE__) . "/2257safeDBconn.php");
    require_once(dirname(__FILE__) . "/functions.inc.php");
    require_once(dirname(__FILE__) . "/XmlSerializer.class.php");
    * This is the main PHP file that process the HTTP parameters,
    * performs the basic db operations (FIND, INSERT, UPDATE, DELETE)
    * and then serialize the response in an XML format.
    * XmlSerializer uses a PEAR xml parser to generate an xml response.
    * this takes a php array and generates an xml according to the following rules:
    * - the root tag name is called "response"
    * - if the current value is a hash, generate a tagname with the key value, recurse inside
    * - if the current value is an array, generated tags with the default value "row"
    * for example, we have the following array:
    * $arr = array(
    *      "data" => array(
    *           array("id_pol" => 1, "name_pol" => "name 1"),
    *           array("id_pol" => 2, "name_pol" => "name 2")
    *      "metadata" => array(
    *           "pageNum" => 1,
    *           "totalRows" => 345
    * we will get an xml of the following form
    * <?xml version="1.0" encoding="ISO-8859-1"?>
    * <response>
    *   <data>
    *     <row>
    *       <id_pol>1</id_pol>
    *       <name_pol>name 1</name_pol>
    *     </row>
    *     <row>
    *       <id_pol>2</id_pol>
    *       <name_pol>name 2</name_pol>
    *     </row>
    *   </data>
    *   <metadata>
    *     <totalRows>345</totalRows>
    *     <pageNum>1</pageNum>
    *   </metadata>
    * </response>
    * Please notice that the generated server side code does not have any
    * specific authentication mechanism in place.
    * The filter field. This is the only field that we will do filtering after.
    $filter_field = "subscriber_id";
    * we need to escape the value, so we need to know what it is
    * possible values: text, long, int, double, date, defined
    $filter_type = "text";
    * constructs and executes a sql select query against the selected database
    * can take the following parameters:
    * $_REQUEST["orderField"] - the field by which we do the ordering. MUST appear inside $fields.
    * $_REQUEST["orderValue"] - ASC or DESC. If neither, the default value is ASC
    * $_REQUEST["filter"] - the filter value
    * $_REQUEST["pageNum"] - the page index
    * $_REQUEST["pageSize"] - the page size (number of rows to return)
    * if neither pageNum and pageSize appear, we do a full select, no limit
    * returns : an array of the form
    * array (
    *           data => array(
    *                array('field1' => "value1", "field2" => "value2")
    *           metadata => array(
    *                "pageNum" => page_index,
    *                "totalRows" => number_of_rows
    function findAll() {
         global $conn, $filter_field, $filter_type;
          * the list of fields in the table. We need this to check that the sent value for the ordering is indeed correct.
         $fields = array('id','subscriber_id','lastName','firstName','birthdate','gender');
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         $order = "";
         if (@$_REQUEST["orderField"] != "" && in_array(@$_REQUEST["orderField"], $fields)) {
              $order = "ORDER BY " . @$_REQUEST["orderField"] . " " . (in_array(@$_REQUEST["orderDirection"], array("ASC", "DESC")) ? @$_REQUEST["orderDirection"] : "ASC");
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //get the page number, and the page size
         $pageNum = (int)@$_REQUEST["pageNum"];
         $pageSize = (int)@$_REQUEST["pageSize"];
         //calculate the start row for the limit clause
         $start = $pageNum * $pageSize;
         //construct the query, using the where and order condition
         $query_recordset = "SELECT id,subscriber_id,lastName,firstName,birthdate,gender FROM `modelName` $where $order";
         //if we use pagination, add the limit clause
         if ($pageNum >= 0 && $pageSize > 0) {     
              $query_recordset = sprintf("%s LIMIT %d, %d", $query_recordset, $start, $pageSize);
         $recordset = mysql_query($query_recordset, $conn);
         //if we have rows in the table, loop through them and fill the array
         $toret = array();
         while ($row_recordset = mysql_fetch_assoc($recordset)) {
              array_push($toret, $row_recordset);
         //create the standard response structure
         $toret = array(
              "data" => $toret,
              "metadata" => array (
                   "totalRows" => $totalrows,
                   "pageNum" => $pageNum
         return $toret;
    * constructs and executes a sql count query against the selected database
    * can take the following parameters:
    * $_REQUEST["filter"] - the filter value
    * returns : an array of the form
    * array (
    *           data => number_of_rows,
    *           metadata => array()
    function rowCount() {
         global $conn, $filter_field, $filter_type;
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //create the standard response structure
         $toret = array(
              "data" => $totalrows,
              "metadata" => array()
         return $toret;

    Hi there,
    I have a php script that accesses a mySQL database and it was generated out of the Flex Builder wizard automatically. The script works great and there are no problems with it. It allows me to perform CRUD on a table by calling it from my Flex app. and it retrieves all the data and puts it into a nice MXML format.
    My question, currently when I call "findAll" to retrieve all the data in the table, well, it retrieves ALL the rows in the table. That's fine, but my table is starting to grow really large with thousands of rows.
    I want to modify this script so that I can pass a variable into it from Flex so that it only retrieves the rows that match the "$subscriber_id" variable that I pass. In this way the results are not the entire table's data, only the rows that match 'subscriber_id'.
    I know how to pass a variable from Flex into php and the code on the php side to pick it up would look like this:
    $subscriberID = $_POST['subscriberID'];
    Can anyone shed light as to the proper code modification in "findAll" which will take my $subscriberID variable and compare it to the 'subscriber_id' field and then only return those rows that match? I think it has something to do with lines 98 to 101.
    Any help is appreciated.
    <?php
    require_once(dirname(__FILE__) . "/2257safeDBconn.php");
    require_once(dirname(__FILE__) . "/functions.inc.php");
    require_once(dirname(__FILE__) . "/XmlSerializer.class.php");
    * This is the main PHP file that process the HTTP parameters,
    * performs the basic db operations (FIND, INSERT, UPDATE, DELETE)
    * and then serialize the response in an XML format.
    * XmlSerializer uses a PEAR xml parser to generate an xml response.
    * this takes a php array and generates an xml according to the following rules:
    * - the root tag name is called "response"
    * - if the current value is a hash, generate a tagname with the key value, recurse inside
    * - if the current value is an array, generated tags with the default value "row"
    * for example, we have the following array:
    * $arr = array(
    *      "data" => array(
    *           array("id_pol" => 1, "name_pol" => "name 1"),
    *           array("id_pol" => 2, "name_pol" => "name 2")
    *      "metadata" => array(
    *           "pageNum" => 1,
    *           "totalRows" => 345
    * we will get an xml of the following form
    * <?xml version="1.0" encoding="ISO-8859-1"?>
    * <response>
    *   <data>
    *     <row>
    *       <id_pol>1</id_pol>
    *       <name_pol>name 1</name_pol>
    *     </row>
    *     <row>
    *       <id_pol>2</id_pol>
    *       <name_pol>name 2</name_pol>
    *     </row>
    *   </data>
    *   <metadata>
    *     <totalRows>345</totalRows>
    *     <pageNum>1</pageNum>
    *   </metadata>
    * </response>
    * Please notice that the generated server side code does not have any
    * specific authentication mechanism in place.
    * The filter field. This is the only field that we will do filtering after.
    $filter_field = "subscriber_id";
    * we need to escape the value, so we need to know what it is
    * possible values: text, long, int, double, date, defined
    $filter_type = "text";
    * constructs and executes a sql select query against the selected database
    * can take the following parameters:
    * $_REQUEST["orderField"] - the field by which we do the ordering. MUST appear inside $fields.
    * $_REQUEST["orderValue"] - ASC or DESC. If neither, the default value is ASC
    * $_REQUEST["filter"] - the filter value
    * $_REQUEST["pageNum"] - the page index
    * $_REQUEST["pageSize"] - the page size (number of rows to return)
    * if neither pageNum and pageSize appear, we do a full select, no limit
    * returns : an array of the form
    * array (
    *           data => array(
    *                array('field1' => "value1", "field2" => "value2")
    *           metadata => array(
    *                "pageNum" => page_index,
    *                "totalRows" => number_of_rows
    function findAll() {
         global $conn, $filter_field, $filter_type;
          * the list of fields in the table. We need this to check that the sent value for the ordering is indeed correct.
         $fields = array('id','subscriber_id','lastName','firstName','birthdate','gender');
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         $order = "";
         if (@$_REQUEST["orderField"] != "" && in_array(@$_REQUEST["orderField"], $fields)) {
              $order = "ORDER BY " . @$_REQUEST["orderField"] . " " . (in_array(@$_REQUEST["orderDirection"], array("ASC", "DESC")) ? @$_REQUEST["orderDirection"] : "ASC");
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //get the page number, and the page size
         $pageNum = (int)@$_REQUEST["pageNum"];
         $pageSize = (int)@$_REQUEST["pageSize"];
         //calculate the start row for the limit clause
         $start = $pageNum * $pageSize;
         //construct the query, using the where and order condition
         $query_recordset = "SELECT id,subscriber_id,lastName,firstName,birthdate,gender FROM `modelName` $where $order";
         //if we use pagination, add the limit clause
         if ($pageNum >= 0 && $pageSize > 0) {     
              $query_recordset = sprintf("%s LIMIT %d, %d", $query_recordset, $start, $pageSize);
         $recordset = mysql_query($query_recordset, $conn);
         //if we have rows in the table, loop through them and fill the array
         $toret = array();
         while ($row_recordset = mysql_fetch_assoc($recordset)) {
              array_push($toret, $row_recordset);
         //create the standard response structure
         $toret = array(
              "data" => $toret,
              "metadata" => array (
                   "totalRows" => $totalrows,
                   "pageNum" => $pageNum
         return $toret;
    * constructs and executes a sql count query against the selected database
    * can take the following parameters:
    * $_REQUEST["filter"] - the filter value
    * returns : an array of the form
    * array (
    *           data => number_of_rows,
    *           metadata => array()
    function rowCount() {
         global $conn, $filter_field, $filter_type;
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //create the standard response structure
         $toret = array(
              "data" => $totalrows,
              "metadata" => array()
         return $toret;

  • Urgent:How to modify a script without changing the print programme

    Hi all,
    Can any body pls tell me <b>How to modify a script without changing the print programme</b>
    Give m esome real time examples.
    Good points willbe rewarded
    Thanks

    Hi
    You can write a external Subroutine to fetch the extra data into the script program
    see the following sample code
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    COPING SCRIPT
    There are some Standard Sap Scripts in SAP. We cant directly execute them in scripts we have to use some T-codes and by giving some input to the required fields we can see the output printform.
    I will show one example. There are some Standard Sap Scripts such as MEDRUCK which is a standard Sap Script for Purchase Order and RVINVOICE01 for billing and so on...
    To see oupt of MEDRUCK go to T-code ME9F give purchase order number and execute select one number and click on dislplay messages button on application tool bar you can find the print form of MEDRUCK.
    You cannot change the Standard Sap Scripts but you can use Standard Sap Scripts and Copy them to userdefined Script and can make changes to them and replace standard Sap Script with usedefind script.
    Ex: Go to SE71,
    on menu bar u find Utilities->copy from Client. click on it u ll find new screen showing
    Form name:
    Source Clinet:
    Target Form:
    give Form name as usedefined form name EX: ZFORM1
    Source client as 000 and
    Target form as MEDRUCK.
    execute.
    Now, the standard from MEDRUCK is copyied to your form ZFORM1.
    NOW, go to SE71 and give form name as ZFORM1 and do some changes to the form such as adding logo any thing. save and Activate.
    Now, you have done changes to the Form ZFORM1 and u have to replace your form with standard SAP Script.
    Go to NACE Transaction.
    on Applications select EF for purchase order and click Output types button on application tool bar.
    now select NEU as output types dobule click on Processing Routines.
    now click on Change option on application tool bar and on right side u find MEDRUCK in form place replace MEDRUCK with ZFORM1 and SAVE.
    go back twice and now go to T-code ME9F give the purchase order number and execute and select one option and click on display messges button .
    you will find the changes that you have done in ZFORM1. so we cant chage the standard Sap Scripts by copying the Standard Sap Scripts we can chage and replace with our forms
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4089895&messageID=3239299
    Regards
    Message was edited by:
            Kiran Sure(skk)

  • Signing: Empty list in "Field Selection" when picking fields to mark as read-only on signing

    I have a PDF form with some signature fields. I am attempting to mark some of the fields in the document as read-only when the document is signed. This is what I did:
    1. Modify the "Signed" properties of the signature field.
    2. Choose "Mark as read-only" and "Just these fields" in the drop down list beside this option.
    3. Click on the "Pick" button to select the fields to be marked read-only when the user signs this field.
    In the "Field Selection" dialog that comes up, nothing is shown in the list.
    Am I doing something wrong? Is there something I need to do to add fields to this list, or should it be populated automatically allowing me to choose what I want?
    I noticed this feature is only available for Acrobat 6.0 and later. The compatibility level for the document I created is 1.6 (Acrobat 7 and later). It is created in Acrobat X.
    Just figuring my way around these things. Did a google search for any solutions, but couldn't find anything on this.
    Any help would be greatly appreciated.
    Thanks,
    Ron

    Hi Ron,
    It certainly sounds like you are on the right track.What version of Acrobat are you using, is it Pro or Standard, Mac or Win? I see where you mentioned the file was created in Acrobat X, but I'm not sure that the app that create the PDF file is the same version as the one you are using for editing.
    Steve

  • Contract and release order for service: connection and field selection

    Hi Experts,
    I have some questions about contract and release order (PO against contarct) for services.
    A -I want ot know if there is any standar way to oblige the creation of a release order to a contract. I mean i had some users  that create a release order w/o reference to the contract and it works fine anyway. The document is a copy of the NB. I cant find the way to reference the 2 purchase document clearly.
    B - Using a release order, when copying the item from contract catalogue by clicking the service selection icon,  description and net price are correctly copied:  the description is not modifiable  but the net price can be change by the user. Can some body explain me where to modify this setting? where is the field selection and where in SPRO step by step please,
    thanks in advance
    Livio

    ... Nobody is so nice to suggest me any solution?  
    For the point A probably the only way is user-exit.... but for B i don't have any idea, please let me know
    thanks
    Livio

  • Use of field selection Key.

    Hello
    I am implementing  the release strategy for the Purchase requisition. can anyone please tell me what is the significance of "Field selection key" and "Value change" under the release indicator.
    Regards

    Dear,
    In the standard system, SAP will not allow changes to the quantity, unit of measure, or price when an approver is executing the release
    transaction. If you require that other fields, such as delivery date, plant, etc., not be modified via the release transaction, this field selection key is useful.
    Field selection key: If you want to allow certain fields to be changed during or after a release, you can modify the Field Selection Key. To modify the Field Selection Key, follow the menu path in the IMG: Materials Management > Purchasing > Purchase Requisition >
    Define Screen Layout at Document level. Once you have created a custom field selection key, you should create a custom release indicator by maintaining a new entry in the u201CCreate Release Indicatorsu201D screen.
    It is also possible to configure the release to not be restarted if the amounts have only changed a specified percentage. To do this, enter u201C4 - Changeable, new release in case of new strategy or valueu201D and a percentage in the u201CValue chgsu201D field.
    Regards,
    Syed Hussain.

  • Set Field Selection for Completion Confirmation

    I want to change the indicator of one field from "ready to input" to "required"..But i couldnt understand exactly the hierarchy under "Set Field Selection for Completion Confirmation"  tab in SPRO. there are 3 parts under that tab;
    1-PM: Confirmation - initial screen
    2-PM: Confirmation - list and detail
    3-PM: Confirmation - parameter
    and i also couldnt find the name of my field which is about "codes for causes"..
    Thanks...

    Russ,
      I don't think it could be accomplished through configuration or through Transaction variants.
    I think the simplest way to accomplish this would be by using one of the below user exits according to your needs.
    CONFPM02: Customer-specific entry checks 1
    CONFPM03: Customer-specific check by operation selection
    CONFPM04: Customer-specific entry checks 2
    The other option would be to use the Implicit enhancement functionality(If you are in EC C6.0 or above)  to modify the table control field attributes dynamically.
    Regards
    Narasimhan

Maybe you are looking for

  • Multiple foreign keys to a single table

    Hi, I need to write an SQL sentence to bring a unique row formed from multiple foreign keys which are dependent on the same table. The two tables as follow: CREATE TABLE UNIDADMEDIDA ( IDUNIDADMEDIDA NUMERIC(3) NOT NULL, DESCRIPCION VARCHAR2(128) NOT

  • Let's Be Honest / Save Time: Lenovo T430s (NVIDIA) DOES NOT Support Multiple Monitors

    There have been a few comments / complaints / articles around the web regarding the T430s and difficulties using multiple monitors. But since this capabilitiy is clearly documented in all of Lenovo's specifications and marketing literature, I went ah

  • Adobe Reader Printing first page miniature - rest fine

    Hi, Currently running Reader 11.0.07 and am having a printing issue similar to the below known issue in Reader X. "Xerox printers shrink page content to 1/10 or 1/20 of the original size, and print the content in the upper left part of the paper. Thi

  • Dual 2,5GHz G5 with startup problems

    Hi, I have a Dual 2,5GHz (June 2004 model) G5 with the following problem: When I try to turn it on, the screen sometimes stays dark. This is often the case the first time in the morning. Occasionally when this happens the front power LED is off. I ha

  • Exporting to JPG and keeping the bleed

    How do i export my indesign file with bleed into a jpg ?  I can do that if I export it to PDF.  But it don't have any option for me to do that if I export it to JPG