How to use print functionality in Java Studio Creator

Hi,
I am working on one JSF project using Java Studio Creator.
I have requirement where I have one table and print button.
By clicking the print button, I want the contents of table to be printed.
I have configured all the required properties of this button but still by clicking this print button, I am not able to see the print window.
Please help me in that, Its urgent.
Thanks in advance.
Vijay

Hi,
i think the best thing for you to do is to use javascript. go to jsp page of the form and find the button, as part of its attribute type onClick="window.print()"

Similar Messages

  • How do expire a page in Java Studio Creator

    Hi There,
    How do expire a page in Java Studio Creator ?
    When pressing Back button, I would like to show "Warning: Page has Expired" on the browser.
    Thanks.

    Could you modify the JSP page to include the following
    lines and try
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV=Expires CONTENT="now">
    <%
    response.setHeader("Pragma", "No-cache");
    response.setDateHeader("Expires", 0);
    response.setHeader("Cache-Control", "no-cache");
    %>

  • How to do internationalization with Sun Java Studio Creator?

    Hi everybody,
    the Sun Java Studio Creator seems to be a great peace of software ;-) Currently I'm trying to design some forms for a hello-world-test-project. My question now is: how can I realize internationalization with property-bundles? I already managed it to create my own bundles, I set up a few locales (de, en, fr) and put in some "SayHello" Variables. But how can I associate my locale-variables in the .propertie-files with the value- or text-attributes of the UI-Components using the form designer?

    well... it's not working!
    I created some locale-properties. Put a
    <f:loadBundle basename="mypackage.mainlocales" var="messages"/>directly under the "<f:view>"-Tag as it is descriped in the manual.
    But when I write something like
    <ui:label binding="#{sites$main$mainmenu.label1}" id="label1" style="position: absolute; left: 312px; top: 168px" text="#{messages.test}"/>The designer crashes with an error-message:
    javax.faces.el.PropertyNotFoundException: Error testing property 'test' in bean of type null
         at com.sun.faces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:342)
         at com.sun.rave.web.ui.faces.UIComponentPropertyResolver.getType(UIComponentPropertyResolver.java:298)
         at com.sun.rave.web.ui.faces.DataProviderPropertyResolver.getType(DataProviderPropertyResolver.java:264)
         at com.sun.jsfcl.data.ResultSetPropertyResolver.getType(ResultSetPropertyResolver.java:141)
         at com.sun.rave.jsfsupp.container.DesignTimePropertyResolver.getType(DesignTimePropertyResolver.java:169)
         at com.sun.faces.el.impl.ArraySuffix.getType(ArraySuffix.java:240)
         at com.sun.faces.el.impl.ComplexValue.getType(ComplexValue.java:208)
         at com.sun.faces.el.ValueBindingImpl.getType(ValueBindingImpl.java:350)
         at com.sun.rave.web.ui.renderer.ValueHolderDesignTimeRenderer.encodeBegin(ValueHolderDesignTimeRenderer.java:59)
         at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)Nevertheless - when I deploy my application, the locales are processed correctly.
    What am I doing wrong?

  • How To Increase heap size in Java Studio Creator 2

    Hi,
    I'd like to know how I can increase the heap size in Java Studio Creator 2.
    I already tried editing creator.conf, but it doesn't seem to work...
    Can anybody help me?
    thanks.

    In the servers window of creator, right-click 'Deployment Server' and choose 'View Admin Console'. A new web page comes up with the web interface to the Sun Application Server 8. Type your username and password that you configured during installation. I think default username is admin and default password either admin or adminadmin. After you're in, click 'Application Server' link in the left window, then click 'JVM Settings' tab, then click 'JVM Options' tab. Add new JVM option -Xms512m to start the server with 512MB. Find the -Xmx option and edit it to something larger, provided you have enough memory on your system.

  • How to Use DLL Function in Java Applet

    Hi all,
    I have been assigned a task to develop java applet. The problem is, I need to use DLL functions in my applet to read records. Could you pls anyone guide me how to interface DLL and applet to read records with sample code?
    I'm using JDK 1.5.0_06 and Windows XP OS. thanx..
    best rgds,
    jpdbay

    You will need to use Java Native Interface JNI. Ther are many posts on the subject, please search, and this is the documentation:
    http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

  • How to Use Exec function in Java Code

    How to Use Exec method
    I want to Execute command
    net Start "some service"
    using exec method of runtime class
    or i use some other way if suggest

    Assuming you have read http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#exec(java.lang.String) already, I can only suggest to be more specific in what your problems are. If you are after just some example code, then download ftp://ftp.ebi.ac.uk/pub/software/textmining/monq/monq.tar.gz and have a look at the source code of monq.stuff.Exec. It does all those things which are necessary to keep track of a Process after it was created with exec.
    Harald.
    BioMed Information Extraction: http://www.ebi.ac.uk/Rebholz-srv/whatizit

  • How to use "put" function in Java.util.Map class

    intially an entry for key is null in a Map.
    then if I try to do put function on the map with the same key which had a null value previously It doesn't allow me to put the new value for the Key.
    Can anyone pleasee suggest as to how I can put a value on to key with the new value even if the old value is null.
    Waiting for replies

    I have problem with the "value"..Not with a "key"
    parameter in the function.I already have a value for
    Key...that is "Firstkey"
    Map map = new HashMap();
    String column = "FirstKey";
    map.put(column, null);
    The below step gives me an IllegalArgumentException
    map.put(column, "FirstValue");That's not the problem. Your error is somewhere else.
    This works.
    public class Test {
         public static void main(String[] args) {
              Map map = new HashMap();
              String column = "FirstKey";
              map.put(column, null);
              map.put(column, "FirstValue");
              System.out.println("Done");
    }Kaj

  • Using Servlets in java studio creator

    Hello, anyone can tell me how can i use a servlet in java studio creator, due the file is in .java i dont know how to use it, here is an example i want to add to my proyect:
    and other question is how can i make to work?
    * Sean C. Sullivan
    * June 2003
    * URL: http://www.seansullivan.com/
    package pdfservlet;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.ByteArrayOutputStream;
    import java.io.PrintWriter;
    // import the iText packages
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    * a servlet that will generate a PDF document
    * and send the document to the client via the
    * ServletOutputStream
    * @author Sean C. Sullivan
    public class PDFServlet extends HttpServlet
         public PDFServlet()
              super();
         * we implement doGet so that this servlet will process all
         * HTTP GET requests
         * @param req HTTP request object
         * @param resp HTTP response object
         public void doGet(HttpServletRequest req, HttpServletResponse resp)
              throws javax.servlet.ServletException, java.io.IOException
              DocumentException ex = null;
              ByteArrayOutputStream baosPDF = null;
              try
                   baosPDF = generatePDFDocumentBytes(req, this.getServletContext());
                   StringBuffer sbFilename = new StringBuffer();
                   sbFilename.append("filename_");
                   sbFilename.append(System.currentTimeMillis());
                   sbFilename.append(".pdf");
                   // Note:
                   // It is important to set the HTTP response headers
                   // before writing data to the servlet's OutputStream
                   // Read the HTTP 1.1 specification for full details
                   // about the Cache-Control header
                   resp.setHeader("Cache-Control", "max-age=30");
                   resp.setContentType("application/pdf");
                   // The Content-disposition header is explained
                   // in RFC 2183
                   // http://www.ietf.org/rfc/rfc2183.txt
                   // The Content-disposition value will be in one of
                   // two forms:
                   // 1) inline; filename=foobar.pdf
                   // 2) attachment; filename=foobar.pdf
                   // In this servlet, we use "inline"
                   StringBuffer sbContentDispValue = new StringBuffer();
                   sbContentDispValue.append("inline");
                   sbContentDispValue.append("; filename=");
                   sbContentDispValue.append(sbFilename);
                   resp.setHeader(
                        "Content-disposition",
                        sbContentDispValue.toString());
                   resp.setContentLength(baosPDF.size());
                   ServletOutputStream sos;
                   sos = resp.getOutputStream();
                   baosPDF.writeTo(sos);
                   sos.flush();
              catch (DocumentException dex)
                   resp.setContentType("text/html");
                   PrintWriter writer = resp.getWriter();
                   writer.println(
                             this.getClass().getName()
                             + " caught an exception: "
                             + dex.getClass().getName()
                             + "<br>");
                   writer.println("<pre>");
                   dex.printStackTrace(writer);
                   writer.println("</pre>");
              finally
                   if (baosPDF != null)
                        baosPDF.reset();
         * @param req must be non-null
         * @return a non-null output stream. The output stream contains
         * the bytes for the PDF document
         * @throws DocumentException
         protected ByteArrayOutputStream generatePDFDocumentBytes(
              final HttpServletRequest req,
              final ServletContext ctx)
              throws DocumentException
              Document doc = new Document();
              ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
              PdfWriter docWriter = null;
              try
                   docWriter = PdfWriter.getInstance(doc, baosPDF);
                   doc.addAuthor(this.getClass().getName());
                   doc.addCreationDate();
                   doc.addProducer();
                   doc.addCreator(this.getClass().getName());
                   doc.addTitle("This is a title.");
                   doc.addKeywords("pdf, itext, Java, open source, http");
                   doc.setPageSize(PageSize.LETTER);
                   HeaderFooter footer = new HeaderFooter(
                                       new Phrase("This is a footer."),
                                       false);
                   doc.setFooter(footer);
                   doc.open();
                   doc.add(new Paragraph(
                                  "This document was created by a class named: "
                                  + this.getClass().getName()));
                   doc.add(new Paragraph(
                                  "This document was created on "
                                  + new java.util.Date()));
                   String strServerInfo = ctx.getServerInfo();
                   if (strServerInfo != null)
                        doc.add(new Paragraph(
                                  "Servlet engine: " + strServerInfo));
                   doc.add(new Paragraph(
                                  "This is a multi-page document."));
                   doc.add( makeGeneralRequestDetailsElement(req) );
                   doc.newPage();
                   doc.add( makeHTTPHeaderInfoElement(req) );
                   doc.newPage();
                   doc.add( makeHTTPParameterInfoElement(req) );
              catch (DocumentException dex)
                   baosPDF.reset();
                   throw dex;
              finally
                   if (doc != null)
                        doc.close();
                   if (docWriter != null)
                        docWriter.close();
              if (baosPDF.size() < 1)
                   throw new DocumentException(
                        "document has "
                        + baosPDF.size()
                        + " bytes");          
              return baosPDF;
         * @param req HTTP request object
         * @return an iText Element object
         protected Element makeHTTPHeaderInfoElement(final HttpServletRequest req)
              Map mapHeaders = new java.util.TreeMap();
              Enumeration enumHeaderNames = req.getHeaderNames();
              while (enumHeaderNames.hasMoreElements())
                   String strHeaderName = (String) enumHeaderNames.nextElement();
                   String strHeaderValue = req.getHeader(strHeaderName);
                   if (strHeaderValue == null)
                        strHeaderValue = "";
                   mapHeaders.put(strHeaderName, strHeaderValue);
              Table tab = makeTableFromMap(
                        "HTTP header name",
                        "HTTP header value",
                        mapHeaders);
              return (Element) tab;
         * @param req HTTP request object
         * @return an iText Element object
         protected Element makeGeneralRequestDetailsElement(
                                  final HttpServletRequest req)
              Map mapRequestDetails = new TreeMap();
              mapRequestDetails.put("Scheme", req.getScheme());
              mapRequestDetails.put("HTTP method", req.getMethod());
              mapRequestDetails.put("AuthType", req.getAuthType());
              mapRequestDetails.put("QueryString", req.getQueryString());
              mapRequestDetails.put("ContextPath", req.getContextPath());
              mapRequestDetails.put("Request URI", req.getRequestURI());
              mapRequestDetails.put("Protocol", req.getProtocol());
              mapRequestDetails.put("Remote address", req.getRemoteAddr());
              mapRequestDetails.put("Remote host", req.getRemoteHost());
              mapRequestDetails.put("Server name", req.getServerName());
              mapRequestDetails.put("Server port", "" + req.getServerPort());
              mapRequestDetails.put("Preferred locale", req.getLocale().toString());
              Table tab = null;
              tab = makeTableFromMap(
                                  "Request info",
                                  "Value",
                                  mapRequestDetails);
              return (Element) tab;
         * @param req HTTP request object
         * @return an iText Element object
         protected Element makeHTTPParameterInfoElement(
                             final HttpServletRequest req)
              Map mapParameters = null;
              mapParameters = new java.util.TreeMap(req.getParameterMap());
              Table tab = null;
              tab = makeTableFromMap(
                        "HTTP parameter name",
                        "HTTP parameter value",
                        mapParameters);
              return (Element) tab;
         * @param firstColumnTitle
         * @param secondColumnTitle
         * @param m map containing the data for column 1 and column 2
         * @return an iText Table
         private static Table makeTableFromMap(
                   final String firstColumnTitle,
                   final String secondColumnTitle,
                   final java.util.Map m)
              Table tab = null;
              try
                   tab = new Table(2 /* columns */);
              catch (BadElementException ex)
                   throw new RuntimeException(ex);
              tab.setBorderWidth(1.0f);
              tab.setPadding(5);
              tab.setSpacing(5);
              tab.addCell(new Cell(firstColumnTitle));
              tab.addCell(new Cell(secondColumnTitle));
              tab.endHeaders();
              if (m.keySet().size() == 0)
                   Cell c = new Cell("none");
                   c.setColspan(tab.columns());
                   tab.addCell(c);
              else
                   Iterator iter = m.keySet().iterator();
                   while (iter.hasNext())
                        String strName = (String) iter.next();
                        Object value = m.get(strName);
                        String strValue = null;
                        if (value == null)
                             strValue = "";
                        else if (value instanceof String[])
                             String[] aValues = (String[]) value;
                             strValue = aValues[0];
                        else
                             strValue = value.toString();
                        tab.addCell(new Cell(strName));
                        tab.addCell(new Cell(strValue));
              return tab;
    }

    Hi, i've done all described in the posts, but i
    don't know how to call the servlet, using the web
    browser, and more, how can i call the servlet frrom
    a button action? or hyperlink?
    nks for the helpOk, I am not sure what you are trying to do. For these events you can
    use the SessionBean. What do you want the servlet to do that the session bean can't?
    I use the sessionbean because I don't know how to receive or respond to xmlhttpreq messages directly in my sessionbean. If you just need the standard http req/resp it doesn't seem like a servlet is needed.

  • Need to improve Java Studio Creator performance

    Can anyone has a suggestion on how to improve the performance of Java Studio Creator? JSC works fine when you have a less than 50 java files but when your building a large project JSC IDE works slow in terms of loading the whole project, modify the page in design layout, drag and drop a component or even modifying some java codes.The PC had a 2 GB memory. I'm grateful for any suggestion you can give. :D

    Hello, i supossed u r using Windows right?, and running in a x86 machine?. Ok well, even Windows XP is not so "Strong" enough to run Creator with a decent performance, i can say this because i have at home a PC Windows XP Pro, Intel Core 2 Duo Processor, 2 GB RAM, and HD Seagate Barracuda 120 GB ATA and Creator Still hangs some time, my suggestion is:
    Install Solaris in your pc, I've installed Solaris 10 11/6 in the pc ans runs great (the x86 vesion). I have a Sun Ultra 20 with 1GB RAM and 3 projects at work with more than 150 pages and works fine.
    Belthazor

  • Web Service + Complex Type + Java Studio Creator

    Hy all!!
    I am using Ubuntu 7.04 + Java Studio Creator 2 and i'm trying to use a webservice.
    This webservice uses a Complex Type and was made in PHP.
    I guarantee that this webservice is working with complex type because i've tested using a PHP client.
    I have already worked with others webservices in Java Studio Creator using simple types!
    So I went to Add Web Service, put the wsdl link, Get Web Service Information and then Test Method that uses Complex Type.
    Then I gave a input value and when I submit i got this error:
    InvocationTargetException com.sun.rave.websvc.ui.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:459) com.sun.rave.websvc.ui.TestWebServiceMethodDlg$MethodTask.run(TestWebServiceMethodDlg.java:1031) java.lang.Thread.run(Thread.java:595) null sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) com.sun.rave.websvc.ui.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:450) com.sun.rave.websvc.ui.TestWebServiceMethodDlg$MethodTask.run(TestWebServiceMethodDlg.java:1031) java.lang.Thread.run(Thread.java:595) Runtime exception; nested exception is:
    [failed to localize] nestedDeserializationError([failed to localize] xmlreader.unexpectedState(END, START: nome))
    com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:318) com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300) webservice.Grs_PortType_Stub.buscarCompleto(Grs_PortType_Stub.java:122) webservice.grs.grsClient.buscarCompleto(grsClient.java:36) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) com.sun.rave.websvc.ui.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:450) com.sun.rave.websvc.ui.TestWebServiceMethodDlg$MethodTask.run(TestWebServiceMethodDlg.java:1031) java.lang.Thread.run(Thread.java:595)
    [failed to localize] nestedDeserializationError([failed to localize] xmlreader.unexpectedState(END, START: nome))
    com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:233) com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:155) webservice.Grs_buscarCompleto_ResponseStruct2_SOAPSerializer.doDeserialize(Grs_buscarCompleto_ResponseStruct2_SOAPSerializer.java:43) com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:192) com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:155) webservice.Grs_PortType_Stub._deserialize_buscarCompleto(Grs_PortType_Stub.java:186) webservice.Grs_PortType_Stub._readFirstBodyElement(Grs_PortType_Stub.java:160) com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:215) webservice.Grs_PortType_Stub.buscarCompleto(Grs_PortType_Stub.java:122) webservice.grs.grsClient.buscarCompleto(grsClient.java:36) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) com.sun.rave.websvc.ui.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:450) com.sun.rave.websvc.ui.TestWebServiceMethodDlg$MethodTask.run(TestWebServiceMethodDlg.java:1031) java.lang.Thread.run(Thread.java:595)
    Any help would be appreciated!
    Thanks a lot!
    Mario Mol

    Have you seen this?
    http://developers.sun.com/jscreator/reference/techart/2/create_consume_web_services.html
    Also have you tried the latest and coolest IDE Netbeans 6?
    It includes all the features of Creator plus lots more.
    Thanks
    K

  • How to add warning message while using 'print' function in Adobe LiveCycle Designer

    I am trying to make pdf document for my company which requires adding a warning message while anyone use 'print' function from the page...
    Does anyone know how to add warning message on LiveCycle Designer
    Also my supervisor mentioned something using 'nag' if that rings any bell

    No you shoudl never go into the XML source unless uinstricted to do so.
    You can open the script editor (under the window menu). It will appear above the drawing area but below the toolbars. You can resize it if there is not enough room. When you click on an object in the form you can choose an event to script against in the Show dropdown. In your case you will want to choose the prePrint event. A line will show up that indicates the object that is associated with the script as well as the event and other information. Add your script below this line. Once that is done you are finished and your form is ready for testing.
    Paul

  • How to avoid Java Studio Creator 2 to use the regional settings?

    How to avoid Java Studio Creator 2 to use the regional settings to select the language that will be used to display the IDE in a certain language?
    My country settings are set to Belgium (French) but I want to have my IDE running in English.
    What should I change in the defautl properties of JSC2 to avoid this behaviour?
    Please, don't tell me to change my regional settings, it is not a valid answer :-)
    Best regards,
    Abdelkrim BOUJRAF

    just modify creator.conf in directory etc/
    add: -J-Duser.language=en
    in the netbeans_default_options line:
    like this:
    netbeans_default_options="-J-Duser.language=en -J-Xms96m -J-Xmx384m -J-XX:PermSize=32m -J-XX:MaxPermSize=128m -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled -J-Xverify:none -J-Dnetbeans.javacore.background_scanning=true -J-Dsunappsrvint.home=\"C:\Program Files\Sun\Creator2\SunAppServer8\""

  • How to change the source level in java Studio creator

    Hi,
    I am using Sun Java Studio Creator 2 Update 1 IDE, in this IDE how to change the source level to 1.5 for an existing project.
    Thanks in advance,
    Rajesh.

    Hi!
    Unfortunately Sun Java Studio Creator 2 Update 1 doesn't support 1.5 source level. But You can try to download NetBeans IDE (from http://www.netbeans.org) and there with Visual Web project You will find the same functionality as for Creator. And 1.5 source level is supported by NetBeans.
    Thanks,
    Roman.

  • How to use print control in Sap script

    I would like to use print control in Sap script.Actualy my problem I have security font Troy ECF. Using this font I would like to print amount field in Check printing.
    we count download this font with sap .we talked to customer care they told we should hard code in sapscript. pls can any1 help on this how to do and how to use print control for this fonts.

    call this funcation. crate_text.
    CALL FUNCTION 'CREATE_TEXT'
             EXPORTING
               FID               =
               FLANGUAGE         =
               FNAME             =
               FOBJECT           =
             SAVE_DIRECT       = 'X'
             FFORMAT           = '*'
             TABLES
               FLINES            =
           EXCEPTIONS
             NO_INIT           = 1
             NO_SAVE           = 2
             OTHERS            = 3
           IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
           ENDIF.

  • How to use this function call function 'REUSE_ALV_COMMENTARY_WRITE' in alv

    hi all
    thanks in advance
    how to use this function in alv programming
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    why use and what purpose use this function plz tell me details
    plz guide me
    thanks

    Hi
    see this exmaple code where i had inserted a LOGO by useing this FM
    *& Report  ZTEST_ALV_LOGO
    REPORT  ztest_alv_logo.
    TYPE-POOLS : slis.
    *ALV Formatting tables /structures
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: gt_events   TYPE slis_t_event.
    DATA: gs_layout   TYPE slis_layout_alv.
    DATA: gt_page     TYPE slis_t_listheader.
    DATA: gs_page     TYPE slis_listheader.
    DATA: v_repid     LIKE sy-repid.
    *ALV Formatting work area
    DATA: w_fieldcat TYPE slis_fieldcat_alv.
    DATA: w_events   TYPE slis_alv_event.
    DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.
    INITIALIZATION.
      PERFORM build_events.
      PERFORM build_page_header.
    START-OF-SELECTION.
    *perform build_comment.     "top_of_page - in initialization at present
      SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.
    *perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
    *USING = Row, Column, Field name, display length, table name, heading
    *OR
      PERFORM build_fieldcat.
      gs_layout-zebra = 'X'.
    *top of page event does not work without I_callback_program
      v_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program                = v_repid
          i_structure_name                  = 'BSID'
       i_background_id                   = 'ALV_BACKGROUND'
          i_grid_title                      = 'This is the grid title'
      I_GRID_SETTINGS                   =
          is_layout                         = gs_layout
          it_fieldcat                       = gt_fieldcat[]
          it_events                         = gt_events[]
        TABLES
          t_outtab                          = gt_bsid.
    Form..............:  populate_for_fm
    Description.......:  Populates fields for function module used in ALV
    FORM populate_for_fm USING p_row
                               p_col
                               p_fieldname
                               p_len
                               p_table
                               p_desc.
      w_fieldcat-row_pos      = p_row.          "Row Position
      w_fieldcat-col_pos      = p_col.          "Column Position
      w_fieldcat-fieldname    = p_fieldname.    "Field name
      w_fieldcat-outputlen    = p_len.          "Column Lenth
      w_fieldcat-tabname      = p_table.        "Table name
      w_fieldcat-reptext_ddic = p_desc.         "Field Description
      w_fieldcat-input        = '1'.
      APPEND w_fieldcat TO gt_fieldcat.
      CLEAR w_fieldcat.
    ENDFORM.                    " populate_for_fm
    *&      Form  build_events
    FORM build_events.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = gt_events.
      READ TABLE gt_events
                 WITH KEY name =  slis_ev_user_command
                 INTO ls_event.
      IF sy-subrc = 0.
        MOVE slis_ev_user_command TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
      READ TABLE gt_events
                 WITH KEY name =  slis_ev_top_of_page
                 INTO ls_event.
      IF sy-subrc = 0.
        MOVE slis_ev_top_of_page TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
    ENDFORM.                    " build_events
    *&      Form  USER_COMMAND
    When user command is called it uses 2 parameters. The itab
    passed to the ALV is in whatever order it currently is on screen.
    Therefore, you can read table itab index rs_selfield-tabindex to get
    all data from the table. You can also check r_ucomm and code
    accordingly.
    FORM user_command USING  r_ucomm     LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      READ TABLE gt_bsid INDEX rs_selfield-tabindex.
    error checking etc.
      SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.
      CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
    ENDFORM.                    "user_command
    *&      Form  top_of_page
    Your own company logo can go here if it has been saved (OAOR)
    If the logo is larger than the size of the headings in gt_page,
    the window will not show full logo and will have a scroll bar. Thus,
    it is a good idea to have a standard ALV header if you are going to
    use logos in your top of page.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_page
          i_logo             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "top_of_page
    *&      Form  build_fieldcat
    *Many and varied fields are available here. Have a look at documentation
    *for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
    FORM build_fieldcat.
      w_fieldcat-fieldname  = 'BUDAT'.
      w_fieldcat-seltext_m  = 'Dte pst'.
      w_fieldcat-ddictxt(1) = 'M'.
      w_fieldcat-edit = 'x'.
    Can change the position of fields if you do not want them in order
    of the DDIC or itab
    w_fieldcat-row_pos = '1'.
    w_fieldcat-col_pos = '10'.
      APPEND w_fieldcat TO gt_fieldcat.
      CLEAR w_fieldcat.
    ENDFORM.                    " build_fieldcat
    *&      Form  build_page_header
          gt_page is used in top of page (ALV subroutine - NOT event)
          *H = Header, S = Selection, A = Action
    FORM build_page_header.
    For Headers, Key is not printed and is irrelevant. Will not cause
    a syntax error, but is not used.
      gs_page-typ  = 'H'.
      gs_page-info = 'Header 1'.
      APPEND gs_page TO gt_page.
      gs_page-typ  = 'H'.
      gs_page-info = 'Header 2'.
      APPEND gs_page TO gt_page.
    For Selections, the Key is printed (bold). It can be anything up to 20
    bytes. It gets printed in order of code here, not by key value.
      gs_page-typ  = 'S'.
      gs_page-key  = 'And the winner is:'.
      gs_page-info = 'Selection 1'.
      APPEND gs_page TO gt_page.
      gs_page-typ  = 'S'.
      gs_page-key  = 'Runner up:'.
      gs_page-info = 'Selection 2'.
      APPEND gs_page TO gt_page.
    For Action, Key is also irrelevant.
      gs_page-typ  = 'A'.
      gs_page-info = 'Action goes here'.
      APPEND gs_page TO gt_page.
    ENDFORM.                    " build_page_header

Maybe you are looking for

  • Microsoft Arc Mouse not working with my Windows Xp home computer

    I bought the MS Arc Mouse yesterday and plugged the USB into my home computer and nothing happened. I didn't get a popup saying "new hardware recognized" or anything and the mouse did not work. I tried the mouse in my mom's laptop and it worked insta

  • Auto Download PDF report in desktop

    Hi, i have a requirement to autosave a standard PDF report every week to a defined path in the desktop of my system. How can we do it in APEX ? i know to manually run the application to print and save the PDF to desktop. But Since it is more than 10

  • Webdynpro ABAP configuration? How to?

    Dear all experts, I wanted to practice Webdynpro ABAP, so I have installed ECC 6.0 IDES system, whenever I run my WD application it loads a browser, it askes for a username/password after that system gives the following  error : Error when processing

  • Trouble with loading photos from a disc can you help?

    I keep getting about half the photos with the message unrecognized format.

  • Open Source Log Analyzer Project

    Hi people, I have a question whether there is a open source project which analyze logs from database. I mean I have a table(Log table which is like syslog message format). I need to analyze this table with a web based project. So, Do you know any ope