How to call a method repeatedly with JSP custom tag?

This senerio is very similar to the usage of StringBuffer.
I have a problem which can be solved easily with scriptlets:
<% NameValuePair nvp = new NameValuePair(request.getQueryString()); %>
<a href="foo.html?<%=nvp.add(name1", "value1").add("name2", "value2").toString();%">">Foo</a>
<a href="bar.html?<%=new NameValuePair(request.getQueryString()).add("x", 1).add("y", 2).toString()%>">Bar</a>
But I cannot use scriplets because it's turned off. I can only use jsp custom tag / jstl. How would I implement this functionality with a custom tag? How would the JSP code look like? Our container supports JSP 2.0.
Thanks.</a>

hi,
you can do within 2 step-
1) use <%@page import="your_java_class"%>
2)use scriptlet code <%...%> and write coding in this tag.
means create instance of your java class .
<% your_java_class obj1=new your_java_class();
     obj1.method_of_your_java_class();
%>or
3) you can make javabean to use method of java class.[Best option]
Thanx
Ranvijay

Similar Messages

  • How to call a method in one JSP from another JSP?

    say that I have 2 JSPs.
    JSP one has a button.
    JSP two has some method that, say, find the square root of the number passed from JPS one.
    How to - when click - the button on page one call the method on page two?
    Please note that I can not use object binding, but I want passing the actual parameter and call the method on page two.
    Please note that this is an update of a previous post on the same topic called "Object scope".
    Thank you all very much.

    No, i dont know how to call other than main methods from other classes
    And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch).........

  • Database access with JSP custom tags

    i have created one file in which i am making the connection with mysql data base with con.mysql.jdbc.Driver.and usking J connector and that i'm doing with custom tag.this is the error which i'm getting in tomcat.
    and the tag handler class and TLD file and jsp file is below
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax.servlet.jsp.JspException: null
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl .java:841)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.j ava:778)
    org.apache.jsp.DbTry_jsp._jspService(org.apache.jsp.DbTry_jsp:72)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NullPointerException
    Try.Connect.<init>(Connect.java:26)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    java.lang.Class.newInstance0(Unknown Source)
    java.lang.Class.newInstance(Unknown Source)
    org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:116)
    org.apache.jsp.DbTry_jsp._jspx_meth_db_connect_0(org.apache.jsp.DbTry_jsp:84)
    org.apache.jsp.DbTry_jsp._jspService(org.apache.jsp.DbTry_jsp:62)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.4 logs.
    Apache Tomcat/5.5.4
    Tag handler class
    package Try;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspWriter;
    import javax.servlet.jsp.PageContext;
    import javax.servlet.jsp.tagext.TagSupport;
    import java.sql.*;
    public class Connect extends TagSupport {
    private String driver = "com.mysql.jdbc.Driver";
    private String dbtype = "mysql";
    private String host = "localhost";
    private String username = "root";
    private String password = "203131";
    private String database = "compose";
    private String scope = "page";
    private String id = "";
    JspWriter out = pageContext.getOut();
    public void setDriver(String str) {
    driver = str;
    public void setDbtype(String str) {
    dbtype = str;
    public void setHost(String str) {
    host = str;
    public void setUsername(String str) {
    username = str;
    public void setPassword(String str) {
    password = str;
    public void setDatabase(String str) {
    database = str;
    public void setScope(String str) {
    scope = str;
    public void setId(String str) {
    id = str;
    public int doStartTag() throws JspException {
    try {
    Class.forName("com.mysql.jdbc.Driver");
    String url= "jdbc:" + dbtype + "://" + host + "/" + database;
    Connection connection = DriverManager.getConnection(url,username,password);
    out.println("right ;;one");
    catch (SQLException e1) {
    System.out.println("Error in HeadingTagv: " + e1);
    catch (Exception e) {
    System.out.println("Error in HeadingTag: " + e);
    return SKIP_BODY;
    TLD is lib.tld
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>db</short-name>
    <display-name>Database Tags</display-name>
    <description>
    A set of tags for working with SQL database access
    </description>
    <tag>
    <name>connect</name>
    <tag-class>Try.Connect</tag-class>
    <body-content>empty</body-content>
    <description>
    </description>
    <attribute>
    <name>driver</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    </description>
    </attribute>
    <attribute>
    <name>dbtype</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    </description>
    </attribute>
    <attribute>
    <name>host</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    Host name of the computer where database is located.
    Default is "localhost".
    </description>
    </attribute>
    <attribute>
    <name>username</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    Username for logging onto the database.
    Default is "root".
    </description>
    </attribute>
    <attribute>
    <name>password</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    Password for logging onto the database.
    Default is the empty string.
    </description>
    </attribute>
    <attribute>
    <name>database</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    The name of the database that will be used for
    the SQL commands. Default is no database specified.
    </description>
    </attribute>
    <attribute>
    <name>id</name>
    <required>false</required>
    <description>
    </description>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <description>
    </description>
    </attribute>
    </tag>
    </taglib>
    JSP file is
    <%@ taglib uri="/WEB-INF/lib.tld" prefix="db" %>
    <html>
    <body>
    <db:connect username="root" password="203131" database="compose" />
    </body>
    </html>

    Answered in your other post:
    http://forum.java.sun.com/thread.jspa?threadID=608780&tstart=0

  • Initial problem with JSP Custom Tag devolopment

    Hi ,
    I have encountered a problem with my JSP application which utilizes a simple custom tag.
    First I created followinng directories.
    1. %TOMCAT_HOME%\webapps\testTags
    2. %TOMCAT_HOME%\webapps\testTags\META-INF
    3. %TOMCAT_HOME%\webapps\testTags\WEB-INF
    4. %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
    5. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
    6. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com
    7. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271
    8. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
    I created the essential four files, that is named as follows.
    1.TagError.java
    2.web.xml
    3.testTld.tld
    4.testJsp.jsp
    Then i put the files under these directories as given below
    testJsp.jsp under %TOMCAT_HOME%\webapps\testTags.
    web.xml under %TOMCAT_HOME%\webapps\testTags\WEB-INF
    TagError.java under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
    TagError.class under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
    testTld.tld %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
    Here is the content inside the files.
    1.TagError.java
    package com.tek271.testTags;
    import java.io.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class TagError extends TagSupport {
    private String mColor = "red";
    public void setColor(String aColor) {
    mColor = aColor;
    } // setColor
    public int doStartTag() throws JspException {
    try {
    JspWriter out = pageContext.getOut();
    out.print("<font color=\"");
    out.print(mColor);
    out.print("\"><b>Error: ");
    } catch (IOException ex) {
    throw new JspTagException(ex.getMessage());
    return EVAL_BODY_INCLUDE; // other return: SKIP_BODY
    } // doStartTag()
    public int doEndTag() throws JspException {
    try {
    JspWriter out = pageContext.getOut();
    out.println("</b></font><br>");
    } catch (IOException ex) {
    throw new JspTagException(ex.getMessage());
    return EVAL_PAGE; // other return: SKIP_PAGE
    } // doEndTag()
    } // TagError
    2.web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app>
    <taglib>
    <taglib-uri>/testTaglib</taglib-uri>
    <taglib-location>/WEB-INF/tlds/testTld.tld</taglib-location>
    </taglib>
    </web-app>
    3.testTld.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>testTld</shortname>
    <info>Testing jsp tags</info>
    <tag>
    <name>tagError</name>
    <tagclass>com.tek271.testTags.TagError</tagclass>
    <bodycontent>JSP</bodycontent> <!-- Also: empty, tagdependent -->
    <info>Show a string as an error message</info>
    <attribute>
    <name>color</name>
    <required>false</required>
    </attribute>
    </tag>
    </taglib>
    4.testJsp.jsp
    <%@ taglib uri="/testTaglib" prefix="test" %>
    <html>
    <head>
    <title>Testing Tag Library</title>
    </head>
    <body>
    <test:tagError>Invalid user name</test:tagError>
    <test:tagError color="blue">Invalid Password</test:tagError>
    </body>
    </html>
    but i am getting the following error.
    Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/testTaglib" not found
    at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:214)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
    at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1162)
    at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:758)
    at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:121)
    at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
    at java.lang.Thread.run(Thread.java:536)
    why is it like this ?please give me a solution.
    Thanking in advance.
    From
    Vinod A.

    Dear patreck ,
    It does not work.
    I have replaced the line
    <%@ taglib uri="/testTaglib" prefix="test" %>
    with
    <%@ taglib uri="WEB-INF/tlds/testTaglib" prefix="test" %>
    but now it shows the error ,
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/testTags/WEB-INF/tlds/testTaglib" not found
    any more suggestion ?
    From Vinod A.

  • How to call the method from the java bean and pass it to JSP textbox

    i'm quite new to java thats why i'm asking how to call a method in the java bean file and pass it to the JSP textbox. My projects are communicating JSP with C#. i had successfully created a C# client bean file for JSP. The whole process is to type something on the server(C# programming) and it would appear in the textbox.

    your question doesn't provide much informartion. provide some other information and coding so that we could tell exactly what you are looking for?

  • How to call java method using jsp

    how to call java method using jsp.....
    anyone can help me.....i having problem here...coz i very new in java and jsp.....
    thanks.....

    keep an eye on this person's thread...they have code there and everything.
    http://forum.java.sun.com/thread.jspa?threadID=777263&tstart=0

  • How to call a method from a separate class using IBAction

    I can't work out how to call a method form an external class with IBAction.
    //This Works 1
    -(void)addCard:(MyiCards *)card{
    [card insertNewCardIntoDatabase];
    //This works 2
    -(IBAction) addNewCard:(id)sender{
    //stuff -- I want to call [card insertNewCardIntoDatabase];
    I have tried tons of stuff here, but nothing is working. When i build this I get no errors or warnings, but trying to call the method in anyway other that what is there, i get errors.

    Can you explain more about what you are trying to do? IBAction is just a 'hint' to Interface Builder. It's just a void method return. And it's unclear what method is where from your code snippet below. is addNewCard: in another class? And if so, does it have a reference to the 'card' object you are sending the 'insertNewCardIntoDatabase' message? Some more details would help.
    Cheers,
    George

  • How to call a method defined in AM when I select any value in LOV

    Lets say there is a LOV. The scenario is as soon as I select any value in LOV, a method needs to be called which I have written in the AM. And the output of the method is displayed in a output text box.
    I am not able to understand how to call a method when the user selects any value in LOV.
    This is wht I did. I had created the binding for the method. Changed the autosubmit property of the LOV to True, and in the properties of the output box, in the partial submit trigger property, passed the ID of the LOV. But I didnt get any place where I need to call the method. I am also not able to drop an action listener on the LOV

    Hi,
    +"its showing an error(underlined in orange)."+
    Any reason you don't share this error with us? Anyway, here is how it goes
    1. LOV, set autosubmit="true" and configure a value change listener
    2. Expose the AM method as a method binding in the PageDef file
    3. In the value change listener:
    BindingContext bctx = BindingContxt().getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    OperationBinding method = (OperationBinding) bindings.get("name of method binding in PageDef");
    method.getParamsMap().put("argument name1", value1);
    method.getParamsMap().put("argument name2", value2);
    Object retVal = method.execute();
    if(!method.getErrors().isEmpty()){
      //handle errors
    else{
      //write retVal to the managed bean variable that is referenced by the outputText value property
      //PPR output text component
      ADFFacesContext.getCurrentInstance().addPartialTarget(outputTextRef);
    }Note that you may have to set clientComponent = "true" on the output text component
    Frank

  • How to call a method in the servlet from an applet

    I want to get the data for the applet from the servlet.
    How to call a method that exits in the servlet from the applet? I want to use http protocol to do this.
    Any suggestions? Please help.
    thanks

    Now that Web Services is around, I'd look at possibly implement a Web Service call in your applet, which can then be given back any object(s) on return. Set up your server side to handle Web Service calls. In this way, you can break the applet out into an application should you want to (with very little work) and it will still function the same

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How to call the method of a Business Object?

    Hi,
    Can someone guide me how to call the method of a business object?
    For example, I want to use the method SalesDocument.Copy of the Business Object VBAK. How can I do that? If you are familiar with any similar scenario please help.
    Regards,
    Renjith Michael.

    Hi
    double click on the copy  and
    go to abap tab
    there u can get functionmodule name
    u can call that
    Rewards if helpful

  • How to call java method having array as argument from c++ ?

    Hello sir,
    how to call java method having array as arguments from c++;
    here is java code which is called from c++
    class PQR {
         public void xyz(int[] ia) {
         System.out.println("hi");
              for (int i = 0; i < ia.length; i++)
                   System.out.println(ia);
    suppose all jvm invocation is done...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    For someone well versed in java, C++ and JNI although tedious that should be obvious.
    For someone not well versed in all three it is going to be very difficult.
    Even for someone that does have knowledge in all of those areas coming up with a C++ interface that reflects that functionality in a dynamic way such that anyone is will to use it is going to be quite an adventure.
    At any rate to start building it you do exactly the same thing that you would in java.
    1. Extract everything in the jar via the zip package
    2. For each found instance extract all of the methods, return types, parameters, etc and build a description tree for each class.
    Doing all of that in C++ is going to take a LOT of code. If someone wanted an estimate from me it would take me 6 months to do it. And before I would even attempt it I would get them to explain to me in detail exactly how they thought they were going to use it when I was done because I can't see any reasonable way to do that.
    I left out the description tree itself. I suppose you could duplicate the entire reflection api in C++.
    Now perhaps if it was much, much more constrained, like to only those classes that implement a single interface then that would be more reasonable.

  • How to call a method in private section of a class in the public section

    Hi Everybody,
    i have written a method(meth1) in the private section of a class(C1).
    it is as follows
    class C1 definition.
    private section.
    methods: meth1 importing im_dt1 like tp1
                                             im_dt2 like tp2
                                             im_dt3 like tp3
                                             im_dt4 like tp4
                               returning value(re_dt1) like tp5.
    endclass.
    i have the final data that has to be displayed in internal table re_dt1.
    now my question is how to call  this method present in private section into public section and display the data present in re_dt1.
    Thanks,
    learning.abap.

    Hi,
    what you need is one public method being called at start-of-selection. Within this the private methods have to be called.
    The question is, why has the method for reading the database tables to be private? If you have only one private method reading all database tables the public method being called at start-of-selection will only consist of a call-method statement.
    This seems to be one call to much.
    The logic for reading the different database tables is hidden inside the class anyway.
    Is there any further logic reading the different database tables?
    Have always all table to be read? If not another approach would be one private method for each database table being called by a public method deciding which table has to be read:
    public section.
    methods get_data returning value(re_Dt1).
    private section.
    methods:
    get_table_a returning value(im_dt1),
    get_table_b returning value(im_dt2),
    get_table_c returning value(im_dt3),
    get_table_d returning value(im_dt4),
    combine_data importing im_dt1
                                    im_dt2
                                    im_dt3
                                    im_dt4
                            returning value(re_dt1).
    *- implementation of public method:
    method get_data.
      data: lt_dt1 ...
               lt_dt2,
               lt_dt3,
               lt_dt4.
    * here decide which tables have to be read:
    lt_dt1 = get_table_a( ).
    lt_dt2 = get_table_b( ).
    lt_dt3 = get_table_c( ).
    lt_dt4 = get_table_d( ).
    re_dt1 = combine_data( i_dt1 = lt_dt1
                                           i_dt2 = lt_dt2
                                           i_dt3 = lt_dt3
                                           i_dt4 = lt_dt4 ).
    endmethod.
    *- implementation of private methods
    method get_table_a.
    endmethod.
    method get_table_b.
    endmethod.
    method get_table_c.
    endmethod.
    method get_table_d.
    endmethod.
    method combine_data.
    endmethod.
    Regards
    Dirk

  • How to call a Method in a Program?

    Hello,
    I am very new to the ABAP world.  I have been given a task to call a method if_hrbas_plain_infotype_access~read_single from the class CL_HRBAS_PLAIN_INFOTYPE_ACCESS in a program to see if we can use it to display some employee information.  I don't know how to call a method in a program.  Can somebody please provide me some pseudo code or instructions?
    Thanks.

    Hi Shan,
    here is the code to call a method. while calling the method Instance as 'r_info' which is the type reference to class as specified.
    pass the values to exporting parameters plvar,otype,objid...etc  according  to the requirement
    infotypes: 0002.   " creates an internal table p0002.
    data:
    r_info type ref to CL_HRBAS_PLAIN_INFOTYPE_ACCESS.
    TRY.
    CALL METHOD r_info->if_hrbas_plain_infotype_access~read
       EXPORTING
         plvar           = 
         otype           =
         objid           =
         istat           =
         infty           =
    *     SUBTY           =
         begda           =
         endda           =
         no_auth_check   =  'X'
         message_handler =
       IMPORTING
         PNNNN_TAB       = P0002
    *     HRTNNNN_TAB     =
    *     IS_OK           =
      CATCH CX_HRBAS_VIOLATED_ASSERTION .
    ENDTRY.
    LOOP AT P0002.
          WRITE:/
            P0002-VORNA,
            P0002-NCHMC,
            P0002-NACHN.
        ENDLOOP.
    Regards

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

Maybe you are looking for

  • Nokia Car Mode on N8 - Bluetooth disconnects when ...

    After recently upgrading to Belle, I installed Nokia Car Mode because it is what I had been looking forward to the most. However it simply disconnects the Bluetooth connection to my car's audio system a few seconds (maybe 5 seconds) after I enter the

  • How to hide a payload in sxmb_moni and RWB and Adapter engine.

    Hi I need to hide the pay load in  sxmb_moni, RWB, Adapter engine. Because payload has some sensite information. I need to hide the pay load for perticuler interface Name (http://filetoidoc.com) only. not all payloads. Please help us this. advanced t

  • Mac needs to force restart too often

    My mac keeps giving me an image on the screen (http://cjmiscfiles.webs.com/20110124211705.jpg) which says I need to force restart my Mac. I got this message 2 times in a week, and I got it once before. I just got my Mid-2010 Mac when it was first out

  • Prompting sys for password

    Hi , sql> sys as sysdba connected. Geneally, sys can login in datasbase without password(because he has already login with oracle user--OS AUTHENTICATED) But IS This possible that sys user will be prompted for password again by DATBASE. Thanks Hemant

  • Internet Explorer Archives

    I'm planning to buy a new Macbook shortly. But I have a problem. I've saved hundreds of web pages using Internet Explorer's "archive" function (this saves a complete page with all graphics as a single file). For a research project, I need to be able