Determining Size of Requests & Responses

Hi there,
I'm looking for a reliable and consistent means of determining the size of data transferred between clients and Servlet-based server-side applications over HTTP.
I've been exploring doing this with a Servlet Filter which would attempt to measure the size of the HttpServletRequest and HttpServletResponse objects passing through it.
While I've been able to write code to measure the size of an HttpServletRequest (by inspecting headers and body content), doing so for responses appears to be more error prone, because the HttpServletResponse interface does not expose accessors to items such as headers and status messages.
The only solution I can think of is to use a custom HttpServletResponseWrapper implementation which would track data size of calls to mutator methods such as setHeader() and setStatus().
However, it's not guaranteed that all of the headers and status messages encapsulated in the response, such as those created by the Servlet Engine itself, will be added through the API (rather than the underlying impl), making this approach error-prone at best.
Can anyone suggest a more reliable means of measuring the amount of data being transferred between the client and server tiers?
Any suggestions or comments are greatly appreciated.
Regards,
Sasha Haghani.

Could you not get the content length by extending HttpServletResponseWrapper in this manner:
public class CustomResponseWrapper extends HttpServletResponseWrapper
private int contentLength;
public CustomResponseWrapper(HttpServletResponse response)
super(response);
public void setContentLength(int length)
this.contentLength = length;
super.setContentLength(length);
public int getContentLength()
return contentLength;
Then after the filter is invoked with doFilter, you could get the content length.
Apologies if I'm not understanding your situation.

