Is it possible to execute same eCATT  script in different SAP versions

is it possible to execute same eCATT  script in different SAP versions?
Regards,
Sunil sankar B.
[email protected]

Yes. In the ecatt script you have the option under ATTRIBUTES --> VERISONING DATA you can restrict it to different software components and different releases.

Similar Messages

  • How to execute one sap gui script in different SAP system component versions.

    Hi Experts,
    I am having a task to write a script which can be executed in different SAP systems , explained as below.
    I have created a script to do password reset for mass users in one system (TC6) & it's working fine. But when i load same script in other system(QR5) to do the same activity , the system unable to execute the same script.
    One thing i found that by comparing in the two systems that the screen-ids in QR5 system is different than TC6 system.
    My question
    1-> why it is different even though the scripting language is same.
    2-> How can i overcome it & make a common script for all the systems.
    Please help me to resolve this.
    Thanks in Advance,
    Khagendra

    Hi Holger & Stefan,
    Sorry for late response first.
    Now i have attached the recorded program-me for two systems for SU01 (simple user maintenance) with highlighted the text. I have highlighted both for easy understanding .
    In system QR5 (upgraded one)
    session.findById("wnd[0]").maximize
    session.findById("wnd[0]/tbar[0]/okcd").text = "/nsu01"
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/ctxtSUID_ST_BNAME-BNAME").text = "test"
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/tbar[1]/btn[18]").press
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_LAST").text = "rest"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_LAST").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_LAST").caretPosition = 4
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_FIRST").text = "user"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_FIRST").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_FIRST").caretPosition = 4
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_COMM_DATA-SMTP_ADDR").text = "[email protected]"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_COMM_DATA-SMTP_ADDR").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_COMM_DATA-SMTP_ADDR").caretPosition = 21
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO").select
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUID_MAINTENANCE:1101/cmbSUID_ST_NODE_LOGONDATA-USTYP").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUID_MAINTENANCE:1101/cmbSUID_ST_NODE_LOGONDATA-USTYP").key = "A"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUID_MAINTENANCE:1101/pwdSUID_ST_NODE_PASSWORD_EXT-PASSWORD").text = "********"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUID_MAINTENANCE:1101/pwdSUID_ST_NODE_PASSWORD_EXT-PASSWORD2").text = "********"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUID_MAINTENANCE:1101/pwdSUID_ST_NODE_PASSWORD_EXT-PASSWORD2").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUID_MAINTENANCE:1101/pwdSUID_ST_NODE_PASSWORD_EXT-PASSWORD2").caretPosition = 9
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG").select
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG/ssubMAINAREA:SAPLSUID_MAINTENANCE:1106/cntlG_ROLES_CONTAINER/shellcont/shell").modifyCell 0,"AGR_NAME","Z:T5_UK_WIPRO_DEV_NONBASIS"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG/ssubMAINAREA:SAPLSUID_MAINTENANCE:1106/cntlG_ROLES_CONTAINER/shellcont/shell").currentCellColumn = "AGR_NAME"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG/ssubMAINAREA:SAPLSUID_MAINTENANCE:1106/cntlG_ROLES_CONTAINER/shellcont/shell").pressEnter
    session.findById("wnd[0]").sendVKey 11
    In system DR0 (Not upgraded)
    session.findById("wnd[0]").maximize
    session.findById("wnd[0]/tbar[0]/okcd").text = "/nsu01"
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/ctxtUSR02-BNAME").text = "test"
    session.findById("wnd[0]/usr/ctxtUSR02-BNAME").caretPosition = 4
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/tbar[1]/btn[18]").press
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtADDR3_DATA-NAME_LAST").text = "test"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtADDR3_DATA-NAME_LAST").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtADDR3_DATA-NAME_LAST").caretPosition = 4
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtADDR3_DATA-NAME_FIRST").text = "user"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtADDR3_DATA-NAME_FIRST").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtADDR3_DATA-NAME_FIRST").caretPosition = 4
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtSZA5_D0700-SMTP_ADDR").text = "[email protected]"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtSZA5_D0700-SMTP_ADDR").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSZA5:0900/txtSZA5_D0700-SMTP_ADDR").caretPosition = 21
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO").select
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUU5:0101/cmbUSLOGOND-USTYP").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUU5:0101/cmbUSLOGOND-USTYP").key = "A"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUU5:0101/pwdG_PASSWORD1").text = "********"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUU5:0101/pwdG_PASSWORD2").text = "********"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUU5:0101/pwdG_PASSWORD2").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO/ssubMAINAREA:SAPLSUU5:0101/pwdG_PASSWORD2").caretPosition = 9
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG").select
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG/ssubMAINAREA:SAPLSUU5:0106/tblSAPLSUU5TC_AGR/ctxtUSAGR-AGR_NAME[1,5]").text = "Z:T5_UK_WIPRO_DEV_NONBASIS"
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG/ssubMAINAREA:SAPLSUU5:0106/tblSAPLSUU5TC_AGR/ctxtUSAGR-AGR_NAME[1,5]").setFocus
    session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpACTG/ssubMAINAREA:SAPLSUU5:0106/tblSAPLSUU5TC_AGR/ctxtUSAGR-AGR_NAME[1,5]").caretPosition = 26
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]").sendVKey 11
    From the above it's clear that the screen IDs in both the systems are different as the program-me name is different for the same TA (SU01) in both the systems.
    Now can you please advise how i will go with both to handle in one script (I can't put a check condition to call different scripts for the specific systems as in my landscape there are more that 100 systems).
    Please help me on this.
    Thanks in Advance,
    Khagendra

  • Execute process (shell script) under different user

    Hi,
    is it possible to use the ProcessBuilder oder .exec()-method to execute a shell script under a JVM-different user? I need to start shell scripts for different system users and I don't want to use SUDO or a wrapper script to switch to the required user. I would like to define the user at java level. Is this possible?
    Best regards,
    Thomas

    looking for something like this too.
    currently i am relying on a script in which i have to set the user as:
    "su username -c java_program"
    the problem with this approach is that if youre not running as root, then su asks for a password, thereby halting execution. (tried input redirects and here-docs, (some popular linux tricks), they did not work)
    so you have to be root for the script option to work.
    if anyone can suggest a more "java based" way of executing a process as a different user , thatll be awesome.

  • Is it possible to have same file size for different dpi?

    I changed one.TIFF file (300dpi, 1024X1332)  to .jpg files of four different dpi. But when I checked the four result jpg files, I found out that they are all in same file size and quality.( I also have checked the property of the files in the Windows.)
    I think more DPI means more data and more file size. Am I wrong?
    I use Photoshop CS 5.1(64bit, WINDOWS) - which is part of my Adobe Master Collection CS5.5.
    TIFF(300dpi, 1024X1332) ->
    1. JPG(72dpi, 1024X1332) : 306KB
    2. JPG(108dpi, 1024X1332) : 306KB
    3. JPG(144dpi, 1024X1332) : 306KB
    4. JPG(600dpi, 1024X1332) : 306KB
    I tested a few times more with different files. and same result comes out.(same file size for different dpi)
    Thanks in advance.

    Yes absolutely. Great observation.  PPI does not control the number of pixels, just how big they are.
    Now, if you change the PPI in the Image Size dialog with Resample checked.. then, that is a different story. In that case you will be changing the pixel dimension of an image (i.e.,changing the total number of pixels making up the image) while keeping its print size.
    In your test files, you will notice all the print sizes are different, because all you were telling Photoshop to do was change the size of the pixels (if or when the image is ever printed), which is really just a bit of metadata of the file.

  • Executing Chained eCATT scripts

    Hi Gurus,
    I have created a chain of scripts (F-47,F-48,FB60 & F-54). In Test Configuration I have added 4 different Test Data Containers, each containing data for each T-Code.In the Variants tab, I have added the Internal Variants using the 'Variant Maintenance Assistance'. So, now for one full run of the script I have four variant, one for each T-code.
    The problem is, when I run the chained script, F-47,F-48 & F-54 is fetching data from the Test Data Containers but the FB60 variant is  not fetching any data from the Test Data Container, but is using the default value only.
    Please help.
    Best Regards,
    Debojit Dey

    Hello Debojit,
    the test configuration is the binding element between testdata and one testscript.
    If you "chain" testscripts as you describe, I assume you are using REF command.
    The testconfiguration can link only one script, let's call it master script, invoking  transaction scripts (F-47,..) by using REF.
    Building such chains makes sense in terms of testing business processes, where one trasaction is a successor to the next, consuming data created by the predecessor.
    On the other hand executing multiple independend tests requires building of multiple test configurations and packaging of them in the SAP Test Workbench (Transaction STWB_1 STWB_2 STWB_WORK ) for collective execution.
    Comming back to your sample and implied you are testing a business process, you can transfer testdata from one REF to the next by using eCATT parameters in your masterscript. Defining these eCATT parameters as import parameters of the master script, they will appear in you test configuration and can be liked to parameters from test data containers.
    Best regards
    Jens

  • Is it possible to create same DC (name) under different SC

    Hi Experts,
    I have a question on creating the DC in development prospective from NWDS 7.3.
    My requirement is as below.
    We have the below DC and SC structure.
    SC <ABC_SC>
        DC <XYZ_DC>
    SC<DEF_SC>
        DC<PSQ_DC>
    both the above SC's and DC's are already checked-in to DTR. Now the question is can I create the  same DC<PSQ_DC> under first SC? Ex as shown below?
    SC <ABC_SC>
        DC <XYZ_DC>
       DC<PSQ_DC>
    As I have developed web dynpro project it will be lot of difficult to create the dc with different name and move all the code? can you please let me know the possibility? would there be any naming convention issue and if yes, what would be the ideal solution for this scenario.
    Thanks a lot in advance.

    Thanks for the quick reply.
    Currently both the DC's on different SC's has been checked in to DTR as shown and explained in scenario1. However, if it is possible to create the same DC under first as shown in scenario 2. Then I'll delete or stop using DC<PSQ_DC> from the first scenario from DTR.
    Scenario1.
    SC <ABC_SC>
        DC <XYZ_DC>
    SC<DEF_SC>
        DC<PSQ_DC>
    Scenario 2.
    SC <ABC_SC>
        DC <XYZ_DC>
       DC<PSQ_DC>
    Please advise?

  • Can we execute an idoc script from a custom service?

    Is it possible to execute an idoc script while executing a custom service?
    -Pratap

    There are several ways to execute iDocScript from Java, but in this quick example we will use a PageMerger object. There are several ways to get ahold of a PageMerger object. If you are executing in a context where a service object is readily available you may be able to get a PageMerger object reference with code like this:
    PageMerger pm = m_service.m_pageMerger;
    If that doesn't work for you I would try something like:
    PageMerger pm = new PageMerger(databinder, executioncontext);
    Now that you have your merger object you can execute all kinds of iDocScript code, an example of which might be:
    pm.evaluateScript("<$lc(\"wwMyString\")$>");

  • Readymade eCATT Scripts Available in a SAP Product?

    Hi Experts/Guru's,
    I'm exploring few things and like to understand them on customer perspective?
    As we know,there are lots lots lots of eCATT Scripts available in SAP for their products & Application.
    Is it (eCATT Scripts)shipped with SAP Products ?( eg: ECC 6.0 )
    (I'm not talking about the explantory scripts of eCATT shipped with the product).I'm aware of this.
    My Question is Say Create a Sales order,purchase order or a Business scenario?Will i have some scripts available in a SAP Product ?
    Or
    Is it downloaded from the SAP Support Portal ?
    Or
    Is it delivered to customer on request  ?
    If the answer is "yes" for anyone of these then,my question is, How & where do we do this?
    Your answers might help in lot in this group.If you dont know.Please take it as investigate topic and try to find out as like me.
    Regards,
    Venky

    Hello,
    Yes for few of the industries the eCATT's are shipped like in case of OIL industry . But this is a rear case.
    Most of the time the eCATT's are not shipped and its used internally within SAP by the SAP test team to check for the correctness of the functionality and to perform regular regression runs. Reason as to why its not shipped is that once its shipped to the customer then there is a need to setup a seperate team for maintenance of the scripts which is a huge task.
    Also the eCATTs created might not be applicable for all possible options of the transaction , it means it might not be reusable for all the conditions.
    There are many more reasons.
    Hope it answers your question.
    Thanks & Best regards,
    Ajay

  • ECATT/ABAP code to close a session while executing a chain script

    How to close the extra created session during the execution of chain script??
    Details of the problem:
    I'm using eCATT for automating different business flows in SAP,
    For a particular scenario I have to create a chain script,
    One chain script may contain up to 40 individual scripts,
    This chain script will contain around 7 report programs using SE38 transation,
    While executing SE38 script(report program), one extra session is opening (log display session),
    but, my script can close the original SE38 screen only, not the extra created session,
    So, after executing 5 scripts (SE38 scripts), then "sessions reached to its max" message is appearing, and the script is failing,
    As it is a automation test script, no manual interaction will be there,
    i.e - we should not close the extra session manually.
    Now, my question is:
    How to close the extra created session..??
    How the recording should be done to handle this problem..??
    or any extra code should be added to close the extra session..??
    Is there any ABAP code.. or eCATT command available to handle this problem..??
    If you have any idea to close the extra created session, please share it with me,
    my effort:
    I tried with "RESCON" command... this will close all the SAP sessions,
    This will not work for my scenario,
    and, I tried with "Close session after every RFC",
    this will work, but, after executing 5 SE38 scripts, I'm facing the above problem.
    Please suggest me a solution, Thanks in advance..
    Regards,
    Chandra shekhar.A
    Message was edited by:
            chandra shekhar
    Message was edited by:
            chandra shekhar

    user13490676 wrote:
    could it be a problem with jmf itself that the endofstream doesnt get generated for the datasource being read from a fileIn this instance, that would be the problem... more than likely, there's something weird about the file, perhaps it doesn't have a duration set in the header and JMF treats it like a live stream.
    You could always write a custom DataSource that just passes through the input of a normal data source, and then generate the EndOfStream event yourself... maybe based on a timeout or failure counter? I haven't received any data in x seconds or after x attempts, so I'm assuming the file is done... Or when you've read enough data that the file can't possibly have any more (read >= file header + file data)...

  • Runtime Error while executing eCATT Script

    Hello @All,
    I worte a small eCATT script to stop the time a certain process needs to finish. The way I did this was to use the SAPGui (Record) method in eCATT.
    This does work fine.
    The second step I tried was to log the time and write it in a table to work with the times.
    If I do this I always get an runtime error, I know why it appears but I do not have any idea how to solve this.
    My script is:
    message ( UZEIT ).
    SAPGUI ( CC04_100_STEP_1 ).
    SAPGUI ( CC04_1100_STEP_1 ).
    endmessage( UZEIT ).
    settab ( ypdm1t001, UZEIT ).
    UZEIT is an Inputparameter with no reference.
    The short text of the runtime error is:
    Access not possible using 'NULL' object reference.
    If I delete the definition of the parameter UZEIT the runtime error does not appear but I get the error in the Log that the parameter UZEIT is not defined.
    Does anyone has a solution for this problem?
    greets
    manuel

    Hi Harsha,
    UZEIT is a command interface (I changed it so that is no more an parameter).
    There seem to be no restrictions to add values in the table. I already spoke to collegues here and they cannot find a mistake.
    I would further try to describe you what I want to do. Perhaps you have better ideas.
    What I want to achive is to get an overview over response times of defined transactions.
    We have a system landscape with local SAPGUIs and with installations on WTS and we want to compare response times from both sides.
    Therefore I made the eCATT skripts.
    Now I want to write the times somewhere so that I need not to write them down from every log file.
    At this point I wanted to write the times (which should be stored in UZEIT) to a table so that afterwards a report can write those times in an excel file.
    If you have better ideas to realize this please tell me.
    Thank you in advance for helping me.
    greets
    Manuel

  • Is possible to execute the same executable vi more than 1 time (like notepad, for example)?

    I have a Labview executable file that use serial ports to communicate with other devices. I need to execute the same "file.exe" more than 1 time, to control different devices simultaneously. When I double click on an executable been executed (from windows explorer), the file under execution comes to front. Is possible to execute the same file more than 1 time (like notepad, for example)?

    Not the answer you are looking for I know..but still: Copying the application to another location is one possibility...if it has a different path it will execute separately.
    (OR - build control of multiple devices into one and the same application... If you do not want to redesign the code to handle multiple instruments in the same VIs, you could clone the VIs within the same application...)
    MTO

  • Is it possible to execute SAPGUI scripts from java program?

    Hi everyone..
         I need to develop an java applications that executes the SAPGUI script or any technique that execute set of transaction as client.
         Is it possible to execute SAPGUI scripts from java program? if so, how it can be achieved? is there any other technique to achieve above mention scenario?.
         it will be more helpful, if docs related to that are shared..
         Thanks in advance

    Oh, bummer. Would be much more convenient if I could just use iTunes for everything. Can't stand WMP. I wonder if WinAmp might be a good compromise?
    Thanks for this answer . . .
    Sharon

  • Is it possible to use same sap script for different comp code with difflogo

    I have 3 company codes. I need to use same sap script to all  but each company code has different logo. I dnt want to go for 3 different sap script. Is it possible to change in coding
    like this
    If comp code = '100'
    print ' logo1'
    If comp code = '200'
    print ' logo2'
    If comp code = '300'
    print ' logo3'
    in same sapscript.If yes how ?

    Hi,
    Yes you can do it.
    In Sap Script use:-
    /: If Comp code='100'
       INCLUDE ZHEX-LOGO100 OBJECT TEXT ID ST LANGUAGE EN
    /:Elseif comp code = '200'
    INCLUDE ZHEX-LOGO200 OBJECT TEXT ID ST LANGUAGE EN
    /:Else
    INCLUDE ZHEX-LOGO300 OBJECT TEXT ID ST
    LANGUAGE EN
    /:Endif
    I hope this helps,
    Regards
    Raju Chitale

  • Executing eCATT Script from Mecury Quality Centre

    Hi All,
       1. Is it possible to Save eCATT Test Script in Mercury Quality Centre? If so, How?
       2. Then How to invoke eCATT Script from mercury Quality Centre?
                      or
       3. Can we call eCATT script from QTP?
          If possible, what r the setup requirements and How to call the ecattt script?   
    Regards,
    Sree

    Hi Sreedhar,
    I cannot help you with you with the first 2 questions.. but I can tell you the integration of QTP & eCATTs.
    You can refer an QTP script in eCATTs and not vice versa. You can call a QTP script in eCATTs like this
    REFEXT ( SCRIPT , SCRIPT_1 ).
    Create a QTP script and name in SCRIPT( anything ) and call the QTP script in eCATTS.
    As far as I know, we cannot call an eCATT in QPT. QTP is a third party tool which you can buy outside, but eCATT is a propereitory tool of SAP which you cannot buy alone. So, there in no possibility for this way(as far as my knowledge goes).
    Best regards,
    Harsha

  • Is it possible to execute .bat file located in package ?

    Hi,
    in my application i execute a print.bat file using Runtime.exec(), i'd like to place this .bat in package, let's say com.me.testpackage. How is it possible to execute the batch file from that location?
    thanks

    jschell wrote:
    sabre150 wrote:
    jschell wrote:
    >Simple 'for' loops seem to work OK but still more research needed.
    There is escaping in the for loops which is necessary in a bat file and not needed at the command line.
    It seem to be that any command spanning more than one line fails. Fail? The example that gave shouldn't fail. It should simply run both echos.As I understand it, the command sequence
    @echo off
    goto XXX
    echo out
    :XXX
    echo last
    should just output 'last' and not 'out so if it prints both 'out' and 'last' then in my view it 'fails'. Am I missing something?
    >
    >>
    Makes me even more pleased that I work mainly with Linux.Looking up syntax - what about getopts (bourne and korn)? You can also create 'functions', which can be defined later (if I recall correctly) in the script and called multiple times. I don't know how that would work streaming it in.I don't know about consequences of the streaming approach forward definitions in 'bourne' and 'korn' though I was not aware that 'bourne' allowed them. For 'bash' where forward definitions do not seem to be allowed (could I be mistaken in this?) then using        Process process = Runtime.getRuntime().exec("bash", null, new File(System.getProperty("user.home")));the following very simple 'bash' script (which contains loops, if statements and functions but no goto or forward definitions) can be executed without problems - # Simple bash script
    function sayHello {
        echo "Hello" $1
    sayHello "World" ;
    for i in $( ls /tmp ); do
        echo file - $i
    done
    for i in `seq 1 10`;
    do
        echo "seq" $i
    done
    i=0
    while [  $i -lt 6 ]; do
    if [ $i -eq 4 ]; then
        echo "then" $i
    else
        echo "else" $i
    fi
        let i=i+1
    done
    i=12
    until [  $i -lt 10 ]; do
    echo "until" $i
    let i-=1
    doneIn the past, I have also published examples of how to run Perl scripts using the same basic approach. The heart of the examples is         final String perlScript = "#!/bin/perl\n" +
                "print \"PID $$\\n\";\n" +
                "print \"UID $<\\n\";\n" +
                "print \"EUID $>\\n\";\n" +
                "print \"GID $(\\n\";\n" +
                "print \"\\nProcessing the command line arguments\\n\";\n" +
                "foreach (@ARGV) {\n" +
                "    $n = factorial($_);\n" +
                "    print \"    $_! = $n\\n\";\n" +
                "}\n" +
                "print \"\\n\".'@INC'.\"\\n\";\n" +
                "foreach (@INC) {\n" +
                "    print \"    $_\\n\";\n" +
                "}\n" +
                "print \"\\n\".'%ENV'.\"\\n\";\n" +
                "foreach (keys %ENV) {\n" +
                "    print \"    $_==$ENV{$_}\\n\";\n" +
                "}\n" +
                "$x = theAnswerToTheUltimateQuestion();\n" +
                "print \"\\nThe answer to the ultimate question is ... '$x'\\n\";\n" +
                "sub theAnswerToTheUltimateQuestion()\n" +
                "{\n" +
                "    return 3*2*7;\n" +
                "}\n" +
                "sub factorial()\n" +
                "{\n" +
                "    my ($n) = @_;\n" +
                "    return ($n > 1) ? $n * factorial($n-1) : 1;\n" +
                "}\n";
            System.out.println(perlScript);
             * The perl source can be from any InputStream. Here I use a
             * ByteArrayInputStream just as a demonstration.
            final InputStream perlSource = new ByteArrayInputStream(perlScript.getBytes());
             * The '-' indicates that the Perl script comes from stdin. The "a","b","c" etc
             * are the command line arguments passed to the Perl script.
            final String[] command =
                "perl", "-", "5", "6", "7", "8", "9", "10"
            final Process process = Runtime.getRuntime().exec(command);piping the 'perlSource' stream to the process stdin.
    This runs as expected on both Linux (FC9 and Ubuntu 8.04) and on Windows using Active Perl.
    Please don't take my use of a String to hold the Perl script to mean that I in any way endorse this approach - I just wanted a simple means to create a self-contained example.
    >
    And the c shell has a goto also.One day I might find some time and investigate 'c' shell goto in this context - since I have not used csh for at least 8 years I am very rusty.
    I can't say that the 'streaming' approach will work with all Linux shells but I can say that on Linux I have had no problem with Perl and Bash. If anyone needs to use the 'streaming' approach with another shell then it takes just a few minutes to setup a test harness. If any problems are found then people can always resort to the 'Plan B' approach.
    I am still pleased I work mainly with Linux and Unix.

Maybe you are looking for