Create/find tables and apply style

Hello,
I'm very new to scripting. I want to learn the basics like creating a table, creating anchored frames, textframes, etc.
Now, I want to create/find tables in a document and I would like to apply styles. I saw a script to do this. When I paste the script in Extendscript CS4, than the program crash.
The program crash in part 1. When I create another script with only part 2 (see //part 2) then there is no problem.
What do i wrong? And can anyone tell me what part 1 of the script do?
Thanks,
// part 1
// using your version; I'd prefer to return 0 if table not found
function findTable(obj) {
         while (obj.constructor.name != "Table") {
        obj = obj.parent;
        if (obj.constructor.name == "Application") {
            throw "Can't find table"
    return obj
// part 2
var myTable = 0;
if (app.documents.length > 0 && app.selection.length > 0)
    myTable = findTable(app.selection[0]);
// check for at least enough rows for 1 top row, 1 body row, 1 bottom row
if (myTable != 0 && myTable.rows.length >= 3) {
    // delete all rules; set insets to 0
    myTable.cells.everyItem().appliedCellStyle = "[None]";
    // format bottom row
    // (remember rows uses 0-based count)
    a = myTable.rows.length - 1;
    myTable.rows[a].cells.everyItem().appliedCellStyle = "4.cell_body_last";
    // format middle rows
    first = 1;
     last = myTable.rows.length - 2;
    for (a = first; a <= last; ++a)
        myTable.rows[a].cells.everyItem().appliedCellStyle = "3.cell_body";
    // format top row
    a = 0;
    myTable.rows[a].cells.everyItem().appliedCellStyle = "2.cell_header";

Part 1 expects the text cursor to be anywhere inside a table -- either in the regular text, or with a cell, row, column, or the entire table selected.
It walks "up" using its parent until it arrives at the table object itself.
This will only work if the text cursor actually is anywhere inside a table. It does nothing when you are somewhere else, and it only works with the "current" table.

Similar Messages

  • How to create Database, table , and apply triiger on oracle10g lite ?

    Hello All,
    I want to use oracle 10g lite , i just download oracle 10g lite from oracle site and just install on my system, i have no any knowledge how to create database, how to create tables and how to apply triggers on tables. I want to access this database using JDBC.
    plzzzzzzzzzzzzzzzzzz help me...............
    Thanks in advance
    Pankaj

    are you trying to use oracle lite just as a database? it is normally used as part of a data synchronisation from a server, replicating snapshots to create the database and tables on the client.
    PL/SQL format triggers are not supported in the oracle lite client. Java stored procedures are, but you would need to build the table interactions

  • Find a specific paragraph style within a table and apply a specific cell style?

    I'm a total beginner when it comes to scripting, but I would like to create a script that finds the paragraph style "resultsUL" within a large table and applies the cell style "female". Sure wish the find/replace was able to account for cell styles as well as paragraph and character styles. Is anyone willing to help me with this? Thank you!

    Hi,
    I do it quickly defining a simple research on the "resultsUL" para style and using a loop with QuicKeys as:
    Cmd-0 is a shortcut associated to the "female" cell style.
    So, What I do: search the para style (Cmd-option-F) and apply the cell style, then search again…
    As easy to do with QuicKeys, I think that can be easily done with a [JS] (faster process!).

  • Create a table and upload data in MS ACCESS from SAP ABAP programming?

    Hi All,
    How to create a table in MS ACCESS database and Upload SAP database table data into MS ACCESS table using ABAP programming?
    Explain: My client requirement is " If he/she runs a ABAP Program, that will create a table and upload data into MS ACCESS Database table in background. "
    Could you please give the solution or code? I know the program RIACCESS and I went through the SAP Note 583698.
    Is this only solution for this?  Or Any other possibilities?
    Please give me solution.
    Thanks in advance.

    Hi,
    It is not possible to create tables in a non SAP schema from inside SAP.
    The SAP-Oracle license also does not allow you to create the table (see note 581312):
    the following actions, among other things, are therefore forbidden at database level:
    Creating database users
    Creating database segments
    Querying/changing/creating data in the database
    Using ODBC or other SAP external access methods
    Please refer following link,
    [Ckick Here|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    You can also do it by LSMW,
    If you are using Access 97, you can download directly into an access
    database from SAP. See program RIACCESS for details. You have to establish
    an RFC destination PS_ACCESS_1 and 2.
    There are then a couple of function modules. Go to SE37 and put in
    msaccess and hit PF4.
    The following is from the readme file: sapgui/ps/readme.sap
    For the MS-Access interface SAP delivers 4 files:
    WDPSASTR.EXE This is an RFC server program that is called by SAP R/3
    (PS module). This program creates a MS Access database. The structure
    information of the tables is transferred from R/3. In addition to
    these tables a table named DDIC is created. This table contains the
    structure information and should in no case be modified or deleted.
    WDPSATAB.EXE This is an RFC server program that is called by SAP R/3
    after WDPSASTR. This program filles the tables of the database with data.
    There must not be made any changes of the structure of
    the tables between the calls of WDPSASTR and WDPSATAB.
    WDPSAZET.EXE This is an RFC client program that triggers work/time
    confirmations in the PS module of SAP R/3 (like transaction CN27 Collectiv
    confirm).
    WDPSAMAT.EXE This is an RFC client program that triggers material
    confirmations in the PS module of SAP R/3 (like transaction MB1A - Goods
    Please also refer following links,
    [Click here|Upload data from MS Access tables, to SAP tables.;
    Before using the program "RIACCESS", you need to install the PS utilities, which are part of SAPGUI install CD.
    It is available in the "SAPGUIPS directory".
    Then do the followings :
    1. Select transaction code SALE -> Systems in network-> Define RFC Destination.
    2. You will need two RFC destinations (TCP/IP connections for the front-end workstation).
    Setup the two RFC destinations PS_ACCESS_1 and PS_ACCESS_2 and you'll have to get them to point to
    wdpsastr.exe and wdpsatab.exe respectively.
    3. Then execute RIACCESS and choose PS_ACCESS_1 to generate access tables.
    The system must also be able to access the RFC-DLL files (librfc2.dll, librfc3.dll, librfc4.dll, librfc5.dll, librfc6.dll, vrfc.dll).
    Please note that Access only supports tables with up to 255 fields.

  • Capture from Two Tables and Apply in one Table

    Hi All,
    Is it possible to capture from two tables (master and child table) and apply in one table?
    For example,
    1. DEPT and EMP tables in source database with relation
    DEPT table structure is like DEPT_ID, DEPT_NAME, LOC_NAME
    EMP table structure is like EMP_ID, EMP_NAME, EMP_DOJ, EMP_SAL, DEPT_ID
    2. EMP_DEPT_STAGING in destination database
    EMP_DEPT_STAGING table structure is like EMP_ID, EMP_NAME, EMP_DOJ, EMP_SAL, DEPT_ID. DEPT_NAME, LOC_NAME
    if there is any update in DEPT table, EMP_DEPT_STAGING should get populated with Department and its employee details. Similarly, if there is any update in EMP table EMP_DEPT_STAGING table should get populated with Employee details and along with department detail.
    Is it possible to accomplish this? If yes, could you please provide me some examples?
    Thanks & Regards
    Thiyagu
    Edited by: mt**** on Sep 4, 2011 11:22 PM

    like this
    INSERT @PlantNew  (PlantID, PlantName, PlantDirExists, PlantAssistantDirID, PlantDirID) 
    SELECT p.PlantID,
    p.PlantName,
    CASE WHEN pd.PlantID IS NULL THEN 0 ELSE 1 END,
    PlantAssistantDirID,
    PlantDirID
    FROM @Plant p
    LEFT JOIN (SELECT PlantID,
    MAX(CASE WHEN Assistant = 1 THEN PlantDirectorID END) AS PlantAssistantDirID,
    MAX(CASE WHEN Assistant = 0 THEN PlantDirectorID END) AS PlantDirID
    @PlantDirector
    GROUP BY PlantID)pd
    ON pd.PlantID = p.PlantID
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    You're missing a FROM
    insert into @PlantNew
    SELECT p.PlantID,
    p.PlantName,
    CASE WHEN pd.PlantID IS NULL THEN 0 ELSE 1 END,
    PlantAssistantDirID,
    PlantDirID
    FROM @Plant p
    LEFT JOIN (SELECT PlantID,
    MAX(CASE WHEN Assistant = 1 THEN PlantDirectorID END) AS PlantAssistantDirID,
    MAX(CASE WHEN Assistant = 0 THEN PlantDirectorID END) AS PlantDirID
    from @PlantDirector
    GROUP BY PlantID)pd
    ON pd.PlantID = p.PlantID

  • Creating Customized Table and Modify Table Maintenance Screen

    Hi,
    I have already created customized table and generate the table maintenance screen, however i encountered 1 problem which is i cannot add new PAI and PBO module in the flow logic. Every time i wanna add new module, i will be getting error message saying that my user currently editing the screen. Any suggestion ?
    Thanks.
    Jon

    Hi <b>Jonathan</b>,
    Please close all the windows and relogin
    For making PAI and PBO modules, Please activate all the Table and its maintainence view.
    Now first make emptu file with <main filename>_PAI and <main filename>_PBO save and activate them.
    Now put the logic in them and then activate now call these in the main prog.. it should work...
    While activation all the sub program modules should be activated already... i suggest select all the prog and sub progs and activate them all at once...so the system automatically takes care of inner activations first...
    If u have some more quereies... please feel free to contact me...
    Regards,,
    <b>Abhishek</b>

  • Is there a way to create a table then apply it to other sheets and have it mirror changes across all the sheets? Like a sync'ed table that will be the same on multiple sheets

    I have a budget spreadsheet with a couple recurring tables. As months go by, I sometimes make changes to these tables and would like those changes to be synced across the different sheets in the spreadsheet. Is there a way to sync content across multiple pages, essentially having one true table that appears on multiple sheets?

    Abdur,
    In the sheet :: table :: cell that is going to receive the data, type an equals sign, then click on the cell that the data will come from and press Return.
    This will require that you navigate to the origin cell by choosing the proper sheet.
    Jerry

  • How can I export table and cell styles to use in another InDesign document?

    I've been looking…and looking but can't find out how to export table styles within InDesign CC. If there is a load table styles option within the panel, it stands to reason there should be an export. Any help would be appreciated, thanks.

    Frank,   John's solution is it.    But that also requires that you have those old files easily on hand to access.  Maybe even searching for them in the future, 3 months down the road, could be a pain.   You can always save a Library for that file and drag some of those styled elements into that library.   Save the library in a place that you will keep access to and readily pull assets from.   In the future doc open that library and drag the styled element into your new document and the styles are now in the new doc to reuse.   I have a library saved just for tables.

  • Javascript code to enable an ADD button to create duplicate tables and pages for multiple entries

    I am using Adobe XI Pro. I have created a multi-page fillable pdf questionnaire that I want to make interactive to the user. Within each page, I have multiple tables that can have ADD buttons to duplicate the table if the client wants more than one test. I would like this table to insert directly below the previous table and they may be able to add upto 5 of these table.
    I also have a couple pages in the questionnaire that require duplication for multiple samples. Eg. One page per sample, and I may have upto 10 samples. I would like the javascript to have an ADD button and then add each page behind the previous related sheet (Original and duplicates together)
    I am not a javascript coder so I would need some examples and a walk through. I did take some developer courses in engineering but it has been almost two decades
    I have search on several forums and cannot find a good resource so I appreciate the help.
    Sincerely
    Tara

    Some of what you want to do can be done using template features and a bit of JavaScript, but if your users will be using Reader, version 11 will be required. You can dynamically add new pages, but adding new tables to existing pages with reflow of content that comes after is not possible with a form created in Acrobat. If you have access to Adobe's LiveCycle Designer form creation software, you can create what's known as a dynamic XFA form that can do all of what you want. You can ask in the LiveCycle Designer forum for more information: http://forums.adobe.com/community/livecycle/livecycle_modules_and_development_tools/livecy cle_designer_es?view=discussions

  • How to find tables and columns in SAP Logon?

    I cant seem to find the table in SAP Logon,therefore i cant proceed with my abap.please help me,thanks

    Hi Koh,
    Create Table Step by step Process:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/frameset.htm
    You can follow the below steps to create the table in SE11.
    step 1. Go to transaction se11.
    step 2. write a table name prefix with z.
    step 3. Give description.
    step 4. It comes to delivery and maintainance, In delivery class u have 3 types u can select any of those 3. I have selected as A(master and transaction data).
    Along with this u have to mention ur data browser as Display/ maintainance allowed only.
    step 5. Go to technical settings, specify ur data class (APPL0) and size.
    step 6. Create your fields with data element and domain.
    step 7. While u enter ur data element ( the name u give should prefix with z) double click on that.
    step 8. Now u have two options either to create domain or data type. After creating this, it will ask for field label, mention the field label.
    step 9. Now activate at the same screen and come back u'll come to data element screen then again activate. Finally u'll come to first screen.
    step 10. Follow steps 6 to 9 for more fields.
    step 11. then activate.
    step 12. To create entries in the table. On menu bar u have utilities, in that u have table contents, in that u have create entries.
    step 13. After every entry save the data. That will be saved in the databaase.
    Hope this helps u...
    Regards,
    KK.

  • How to create a table and add columns to it with a stored procedure

    Hi,
    I hope that someone can help me.
    I want to create an empty table with the same columns as another
    table but with 4 columns more.
    So it's actualy a copy of a table but with 4 added columns.
    I have to do it in a stored procedure but I don't know which
    statements I have to use. I need to give 3 parameters : schema,
    table and prefix(e.g. the pers from column pers_number)
    Can someone help me?
    Thanks in advance, Ann

    you can !!
    here is some examples
    DECLARE
    sql_stmt VARCHAR2(200);
    plsql_block VARCHAR2(500);
    emp_id NUMBER(4) := 7566;
    salary NUMBER(7,2);
    dept_id NUMBER(2) := 50;
    dept_name VARCHAR2(14) := 'PERSONNEL';
    location VARCHAR2(13) := 'DALLAS';
    emp_rec emp%ROWTYPE;
    BEGIN
    EXECUTE IMMEDIATE 'CREATE TABLE bonus (id NUMBER, amt
    NUMBER)';
    sql_stmt := 'INSERT INTO dept VALUES (:1, :2, :3)';
    EXECUTE IMMEDIATE sql_stmt USING dept_id, dept_name, location;
    sql_stmt := 'SELECT * FROM emp WHERE empno = :id';
    EXECUTE IMMEDIATE sql_stmt INTO emp_rec USING emp_id;
    plsql_block := 'BEGIN emp_pkg.raise_salary(:id, :amt); END;';
    EXECUTE IMMEDIATE plsql_block USING 7788, 500;
    sql_stmt := 'UPDATE emp SET sal = 2000 WHERE empno = :1
    RETURNING sal INTO :2';
    EXECUTE IMMEDIATE sql_stmt USING emp_id RETURNING INTO salary;
    EXECUTE IMMEDIATE 'DELETE FROM dept WHERE deptno = :num'
    USING dept_id;
    EXECUTE IMMEDIATE 'ALTER SESSION SET SQL_TRACE TRUE';
    END;

  • Re : Hw to create a table and insert records using procedures

    Hi..
    I tried to run a procedure to create tables but is givin an error message "insufficient previlages" and when i tried to run it using a anonymous block i can create the tables..so can any one help me to resolve this issue.
    Thanks in advance.
    balveer.

    You don't have the privilege on creating the procedures. Hence you are not able to create tables through procedures. where as you can create table from anonymous blocks..

  • Creating a table and content updation in Java Stack

    Hi All
    I have a requirement that i need to capture the information of deployed content in a deploy log file present in the directory of a J2EE Engine and store it in a JAVA Persistence stack.I should not use any SAP tables so the JCO and RFC approch is not helpful in my case.Is it possible to create a table in  the Java persistence layer (NetWeaver DB partition for Java).
    So can any body helps me how to crate a table and update the content.As of now I am able to capture the log info.
    Some body suggested me to use open SQL for Java.But I am very new to this area.
    Any suggetions and code helps me to resolve this issue.
    Regards
    Kalyan

    Yes your assumption is correct
    What you need is a foreach loop based on ADO.Net enumerator which iterates through an object variable created in SSIS
    The object variable you will populate inside execute sql task using query below
    SELECT Col1,Col2
    From Table2
    Have two variables inside loop to get each iterated value of col1 and col2
    Then inside loop have a data flow task with oledb source and flat file destination
    Inside OLEDB Source use query as
    SELECT *
    FROM Table1
    WHERE col1 = ?
    Map parameter to Col1 variable inside loop
    Now link this to flat file destination
    Have a variable to generate filename using expression below
    @[User::Col2] + (DT_STR,1,1252) "\\" + (DT_STR,10,1252) @[User::Col1] + ".txt"
    Map this filename variable to connection string property of the flat file connection manager
    Once executed you will get the desired output
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to find tables and fields in the standard program.

    Hi to all,
                  I am very new to ABAP,
                i am willing to write Report ,that is  if i enter  the vendor number i have to get item,quantity , name...with dateetc....
    My approach was :  i went to ME2L and i gave vendor number and date in that then i got some data ,then i got the program of that list ( it was there in  bottom right) i.e, SAPMSSY0 .
               Then i entered in SE38,in that i go with Display Object LIst to find out the tables and fields,but i failed to found.
    My question is : I can write the reports if i know the fields and tables location....
                              Here i want to know the ,if i enter the Vendor No, i have to get the regarding information about that NO,_for that i have to know the fields and tables_ of item and cost ....every thing ...
           if my question was not clear please ask me i will explain you again...
          Can you help me how to find...
    Thanks in Advance
    Bhanu.

    Hi Bhanu,
       Goto transaction SE84 then follow the path
    SE84-->ABAP DICTIONARY--->FIELDS---->TABLE FIELDS-->ENTER THE TABLE OR FIED NAME you want to find
        and EXECUTE the programm you will get all the information regarding that field or table.
        Hope this solves your problem.
    Thank you,
    Pavan.
    Edited by: PAVAN CHANDRASEKHAR GANTI on Sep 1, 2009 12:57 PM
    Edited by: PAVAN CHANDRASEKHAR GANTI on Sep 1, 2009 12:58 PM

  • Delete and Reload Vs Create another table and rename to original

    Hi
    I have a set of summary tables which I have to delete and re-load on a daily basis. Before I take a decision to go ahead with it, I wanted to know if its better to create a new table with the up-to-date summary data and then rename the new table to the existing one. Deleting and reloading might cause the table to be empty for a while, but would there be any issue if i go with the re-naming approach.
    Can I know the advantages and disadvantages of both
    Thanks in Advance
    -G

    >
    I have a set of summary tables which I have to delete and re-load on a daily basis
    >
    Partition Exchange is another technique that can be used effectively for this use case.
    This technique uses the standard table that you are using now and a new partitioned table.
    The partitioned table is a mirror (clone) of the standard and has just one partition (usually a MAX VALUES partition).
    The process is as follows:
    1. Assume your standard table already contains data and you are ready to replace all data with new data
    2. Truncate and load the partition of the partitioned table - the standard table data is available during this process
    3. Perform a partition exchange between the partitioned table and the standard table. This is a metadata (data dictionary) operation only and takes a mere fraction of a second. At the end of this operation the standard table now contains all of the data that you loaded into the partitioned table and the partitioned table contains the data that had previously been in the standard table. That is, the tables have 'exchanged' data.
    4. Repeat steps 2 and 3 each time you need to load new data.
    The partition exchange method allows the current data to be accessible at all times during the truncate and load of the new set of data. Then it becomes unavailable for the fraction of a second it takes to do the exchange. After the exchange it has the new data.
    As far as I know this is the fastest way to load new data and make it available without downtime for the existing data.
    See Exchanging Partitions in the VLDB and Partitioning Guide
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1107555

Maybe you are looking for

  • How to copy image from client machine to server machine?

    Hi , Im doing a project in web applications...im using tomcat 5.0....when clients (using different machine) upload a image i need to make a copy of that in my "webapps" folder...can u help to solve it? The following code is working only in my machine

  • Write data to table

    hallow i have table yhr_1 and i wont to write data to her how can i do that? just from progran or other option. regards

  • How to check which fields of a table are changed

    Hi I have a FM in which i pass VBAK and VBAP. I store records of table in internal tables and update the values during execution and at the end of this i have to cpmare VBAK and VBAP with internal tables to chcek which field value is changed in both

  • My 'MODIFY button' is not working

    coding is given below begin      :GLOBAL.ADDNEW:=2;      GO_BLOCK('IMPORTER_TYPE1');      GO_ITEM('IMPORTER_TYPE1.IMP_TYPE_DESC');      item_enable_disable('IMPORTER_TYPE',property_on); item_enable_disable('IMPORTER_TYPE1',property_on); end; pls tell

  • Can we create complete report in OOPs

    Hi, Could you please advice if we can code the complete report in SE24 and call it in SE38 report.. For ex. I have a report followed by ALV output..now can i write everything in a Z Object (from decalration to output ) .. Kindly suggest if it is a go