FM to Find segment name based on material class type

Hi Experts,
is there any function module availble to find out the segment name based on material class or material class type?
Please use a more informative subject line in the future.
Edited by: Rob Burbank on Feb 17, 2009 10:33 AM

HI,
Try with transcation Code WE41
Thanks
Kalyan

Similar Messages

  • Find Report Name based on Report ID

    How do I find out the report name based on the report id ('D12C939B-4309-4364-A025-BFDB5203EE0B')?

    Hi Sudhir,
    Based on my research, I find that the general properties of all the items (including Date Sources, Datasets and reports) on the report server will be stored in the Catalog table in ReportServer database. So that the report name (correspond to Name column)
    and report id (correspond to ItemID column) also be stored in the table. If we want to select the report name based on the report id, we can use the query below:
    use ReportServer
    select Name
    from dbo.Catalog
    where dbo.Catalog.ItemID='D12C939B-4309-4364-A025-BFDB5203EE0B'
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Find Userexit name based on Exit function module

    Hi All,
    Is there any way to find the userexit name based on the function module.
    My exit function module is EXIT_SAPLATPC_001. I want to find the exit name.
    Appreciate your help.
    Thanks,
    Jaffer Ali.S

    Hi
    This is the Exit Name: ATP00001 for the Exit FM you have given. I took the package name this exit FM is stored in the Attributes of FM in SE37. In the search criteria of SMOD,after hitting f4..and selecting Information System, I gave the package name...and it gave me the exit name.
    P.S: The above method may sometimes lead to giving in more than one exit as result.
    Vishwa.

  • How to find field name based on screen field name

    Hi all,
    I need to find field name at run time based on screen field name for doing some check.
    Eg, if i have P_CUST on screeen which refers to KUNNR . Then i should be able to find KUNNR based on screen name ie P_CUST during run time.
    Thanks in advance.
    Thanks and Regards,
    Taranam

    Hi
    ex:
    PARAMETERS :
      p_carrid LIKE spfli-carrid,
      p_connid LIKE spfli-connid.
    DATA:
      T_DYNPRO TYPE
      STANDARD TABLE
            OF DYNPREAD
          WITH HEADER LINE,
      W_PROG LIKE D020S-PROG,
      W_DYNP LIKE D020S-DNUM.
    CLEAR: FIELD_VALUE, T_DYNPRO.
      FIELD_VALUE-FIELDNAME = 'P_CARRID'.
      APPEND FIELD_VALUE TO T_DYNPRO.
    w_prog = sy-repid.
    w_dynp = sy-dynnr.
    ***TO READ VALUES on screen
    CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME                   = W_PROG
                DYNUMB                   = W_DYNP
                TRANSLATE_TO_UPPER       = 'X'
           TABLES
                DYNPFIELDS               =  T_DYNPRO.
    Reward if helpful.
    Best Wishes,
    Chandralekha

  • Finding Template Name Based on the Query

    Is there a way to find the Technical Name of a Template in which a query is being used?  I tried the Where-Used command on the query but it doesn't show which templates are using it.

    The "Where used" from the BEx query designer will display all the templates and workbooks which uses that query.
    The template will be displayed only if the dataprovider assignment for the query is done in the template definition not thru the URL.

  • Find query name based on workbook id and vice versa

    Hi,
      I need to developed a progarm in which user can enter Query name ( tech name ) and  it should display all workbooks releated to it  and vice versa .
    Is there any tables which stores this relationship.?
    Wating for response.
    Thx in advance .
    Regards
    Nilesh

    hi Nilesh,
    Table RSRWORKBOOK WORKBOOKID, GENUNIID is the query ID;
    goto RSRREPDIR for detail query properties
    (query belongs, in bex analyzer, right click cell 'properties', tab 'information' - query id)
    Queries in Work Book
    determine the workbooks
    table with list of work books
    hope this helps.

  • Single material class in MM02

    Hi,
        I need some assistance on this issue. We have multiple classes of the material class type 001 assigned to a material master. When I enter the MM02/MM03 tcodes, I see all the classes listed one below the other. So far so good. However when I look at the characteristics section below, I see all the characteristics in all the material classes listed. If I click on the blue magnifying lens I still cannot see the class specific characteristics. What I want is if I select a class in teh list of classes and click the blue magnifying icon, I should see only the characteristics assigned to that class in the characteristics section and not the entire list. Any ideas? I tried the value assignment option and the user settings but could not find anything
    Thanks
    GS

    Hello G S,
    Hope to understand your query. I believe you have "with inherited characteristic" checked in the user settings. Please uncheck the flag as per the attachments. With this flag unset characteristics will be displayed only for the class you selected.
    Let me know If I misunderstood your query.
    Thanks Amber

  • HOW TO FIND LAST DOCUMENT DATE BASED ON MATERIAL NUMBER

    Hi,
           I want to know how to find the last document details based on material number.
    Is there any Functional modulle or BAPI programe?
    i,e, I want know last goods receipt details (MIGO)  based on material number.
    Can u please anybody tell me.
    Thanks,
    S.Muthu.
    Edited by: Subramaniyan Marimuthu on Jan 2, 2008 9:07 AM

    Hello.
    Check the BAPI_GOODSMVT_GETITEMS
    -example--
    Get GRs after a specific date for a specific plant/ storage location and movement types
      wa_budats-sign = 'I'.
      wa_budats-option = 'GE'.
      wa_budats-low = '20071201'.
      APPEND wa_budats TO budats.
      wa_plants-sign = 'I'.
      wa_plants-option = 'EQ'.
      wa_plants-low = '1000'.
      APPEND wa_plants TO plants.
      wa_stlocs-sign = 'I'.
      wa_stlocs-option = 'EQ'.
      wa_stlocs-low = '0001'.
      APPEND wa_stlocs TO stlocs.
      wa_mvts-sign = 'I'.
      wa_mvts-option = 'EQ'.
      wa_mvts-low = '101'.
      APPEND wa_mvts TO mvts.
      wa_mvts-low = '901'.
      APPEND wa_mvts TO mvts.
      wa_mvts-low = '123'.
      APPEND wa_mvts TO mvts.
      CALL FUNCTION 'BAPI_GOODSMVT_GETITEMS'
        TABLES
          plant_ra        = plants
          stge_loc_ra     = stlocs
          move_type_ra    = mvts
          pstng_date_ra   = budats
          goodsmvt_header = header
          goodsmvt_items  = item
          return          = return.
    Reward if helpful.
    Cheers,
    George

  • How can I find a segment name from p1 and p2 value of v$session??

    Hi, all.
    A session is waiting with "gc cr request".
    The pvalue of the session are as followings.
    p1text p1 p2text p2 p3text p3
    file# 15 block# 412 id# 33619969
    I issued the following sql statement to find the segment name.
    select segment_name
    from dba_extents
    where file_id = 15
    and 412 between block_id and (block_id + blocks -1)
    However, No row returned.
    Is there any mistake??
    Thanks and Regards.

    Hi,
    You will find what the wait means in the Oracle Reference manual.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/toc.htm
    To find out what object P1 refers to:
    select * from v$datafile where file# = file#;
    To find the hot block within that object above do:
    select name, kind from ext_to_obj_view
    where file# = file#
    and lowB <= block#
    and highB >= block#;
    to create a report an example change your variable to what you need
    select
    sess.username,
    sess.sid,
    se.event,
    se.total_waits,
    se.total_timeouts,
    se.time_waited/100 time_waited,
    se.average_wait
    from v$session_event se, v$session sess
    where event like '%buffer busy% <===== change to your choosing
    and sess.sid = se.sid
    and sess.username is not null
    and se.total_waits > 10000
    order by username, sid
    hope this helps.
    al

  • Find the folder name based on the View Name

    Hi ,
    I need to find out a Folder name based on a View Name . Basically i know the view Name and want to find out the Folder that is created in Discovrer based out of that view.
    Does any one know of any EUL table that stores this relationship.
    Thanks in advance for your help
    Sunny

    Hi,
    Your requirement can be fulfilled using the following script:
    SELECT bas.ba_name,
    bas.ba_id,
    obj.obj_name folder,
    decode(obj.obj_type,
    'COBJ',
    'Complex',
    'SOBJ',
    'Simple',
    'CUO',
    'Custom',
    'Unknown') AS obj_type,
    decode(obj.obj_hidden,0,'Bare','Hidden') IS_HIDDEN,
    obj.sobj_ext_table folder_source_object
    FROM eul10g_us.eul5_ba_obj_links bol,
    eul10g_us.eul5_objs ; obj,
    eul10g_us.eul5_bas ; bas
    WHERE obj.obj_id = bol.bol_obj_id
    AND bas.ba_id = bol.bol_ba_id
    BUT
    As you can see from the SQL, only simple folders are mapped to objects.
    This means that if the object is used inside a custom folder or complex folder you will not see it.
    Tamir

  • How to append an alphabet to material name based on characteristic selectin

    Hi every one,
    i have a BOM with material name 'abc' and it has characteristics and class assigned to it. when i select a particular characteristic in the sales order it should append a letter to the existing name of the material. so that the selection differentiates wht characteristic is selected.
    Its like material name should change based on the characteristics.
    one more simple ex:
    material name - 'bike'
    bike with color green -
    'bike-gr'
    green bike with 120 cc -
    'bike-gr-120cc'
    how to approach this ????
    rewards for sure
    thanks
    mmn
    Message was edited by:
    mmn...!!

    Mmn,
    The fucntion module exit EXIT_SAPFV45S_002 is triggered at sales order save. When you perform the configuration and save these values should be available to you. Check with your Abaper how this is to be coded. I could see the field ARKTX (sales order item text) in the export parameters E_VCSDPOS and E_VBAP which means this could be changed. Now how exactly you get the info from characteristics you need to check with abaper.
    Regards
    Ram

  • Hi , i want to find the names of ship to party , sold to party based likp

    Hi ,
    Could you plz help me .
    how to find the names of the ship to party , sold to party depending on the
    sold to party (likp-kunnr) and ship to party(likp-kuang).
    Thanks
    Suresh.

    Sold-to-party
    Take ur likp-kunnr ,do compare compare with kna1-kunnr,take adrnr number from kna1,use adrc table..
    so adrc table field is name1
    Ship-to-party :
    take LIKP-kunag,do compare with kna1-kunnr,get adrnr field from kna1,do compare with ADRC Table with adrnr,
    so you can use ADRC-NAME1 field
    Thanks
    Seshu

  • MM-material class field name req??

    Hi
    I had to develop a reprot to generate the vendor list,based on the selection-screen i/p:mat no,mat type,mat grp,mat class.
    except Material Class I had found the filed name & all req data to do the report.I had found the fileds frm mm03,class type(KLART),class name(CLASS) ,but i am unable to a make a link with the matnr,also whcih table will be the most approp fo all this senerio of vendor list.
    So its a kind request,if any one can tell me the resp fildname & table for
    mat class,so that i can do the reprot.
    Tables : mara,m_kredm. i am using in this reprot.
    rgds
    vipin.

    hi vipin...try this method....
    use the table KSSK , KLAH and SWOR;
    first of all get the int class no ( CLINT ) for that material  from kssk;
    here object is the material with all leading zeros from the table KSSK(OBJEK).
    then use the int.class no as the key field for the other two tables.
    you will find the description in SWOR table.
    kesav

  • Crystal Reports XI and Sun One 6.1 web server SP 5 Error finding JNDI name

    I am trying to create a Crystal Reports XI report in a JSP using Sun One 6.1 Web server sp 5.
    At this point I am getting the error �Error finding JNDI name� on Sun One
    The application will run on Netbeans/Tomcat
    I have done the following:
    I edited CRConfig.xml
    <?xml version="1.0" encoding="utf-8"?>
    <CrystalReportEngine-configuration>

    <DataDriverCommon>
         <JavaDir>C:\Program Files\Java\j2re1.4.2_10\bin</JavaDir>
    <Classpath>C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;�</Classpath>

    <JDBC>
         <CacheRowSetSize>100</CacheRowSetSize>
         <JDBCURL>jdbc:oracle:thin:@10.10.10.10:1521:dev</JDBCURL>
         <JDBCClassName>oracle.jdbc.driver.OracleDriver</JDBCClassName>
         <JDBCUserName>lab_ro</JDBCUserName>
         <JNDIURL></JNDIURL>

    </JDBC>
    I created a report using JDBC (JNDI) connection and have the JNDI Connection set to the name of DATA.
    The report works just fine in Crystal Reports.
    Then in Netbeans I created an application and it runs in the Tomcat part of Netbeans
    In context.xml I have:
    <Context path="/BOEnterpriseTest3">
    <Resource name="jdbc/dev" auth="Container" type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev"
    username="theuserid" password="thepassword" maxActive="20" maxIdle="10" maxWait="-1"/>
    </Context>
    In web.xml I have
    <web-app>
    <context-param>
    <param-name>crystal_image_uri</param-name>
    <param-value>crystalreportviewers11</param-value>
    </context-param>

    <taglib>
    <taglib-uri>/crystal-tags-reportviewer.tld</taglib-uri>
    <taglib-location>/WEB-INF/crystal-tags-reportviewer.tld</taglib-location>
    </taglib>
    <resource-ref>
    <description>jdbc:oracle:thin:@10.10.10.10:1521:dev</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <resource-ref>
    <description>jdbc:oracle:thin:@10.10.10.10:1521:dev</description>
    <res-ref-name>Data</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    </web-app>
    in web-inf\sun-web.xml I have
    <sun-web-app>
    <resource-ref>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <jndi-name>Data</jndi-name>
    </resource-ref>
    </sun-web-app>
    I have copied all of Common Files\Business Objects\3.0\java\lib and Common Files\Business Objects\3.0\java\lib\external to the lib folder
    I have copied crystalreportviewers11 to the root of my web application
    I have tried to load the JNDI information and display the report
    <%@page pageEncoding="UTF-8"
    import="com.crystaldecisions.reports.reportengineinterface.*,
    com.crystaldecisions.report.web.viewer.*,
    javax.naming.*,
    javax.sql.*,
    java.sql.*"%>
    <%
    InitialContext initContext = new InitialContext();
    DataSource source = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    try{
         // Look up our data source
    DataSource ds = (DataSource)initCtx.lookup("Data");
    out.println("found ds under jdbc/Data");
    catch ( NamingException e ){
    // Look up our data source
    DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    initCtx.bind("Data", ds);     
    out.println("found ds under java:com/env:jdbc/Data - bound into root initial context for Crystal to find");
    %>
    <%
    //Use the relative path to the report; the physical or full qualified URL cannot be used.
    String reportName = "useridincluded.rpt";
    //Database username and password
    String userName = "theuserid";
    String password = "thepassword";
    //check to see if the Report Source Session Variable already exist
    Object reportSource = session.getAttribute("Report1");
    // Create a new ConnectionInfos and ConnectionInfo object
    com.crystaldecisions.sdk.occa.report.data.ConnectionInfos connectionInfos = new com.crystaldecisions.sdk.occa.report.data.ConnectionInfos();
    com.crystaldecisions.sdk.occa.report.data.ConnectionInfo connectionInfo = new com.crystaldecisions.sdk.occa.report.data.ConnectionInfo();
    //Set username and password for the report's database
    connectionInfo.setUserName(userName);
    connectionInfo.setPassword(password);
    //Add object to collection
    connectionInfos.add(connectionInfo);
    //---------- Create a ReportClientDocument -------------
    com.crystaldecisions.reports.sdk.ReportClientDocument reportClientDocument = new com.crystaldecisions.reports.sdk.ReportClientDocument();
    //---------- Set the path to the location of the report soruce -------------
    //Open report.
    reportClientDocument.open(reportName, 0);
    //Get the report source
    reportSource = reportClientDocument.getReportSource();
    //---------- Create the viewer and render the report -------------
    //create the CrystalReportViewer object
    com.crystaldecisions.report.web.viewer.CrystalReportViewer crystalReportViewer = new com.crystaldecisions.report.web.viewer.CrystalReportViewer();
    //set the reportsource property of the viewer
    crystalReportViewer.setReportSource(reportSource);
    //set the DB logon into the viewer
    crystalReportViewer.setDatabaseLogonInfos(connectionInfos);
    //set viewer attributes
    crystalReportViewer.setOwnPage(true);
    crystalReportViewer.setOwnForm(true);
    crystalReportViewer.refresh();
    //set the CrystalReportViewer print mode
    //crystalReportViewer.setPrintMode(com.crystaldecisions.report.web.viewer.CrPrintMode.ACTIVEX);
    crystalReportViewer.setPrintMode(com.crystaldecisions.report.web.viewer.CrPrintMode.PDF);
    //process the report
    crystalReportViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
    %>
    On the Sun One Web server
    On the Java Tab
    JDBC Connection Pools
    Pool Name = dev10g
    Class name = oracle.jdbc.pool.OracleDataSource
    User id = theuserid
    url = 10.10.10.10
    password=thepassword
    JDBC Resources
    JNDI Name=dev10g
    Pool = dev10g
    I get the error finding JNDI name � how do I tell Sun One where the JNDI is to make Crystal Reports work?

    I tried the following to test the JNDI
    I am trying to do JNDI in Sun One Web server 6.1 sp 5 but I seem to be missing an important part. I get two different errors based on the JSP code, �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance� or �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance�.
    Context.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/BOTest">
      <Resource name="jdbc/dev10g" auth="Container" type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev10g"
    username="userid" password="password" maxActive="20" maxIdle="10" maxWait="-1"/>
      <Resource name="Data" auth="Container" type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev10g"
    username="userid" password="password" maxActive="20" maxIdle="10" maxWait="-1"/>
    </Context>Sun-one.xml:
    <sun-web-app>
    <context-root>BOTest</context-root>
    <resource-ref>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <jndi-name>jdbc/dev10g</jndi-name>
    </resource-ref>
    </sun-web-app>web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
         <welcome-file>
                index.jsp
            </welcome-file>
        </welcome-file-list>
        <resource-ref>
            <description>jdbc:oracle:thin:@10.10.10.10:1521:dev10g</description>
            <res-ref-name>jdbc/dev10g</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
        <resource-ref>
            <description>jdbc:oracle:thin:@10.10.10.10:1521:dev10g</description>
            <res-ref-name>Data</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
    </web-app>server.xml has:
    <RESOURCES>
    - <JDBCCONNECTIONPOOL name="dev10g" datasourceclassname="oracle.jdbc.pool.OracleDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off" connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off">
      <PROPERTY name="URL" value="jdbc:oracle:thin:@10.45.3.197:1521:dev10g" />
      <PROPERTY name="User" value="lab_ro" />
      <PROPERTY name="Password" value="0asphalt1" />
      </JDBCCONNECTIONPOOL>
      <JDBCRESOURCE jndiname="jdbc/dev10g" poolname="dev10g" enabled="on" />
      <JDBCRESOURCE jndiname="Data" poolname="dev10g" enabled="on" />
    - <JDBCCONNECTIONPOOL name="Data" datasourceclassname="oracle.jdbc.pool.OracleDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off" connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off">
      <PROPERTY name="User" value="lab_ro" />
      <PROPERTY name="URL" value="jdbc:oracle:thin:@10.45.3.197:1521:dev10g" />
      <PROPERTY name="Password" value="0asphalt1" />
      </JDBCCONNECTIONPOOL>
      <JDBCRESOURCE jndiname="jdbc/Data" poolname="Data" enabled="on" />
      <JDBCRESOURCE jndiname="dev10g" poolname="dev10g" enabled="on" />
      </RESOURCES>I am getting the following error: �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance�
    With the following code:
    <%@page
       import="java.io.*,
               javax.sql.*,
               javax.naming.*,
               java.sql.*,
               java.util.*"%>
    <%
    Context init;
    Context ctx;
    DataSource datasource;
    Connection con;
    try
    init = new InitialContext();
    Context envCtx = (Context) init.lookup("java:comp/env");
    datasource = (DataSource)  envCtx.lookup("jdbc/dev10g");
    catch(NamingException ex)
        out.print("Cannot retrieve data source: " + ex.toString(true));
        return;
    try
        con = datasource.getConnection();
    catch (Exception e)
      out.print("Cannot retrieve connection: " + e.toString());
      return;
    try
        PreparedStatement pstmt = con.prepareStatement("SELECT PROJNO FROM MATERIALSLAB.VW_ASPHALTHEADERINFO");
        ResultSet results = pstmt.executeQuery();
        while (results.next())
        out.println(results.getString(1));
    catch(Exception ex)
    out.print("Got connection, can't execute query: " + ex.toString());
    return;
    %>I get the following error: Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance
    With the following code:
    <%@page
       import="java.io.*,
               javax.sql.*,
               javax.naming.*,
               java.sql.*,
               java.util.*"%>
    <%
    Context init;
    Context ctx;
    DataSource datasource;
    Connection con;
    try
        init = new InitialContext();
        ctx = (Context) init.lookup("java:comp/env");
        datasource = (DataSource) ctx.lookup("jdbc/dev10g");
    catch(NamingException ex)
        out.print("Cannot retrieve data source: " + ex.toString(true));
        return;
    try
        con = datasource.getConnection();
    catch (Exception e)
      out.print("Cannot retrieve connection: " + e.toString());
      return;
    try
        PreparedStatement pstmt = con.prepareStatement("SELECT PROJNO FROM MATERIALSLAB.VW_ASPHALTHEADERINFO");
        ResultSet results = pstmt.executeQuery();
        while (results.next())
        out.println(results.getString(1));
    catch(Exception ex)
    out.print("Got connection, can't execute query: " + ex.toString());
    return;
    %>

  • How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?

    Greetings all,
    I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
    We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
    The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
    For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
    There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
    I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
    PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
    var myPresets = app.pdfExportPresets.everyItem().name;
    myPresets.unshift("- Select Preset -");
    var myWin = new Window('dialog', 'PDF Export Presets');
    myWin.orientation = 'row';
    with(myWin){
        myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
        myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
        myWin.myPDFExport.selection = 0;
        myWin.btnOK = add('button', undefined, 'OK');
    myWin.center();
    var myWindow = myWin.show();
    if(myWindow == true && myWin.myPDFExport.selection.index != 0){
        var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
        myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
        if(myFile != null){
            app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
        }else{
            alert("No File selected");
    }else{
        alert("No PDF Preset selected");
    So far my code does the following:
    1) Runs the Multi-Page PDF Import Script
    2) Runs PDF Export Script Above
    3) Toggles the Template
    4) Runs #2 Again
    5) Deletes the imported PDF and all pages and toggles template again.
    It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
    Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!

    If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
    Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
    It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.

Maybe you are looking for