Convert existing servlet into portlet

Hi
We have a set of Java servlets running on apache and jserv and not using Portal. My task is to be able to convert these into Portal.All of the existing servlets are extends/use our existing set of classes. They display a list of rows in a table as HTML with a URL pointing back to the same servlet or different servlet based on logic, with set of parameter. With my current setup (all on a Win2000 system), I have installed the JPDK samples and it is working fine, but have now got stuck in applying the concepts to my own existing servlets. So can you help me how can i convert an existing Java servlet into Portal?
First i tried the "how to build your own java portal exercise" and it runs fine. But when i tried to run simple servlet to convert into portlet, i got the following error. I am really confuse about Renderer. Is it nessessary to make Renderer or use Default Renderer? I will really thankful to you if you give me some idea.
I changed the following in to conf/jserv properties.
1. set the " <showPage class="AgeServlet"/> " in provider.xml
2. in zone property
servlet.AgeServlet.code=oracle.portal.provider.v1.http.HttpProvider
servlet.AgeServlet.initArgs=provider_root=C:\MyProvider,sessiontimeout=1800000,debuglevel=1
3. In jserv property
wrapper.classpath=C:\MyProvider\MyClasses
Where i put my AgeServlet.class
4.Stop and Start the Oracle HTTP Server.
When i try to run url(http://host.domain:port/servlet/AgeServlet) it gives me following error.
Error!
javax.servlet.ServletException: Unable to initialize new provider instance: java.lang.reflect.InvocationTargetException
My servlet is
// JDK1.2.2 module
import java.io.*;
import java.util.*;
//JSDK modules
import javax.servlet.*;
import javax.servlet.http.*;
* class to promt for the year of birth
* and calculate the age.
* @author Vipul Patel [email protected]
public class AgeServlet extends HttpServlet {
* method to call doPost
* @param request
* @param response
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
doPost(request, response);
* method to call calculateAge
* @param request
* @param response
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
getAge(request, response);
* method for display html form for get year
* and calculate the age
* @param request
* @param response
public void getAge(HttpServletRequest request,
HttpServletResponse response) {
response.setContentType("text/html");
PrintWriter out = null;
try {
out = response.getWriter();
} catch(IOException ex) {
ex.printStackTrace();
String age = calculateAge(request, response);
// create and send html form to user
out.println("<html>");
out.println("<body>");
out.println("<title>Age calculation</title>");
out.println("<form action=\"/servlets/AgeServlet\" method=get>");
out.println(age + "<br>");
out.println("Enter the Year of Birth<input type=\"text\" name=ageyear><br>");
out.println("<input type=submit value=submit>");
out.println("<input type=\"reset\" value=\"reset\">");
out.println(" </form>");
out.println("</body>");
out.println("</html> ");
* calculate the age
* @param request
* @param response
* @return age
public String calculateAge(HttpServletRequest request,
HttpServletResponse response) {
String age= "";
String year="";
int curr_year;
int count_year = 0;
year = request.getParameter("ageyear");
Date date = new Date();
String today_date = date.toString();
today_date = today_date.substring(24,29);
curr_year = Integer.parseInt(today_date);
if((year != null) && (!year.equals("")) ) {
int get_year = Integer.parseInt(year);
if(get_year > curr_year) {
age = "You enterd wrong entry!!!!!";
} else {
for (int i=get_year; i<=curr_year; i++) {
count_year++;
age ="Your age is: " + String.valueOf(count_year);
} else {
age = "Enter the year of Birth";
return age;
Thank you very much!!
Vipul Patel
null

Hi
Now i changed my code and it display my contents on broweser. But when i submit the form i cannot able to forward my request to same page. Any suggestion please.
Thanks.
changed code
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import oracle.portal.provider.v1.*;
import oracle.portal.provider.v1.http.*;
public class AgeServlet extends HttpServlet {
* Initialize global variables
public void init(ServletConfig config) throws ServletException {
super.init(config);
* Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
doGet(request,response);
* Get Servlet information
* @return java.lang.String
public String getServletInfo() {
return "AgeServlet Information";
* Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
PortletRenderRequest pr = (PortletRenderRequest)request.getAttribute(HttpProvider.PORTLET_RENDER_REQUEST);
try {
renderShow(pr);
} catch (Exception e) {
private void renderShow(PortletRenderRequest pr)
throws PortletException {
try {
/*HttpServletRequest request = (HttpServletRequest)
pr.getAttribute(HttpProvider.SERVLET_REQUEST);
HttpServletResponse response = (HttpServletResponse)
pr.getAttribute(HttpProvider.SERVLET_RESPONSE); */
PrintWriter out = pr.getWriter();
pr.setContentType("text/html; charset=WINDOWS-1252");
pr.setContentType("text/html");
//PrintWriter out = response.getWriter();
// create and send html form to user
out.println("<html>");
out.println("<body>");
out.println("<title>Age calculation</title>");
out.println("<form method=\"POST\" action=\""+HttpPortletRendererUtil.htmlFormActionLink(pr,PortletRendererUtil.PAGE_LINK) +"\">");
HttpPortletRendererUtil.htmlFormHiddenFields(pr,PortletRendererUtil.PAGE_LINK);
String ageParam = HttpPortletRendererUtil.portletParameter(pr, "ageyear");
String submitParam = HttpPortletRendererUtil.portletParameter(pr, "mySubmit");
out.println("Enter the Year of Birth<input type=\"text\" name=\" + ageParam + \"><br>");
out.println("<input type=\"submit\" name=\" + submitParam + \" value=\"submit\">");
out.println(" </form>");
out.println("</body>");
out.println("</html> ");
if (pr.getParameter(submitParam) != null ) {
out.println("You are "+ calculateAge(pr,out));
} catch (Exception e) {
* calculate the age
* @param request
* @param response
* @return age
public String calculateAge(PortletRenderRequest pr, PrintWriter out) {
String age= "";
String year="";
int curr_year;
int count_year = 0;
year = pr.getParameter("ageParam");
Calendar rightNow = Calendar.getInstance();
curr_year = rightNow.get(Calendar.YEAR);
if((year != null) && (!year.equals(""))) {
int get_year = Integer.parseInt(year);
if(get_year > curr_year) {
age = "You enterd wrong entry!!!!!";
} else {
count_year = curr_year - get_year;
age = String.valueOf(count_year);
} else {
age = "Enter the year of Birth";
return age;
Error message
Wed, 08 Aug 2001 00:04:55 GMT
No DAD configuration Found
DAD name:
PROCEDURE : !null.wwpob_page.show
URL : http://ntserver:80/pls/null/!null.wwpob_page.show?_pageid=null
PARAMETERS :
===========
ENVIRONMENT:
============
PLSQL_GATEWAY=WebDb
GATEWAY_IVERSION=2
SERVER_SOFTWARE=Oracle HTTP Server Powered by Apache/1.3.12 (Win32) ApacheJServ/1.1 mod_ssl/2.6.4 OpenSSL/0.9.5a mod_perl/1.24
GATEWAY_INTERFACE=CGI/1.1
SERVER_PORT=80
SERVER_NAME=ntserver
REQUEST_METHOD=POST
QUERY_STRING=_pageid=null
PATH_INFO=/null/!null.wwpob_page.show
SCRIPT_NAME=/pls
REMOTE_HOST=
REMOTE_ADDR=172.16.0.27
SERVER_P ROTOCOL=HTTP/1.1
REQUEST_PROTOCOL=HTTP
REMOTE_USER=
HTTP_CONTENT_LENGTH=52
HTTP_CONTENT_TYPE=application/x-www-form-urlencoded
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) RPT-HTTPClient/0.3-2S
HTTP_HOST=ntserver
HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
HTTP_ACCEPT_ENCODING=gzip, deflate, x-gzip, compress, x-compress
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_ACCEPT_CHARSET=
HTTP_COOKIE=portal30=3.0,en,us,AMERICA,7044103775205D94AE891C2EB8EC88ECB9671CC56E5524FFBAE3419299B938639A5159BD1DF60D6A57362DA77173DED757521073FAB521072C6E83A9EDD32D5DD1E3859A48A75
9C1537468FDD6B2AF6C36692DA501614F9B;
portal30_sso=3.0,en,us,AMERICA,C62FD25D23E9A2D66948EDCD463B2CCD50050AD8D02B7EF55A61DBC14E253387C44B1A5D9668CC141CE38DD4455FEF3D28188817CC1678D8F0C1F642C95CB0E34406EFC41D4A36E1A2915
182A5FC121377E258FA76480763
Authorization=
HTTP_IF_MODIFIED_SINCE=
HTTP_REFERER=
null

Similar Messages

  • How to convert this Servlet into JSP

    I am trying to convert this Servlet into JSP page.
    How do I go about doing this?
    Thanks.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.text.*;
    /** Shows all items currently in ShoppingCart. Clients
    * have their own session that keeps track of which
    * ShoppingCart is theirs. If this is their first visit
    * to the order page, a new shopping cart is created.
    * Usually, people come to this page by way of a page
    * showing catalog entries, so this page adds an additional
    * item to the shopping cart. But users can also
    * bookmark this page, access it from their history list,
    * or be sent back to it by clicking on the "Update Order"
    * button after changing the number of items ordered.
    * <P>
    * Taken from Core Servlets and JavaServer Pages 2nd Edition
    * from Prentice Hall and Sun Microsystems Press,
    * http://www.coreservlets.com/.
    * &copy; 2003 Marty Hall; may be freely used or adapted.
    public class OrderPage extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    HttpSession session = request.getSession();
    ShoppingCart cart;
    synchronized(session) {
    cart = (ShoppingCart)session.getAttribute("shoppingCart");
    // New visitors get a fresh shopping cart.
    // Previous visitors keep using their existing cart.
    if (cart == null) {
    cart = new ShoppingCart();
    session.setAttribute("shoppingCart", cart);
    String itemID = request.getParameter("itemID");
    if (itemID != null) {
    String numItemsString =
    request.getParameter("numItems");
    if (numItemsString == null) {
    // If request specified an ID but no number,
    // then customers came here via an "Add Item to Cart"
    // button on a catalog page.
    cart.addItem(itemID);
    } else {
    // If request specified an ID and number, then
    // customers came here via an "Update Order" button
    // after changing the number of items in order.
    // Note that specifying a number of 0 results
    // in item being deleted from cart.
    int numItems;
    try {
    numItems = Integer.parseInt(numItemsString);
    } catch(NumberFormatException nfe) {
    numItems = 1;
    cart.setNumOrdered(itemID, numItems);
    // Whether or not the customer changed the order, show
    // order status.
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Status of Your Order";
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>");
    synchronized(session) {
    List itemsOrdered = cart.getItemsOrdered();
    if (itemsOrdered.size() == 0) {
    out.println("<H2><I>No items in your cart...</I></H2>");
    } else {
    // If there is at least one item in cart, show table
    // of items ordered.
    out.println
    ("<TABLE BORDER=1 ALIGN=\"CENTER\">\n" +
    "<TR BGCOLOR=\"#FFAD00\">\n" +
    " <TH>Item ID<TH>Description\n" +
    " <TH>Unit Cost<TH>Number<TH>Total Cost");
    ItemOrder order;
    // Rounds to two decimal places, inserts dollar
    // sign (or other currency symbol), etc., as
    // appropriate in current Locale.
    NumberFormat formatter =
    NumberFormat.getCurrencyInstance();
    // For each entry in shopping cart, make
    // table row showing ID, description, per-item
    // cost, number ordered, and total cost.
    // Put number ordered in textfield that user
    // can change, with "Update Order" button next
    // to it, which resubmits to this same page
    // but specifying a different number of items.
    for(int i=0; i<itemsOrdered.size(); i++) {
    order = (ItemOrder)itemsOrdered.get(i);
    out.println
    ("<TR>\n" +
    " <TD>" + order.getItemID() + "\n" +
    " <TD>" + order.getShortDescription() + "\n" +
    " <TD>" +
    formatter.format(order.getUnitCost()) + "\n" +
    " <TD>" +
    "<FORM>\n" + // Submit to current URL
    "<INPUT TYPE=\"HIDDEN\" NAME=\"itemID\"\n" +
    " VALUE=\"" + order.getItemID() + "\">\n" +
    "<INPUT TYPE=\"TEXT\" NAME=\"numItems\"\n" +
    " SIZE=3 VALUE=\"" +
    order.getNumItems() + "\">\n" +
    "<SMALL>\n" +
    "<INPUT TYPE=\"SUBMIT\"\n "+
    " VALUE=\"Update Order\">\n" +
    "</SMALL>\n" +
    "</FORM>\n" +
    " <TD>" +
    formatter.format(order.getTotalCost()));
    String checkoutURL =
    response.encodeURL("../Checkout.html");
    // "Proceed to Checkout" button below table
    out.println
    ("</TABLE>\n" +
    "<FORM ACTION=\"" + checkoutURL + "\">\n" +
    "<BIG><CENTER>\n" +
    "<INPUT TYPE=\"SUBMIT\"\n" +
    " VALUE=\"Proceed to Checkout\">\n" +
    "</CENTER></BIG></FORM>");
    out.println("</BODY></HTML>");
    }

    Sorry.
    actually this is my coding on the bottom.
    Pleease disregard my previous coding. I got the different one.
    My first approach is using <% %> around the whole doGet method such as:
    <%
    String[] ids = { "hall001", "hall002" };
    setItems(ids);
    setTitle("All-Time Best Computer Books");
    out.println("<HR>\n</BODY></HTML>");
    %>
    I am not sure how to break between code between
    return;
    and
    response.setContentType("text/html");
    Here is my coding:
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
         String[] ids = { "hall001", "hall002" };
         setItems(ids);
         setTitle("All-Time Best Computer Books");
    if (items == null) {
    response.sendError(response.SC_NOT_FOUND,
    "Missing Items.");
    return;
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>");
    CatalogItem item;
    for(int i=0; i<items.length; i++) {
    out.println("<HR>");
    item = items;
    if (item == null) {
    out.println("<FONT COLOR=\"RED\">" +
    "Unknown item ID " + itemIDs[i] +
    "</FONT>");
    } else {
    out.println();
    String formURL =
    "/servlet/coreservlets.OrderPage";
    formURL = response.encodeURL(formURL);
    out.println
    ("<FORM ACTION=\"" + formURL + "\">\n" +
    "<INPUT TYPE=\"HIDDEN\" NAME=\"itemID\" " +
    " VALUE=\"" + item.getItemID() + "\">\n" +
    "<H2>" + item.getShortDescription() +
    " ($" + item.getCost() + ")</H2>\n" +
    item.getLongDescription() + "\n" +
    "<P>\n<CENTER>\n" +
    "<INPUT TYPE=\"SUBMIT\" " +
    "VALUE=\"Add to Shopping Cart\">\n" +
    "</CENTER>\n<P>\n</FORM>");
    out.println("<HR>\n</BODY></HTML>");

  • How to convert existing image into gradient?

    First of all, bear in mind I'm using Photoshop 7.... I have a picture of a truck parked on flat dirt with a sky behind that goes from pale blue near the horizon to black at the very top. I want the right-most side of theoverall image to keep it's vertical pattern (included here) but fade to darkness to the right. I've created plain gradients from scratch but never gradient-ized an existing photo. Surfed the Web but couldn't find the answer. If this has been answered elsewhere and I didn't find it, just point me in that direction. Thank you!

    HealthcareHelper wrote:
    I want the right-most side of theoverall image to keep it's vertical pattern (included here) but fade to darkness to the right.
    I'm trying to envision what result you are trying to get.  Is it something like this?  If so, you can add an adjustment layer to your photo to darken the photo to the extent you want the right side to have, add a layer mask and make a black to white gradient on the layer mask.

  • Servlet to Portlet

    Hi,
    I'm able to convert my simple servlets into portlets but I've a servlet which generates a lot of html code creates a frame also. I'm not getting any errors while running this portlet but it's not showing anything on the browser. Am I supposed to do anything else. Any help will be appreciated.
    Thanks,
    Chetan

    According to the Primer on Rendering Portlets,
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Some constructs cannot be used simply because they do not display correctly in a table cell. Frames, for example, do not appear when inserted in a table.<HR></BLOCKQUOTE>
    Regards,
    -rh
    null

  • Convert existing party to customer

    Hi,
    Is it possible to use Customer Open Interface to convert existing party into Customer?
    What I know is that Customer Open Interface will create party first and then create the customer account for that party.
    But my requriement is to convert existing party into customer or say create customer account (and other account related data) for an existing party.
    Is is possible to use Customer Open Interface?
    Thanks,
    Pankaj

    I think TCA API's would be your best bet. Search on metalink(now http://support.oracle.com) for TCA API and you will get many notes with sample codes.
    -Nitin S. Darji

  • How to convert JSR-168 compliant Portlets into SAP iviews

    Hi All,
    Its very urgent requirement for me...
    <b>How to convert JSR-168 compliant Portlets into SAP Enterprise Portal supported iViews in SAP NetWeaver 2004 or 2004s.</b> Can you please tell me any tools are available for conversion or is there any another procedure to achieve this problem.
    At last can we ach
    Each answer will be awarded with points.
    Regards
    Sreedhar G

    Hi Sreedhar,
    Is there anyway to display Standard Business packages content in IBM websphere portal.If there is anyway please let me know.
    thanks,
    Anil

  • I have a 27" iMac with a broken hard drive. Is there a way to convert the existing hardware into a display monitor without too much technical work?

    I have a 27" iMac with a broken hard drive. Is there a way to convert the existing hardware into a display monitor without too much technical work?

    You don't state what iMac it is or what you want to use it for an external display with so we cannot answer the question. But without a bootable drive, no you cannot. However you can get the internal HD replaced or you can connect an external HD and boot from it. Without some basics about the computer it's impossible question to answer. However you may find what need in Apple's Target Display Mode: Frequently Asked Questions (FAQ)

  • How to convert JSR 168 compliant Portlets into SAP supported iViews.

    Hi,
    How to convert JSR 168 compliant Portlets into SAP supported iViews in SAP NetWeaver 2004.
    Thanks & Regards
    Siva

    Guys,
    JSR is not supported untill NW05. Please check this
    /thread/176954 [original link is broken]
    Akhilesh

  • How to Convert an existing window into an HTML page

    Hi,
    I am trying to convert a window into an HTML page using Forte Web
    Enterprise.
    - The window has just the widgets without any code behind it.
    - How can I use the WindowConverter class, WindowToDocument method for
    it etc.....
    Any suggestions? Can I get a sample code if anyone has tried this.
    Thanks in advance
    Nafisa Husain
    CBSI, Chicago

    user8731258 wrote:
    Hi,
    I want to know how can i convert my application into a clustered application.
    my current application there are 5 modules and thses modules have 5-10 tables in common.Since these modules work simultaeously the processing time gets increased drastically.Is it possible that to have seperate instances of these tables and every module works independently and oracle take care of the consistency.
    I want to know if RAC could be the solution?Sounds like an application design issue. I think you'd be best served tracing the applications and see where the overhead is being introduced when they do their process concurrently.
    Throwing RAC at a poorly developed application would do nothing except amplify the poor design (it'll make things worse).
    Cheers,

  • How can I convert my animation into a working movie clip that can be used with a new scene?

    Hello all,
    First and foremost, I AM A TOTAL FLASH NOOB. I want to preface this and make it incredibly clear how new this all is to me. I LITERALLY started using flash this morning; that is precisely how new I am.
    With that being said I am going to do my best to explain what I'd like to do.
    I have created an animation of a spider moving its legs back and forth. I want to be able to combine all of the layers into 1 simple animation that can be imported into new flash scenes with the animation exactly how it stands. I have figured out how to convert the whole animation into a symbol AND I have figured out how to import the movie clip from the library. However, herein lies my problem. When I open a new flash scene and import my animation, I play it and it does nothing at all. It's just the static image of the spider I created with no movement.
    I've spent the last couple hours trying to figure out (and doing my own research) what I have done or didn't do to get to this point. I'd be willing to bet I am just going about the entire process incorrectly and I'm simple overlooking a basic facet of the program.
    Any insight to fix my ignorance is greatly appreciated.
    (P.S. Hell, I don't even know if I am using the correct terminology so for all I know I am confusing every person who has taken the time to look at my question. If I am using incorrect terminology please correct me to avoid future hang ups. Thank you.)

    Ned! This totally worked! Thank you! I knew there was a tiny piece of this whole thing that was preventing me from making everything work. Unfortunately as my luck would have it, although I have the movieclip working the spritesheet converter I'm using now no longer recognizes the movie clip. The converter says there are 7 frames in the animation, but doesn't display any working sprites. Just a blank sheet. Frustrating to say the least.
    I'm just going to throw everything out on the table here:
    This is the video tutorial i'm using to convert my animation into a spritesheet. I've done the steps exactly as directly up until the point I actually click "Begin Conversion." When begin conversion is selected, it shows the movieclip exists on the bottom left underneath "list of movieclips" but doesn't actually show any individual sprites.
    Here's the simple sprite converter I am using.
    The irony of this whole situation is that you have successfully helped me make a working movieclip (which was the important piece), but the converter no longer recognizes it. Whereas before, it would at least show the image on the 1 frame of animation it had.
    If you wanted to to take a stab at it and see if you can successfully get it to work I'd be appreciative. If not, I totally understand as you have already been incredibly helpful and have my eternal gratitude for getting me this far. These animation programs can be quite overwhelming when they so vastly differ from one another. Don't even get me started no Anime' Studio Pro.

  • Converting spool request into multiple pdf formated documents

    Hi Guys,
                 I am designing a report with several pages of output and running it in background.
    Is there a possibility to convert each page into an separate pdf format document ?
    If I use ALV report as output, if its more than page, do I face any issue with pdf conversion.
    Thanks

    Check the Following code, This might be helpful:
    form rstxpdft4 using filename.
    * Read spool job contents (OTF or ABAP list) and convert
    * to PDF, download PDF
      data: download  value 'X'.
      data: lv_filename like rlgrap-filename.
      lv_filename = filename.
      data otf like itcoo occurs 100 with header line.
      data cancel.
      data pdf like tline occurs 100 with header line.
      data doctab like docs occurs 1 with header line.
      data: numbytes type i,
            arc_idx like toa_dara,
            pdfspoolid like tsp01-rqident,
            jobname like tbtcjob-jobname,
            jobcount like tbtcjob-jobcount,
            is_otf.
      data: client like tst01-dclient,
            name like tst01-dname,
            objtype like rststype-type,
            type like rststype-type.
      select single * from tsp01 where rqident = gt_rq-rqident.
      if sy-subrc <> 0.
        write: / 'Spool request does not exist', gt_rq-rqident
                color col_negative.
        exit.
      endif.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
      call function 'RSTS_GET_ATTRIBUTES'
           exporting
                authority     = 'SP01'
                client        = client
                name          = name
                part          = 1
           importing
                type          = type
                objtype       = objtype
           exceptions
                fb_error      = 1
                fb_rsts_other = 2
                no_object     = 3
                no_permission = 4.
      if objtype(3) = 'OTF'.
        is_otf = 'X'.
      else.
        is_otf = space.
      endif.
      if is_otf = 'X'.
        call function 'CONVERT_OTFSPOOLJOB_2_PDF'
             exporting
                  src_spoolid              = gt_rq-rqident
                  no_dialog                = ' '
             importing
                  pdf_bytecount            = numbytes
                  pdf_spoolid              = pdfspoolid
                  btc_jobname              = jobname
                  btc_jobcount             = jobcount
             tables
                  pdf                      = pdf  .
      else.
        call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
             exporting
                  src_spoolid              = gt_rq-rqident
                  no_dialog                = ' '
             importing
                  pdf_bytecount            = numbytes
                  pdf_spoolid              = pdfspoolid
                  btc_jobname              = jobname
                  btc_jobcount             = jobcount
             tables
                  pdf                      = pdf
    *************** download PDF file ***********
    v_filename = lv_filename.
    *  call function 'WS_DOWNLOAD'
    *       exporting
    *            bin_filesize            = numbytes
    *            filename                = lv_filename
    *            filetype                = 'BIN'
    *       tables
    *            data_tab                = pdf
    *       exceptions
    *            file_open_error         = 1
    *            file_write_error        = 2
    *            invalid_filesize        = 3
    *            invalid_type            = 4
    *            no_batch                = 5
    *            unknown_error           = 6
    *            invalid_table_width     = 7
    *            gui_refuse_filetransfer = 8
    *            customer_error          = 9
    *            others                  = 10.
    *  if sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  else.
    *    gv_count = gv_count + 1.
    *  endif.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        BIN_FILESIZE                    = numbytes
        FILENAME                        = v_filename
        FILETYPE                        = 'BIN'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    *   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    *   SHOW_TRANSFER_STATUS            = ABAP_TRUE
    * IMPORTING
    *   FILELENGTH                      =
      TABLES
        DATA_TAB                        = pdf .
    *   FIELDNAMES                      =
    Thanks.

  • Function Module to convert multiple records into single record and vice-ver

    hi,
    i have a requirement to convert 10 records in an internal table to single record which should be passed
    to a single variable and store in the database.Kindly let me know is there any function module
    which meets my requirement. Also i need to do split one single record to 10 records each of
    say 65 length interval.
    kindly provide me if there is nay functinon module as such.
    I can do with ABAP-OOPS.Please suggest function module.

    I dont think such FM exists, but if you wanna code one it would be simple. Just loop through the internal table, keep concatenating the currently processing record into a long character variable to convert 10 records into one record.

  • How to convert a Tcode into Function module or a Bapi

    Dear all,
    i would like to convert Tcode : ME21N into a Function module or a Bapi to create a Webservice.
    Kindly help me..!!
    Thanks in advance..
    SreeKumar..

    Hey,
    Is the existing BAPI  'BAPI_PO_CREATE1' not sufficient for your needs?
    Till now never had to do something with webservices but this service ...maybe it does exist already...
    seems a likely candidate to be converted by SAP. So you do no need to re-invent the wheel again...and again...
    Cheers,
    BV.

  • Error converting DOM nodes into SOAP nodes

    Hi,
    i am doing an http call using http binding activity in oracle soa suite 11g.The http call requires some header information.When I pass the header information through headers in invoke activity and invoke the http call,I get an error " Error converting DOM nodes into SOAP nodes".What might be the reason and how to solve it.
    Naresh

    Hello,
    It appears your code is trying to repeat messagePart itself. Split Joins strictly adheres to a WSDL definition for incoming and outgoing messages.
    Instead of repeating <RootElement> which is defined as single occurance in your message definition within WSDL, you should find a way to tweak the WSDL to have "repetitive node which will become single message after split" within 1 Root element.
    This will call for having need of implementing transformation within split join based on need of target input message. Below is the example:
    WSDL contains:
    <wsdl:message name="inputMessageName">
         <wsdl:part name="partInput" element="rootElement"/>
    </wsdl:message>
    What your current xml structure is(please note how message itself is repeating below while it has been defined as single in wsdl, unfortunately there is nothing maxOccurs for message in WSDL definition , although you can define multiple parts but that is not case here):
    <soap:Body>
    <rootElement>
    </rootElement>
    <rootElement>
    </rootElement>
    <rootElement>
    </rootElement>
    </soap:Body>
    What Split-Join expects(If you have existing wsdl then you need to tweak it to conform to below kind of structure then use transformation within split join to convert it into correct xml structure for outgoing):
    <soap:Body>
    <rootElement>
         <repetitiveElementSpecificToIndividualSplitRequest/>
         <repetitiveElementSpecificToIndividualSplitRequest/>
         <repetitiveElementSpecificToIndividualSplitRequest/>
    </rootElement>
    </soap:Body>
    I hope this helps.
    Regards,
    Ankit

  • Convert Problems/Solutions into Knowledge Articles

    Hi Experts,
    I am wroking on SAP CRM 7.0 SP06 and now we are planning to implement Knowledge Article functionality.
    I have done the all configuration settings and multilevel categorization, every thing working fine. Now I want to convert problems/solutions which already created in CRM and stored in SDB into knowledge article.
    Any one please guide me how can I convert existing problems/solutions into knowledge articles. Is there any report for this?
    Thanking you in anticipation.
    Regards,
    Babu.

    Hi Kevin,
    Well, I'm new on this and have only worked on CRM 6 & 7. I'll give you my advice regarding these CRM versions. I don't know if it is supported on CRM 5.
    IMG:
    CRM >> Enterprise Intelligence >> SAF >> Name and Configure KB
    You create and define you DB as you want: ACME INC
    CRM >> Enterprise Intelligence >> SAF >> Business Add-Ins >> BAdI: Knowledge Base
    Each knowledge base should have its own Add-In implementation. So you have to implement an Add-In based on Add-In definition CRM_SAF_KB_*: CRM_SAF_KB_ACME. You can follow IMG documentation.
    In my case, the add-in already existed, since Knowledge Article functionality is standard in 7.0. KB didn't exist, I don't know why. I just created it with the name assigned on the BAdI, compiled, and everything works fine now.
    Hope it helps.
    Regards.
    Pablo

Maybe you are looking for

  • New g/l concept

    hi sap masters, i have some doubts belongs to new g/l concept. 1) is it different special g/l and new g/l 2) parrlel currancy is in the part of new g/l 3) is leading ledger max having 3 currancy? 4)if non leading ledgder how may max currencies we mai

  • Getting Adobe Lifecycle Error when opening the pdf document to provide comments

    Hi All, I am getting AdobeLifeCycle Error message when I am trying to give comments in the pdf document. I have a workaround in place for the same but I want a permanent fix. PFB the workaround for the same: 1.Delete the Adobe folder from the users l

  • FRM-40735 when validate-item_trigger raised unhandled exception ORA 06502

    Hi, after i migrated my form to 10g when I enter a new record into the form and want to save I get the following message: Frm-40735 when validate-item_trigger raised unhandled exception ORA 06502 what could be the reason? It worked before in 6i but n

  • About Transaction IB51 and related

    HI Experts,          I want to know about the transaction IB51,52,53 please give information to me to get  ready about that. Regards, Naveen Kumar M s

  • Event-dispatching create'n'showGUI useful for applets?

    I want to create and show the GUI in my applet's init method. Do I still need to wrap my code like this: javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { // create and show gui code (The applet is extends the JApplet class.