Help on Scripts

Hi Gurus,
          My requirement is i need to change the standard script MEDRUCK and insert one filed in "Info" window. Please can any one guide me how to do this.
          Thanks in advance.
Thanks and Regards
Srihari.

Hi
I saw a simmilar case in MEDRUCK. FInd below the question and answer and do accordingly in ur case too..
Question:
I have copied from standard form medruck.
i want add the telephone no. field in the address window.please give me the synatax.
Answer:
In the address window you need to call a subroutine of a subroutine-pool program sending the customer no. and fetch the telephone no in that subroutine and send it back to layout and print.
/: PERFORM GET_TELNO IN PROGRAM ZTEST
/: USING & -KUNNR&
/: CHANGING &TELNO&
/: ENDPERFORM.
/* &TELNO&
mention the proper fieldname of kunnr.
write this in ztest.
FORM GET_TELNO TABLE INPUT STRUCTURE ITCSY OUTPUT STRUCTURE ITCSY.
*itcsy contains two columns name & value. name contains the fieldname & value contains the value of it.
READ TABLE INPUT WITH KEY NAME = -KUNNR. " MENTION THE FIELDNAME U PASSED
L_KUNNR = INPUT-VALUE.
SELECT SINGLE TELNO FROM KNA1 INTO L_TELNO WHERE KUNNR = L_KUNNR.
READ TABLE OUTPUT WITH KEY NAME = 'TELNO'.
OUTPUT-VALUE = L_TELNO.
MODIFY OUTPUT INDEX SY-TABIX TRANSPORTING VALUE.
ENDFORM.

Similar Messages

  • With the help of script i want to identify each and every thing in a indesign file

          i want to identify the each and every thing in a .indd file with help of script.and also i have to find totally how many farmes or things present in that file
    kindly guys help me out.
    and also suggest me some ideas.
    thanks in advance
    regards,
    siv 

    thanks ya...
    Actually my recuirment is there will be so many number of frame or text frame will present there in a indd file
    >with the help script im giving number to the script label . it follows the order of Stack
    (the frame designed latest will get the latest script label)
    >in a particular order the frame has to get numbered in script label
    i.e
    either from right to left or left to right.
    hope u got my point
    kindly help me out
    regards siv

  • Hello i need a help about script to export translatable text strings from ai files and import them back

    Hello i need a help about script to export translatable text strings from ai files and import them back after editing, thanks in advance

    Lanny -
    Thank you for taking the time to help with this problem. Can I just say however that as someone who has posted a first comment here and quite clearly never used a forum like this before, your comment unfortunately comes across as very excluding. It makes me feel there are a set of unwritten rules that I should know, and that I don't know them shows that the forum is not for me. In short, it's exactly the kind of response that stops people like me using forums like this.
    I'm sure it's not intended to be received like this and I am sure that the way you have responded is quite normal in the rules of a forum like this. However, it is not normal for those of us who aren't familiar with forums and who only encounter them when they have a genuine problem. This is why I hope it is helpful to respond in full.
    The reason I posted here is as follows. I was directed here by the apple support website. The original comment seemed to be the only one I could find which referred to my issue. As there is no obvious guidance on how to post on a forum like this it seemed perfectly reasonable to try and join in a conversation which might solve more than one problem at once.
    Bee's reply however is both helpful and warm. This could in fact be a template for how new members should be welcomed and inducted into the rules of the forum in a friendly and inclusive way. Thank you very much indeed Bee!

  • Help with Script created to check log files.

    Hi,
    I have a program we use in our organization on multiple workstations that connect to a MS SQL 2005 database on a Virtual Microsoft 2008 r2 Server. The program is quite old and programmed around the days when serial connections were the most efficient means
    of connection to a device. If for any reason the network, virtual server or the SAN which the virtual server runs off have roughly 25% utilization or higher on its resources the program on the workstations timeout from the SQL database and drop the program
    from the database completely rendering it useless. The program does not have the smarts to resync itself to the SQL database and it just sits there with "connection failed" until human interaction. A simple restart of the program reconnects itself
    to the SQL database without any issues. This is fine when staff are onsite but the program runs on systems out of hours when the site is unmanned.
    The utilization of the server environment is more than sufficient if not it has double the recommended resources needed for the program. I am in regular contact with the support for the program and it is a known issue for them which i believe they do not
    have any desire to fix in the near future. 
    I wish to create a simple script that checks the log files on each workstation or server the program runs on and emails me if a specific word comes up in that log file. The word will only show when a connection failure has occurred.
    After the email is sent i wish for the script to close the program and reopen it to resync the connection.
    I will schedule the script to run ever 15 minutes.
    I have posted this up in a previous post about a month ago but i went on holidays over xmas and the post died from my lack or response.
    Below is what i have so far as my script. I have only completed the monitoring of the log file and the email portion of it. I had some help from a guy on this forum to get the script to where it is now. I know basic to intermediate scripting so sorry for my
    crudity if any.
    The program is called "wasteman2G" and the log file is located in \\servername\WasteMan2G\Config\DCS\DCS_IN\alert.txt
    I would like to get the email side of this script working first and then move on to getting the restart of the program running after.
    At the moment i am not receiving an error from the script. It runs and doesn't complete what it should.
    Could someone please help?
    Const strMailto = "[email protected]"
    Const strMailFrom = "[email protected]"
    Const strSMTPServer = "mrc1tpv002.XXXX.local"
    Const FileToRead = "\\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\alert.txt"
    arrTextToScanFor = Array("SVR2006","SVR2008")
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
    Set oFile = objFSO.GetFile(FileToRead)
    dLastCreateDate = CDate(WshShell.RegRead("HKLM\Software\RDScripts\CheckTXTFile\CreateDate"))
    If oFile.DateCreated = dLastCreateDate Then
    intStartAtLine = CInt(WshShell.RegRead("HKLM\Software\RDScripts\CheckTXTFile\LastLineChecked"))
    Else
    intStartAtLine = 0
    End If
    i = 0
    Set objTextFile = oFile.OpenAsTextStream()
    Do While Not objTextFile.AtEndOfStream
    If i < intStartAtLine Then
    objTextFile.SkipLine
    Else
    strNextLine = objTextFile.Readline()
    For each strItem in arrTextToScanFor
    If InStr(LCase(strNextLine),LCase(strItem)) Then
    strResults = strNextLine & vbcrlf & strResults
    End If
    Next
    End If
    i = i + 1
    Loop
    objTextFile.close
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\FileChecked", FileToRead, "REG_SZ"
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\CreateDate", oFile.DateCreated, "REG_SZ"
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\LastLineChecked", i, "REG_DWORD"
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\LastScanned", Now, "REG_SZ"
    If strResults <> "" Then
    SendCDOMail strMailFrom,strMailto,"VPN Logfile scan alert",strResults,"","",strSMTPServer
    End If
    Function SendCDOMail( strFrom, strSendTo, strSubject, strMessage , strUser, strPassword, strSMTP )
    With CreateObject("CDO.Message")
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTP
    .Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic
    .Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strUser
    .Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strPassword
    .Configuration.Fields.Update
    .From = strFrom
    .To = strSendTo
    .Subject = strSubject
    .TextBody = strMessage
    On Error Resume Next
    .Send
    If Err.Number <> 0 Then
    WScript.Echo "SendMail Failed:" & Err.Description
    End If
    End With
    End Function

    Thankyou for that link, it did help quite a bit. What i wanted was to move it to csript so i could run the wscript.echo in commandline. It all took to long and found a way to complete it via Batch. I do have a problem with my script though and you might
    be able to help.
    What i am doing is searching the log file. Finding the specific words then outputting them to an email. I havent used bmail before so thats probably my problem but then im using bmail to send me the results.
    Then im clearing the log file so the next day it is empty so that when i search it every 15 minutes its clean and only when an error occurs it will email me.
    Could you help me send the output via email using bmail or blat?
    @echo off
    echo Wasteman Logfile checker
    echo Created by: Reece Vellios
    echo Date: 08/01/2014
    findstr "SRV2006 & SRV2008" \\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt > c:\log4mail.txt
    if %errorlevel%==0 C:\Documents and Settings\rvellios\Desktop\DCS Checker\bmail.exe -s mrc1tpv002.xxx.local -t [email protected] -f [email protected] -h -a "Process Dump" -m c:\log4mail.txt -c
    for %%G in (\\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt) do (copy /Y nul "%%G")
    This the working script without bmail
    @echo off
    echo Wasteman Logfile checker
    echo Created by: Reece Vellios
    echo Date: 08/01/2014
    findstr "SRV2006 & SRV2008" \\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt > C:\log4mail.txt
    if %errorlevel%==0 (echo Connection error)
    for %%G in (\\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt) do (copy /Y nul "%%G")
    I need to make this happen:
    If error occurs at "%errorlevel%=0" then it will output the c:\log4mail.txt via smtp email using bmail.

  • Help with scripting: need to import Excel files into PS type layers

    Howdy all,
    I have a series of TV commercials provided to me as layered PS files.  I work in CS3 and export to Avid for editing.
    For customization, I need to import their Excel list of phone numbers and duplicate each one into a type layer with existing efx and placement.
    There are 30-60 #s, which appear in 2 locations, so automation is key (just finished a 45 # series, and they have more!)
    I dont know how to script this, and would appreciate any guidance. I am not asking for someone to do it for me, just help me learn what I have to do.
    Dave Koslow

    From Excel save your file out as either CSV or TDT from the drop down 'save as' options. Once you have a plain text file script will be able to read the text file using which ever delimiter best suits you and create an array of string variables that you can use within photoshop to assign to the contents of a text layer…

  • Help! Script that works in 8.1.7 does not work in 9.2.0

    I have a generic hot backup script that runs well in our 8i environment where I source the username and password for SYS from a secured txt file. However I could not get the script to work in our recently installed 9.2.0 environment.
    Below is an extract of the hot backup script:
    # Set environment
    . ${HOME}/BACKUP/${DBNAME}.env
    CONNECT_STRING=`${HOME}/admin/Util/syspass.sh sys $DBNAME`
    export CONNECT_STRING
    #Define some commands and files
    SQLPLUS="${ORACLE_HOME}/bin/sqlplus -s ${CONNECT_STRING}"
    TIME_STAMP=`date +"%d-%b-%Y"`
    # Test for duplicate filenames
    $SQLPLUS <<-EOF
    var numfiles number;
    BEGIN
    SELECT count(*) into :numfiles
    FROM dba_data_files a, dba_data_files b
    WHERE a.file_name != b.file_name
    AND SUBSTR(a.file_NAME, INSTR(a.file_name, '/', -1) + 1)
    = SUBSTR(b.file_NAME, INSTR(b.file_name, '/', -1) + 1);
    END;
    exit :numfiles
    EOF
    FILE_ERROR=$?
    echo "Number of duplicate files $FILE_ERROR"
    if [ $FILE_ERROR -gt 0 ]; then
    echo "Aborting, ... $FILE_ERROR duplicate filenames"
    exit
    fi
    As per the extract above,
    in our 8.1.7 environment,
    (1) the command CONNECT_STRING=`${HOME}/admin/Util/syspass.sh sys $DBNAME`
    will result in CONNECT_STRING=sys/xxxxxx@<sid>
    (2) the command SQLPLUS="${ORACLE_HOME}/bin/sqlplus -s ${CONNECT_STRING}"
    will result in SQLPLUS=/usr/oracle/product/8.1.7/bin/sqlplus -s sys/xxxxxx@<sid>
    (3) and when issue $SQLPLUS <<-EOF
    it connects fine and execute the procedure successfully.
    in Oracle 9.2.0,
    (1) the command CONNECT_STRING=`${HOME}/admin/Util/syspass.sh sys $DBNAME`
    works fine with result same as in 8.1.7 - CONNECT_STRING=sys/xxxxxx@<sid>
    (2) the command SQLPLUS="${ORACLE_HOME}/bin/sqlplus -s ${CONNECT_STRING}"
    works fine with result SQLPLUS=/usr/oracle/product/9.2.0/bin/sqlplus -s sys/xxxxxx@<sid>
    (3) However, when issue $SQLPLUS <<-EOF returns an error:
    ERROR:
    ORA-28009: connection to sys should be as sysdba or sysoper
    How can I fix that??
    Is it because of the username/password structure (sys/xxxxxx@<sid>)??
    I would like to keep such username/password format if possible.
    I have also tried to hard coded the username/password for variable SQLPLUS as:
    SQLPLUS="/usr/oracle/product/9.2.0/bin/sqlplus -S '/ as sysdba'"
    But it still doesn't work when issue $SQLPLUS, it returns the following:
    Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
    where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
    <logon> ::= <username>[<password>][@<connect_string>] | / | /NOLOG
    <start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
    "-H" displays the SQL*Plus version banner and usage syntax
    "-V" displays the SQL*Plus version banner
    "-L" attempts log on just once
    "-M <o>" uses HTML markup options <o>
    "-R <n>" uses restricted mode <n>
    "-S" uses silent mode
    Any ideas as to how to have the script run in 9.2.0??
    Your help is much appreciated.

    Hi, I tried CJ’s suggestion; however it still doesn’t work for me.
    I tried assigning the command line to a variable, I tried to log in directly from the command line, and both don’t work (see below). What did I do wrong??
    $ SQLPLUS="/usr/oracle/product/9.2.0/bin/sqlplus -S \"sys/xxxxxx@<sid> as sysdba\""
    $ echo $SQLPLUS
    /usr/oracle/product/9.2.0/bin/sqlplus -S "sys/xxxxxx@<sid> as sysdba"
    $ $SQLPLUS
    Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
    where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
    <logon> ::= <username>[<password>][@<connect_string>] | / | /NOLOG
    <start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
    "-H" displays the SQL*Plus version banner and usage syntax
    "-V" displays the SQL*Plus version banner
    "-L" attempts log on just once
    "-M <o>" uses HTML markup options <o>
    "-R <n>" uses restricted mode <n>
    "-S" uses silent mode
    $ sqlplus "sys/xxxxxx@<sid> as sysdba"
    SQL*Plus: Release 9.2.0.4.0 - Production on Wed Mar 24 08:53:05 2004
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    ERROR:
    ORA-01031: insufficient privileges

  • Need Help in scripts relating to subscripts

    I have encountered a HUGE problem in flash and I desperately
    need urgent help from flash experts out there so please hear me
    out. Here it goes >> I am currently working on ‘fill in
    the blanks’ questions and answer for my chemistry project and
    the thing is , I need to ENABLE other people who are going to do
    the questions I created to type ‘subscripts’ for
    example ‘3 2’. Now I have seen similar questions from
    other flash documents is also requires entering of
    ‘subscripts’ and they used some script in the flash
    document, WHICH is the user( person who is answering the questions)
    can type in normal fonts as well as subscripts by HOLDING down ALT
    key and typing the number, and the subscript would appear in the
    selected INPUT BOX. i have attached an image below for better
    understanding of my problem.
    http://img239.imageshack.us/my.php?image=problemyd5.jpg
    apart from that, i am also looking for a script that i can insert
    into my 'check' button at the bottom of the page to check the
    answers. To be specific, the script must be able to check the
    answers WHICH also includes SUBSCRIPTS for example '
    HNO[SIZE="2"]3[/SIZE] or H[SIZE="2"]2[/SIZE]O ' as I fail to obtain
    the first script i mentioned which is the script that enables one
    to type in normal fonts AND subscripts by holding ALT key or
    something similar to that, i also fail to come up with a proper
    script for my 'check' button to check my answers. I hope readers of
    this passage are able to understand what i am trying to say here as
    well as help me solve my dilemma that i am facing. IN a nutshell, i
    am need 2 types of scripts now .....which are
    1) script that enables one to type in subscript by holding
    down the 'alt' key and typing the letter at the same time 2)and the
    second script which when embedded to my 'check' button, when
    CLICKED will be able to check the answers which includes
    SUBSCRIPTS.
    if you need any further information to have a better
    understanding, do tell and i will provide more pictures or even
    flash documents.

    No I am just using SET DATE MASK command to make it appear as required but that is changing my value at the other window also so I dont want this date format anywhere else other than footer.
    Thanks
    Sudharshan

  • Help with script to eject an external drive and change Network Location?

    Hello,
    Could someone help me with a script that would do the following:
    -eject an external hard drive call "1TB_BU"
    -change the Network System Preferences Location from "Work" to "Home"
    I then need another that would change the Location from "Home" to "Work"
    THx!
    ~Von

    1. Use the following:
    tell application "Finder"
    eject disk "1TB_BU"
    end tell
    2. Click here for information.
    (35975)

  • Urgent help in script

    Hi all,
    I have a script with 2 pages first and next
    i have two main windows 00 and 01 per page.
    I have records like
    type mat matdes
    a 1 abc
    b 2 abcd
    a 3 abcde
    b 4 bggu
    I want to display in my script as
    type mat matdes --inside a box
    a 1 abc
    a 3 abcde
    type mat matdes --inside a box.
    b 2 abcd
    b 4 bggu
    my requirement is
    1)i want a box for type mat matdes headings
    2) i wnat to display everything in 1 window i.e main 00 or main 01,
    i.e i dont type mat matdes in mianwindow 00
    and
    b 2 abcd
    b 4 bggu
    in mainwindow 01.
    or
    i dont type mat matdes in mianwindow 01 of page first
    and
    b 2 abcd
    b 4 bggu
    in mainwindow 00 of page next.
    mY CODE IS LIKE
    /E ITEM
    /: PROTECT
    /: IF &TYPE1& NE ' '.
    P TYPE Material Description
    /: ENDIF.
    Q &TYPE1& &MATNR& &MAKTX&
    /: ENDPROTECT
    tHIS IS MY DRIVER PROGRAM.
    LOOP AT ITAB.
    CLEAR TYPE.
    AT NEW TYPE.
    TYPE1 = ITAB-TYPE.
    ENDAT.
    WRITE_FORM
    ITEM
    END LOOP.
    WHAT I SEE IN MY OUTPUT IS,
    1)i DON'T HOW TO WRITE THE CODE FOR BOX, BECAUSE THE YPOS IS DETERMINED BASED ON THE NO OF RECORD FOR EACH TYPE,
    2)i GET THE PROTECT END PROTECT WORKING FOR MAIN WINDOW 00 TO MAIN WINDOW 01 IN FIRST PAGE,
    BUT IT DOESN'T WORK FOR MAIN WINDOW 01 OF FIRST PAGE TO MAIN WINDOW OF WINDOW 00 OF NEXT PAGE AND
    ALSO IT DOESN'T WORK FROM MAIN WINDOW 00 TO MAIN WINDOW 01 OF NEXT PAGE.
    the number of items for type may vary some times type a has 4 and some times 5 .
    so it varies.
    Any help regarding would be greatly appreciated and its bit urgent.
    Thanks in advance.

    Hi all,
    Please read carefully,
    i know how to write box,
    I need box in mainwindow multiple times.
    type  mat mat des  this box
    record1
    record2.
    type mat matdes des again this in box.
    record3
    record4
    record5.
    LET ME KNOW IF IAM NOT CLEAR.
    I DON'T KNOW THE Y POS OF THE BOX BECAUSE OF VARIABLE NO OF RECORDS.
    IS THERE A WAY TO KNOW THE YPOS DURING RUNTIME.
    THANKS

  • Help. Scripts in Tools menu in Bridge have vanished

    I'm not sure if this is the appropriate forum to place this message, but I need some help, so here goes:
    I have CS2 installed on a G5 dual 2 Ghz, with 1 GB RAM. When in Bridge, under the Tools menu where there should be 3 submenus for Photoshop, Illustrator and InDeisgn, there is nothing. I get the Batch Rename, Cache and Metadata submenus, but nothing else.
    So, I completely uninstalled CS2, including running the Version Cue uninstaller, did searches for literally anything Adobe or Bridge related on the whole system, deleted these, restarted and proceeded to reinstall CS2. But the problem remains- no script menus under Tools. What the heck?!
    Yet, on another Mac running the same version of CS2, including the updates that were available for it, the Tools menu shows these script submenus. I don't understand why it won't show up on this one Mac. And I've searched just about everywhere on both systems to see if there is some folder in application support or elsewhere that's missing on the Mac that doesn't display them, but I can see no difference.
    Has anyone run into this before, or have any ideas what I might try? We need to be able to use the InDesign Contact Sheet script from Bridge on this Mac, so it's causing some problems that it's not showing up.
    Any help at all would be greatly appreciated.

    No solution et?
    Good Luck.
    My
    Si
    tes

  • Need Help in scripts relating ot subscripts

    I have encountered a HUGE problem in flash and I desperately
    need urgent help from flash experts out there so please hear me
    out. Here it goes >> I am currently working on ‘fill in
    the blanks’ questions and answer for my chemistry project and
    the thing is , I need to ENABLE other people who are going to do
    the questions I created to type ‘subscripts’ for
    example ‘3 2’. Now I have seen similar questions from
    other flash documents is also requires entering of
    ‘subscripts’ and they used some script in the flash
    document, WHICH is the user( person who is answering the questions)
    can type in normal fonts as well as subscripts by HOLDING down ALT
    key and typing the number, and the subscript would appear in the
    selected INPUT BOX. i have attached an image below for better
    understanding of my problem.
    http://img239.imageshack.us/my.php?image=problemyd5.jpg
    apart from that, i am also looking for a script that i can insert
    into my 'check' button at the bottom of the page to check the
    answers. To be specific, the script must be able to check the
    answers WHICH also includes SUBSCRIPTS for example '
    HNO[SIZE="2"]3[/SIZE] or H[SIZE="2"]2[/SIZE]O ' as I fail to obtain
    the first script i mentioned which is the script that enables one
    to type in normal fonts AND subscripts by holding ALT key or
    something similar to that, i also fail to come up with a proper
    script for my 'check' button to check my answers. I hope readers of
    this passage are able to understand what i am trying to say here as
    well as help me solve my dilemma that i am facing. IN a nutshell, i
    am need 2 types of scripts now .....which are
    1) script that enables one to type in subscript by holding
    down the 'alt' key and typing the letter at the same time 2)and the
    second script which when embedded to my 'check' button, when
    CLICKED will be able to check the answers which includes
    SUBSCRIPTS.
    if you need any further information to have a better
    understanding, do tell and i will provide more pictures or even
    flash documents.

    No I am just using SET DATE MASK command to make it appear as required but that is changing my value at the other window also so I dont want this date format anywhere else other than footer.
    Thanks
    Sudharshan

  • Help with scripting a period in barcode between fields.

    Good Morning,
    I need help scripting a barcode that has a period as a separator in between fields.
    I have 3 fields that I need all encoded in to one barcode and need a period as separators.
    EMPID
    FormName
    EMPSSN
    I need barcode to read as follows
    EMPID.FormName.EMPSSN
    546514.Harvest123.555284569
    I am very new to this and any help would be greatly appreciated.

    When you go to the Barcode's Value tab and select "Custom calculation script", you get an empty template of how the barcode's value is calculated, which you can then fill-in with the names of the form fields. You can also edit the separator used between the values. I'm not sure the result is a valid barcode, strictly speaking, but it works. Here's the code I used:
    /* Customize: */
    function bMemberOf(strName, aStrNames)
        for (var nMembIdx in aStrNames)
            if (strName == aStrNames[nMembIdx])
                return true;
        return false;
    function strTabDelimited(oParam)
        var bNeedTab = false;
        var strNames = "";
        var strValues = "";
        for (var i = 0; i < oParam.oDoc.numFields; ++i)
            var strFieldName = oParam.oDoc.getNthFieldName(i);
            if ((null == oParam.aFields || bMemberOf(strFieldName, oParam.aFields))
                && (null == oParam.strXclField || strFieldName != oParam.strXclField)
                && (oParam.oDoc.getField(strFieldName).type != "button"))
                if (bNeedTab)
                    if (oParam.bFieldNames)
                        strNames += "."; // I changed these two lines so the separator is a period instead of the default tab
                    strValues += ".";
                if (oParam.bFieldNames)
                    strNames += strFieldName;
                strValues += oParam.oDoc.getField(strFieldName).value;
                bNeedTab = true;
        if (oParam.bFieldNames)
            return strNames + "\n" + strValues;
        else
            return strValues;
    try
        if ( app.viewerVersion >= ADBE.PMD_Need_Version )
            event.value = strTabDelimited({oDoc: this, aFields: ["EMPID", "FormName", "EMPSSN"], bFieldNames: true});
        else event.value = " ";
    catch (e)
        event.value = " ";

  • Help in script logic

    Hi Experts,
    We are using SAP BPC 7.5 NW Version SP08. We are using a script logic that calculates the opening value of inventory(ASSTCAINVAMO) for each month except the 1st month of financial year for which the value is entered from an input schedule. The opening value of inventory of each subsequent months are calculated when the parameters for production(e.g. OSDA) are entered from a separate input schedule. The following script logic is written for the calculation:
    *FOR %TIM_MEM%=%TIME_SET%
    *XDIM_MEMBERSET TIME =%TIM_MEM%
    *WHEN P_ACCT2
    *IS "OSDA",
    REC(EXPRESSION=[P_ACCT2].[ASSTCAINVAMO]+[P_ACCT2].[RDPA][P_ACCT2].[EFFA][P_ACCT2].[OSDA]-[P_ACCT2].[CONVAMUR][P_ACCT2].[RDPU][P_ACCT2].[EFFU][P_ACCT2].[OSDU]-([P_ACCT2].[SALQAMBC]+[P_ACCT2].[SALQAMM]),P_ACCT2="ASSTCAINVAMO",TIME=TIME.NEXT)
    *ENDWHEN
    *COMMIT
    *NEXT
    The loop works fine, but it seems the list of time values are not coming in proper sequence. For example, the loop is running for 2011.NOV before it iterates for 2011.OCT. So when it iterates for 2011.NOV, it is not getting the opening value for the month and consequently 2011.DEC's opening value is calculated assuming 2011.NOV's opening value to be 0. In the input schedule the months are in proper sequence.
    Is there any way out so that the months come in proper sequence in the logic as well?
    Thanks in advance for any help.

    We had similar issue . we changed TIME members from Monthnames to numbers . i.e  changed 2011.JAN to 2011.01 . Then you get correct result  as you are expecting . Issue when using month names in combination of TMVL is that  , instead of getting 2011. MAY for TMVL(1,2011.APR) , it gets 2011.FEB . TMVL function some how takes alphabetical order instead of taking month order . Not sure if this behavior is with service pack . But never saw any thread reporting this issue .
    Anyways ,you can wait for other responses  as i am too curious to know if any one faced this issue and how did they resolve.

  • Need help writing script for Digital DAQ

    Hello,
    I am trying to write an aquisition program for digital input coming from a hall sensor.  I will be passing a magnet over a hall sensor on a motor and want to record the number of rotations.  I have pasted together a script based on various websites, but it isn't functioning the way I want.  I would like to be able to collect data points indefinately, or fixed, and then print out the resulting count.  I have attepted to use the ctypes wrapper in Python.  The NI functions remain unchanged though, so if you don't know Python it shouldn't be a problem to read.  I am using a NI PCI-6503. 
    NI PCI-6503
    NI PCI-6503
    NI PCI-6503
    The code:
    # C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Acq-Int Clk\Acq-IntClk.c
    import ctypes
    import numpy
    nidaq = ctypes.windll.nicaiu # load the DLL
    # Setup some typedefs and constants
    # to correspond with values in
    # C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h
    # the typedefs
    int32 = ctypes.c_long
    uInt32 = ctypes.c_ulong
    uInt64 = ctypes.c_ulonglong
    float64 = ctypes.c_double
    TaskHandle = uInt32
    # the constants
    DAQmx_Val_ChanForAllLines = int32(0)
    def CHK(err):
    """a simple error checking routine"""
         if err < 0:
              buf_size = 200
              buf = ctypes.create_string_buffer('\000' * buf_size)
              nidaq.DAQmxGetErrorString(err,ctypes.byref(buf),buf_size)
              raise RuntimeError('nidaq call failed with error %d: %s'%(err,repr(buf.value)))
    # initialize variables
    taskHandle = TaskHandle(0)
    max_num_samples = 1000
    # array to gather points
    data = numpy.zeros((max_num_samples,),dtype=numpy.float64)
    # now, on with the program
    CHK(nidaq.DAQmxCreateTask("",ctypes.byref(taskHandle)))
    CHK(nidaq.DAQmxCreateDIChan(taskHandle,'Dev1/port1/line1',"", DAQmx_Val_ChanForAllLines))
    CHK(nidaq.DAQmxStartTask(taskHandle))
    read = int32()
    CHK(nidaq.DAQmxReadDigitalU32(taskHandle,int32(-1),float64(1),DAQmx_Val_GroupByChannel,data.ctypes.data,max_num_samples,ctypes.byref(read),None))
    print "Acquired %d points"%(read.value)
    if taskHandle.value != 0:
         nidaq.DAQmxStopTask(taskHandle)
         nidaq.DAQmxClearTask(taskHandle)
    print "End of program, press Enter key to quit"
    raw_input()
    This script returns "Acquired 1 points" immediately, regardless of how many times the hall sensor has been switched.  
    I apologize for the sloppy code, but I understand very little of the underlying principles of these DAQ functions, despite reading their documentation.  Seeing as how the code does not return an error, I am hoping there is just a minor tweak or two that will be farily obvious to someone with more experience.  
    Thanks

    Hey Daniel,
    Most of this script is from http://www.scipy.org/Cookbook/Data_Acquisition_with_NIDAQmx. 
    I needed to run the ReadDigitalU32 function in Python loop because my DAQ device did not support timed aquistion and I don't have LabView.  
    import numpy
    import time
    import ctypes
    nidaq = ctypes.windll.nicaiu # load the DLL
    # Setup some typedefs and constants
    # to correspond with values in
    # C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h
    # the typedefs
    int32 = ctypes.c_long
    uInt32 = ctypes.c_ulong
    uInt64 = ctypes.c_ulonglong
    float64 = ctypes.c_double
    TaskHandle = uInt32
    # the constants
    DAQmx_Val_Cfg_Default = int32(-1)
    DAQmx_Val_Volts = 10348
    DAQmx_Val_Rising = 10280
    DAQmx_Val_FiniteSamps = 10178
    DAQmx_Val_GroupByChannel = 0
    DAQmx_Val_ChanForAllLines = int32(0)
    # initialize variables
    taskHandle = TaskHandle(0)
    max_num_samples = 10000
    data = numpy.zeros((max_num_samples,),dtype=numpy.float64)
    read = uInt32()
    bufferSize = uInt32(10000)
    def CHK(err):
    """a simple error checking routine"""
         if err < 0:
              buf_size = 200
              buf = ctypes.create_string_buffer('\000' * buf_size)
              nidaq.DAQmxGetErrorString(err,ctypes.byref(buf),buf_size)
              raise RuntimeError('nidaq call failed with error %d: %s'%(err,repr(buf.value)))
    # Start up DAQ
    CHK(nidaq.DAQmxCreateTask("",ctypes.byref(taskHandle)))
    CHK(nidaq.DAQmxCreateDIChan(taskHandle,"Dev?/port?/line?","", DAQmx_Val_ChanForAllLines))
    CHK(nidaq.DAQmxStartTask(taskHandle))
    #initialize lists and time 1 
    t1 = time.time()
    times = []
    points = []
    while True:
         try:
              CHK(nidaq.DAQmxReadDigitalU32(taskHandle,int32(-1),float64(1),
              DAQmx_Val_GroupByChannel,data.ctypes.data,uInt32(2*bufferSize.value)
             ,ctypes.byref(read), None))
              t2 = time.time()
             #data[0] is the position in the numpy array 'data' that holds the value aquired
             #from your device
             points.append(data[0])
             times.append(t2 - t1) 
             t1 = time.time()
             #Choose time interval between data aquisition
             time.sleep(.02)
         except KeyboardInterrupt:
              break
    #process the lists of points and time intervals as you so choose
    Thanks for the help!
    Paul

  • Need help with scripting Jumps

    Hi - hope someone can help me. I'm in over my head. I have a long (4 hrs.) commercial video track separated by dozens of markers (placed earlier in FCP). All my menu buttons work fine, but I want to include a button which serves as an "In-Store" demo loop featuring about 30-45 minutes of highlights (meaning favorite clips) looped endlessly for in-store sales. I can't seem to get the right combination going. New user of DVDSP but not of Mac. I managed to get it to jump to a marker, but so far, every attempt results in the program not recognizing the end of a segment. Struggling with the manual and need an expert to simplify things.

    Hi Hal -
    Just perfect. Thanks very much, Hal. I'd entirely skipped the "Stories" sections of my tutorials and manual automatically assuming (from prior experiences with Flash, SuperCard, etc.,) that scripting would be the solution. (Plus I'm rushing to complete the thing.) The best part is that it this extremely easy to do. If I need to shorten a clip I can just add a separate marker in DVDSP with no apparent down side. Stories are a sweet feature, and I'm sure I'll be using them over and over with each new production.
    So, you've just scored the "Expert" ranking in my book and I'm wondering you'd like to make it a daily double... Here's the next and hopefully last sticking point in my little project: I set up multiple angles in several clips in FCP, which don't seem to display in DVDSP. They might, I just can't tell from the sim. And yes, I'm aware that importing separate tracks and re-compositing them in DVDSP is a way to make angles happen, but I already did all this once, with great care, and I'm wondering how to get the Final Cut angles to change in the simulator in DVDSP. Any experience in these areas?
    Thanks again for the "stories" advice. Right on the money.

  • Help on scripts used in bpc

    Hi All,
    Hope you can help me in know
    where to find some help doc's on scripts used in BPC and coding in SSIS packeges.
    And does BPC internally convert scripts to SQL script or MDX?
    And can i use both SQL and MDX in single logic file?
    Any help will be greatly appriceated

    The BPC logic engine converts the "SQL-style" script logic syntax into true SQL, that's executed against the data in the fact tables.
    MDX script logic is executed against the Analysis Services cubes; I don't believe that much conversion is involved here, but honestly I'm not an MDX expert, so I could be mistaken.
    You can mix both in a single logic file, subject to a clear understanding of how *COMMIT and XDIM_Member, etc. work to scope a particular block of code. The BPC Admin guide (also in the online admin help) is the key reference guide for this.
    But the most important piece of advice I can give is, don't write MDX logic. Only use it (as sparingly as possible) for raios (division) in member formulas, where you need to evaluate a formula at various points in the hierarchy (not just at base members). For everything else, use business rules or SQL logic.

Maybe you are looking for