Similar Messages

  • Request-response topic questions

    Hi all,
    I'd like to know if the following is possible:
    � Could I configure a request-response topic having several subscribers?
    � If the answer to the last question is affirmative, could I configure a selector (a filter) on those subscribers to get a response only from one of them? (i know i could use directly a queue to receive a synchronous response from a determined destination, but my doubt is related with topics)
    � if the answer is affirmative again. What happens if several subscribers respond to a message?
    Thanks in advance

    Comments bellow:
    1. Yes
    2. Subscribers define their filters. I do not know if you could defined this on the system as administrator
    I don't understand the last phrase, could you give more details? I'll try to explain question 2 again to make sure i am understood (english is not my native language).
    - Suppose I have several subscribers for a determined topic, each with its own filter.
    - Suppose I send a message on that topic.
    - Suppose only one of the subscribers receives the message (its selector doesn't filter the message)
    - This subscriber responds, and I receive a response from it.
    - The rest of the subscribers doesn't receive any response at all.
    Could you confirm this steps?
    3. Each subscriber receives all the responses including his own response as long as he listen to this topic
    According to this point, my affirmation "The rest of the subscribers doesn't receive any response at all." is false +, isn't it?. Why each subscriber receives all the responses? That would only happen if the response is+
    published on the topic, am I right? I'm newbie at JMS Technology, please be patience".
    Thanks for your time.

  • Clearing Request / Response Objects

    Hi,
    I have a File Upload Screen where I have validated for the File Content Length to be within 3 MB. Now I call the MultiPartRequest Reusable Object provided by Jason Hunter from a Servlet. Now as long as the file (which I am uploading) size is less than 3 MB, the Screen seems to be very fast. The Problem that I face is as follows:
    I am trying to upload a file of 5 MB file size. Since my validation is in the Reusable MultiPartRequest Object, an Exception is thrown out of this Object and caught in the Servlet.
    Scenerio 1:
    Now from the Servlet I was using RequestDispatcher to forward to the Error Page. Since when I forward like this, the same request Object is send back to the Client which increases the response time. For me the Screen crashes due to Browser Time out.
    Scenerio 2:
    Now from the Servlet I tried using response.sendRedirect to the Error Page. Still the response time is more but comparatively less than the Scenerio 1.
    My Question:
    1. Is there a way to clear the contents of the Request and Response Object so that the response time to the client is reduced?
    2. I think what I am asking is not possible. But still taking a chance is not a mistake. Is there a way to create a new Request or Response Object? I believe we (as an application developer) have no control over this as the Application Server will have control over this.
    Any help or tips would be appreciated.
    Thanks and regards,
    Pazhanikanthan. P

    Hi,
    Thanks for your response. I do agree it is not the problem with the Multipart Classes.
    Kindly see the following URL for the differences between RequestDispatcher.forward () and response.sendRedirect ().
    http://www.theserverside.com/discussion/thread.jsp?thread_id=742
    Here they say that "the request and response objects remain the same both from where the forward call was made and the resource which was called." Is this wrong?
    More over I found that MultipartParser doesnt improve the performance very drastically over the MultipartRequestObject ...
    Please find attached the time I have calculated in between the time I forward / redirect in Servlet to the time when the response is painted in the Screen.
    Using Send Redirect Method (in Seconds)
    =======================================
    MultipartParser.java
    170.156
    MultipartRequestObject.java
    172.422
    Using requestDispatcher.forward () (in seconds)
    ==============================================
    MultipartParser.java
    Browser Times out
    MultipartRequestObject.java
    Browser Times out
    Here is my code:
    public void doPost(HttpServletRequest request,HttpServletResponse response)
         throws ServletException, IOException
         HttpSession objSession = request.getSession(true);
         String strFilePath = "D:\\uploads";
         String strFilename = "";
         MultipartRequestObject clsMulti;
         MultipartParser clsMultiParser;
         try
              System.out.println ("Action is :" + request.getParameter ("hdAction"));
              if (request.getParameter ("hdAction") == null)
                   clsMultiParser = new MultipartParser (request, 1*1024*1024);
                   Part objPart = clsMultiParser.readNextPart ();
                   if (objPart != null)
                        FilePart objFilePart = (FilePart) objPart;
                        System.out.println ("The File Name is : " +objFilePart.getFileName ());
                        objFilePart.writeTo (new File (strFilePath + File.separatorChar + objFilePart.getFileName ()));
                   clsMulti = new MultipartRequestObject (request, strFilePath, 1*1024*1024);
                   Enumeration enumFiles=clsMulti.getFileNames();
                   while(enumFiles.hasMoreElements())
                        String strName=(String)enumFiles.nextElement();
                        strFilename = clsMulti.getFilesystemName(strName);
         catch(Exception expGeneral)
              System.out.println ("" + new java.util.Date () + "----" + expGeneral.getMessage ());
              objSession.setAttribute ("MESSAGE", expGeneral.getMessage ());
         try
              System.out.println (1);
              RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/Upload.jsp");
              System.out.println (2);
              java.util.Date dt1 = new java.util.Date ();
              System.out.println (dt1.getTime ());
              dispatcher.forward(request, response);
              System.out.println (3);
              java.util.Date dt1 = new java.util.Date ();
              System.out.println (1);
              System.out.println (dt1.getTime ());
              response.reset ();
              System.out.println (2);
              response.sendRedirect ("Upload.jsp");
              System.out.println (3);
              return;
         catch (Exception e)
              e.printStackTrace ();
    For testing pupose I have commented some part of the code.
    Thanks and regards,
    Pazhanikanthan. P

  • Cannot retrieve my e-mail "browser sent request server could not understand. Size of request header field exceeds server limit"

    Upgraded to Firefox 5.0.1 yesterday. No, after logging on to firefox, which takes me to my comcast page and when I try to get
    my e-mail I get this message "your browser sent a request this server could not understand. Size of request header field exceeds server limit" Then it says something about "cookies" I also tried to connect to other sites and get similar messages. Just to let you know I am not a guru, and 80 years old, but I did not have this problem with the previous version. Question, why are the headers repeated? Could that be the problem???

    This issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites (e.g. comcast) that cause problems.
    "Clear the Cache":
    * Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Firefox > Preferences > Privacy > Cookies: "Show Cookies"

  • Sender adapter request response bean not working for calling a webservice

    Hi All,
    In PI 7.31, My scenario :  SOAP sender Asynch-> PI -> HTTP Receiver Sync ->take response to call another webservice  (SOAP)
    I have configured request response bean and response one way bean in the sender adapter to make this work.
    Attached the screenshot of the module config in  the sender soap adapter. The final response from HTTP has to be used to call another webservice (not sender webservice)
    This giving an error "couldn't retrieve binding values for sender to receiver etc etc ----------"
    Has anyone configured response one way bean to call a webservice to submit? If so, please share the configuration details. And let me know if I am doing anything wrong
    thx
    mike

    Hi Michael,
    I think the adapter type is for the receiver channel looking at the documentation SAP Library - SAP Exchange Infrastructure
    Have you checked your receiver channel doesn't belong to a party?
    I havent tried this bridge with the http_aae but looks to be problematic according with Michal comment here http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/01/28/generic-pi-async-sync-bridge-configuration-for-any-adapters#comment-454463
    Regards.

  • Error in RFC Adapter PI 7.10 maximum size of requests for one LUW

    Hello all,
    I have a big issue on our Development - SAP PI 7.10 System. If I try to push a RFC from a Client System
    I get follow error messagei in the Runtime Workbench (RWB)  back:
    processing error to be caused by: com.sap.aii.adapter.rfc.core.server.RfcServerException: maximum size of requests for one LUW has been reached (1). handling of request for tRFC (TID: 0AA001B8712C49D35D4D06C2) not possible (server: RfcServer[PKG_R3_D07_600_RFC_SND]1)
    But I don't know why. I checked follow OSS Notes:
    730870 and 774705 w/o success. It will be nice somebody can help me.
    Thanks
    S. Kohler
    P.S. We have the same scenario in our Quality SAP XI System and there works. I couldn't find any
    differences between the Adapters. Is there a problem with the parameters ????

    Hello Tarang Shah,
    okay. Here again ( I thought I mentioned above):
    in Q50 (SAP PI 7.10 System) we create a RFC Server with the program ID RFC_Q50.
    in D64 (SAP PI 7.10 System) we vreate a RFC Server with the program ID RFC_D64
    in D07 (SAP R/3 4.7 x110) we create a RFC Connection to D64 with the program ID RFC_D64.
    The testconnection works well. I see in our Dev. SAP PI System (D64) that the connection works.
    The problem is here, if you start in the application (System D07) the push, you get the error :
    maximum size of requests for one LUW has been reac hed (1). handling of re
    in Q50 (SAP R/3 4.7 x110) we create a RFC Connection to Q50 with the program ID RFC_Q50.
    The testconnection in Q17 works well. Also the push from the application (System Q17.)
    This means, the functionallity is okay on both sides (Q17 and D07) only the application sending
    process from D07 makes trouble ( you see in Transaction SM 58 on Client Site, the error as I mentiond above and in SAP PI side.) It seems that SAP PI could't accept more as one LUWs
    in the same time. Q50 (Q- System) accepted.
    So, this is the reason in my point of view, that the problem isn't the connection, seems more
    an paramter problem in D64 side. But I don't know which parameters. I checked the OSS Note 730870 and 774705 w/o success.
    Thanks
    S. Kohler

  • Using Request Response Bean Module in FILE Adapter

    Hi Experts,
    Can we use Request Response Bean Module in FILE Adapter in reverse way. That is can we configure thses adapter modules in Reciever file channel and call a sender file channel in it?
    My case is RFC to File synchronous case? How do we do this?
    Thanks & Regards,
    priyanka

    Can we use Request Response Bean Module in FILE Adapter in reverse way. That is can we configure thses adapter
    modules in Reciever file channel and call a sender file channel in it?
    My case is RFC to File synchronous case? How do we do this?
    The above is not possible....Bean works only for Sender channel and not for Receiver.....requirement not possible using even a BPM as FILE does not support SYNC communication in receiver end......max you can do is split the scenario into SYNC-ASYNC bridge.
    Regards,
    Abhishek.

  • ESB Console turns Request/Response message into One Way message

    Hi folks,
    have come across a strange situation and wondered if anyone else had come across this. Maybe it's fixed as part of a patch set.
    I'm running SOA Suite 10.1.3.1.0 on Windows.
    After I've created and deployed a Request/Response service (either RS or SOAP Invocation Service) if I go to the ESB Console and click on "Apply" in say the Definition tab, my service turns into a One Way service.
    This then causes null pointer exceptions when I run my process, as you might expect.
    If I redeploy from JDev and leave the "Apply" button alone I'm back in business.
    Is this something that anyone else has had a problem with?

    Hi.
    I would recommend you to install version 10.1.3.3 of SOA Suite
    http://download.oracle.com/otn/nt/ias/10133/ias_windows_x86_101330.zip
    http://download.oracle.com/otn/linux/ias/10133/ias_linux_x86_101330.zip
    Also, use the JDev 10.1.3.3
    http://www.oracle.com/technology/software/products/jdev/htdocs/soft10133.html
    They are supposed to be much more stable.
    After using the new release, let us know if you still run into this problem.
    Denis

  • How to implement request/response domain in JMS

    hi friends,
    I need help regarding implementing request/response domain
    in jms.please help me.

    See the TopicRequestor and QueueRequestor helper classes in the JMS API.
    FWIW there's a POJO based request/response implementation using JMS here...
    http://lingo.codehaus.org
    you might find the source code useful as it does efficient request/response in a highly concurrent way using JMS under the covers.
    James
    http://logicblaze.com/

  • Request Response Bean for SOAP Sender Adapter

    Hi Friends,
    Is it possible to use  Request Response Bean Module described (FIle to RFC to File here) for SOAP(sender) and JDBC(receiver) adapter?
    I want to configure SOAP to JDBC to JDBC scenario.
    http://wiki.sdn.sap.com/wiki/display/HOME/UsingRequestResponseBeanModuleinFILE+Adapter
    Scenario:
    I will do SOAP adapter call Asynchronously and JDBC receiver adapter will select data from database. This response will go back to SOAP adapter and then SOAP will divert this response to another JDBC adapter. This JDBC adapter will insert data into another database.
    I do not want to use ccBPM. Is there any design approach to implement this scenario?
    Thanks,
    Sandeep Maurya

    Hi Sandeep,
    SAP says SOAP sender adapter does not support Modules. You can serch Help.sap (for SOAP sender channel) to find the same.
    I would suggest to use AXIS adapter (provides all the functionality of SOAP) and supports the Modules as well.
    I have used the Module beans that you mentioned in the past... but it is not consistent with its processing.. sometimes it stucks with Message ID issue... I have seen same issue faced some other friends as well .. search on SDN you will find the issue with these modules...
    Using BPM would be another option...
    Thanks,
    Sunil Singh

  • XML Namespace in WebService Request/Response

    Hi all,
    I have a question regarding xml namespace usage in wsdl and the corresponding request/response messages.
    I have already browsed quite some articles about xml namespaces as well as some forum threads, but I am still not sure.
    I have the following part of a wsdl document (generated by Integration Directory), defining a targetnamespace.
    u2026
    <wsdl:types>
        <xsd:schema targetNamespace="http://www.dorma.com/sap/xi/finance"
                             xmlns="http://www.dorma.com/sap/xi/finance"
                             xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:element name="DebtorGetDetailResponse" type="Z_BAPI_DEBTOR_GETDETAIL_Response"></xsd:element>
            u2026
            <xsd:complexType name="Z_BAPI_DEBTOR_GETDETAIL_Response">
                <xsd:sequence>
                    <xsd:element name="DEBITOR_COMPANY_DETAIL" type="BAPI1007_5" minOccurs="0">
                    </xsd:element> u2026
                </xsd:sequence>
            </xsd:complexType>
            u2026
        </xsd:schema>
        u2026
    </wsdl:types>
    u2026
    In my understanding, all types defined in the schema section of a wsdl document will be in the targetnamespace, if defined.
    Therefore the element DEBITOR_COMPANY_DETAIL would be in the namesapce
    http://www.dorma.com/sap/xi/finance
    However, the ABAP proxy generates a response message like follows,
    where only the root element is in this namespace and the child elements are in the global namespace:
    <?xml version="1.0" encoding="utf-8"?>
    <ns1:DebtorGetDetailResponse xmlns:ns1="http://www.dorma.com/sap/xi/finance"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <DEBITOR_COMPANY_DETAIL>
            u2026
        </DEBITOR_COMPANY_DETAIL>
        u2026
    </ns1:DebtorGetDetailResponse>
    Do I have a wrong understand of the wsdl (xml schema) or is this an erroneous behavior?
    The problem is that some 3rd-party software web service module does not accept
    the response message as not complient with the respective wsdl document.
    Any input is appreciated.
    Thanks
    Hans
    Edited by: Hans-Jürgen Schwippert on Oct 1, 2008 12:02 PM

    I have the same problem. I am trying to connect to a webservice running on IBM websphere but it doesn't accept the xml in my request. It appears to be the same namespace issue.
    Did you ever find a solution for this?
    Is it a valid webservice call if you omit the namespace for an element or is this a bug in the Adaptive WS implementation?
    Web Dynpro web service model generated request:
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header>
    <sapsess:Session xmlns:sapsess="http://www.sap.com/webas/630/soap/features/session/">
    <enableSession>true</enableSession>
    </sapsess:Session>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    look between these lines -
    <ns1:tamKontrolleraKontoLastAnrop xmlns:ns1="http://schemas.fora.se/modell/tam/1.0/TAM_Data">
    <AnvandarNamn>30039647</AnvandarNamn>
    </ns1:tamKontrolleraKontoLastAnrop>
    look between these lines -
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    As you can see the tag
    <AnvandarNamn>30039647</AnvandarNamn>
    is missing a namespace.
    It should be
    <ns1:AnvandarNamn>30039647</ns1:AnvandarNamn>
    Using a third part tool called Soapui i generate this request that works:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tam="http://schemas.fora.se/modell/tam/1.0/TAM_Data">
       <soapenv:Header/>
       <soapenv:Body>
          <tam:tamKontrolleraKontoLastAnrop>
             <tam:AnvandarNamn>30039647</tam:AnvandarNamn>
          </tam:tamKontrolleraKontoLastAnrop>
       </soapenv:Body>
    </soapenv:Envelope>

  • HTTP request/response object not thread safe.

    According to the serlvet spec. Http Request/Response
    are not thread safe. Quoting from the Spec:
    " Implementations of the request and response objects are not guaranteed to be thread safe. This means that they should only be used within the scope of the request handling thread. References to the request and response objects must not be given to objects executing in other threads as the resulting behavior may be nondeterministic."
    This has prompt me to ask the following question.
    For Example I have a servlet which does the following
    request.setAttribute("myVar","Hello");
    The request and response is dispatched(using RequestDispatch.include(request,response)) to another
    servlet which retrieve this attribute i.e request.getAttribute("myVar");
    Is this safe?
    The Spec only said "The Container Provider must ensure that the dispatch of the request to a target
    servlet occurs in the same thread of the same VM as the original request." I take this meaning that the targeting servlet does not have to run in the same thread(only dispatch), otherwise it would be safe.

    To put it another way, you can only have onle thing working on a request at a time. For instance, the ServletContext is available to all servlets running on a server. If you tried to save a particular request to the ServletContext, it would potentially be available to many concurrently running servlets. They could all change whatever in it at the same time. Each servlet is in its own running thread. Hope that helps some.

  • Is there a way to attach request/response handlers in BEA Weblogic Workshop similar to Axis?

    Apache Axis allows developers to attach Request/Response handlers to do
    stuff like logging, authorization check etc.
    Something like...
    public class MyHandler extends org.apache.axis.handlers.BasicHandler {
    public void invoke(org.apache.axis.MessageContext msgContext) throws
    AxisFault
    Does BEA Weblogic Workshop has a similar capability?
    Thanks.
    Best Regards
    Hitesh

    Hi Hitesh,
    The logging in Workshop user log4j and is configured in the
    <WL-HOME>/weblogic700/server/lib/workshopLogConfig.xml file.
    To log the SOAP responses, add the following lines in the xml file:
    <category name="knex.SoapJwsReq"> <priority value="debug" /> <appender-ref
    ref="MYLOGFILE" /> </category>
    <category name="knex.SoapJwsResp"> <priority value="debug" /> <appender-ref
    ref="MYLOGFILE" /> </category>
    The MYLOGFILE can be configured by copying from the already defined
    appenders. The file location is relative to the domain directory.
    <appender name="MYLOGFILE" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="mylog.log" />
    <param name="Append" value="true" />
    <param name="MaxFileSize" value="3000KB" />
    <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1}: %m%n"/>
    </layout>
    </appender>
    As of now, the SOAP request message is not logged, only the responses are
    getting logged. This will be corrected within the next few days. Please also
    note that if you are using the Test View for running the web service, you
    should use the 'Test XML' tab for seeing the SOAP requests/responses. The
    'Test Form' tab uses HTTP GET, and hence you will not see any SOAP messages.
    Do let me know if you have any further queries.
    Regards,
    Anurag
    Workshop Support
    "Hitesh Seth" <[email protected]> wrote in message
    news:[email protected]...
    Thanks Anurag. What is the best recommended way in BEA Weblogic Workshop
    today to implement a logger which will log all SOAP Requests & Responses
    into a custom logging system.
    Best Regards
    Hitesh
    "Anurag Pareek" <[email protected]> wrote in message
    news:[email protected]...
    Hitesh,
    You can modify the SOAP request and response payload by using ECMA
    Script
    and XMLMaps.
    In the current release, Workshop does not support 'handlers' for SOAP
    messages.
    Regards,
    Anurag
    Workshop Support
    "Hitesh Seth" <[email protected]> wrote in message
    news:[email protected]...
    Apache Axis allows developers to attach Request/Response handlers to
    do
    stuff like logging, authorization check etc.
    Something like...
    public class MyHandler extends org.apache.axis.handlers.BasicHandler {
    public void invoke(org.apache.axis.MessageContext msgContext)throws
    AxisFault
    Does BEA Weblogic Workshop has a similar capability?
    Thanks.
    Best Regards
    Hitesh

  • Determining if a request has timed out

    My code creates an NSMutableURLRequest, then uses a NSURLConnection to make a http request. I am combing the documentation but I cannot find how to determine if the request has timedout, i.e. I want to handle the timeout before the error is displayed
    Here is my code:
    NSData *serverData = [[NSData alloc] init];
    NSString *theServerURL = @"http://myurl.com"
    NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:theServerURL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0];
    [theRequest setHTTPMethod:@"POST"];
    serverData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&serverResponse error:nil];
    DO I somehow determine the timeout error based on the error in NSURLConnection? If so, how do error codes work? Is it somehow determined based on some variable in NSMutableURLRequest/NSURLRequest? Any help would be appreciated. Thank you.

    Thats what I thought. I think I am screwing up the implementation as I am confused on the initialization properties. The initialization code from the doc is as follows:
    NSError *myerror = [[NSError alloc] initWithDomain:domain code:code userInfo:dict
    Then I think I would replace nil with myerror
    I am struggling with what the domain, code, and userInfo properties. I think I want the error code NSURLErrorTimedOut but I have no idea how to get that.

  • Determine size of pdf from spool

    All,
    does anyone know how to determine size of pdf from spool.
    i'm using RSPO_RETURN_ABAP_SPOOLJOB to get pdf file, but i want to know its size.
    any idea?

    Assume the PDF data is in internal table gt_messg_att.
    MOVE p_spoolno TO lv_spoolno.
    * CONVERT THE SPOOL TO PDF
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid                    = lv_spoolno
          no_dialog                      = lc_no_dialog
    *     DST_DEVICE                     =
    *     PDF_DESTINATION                =
       IMPORTING
         pdf_bytecount                  = lv_bytecount
    *     PDF_SPOOLID                    =
    *     OTF_PAGECOUNT                  =
    *     BTC_JOBNAME                    =
    *     BTC_JOBCOUNT                   =
       TABLES
         pdf                            = gt_pdf_output
       EXCEPTIONS
         err_no_otf_spooljob            = 1
         err_no_spooljob                = 2
         err_no_permission              = 3
         err_conv_not_possible          = 4
         err_bad_dstdevice              = 5
         user_cancelled                 = 6
         err_spoolerror                 = 7
         err_temseerror                 = 8
         err_btcjob_open_failed         = 9
         err_btcjob_submit_failed       = 10
         err_btcjob_close_failed        = 11
         OTHERS                         = 12
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
    * Transfer the 132-long strings to 255-long strings
        LOOP AT gt_pdf_output INTO wa_pdf_output.
          TRANSLATE wa_pdf_output USING ' ~'.
          CONCATENATE v_buffer wa_pdf_output INTO v_buffer.
          MODIFY gt_pdf_output FROM wa_pdf_output.
          CLEAR wa_pdf_output.
        ENDLOOP.
    * TO CONVERT THE DATA INTO PDF FORMAT ELSE THE PDF FILE
    * WON'T OPEN & REPORT WOULD GIVE A MESSAGE THAT
    * THE FILE IS DAMAGED & COULD NOT BE OPENED
        TRANSLATE v_buffer USING '~ '.
        CLEAR : wa_messg_att,
                gt_messg_att.
        DO.
          wa_messg_att = v_buffer.
          APPEND wa_messg_att TO gt_messg_att.
          SHIFT v_buffer LEFT BY 255 PLACES.
          IF v_buffer IS INITIAL.
            EXIT.
          ENDIF.
          CLEAR wa_messg_att.
        ENDDO.
      ENDIF.
    * Get size of attachment
      DESCRIBE TABLE gt_messg_att LINES lv_cnt.
      READ TABLE gt_messg_att INTO wa_messg_att INDEX lv_cnt.
      lwa_doc_data-doc_size =  ( lv_cnt - 1 ) * 255 + STRLEN( wa_messg_att ).

Maybe you are looking for

  • Need sample pgm to delete entries

    Hi experts , iam some prblm with transaction data .. so i want to delete these entries fro the table . what my question is ?? A  program should take input from flat file consisting of same structure as of table XYZ  table . NOW IT HAS TO DELETE ALL T

  • Recording to a blank cd

    I will be teaching a class at my home on Saturday. Is there a way for me to record the class (to a cd) using my laptop?

  • Photo not found when publishing to .Mac

    Hi, I imported some photos from an external drive into iPhoto. Then I disconnected the external drive. Later when I tried to publish the newly imported photos to the .Mac gallery, I received an error that says the photos are not found and asks if I w

  • WAV file won't replay in LabView or load in WMP, but works in VLC

    I'm creating an audio file for an interview with the code snippet attached (VI is very large and does a lot of unrelated processing).  This audio is recorded in the "interview" subvi.  At completion, this subvi is closed and the "process" subvi is op

  • How to populate image and text field in SQL Server

    I want to populate a table, i.e insert images in a table in SQL Server. I am using Java(JSP/Servlet). Can any one suggest me how to populate the image and text fields in SQL Server...of course, using Java. If possible, could you please give me a piec