PDF doesnt get generated

Hi,
I wrote a concurrent program to generate order details. Data defnitions and templates from XML Publisher are created and mapped correctly.
When the concurrent program executes PDF is getting generated but doesnt hold any data.
Please find the details below.
Variable "result" hold the xml data
and using
1. "FND_FILE.PUT_LINE(FND_FILE.OUTPUT,result);" Iam writing into the output file and
2. FND_FILE.PUT_LINE(FND_FILE.log,result); Iam writing into the log file.
The conc program executes in Complete Normal and I can even find the xml tags with data in the log file and even the PDF gets generated when clicked on view output. However there is no data in the PDF.
Can someone assist in resolving this issue. Is this something to do with the printer/output file settings???
Thanks
Kiran

Hi Kiran,
We have a similar problem. Can you pls share the internal link so that we can evaluate whether it resolves our issue.
Thanks,
Impha

Similar Messages

  • Pdf reports not getting generated

    Hello All,
    We are having an issue in generating the pdf reports.. we are getting errors as mentioned below
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    We went through the below mentioned note as well :
    REP-0069, REP-57054, REP-3000 in R12
    Our's is a multi tier Oracle E-Business suite setup with multiple nodes as mentioned below:
    a , b -- Web and forms
    c, d -- Concurrent tier nodes
    e, f -- Database tier nodes
    In the $APPL_TOP we did the below command to see what is setting for the DISPLAY environment variable.
    grep DISPLAY *.env
    it gave the results as mentioned below :
    instancename_a.env : export DISPLAY=a:311.0
    instancename_b.env : export DISPLAY=b:311.0
    instancename_c.env: export DISPLAY=c:311.0
    instancename_d.env: export DISPLAY=d:311.0
    Could someone please advise and help us regards this as to what all needs to be checked and verified for a multiple node instance ..we are not able to get which is that environment setting which is incorrect or missing which is causing these seeded report related error messages.
    thanks

    Please post the details of the application release, database version and OS.
    Can you reproduce the issue with PS reports?
    Please review these docs.
    Intermittent Oracle Reports REP-0069: REP-57054: Error [ID 1237834.1]
    Reports Fail With REP-0004 REP-3000 REP-0069 REP-57054 On a Cloned R12 (12.0.4) Instance [ID 742122.1]
    REP-1924, REP-0069, REP-57054, REP-1924 - Errors When Generate Reprts By PDF Style [ID 1053091.1]
    After Upgarde to R 12.1.2 Running Any PDF Reports: Get: REP-3000,REP-0069 and REP-57054 [ID 1204553.1]
    Concurrent Processing - Concurrent Reports Failing With Errors REP-0004,REP-0082 and REP-0104 [ID 844976.1]
    Thanks,
    Hussein

  • While assigning PDF in APP Spool not getting generated

    Hi,
    am working on APP(Automatic Payment Program)...for both cheque printing and  Payment Advice printing..Am Using Script for Cheque Printing and PDF forms for Payment Advice Printing...
    But after running F110,
    spool is getting generated only for Cheque printing not for Payment Advice Printing...Spool is getting generated for Payment Advice Printing if am using Standard Script instead of my customised PDF form..
    Plz help me out..
    How to solve this out..
    Thanks in Advance
    SATYA

    Hi Aparna,
    I tried NEW-PAGE PRINT ON.
    I am pasting source code extract below:
       IMPORT DATA = ME->IT_FINAL2 FROM MEMORY ID SY-CPROG.
        FREE MEMORY ID SY-CPROG.
        CHECK ME->IT_FINAL2 IS NOT INITIAL.
        CHECK LO_DOCK IS INITIAL.
        CREATE OBJECT LO_DOCK
          EXPORTING
            REPID = SY-REPID
            DYNNR = SY-DYNNR
            RATIO = 70
            SIDE  = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM
            NAME  = 'DOCK_CONT'.
        IF SY-SUBRC NE 0.
          MESSAGE 'Error in Docking Control' TYPE 'S'.
        ENDIF.
        IF LO_ALV IS INITIAL.
          TRY.
              LO_CONT ?= LO_DOCK.
              CALL METHOD CL_SALV_TABLE=>FACTORY
                EXPORTING
                  LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
                  R_CONTAINER    = LO_CONT
                  CONTAINER_NAME = 'DOCK_CONT'
                IMPORTING
                  R_SALV_TABLE   = LO_ALV
                CHANGING
                  T_TABLE        = ME->IT_FINAL2.
            CATCH CX_SALV_MSG.
          ENDTRY.
      CLEAR LR_COLUMN.
          TRY.
              LR_COLUMNS = LO_ALV->GET_COLUMNS( ).
              LR_COLUMN = LR_COLUMNS->GET_COLUMN( 'KSCHL' ).
              LR_COLUMN->SET_LONG_TEXT( 'Cond.Type' ).
    CATCH CX_SALV_NOT_FOUND.
          ENDTRY.
    NEW-PAGE PRINT ON.
            LO_ALV->DISPLAY( ).
            NEW-PAGE PRINT OFF.
    I am not getting spool list while executing it in background.
    BR,
    Praveen

  • Unable to generate Pdf report for crystal 9/10  in Windows 2012 (Standard) server with Times New Roman font. With same font, report getting generated in excel, text, csv format in Windows 2012.

    For Times New Roman font in Windows server 2012 R2 (Standard), crystal 9/10 report in pdf format is not getting generated. When we change the font for specific report like Arial, Calibri , Cambria then pdf report getting created.
    In Windows 2008 R2, same application worked fine to generate pdf report for TimesNewRoman font and there is no change done in the application which is being used in Windows 2012 R2 server.

    Ok, thanks for the reply. You need to contact support or a forum for the Crystal software. Third party products don't usually include Adobe technology, they have their own software. When you contact them, you may want to expand "unable to generate" to give any specific symptoms including any error messages.

  • PDF file gets corrupted when generated from BSP

    Hi,
         I am generating a PDF file from a BSP page ( see the code below). The problem is that PDF file gets corrupted and  I am unable to open it. I also tried to use other functions like GUI_Download and DOwnload as suggested by many and they also do not work either. Has any one generated a PDF from BSP and can some one help?
    Data: GG type String.
    event handler for data retrieval
    data : event type ref to cl_htmlb_event.
    class cl_htmlb_manager definition load.
    class CL_HTTP_RESPONSE DEFINITION LOAD.
    DATA : PARAMS TYPE PRI_PARAMS,
             VALID  TYPE C,
    GV_SUCCESS_SPOOL_NO LIKE SY-SPONO.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING DESTINATION           = 'LOCL'
               COPIES                = COUNT
               LIST_NAME             = 'TEST'
               LIST_TEXT             = 'Test NEW-PAGE PRINT ON'
                  IMMEDIATELY           = ''
                  RELEASE               = 'X'
                  NEW_LIST_ID           = 'X'
               EXPIRATION            = DAYS
                  LINE_SIZE             = 140
               LINE_COUNT            = 23
               LAYOUT                = 'X_PAPER'
               SAP_COVER_PAGE        = 'X'
               RECEIVER              = 'SAP*'
               DEPARTMENT            = 'System'
                  NO_DIALOG             = 'X'
        IMPORTING OUT_PARAMETERS        = PARAMS
                  VALID                 = VALID.
      IF VALID <> SPACE.
        NEW-PAGE PRINT ON  PARAMETERS PARAMS NO DIALOG.
    write :/ 'Hello Message1'.
    write :/ 'Hello Message2 '.
    NEW-PAGE PRINT OFF .
      ENDIF.
    data :        spool_no TYPE TSP01-RQIDENT .
    spool_no = sy-spono.
    DATA: itab TYPE TLINE,
            witab TYPE TABLE OF TLINE,
            output TYPE STRING,
            outputx TYPE XSTRING.
    data : l_pdf_len type i.
    data: mi_bytecount type i.
    DATA : APP_TYPE TYPE STRING VALUE  'APPLICATION/PDF' .
    DATA:    cached_response TYPE ref to if_HTTP_RESPONSE.
    data : l_display_url type string .
    data : guid type GUID_32 .
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = spool_no
          NO_DIALOG                = 'X'
       IMPORTING
          PDF_BYTECOUNT            =  mi_bytecount
        TABLES
          PDF                      = witab
        EXCEPTIONS
          ERR_NO_ABAP_SPOOLJOB     = 1
          ERR_NO_SPOOLJOB          = 2
          ERR_NO_PERMISSION        = 3
          ERR_CONV_NOT_POSSIBLE    = 4
          ERR_BAD_DESTDEVICE       = 5
          USER_CANCELLED           = 6
          ERR_SPOOLERROR           = 7
          ERR_TEMSEERROR           = 8
          ERR_BTCJOB_OPEN_FAILED   = 8
          ERR_BTCJOB_SUBMIT_FAILED = 9
          ERR_BTCJOB_CLOSE_FAILED  = 10
          others                   = 11.
      if sy-subrc EQ 0.
        LOOP AT witab INTO itab.
          CONCATENATE
            output
            itab-tdline
          INTO output in character mode.
        ENDLOOP.
    endif.
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
            EXPORTING
                text   = output
                mimetype =   'APPLICATION/PDF'
            IMPORTING
                buffer = outputx.
    concatenate cl_abap_char_utilities=>byte_order_mark_little
    outputx
    into outputx in byte mode.
      response->set_header_field( name = 'content-type' value =
    'APPLICATION/PDF; charset=utf-16le'  ).
      response->delete_header_field( name =
    if_http_header_fields=>cache_control ).
      response->delete_header_field( name = if_http_header_fields=>expires
      response->delete_header_field( name = if_http_header_fields=>pragma )
      response->set_header_field( name = 'content-disposition'
                                  value = 'attachment; filename = TEST.PDF'
      l_PDF_len = xstrlen( OUTPUTX ).
      response->set_data( data = OUTPUTx
                          length = l_PDF_len ).
    navigation->response_complete( ).
    Regards
    Amit Agrawal

    HI Craig Cmehil,
                   I have tried this code as well as given in the URL specified by you. But using this also browser shows the following  content. It seems that PDF content is corrupted.
    My Output as shown on Browser Starts below this line----
    DF-1.3
    %âãÏÓ
    2 0 obj
    /WinAnsiEncoding
    endobj
    3 0 obj
    <<
    /Type /Font
    /Subtype /Type1
    /BaseFont /Courier
    /Name /F001
    /Encodg 2 0 R
    >>
    endobj
    4 0 obj
    <<
    /Length 5 0 R
    >>
    stream
    /F001 7.30 Tf 0 0 0.753 rg BT 18.00 570.65 Td 0 Tw <33302E30362E3230302020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020>Tj ET 0 0 0.753 rg BT 2950 570.65 Td 0 Tw
    <20204854545020436F6E74726F6C202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020>Tj ET 0 0 0.753 rg BT 572.40 570.65 Td 0 Tw <2020202020202020202020202031>Tj ET q 0 0 0 RG 0.55 w 18.00 562.90 m
    634. 562.90 l S Q 0 0 0.753 rg BT 18.00 551.45 Td 0 Tw <48656C6C6F20416D6974>Tj ET 0 0 0.753 rg BT 18.00 541.85 Td 0 Tw <48656C6C6F204765726176>Tj ET
    endstream
    endobj
    5 0 obj
    624
    endobj
    6 0 obj
    <<
    /Type /Page
    /MediaBox
    /Parent 1 0 R
    /Resource
    <<
    /ProcSet
    /PDF /Text
    /Font
    <<
    /F001 3 0 R
    >>
    /XObject
    <<
    >>
    >>
    /Contents 4 0 R
    >>
    endobj
    7 0 obj
    <<
    /Author (AMG )
    /CreationDate (20050630 181301)
    /Creator (Form X_58_170 EN)
    /Producer (SAP R/3 Release 620 )
    %SAPinfoStart TOA_DARA
    %FUNCTI=(    )
    %MANDANT=(   )
    %DEL_DATE=(00000000)
    %SAP_OBJECT=(          )
    %AR_OBJECT=(          )
    %OBJECT_ID=(                          )
    %FORM_ID=(                                        )
    %FORMARCHIV=(  )
    %RESERVE=(   )
    %NOTIZ=(                                                                )
    %SAPinfoEnd TOA_DARA
    >>
    endobj
    1 0 obj
    <<
    /Type /Pages
    /Kids
    [ 6 0 R
    /Count 1
    >>
    endobj
    8 0 obj<<
    /Type /Catalog
    /Pages 1 0 R
    /PageMode /UseNone
    >>
    endobj
    xref
    0 9
    0000000000 65535 f
    0000001801 00000 n
    0000000017 0000n
    0000000052 00000 n
    0000000157 00000 n
    0000000840 00000 n
    0000000862 00000 n
    0000001048 00000 n
    0000001869 00000 n
    trailer
    /Size 9
    /Root 8 0 R
    /Info 7 0 R
    >>
    startxref
    1944
    %%EOF
    Browser Displey Content Ends----
    My Coding Starts----
    Data: GG type String.
    event handler for data retrieval
    data : event type ref to cl_htmlb_event.
    class cl_htmlb_manager definition load.
    class CL_HTTP_RESPONSE DEFINITION LOAD.
    DATA : PARAMS TYPE PRI_PARAMS,
             VALID  TYPE C,
    GV_SUCCESS_SPOOL_NO LIKE SY-SPONO.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING DESTINATION           = 'LOCL'
               COPIES                = COUNT
               LIST_NAME             = 'TEST'
               LIST_TEXT             = 'Test NEW-PAGE PRINT ON'
                  IMMEDIATELY           = ''
                  RELEASE               = 'X'
                  NEW_LIST_ID           = 'X'
               EXPIRATION            = DAYS
                  LINE_SIZE             = 140
               LINE_COUNT            = 23
               LAYOUT                = 'X_PAPER'
               SAP_COVER_PAGE        = 'X'
               RECEIVER              = 'SAP*'
               DEPARTMENT            = 'System'
                  NO_DIALOG             = 'X'
        IMPORTING OUT_PARAMETERS        = PARAMS
                  VALID                 = VALID.
      IF VALID <> SPACE.
        NEW-PAGE PRINT ON  PARAMETERS PARAMS NO DIALOG.
    write :/ 'Hello Amit'.
    write :/ 'Hello Gaurav '.
    NEW-PAGE PRINT OFF .
      ENDIF.
    GV_SUCCESS_SPOOL_NO = sy-spono.
    data :        spool_no TYPE TSP01-RQIDENT .
    spool_no = sy-spono.
    write: GV_SUCCESS_SPOOL_NO.
    *write: spool_no.
    IF display_type = 'convertspool'.
      DATA: itab TYPE TLINE,
            witab TYPE TABLE OF TLINE,
            output TYPE STRING,
            outputx TYPE XSTRING.
    data : l_pdf_len type i.
    data: mi_bytecount type i.
    DATA : APP_TYPE TYPE STRING VALUE  'APPLICATION/PDF' .
    DATA:    cached_response TYPE ref to if_HTTP_RESPONSE.
    data : l_display_url type string .
    data : guid type GUID_32 .
           spool_no like TSP01-RQIDENT .
    *spool_no = GV_SUCCESS_SPOOL_NO .
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = spool_no
          NO_DIALOG                = 'X'
       IMPORTING
          PDF_BYTECOUNT            =  mi_bytecount
        TABLES
          PDF                      = witab
        EXCEPTIONS
          ERR_NO_ABAP_SPOOLJOB     = 1
          ERR_NO_SPOOLJOB          = 2
          ERR_NO_PERMISSION        = 3
          ERR_CONV_NOT_POSSIBLE    = 4
          ERR_BAD_DESTDEVICE       = 5
          USER_CANCELLED           = 6
          ERR_SPOOLERROR           = 7
          ERR_TEMSEERROR           = 8
          ERR_BTCJOB_OPEN_FAILED   = 8
          ERR_BTCJOB_SUBMIT_FAILED = 9
          ERR_BTCJOB_CLOSE_FAILED  = 10
          others                   = 11.
      if sy-subrc EQ 0.
        LOOP AT witab INTO itab.
          CONCATENATE
            output
            itab-tdline
          INTO output in character mode.
        ENDLOOP.
    endif.
    *write : output.
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
            EXPORTING
                text   = output
                mimetype =   'APPLICATION/PDF'
            IMPORTING
                buffer = outputx.
    *concatenate cl_abap_char_utilities=>byte_order_mark_little
    *outputx
    *into outputx in byte mode.
    CREATE OBJECT cached_response TYPE CL_HTTP_RESPONSE EXPORTING add_c_msg = 1.
    some Browsers have caching problems when loading Excel Format
      response->set_header_field( name = 'content-type' value =
    'APPLICATION/PDF'  ).
      response->delete_header_field( name =
    if_http_header_fields=>cache_control ).
      response->delete_header_field( name = if_http_header_fields=>expires
      response->delete_header_field( name = if_http_header_fields=>pragma )
        l_pdf_len = xstrlen( outputx ).
        cached_response->set_data( data   = outputx
                            length = l_pdf_len ).
        cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                           value = 'application/pdf' ).
        cached_response->set_status( code = 200 reason = 'OK' ).
        cached_response->server_cache_expire_rel( expires_rel = 180 ).
        CALL FUNCTION 'GUID_CREATE'
          IMPORTING
            ev_guid_32 = guid.
        CONCATENATE runtime->application_url '/' guid '.pdf' INTO l_display_url.
        cl_http_server=>server_cache_upload( url      = l_display_url
                                             response = cached_response ).
    RETURN.
    My Coding Ends----
    Any Further help on this.
    Regards
    Amit Agrawal

  • PDFs are not generated from Burst

    Hi all
    I am getting this error when i schedule my report to run:
    Document generation failed
    [INSTANCE_ID=V110APLFFC006.1305547398367] [OUTPUT_ID=1035][ReportProcessor]Error rendering documentoracle.xdo.servlet.scheduler.ProcessingException: [ReportProcessor]Error rendering document
    at oracle.xdo.enterpriseScheduler.bursting.BurstingReportProcessor.renderReport(BurstingReportProcessor.java:455)
    at oracle.xdo.enterpriseScheduler.bursting.BurstingReportProcessor.onMessage(BurstingReportProcessor.java:127)
    at oracle.xdo.enterpriseScheduler.util.Checkpoi
    This is my bursting delivery query below (which took me a loooong time to figure out!). I am bursting to the file system on the OBIEE server. Funnily enough when i change the output format to RTF, then the bursting works perfectly, but if i change it to PDF, i get this error. I have looked and looked for a reason as to why this happens but i have no idea. I can see in the job history that the data is split correctly and i can see that it generates the documents (they are shown when i click on Republish). Please if anyone has any idea, please reply - i desperately want to get this working, and i have no idea why it doesnt work.
    I have checked the logs and it seems that everything generates correctly, and when i open the .out files produced in AdobeReader everything opens successfully and the document has the correct information. It is also not related to permissions on the folder specified in the bursting query -> if i use the runReport webservice for the same report and specify C:\Temp as the output path ( and pdf as the attributeFormat), the file is written out correctly. It seems that the problem is with writing out more than one pdf file, but why???????? Not sure if it has anything to do with the scheduler at all ( i run the report by using the RunNow option in the scheduler)?
    Thanks very much for any and all help!
    SELECT nvl("NAME",0) KEY,
    'OIC' TEMPLATE,
    'en-us' LOCALE,
    'PDF' OUTPUT_FORMAT,
    'FILE' DEL_CHANNEL,
    'C:\Temp\' PARAMETER1,
    "NAME" PARAMETER2
    from
    (select "EXT"."NAME" as "NAME",
    "RES"."AT12" as "AT12"
    from "JM"."EXT" "EXT",
    "CN"."RES" "RES"
    where "RES"."AT12" = "EXT"."ID" )

    HI,
    Kidnly check whether Cost Center is maintained in the Work Center which is attached in the Maint. Plan
    Regards,
    Chandru.

  • Acrobat Pro 8: When I print to pdf I get windows print error message

    This just started happening when I installed my acrobat professional 8.0 on my new computer (with Windows XP Pro). Everything works fine, but when I print a document to .pdf, I get that windows printer pop-up message that says that it was unable to print. As a consequence, I get a bunch of allegedly unprinted documents in my printer queue that I have to keep deleting. This is more an annoyance than anything else, but can anyone tell me how to stop this from happening??
    THanks.

    OK, I'm still not sure I'm getting this, but I printed to file, and then opened the prn file in Acrobat Distiller. The actual pdf file was not in the folder, but I could open it with distiller.
    The message below distiller said: tart Time: Tuesday, January 20, 2009 at 13:03:04
    Source: retainerpetitionreview.prn
    Destination: C:\Documents and Settings\Mark Markus\Desktop\retainerpetitionreview.pdf
    Adobe PDF Settings: C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings\Standard.joboptions
    %%[ ProductName: Distiller ]%%
    %%[Page: 1]%%
    %%[Page: 2]%%
    %%[Page: 3]%%
    %%[LastPage]%%
    Distill Time: 00 Hour(s) : 00 Minute(s) : 00.265 Second(s)
    **** End of Job ****
    However, when I just print "regularly" (not, "to file") the pdf file is saved and generated, but I get that popup error message, which stays in my printer queue, saying that there was an error printing to LPT 1

  • PDF file not generating for only one Invoice billing document

    Hi all,
    We have upgraded our system into ECC6.0 from 4.7 version. During our Testing time, we have found the following Bug:
    Bug: Not possible to get output in pdf format for only one  Invoice type(TR code: VF02) except for all it is generating PDF output.
    Can anybody help me out to find the route cause for this problem.
    Regards,
    Murali.

    Hi,
    For one Billing-Invoice type , PDF is not generating. But it is generating for other Invoices.
    So should i need to go through the Printer settings?
    Regards,
    Murali.

  • PDF attachment getting cut off

    Hello Experts,
    I'm trying to send a PDF attachment using a PL/SQL procedure. In this procedure Im picking up the PDF file from server and sending it via email attachment. The procedure works fine and sends the PDF but it cuts off the data in the PDF. When I open the PDF file I can only see half of page the rest is just blank. I cant figure out why this is happening, can someone please check the procedure and let me know where im going wrong.
    CREATE OR REPLACE PROCEDURE send_email AS
    v_file_handle UTL_FILE.FILE_TYPE;
    v_email_server VARCHAR2(100) := 'xxxx'; -- replace with SMTP server
    v_conn UTL_SMTP.CONNECTION;
    v_port NUMBER := 25;
    v_reply UTL_SMTP.REPLY;
    v_msg VARCHAR2(32767);
    v_line VARCHAR2(2000);
    v_message VARCHAR2(2000) ;
    b_connected BOOLEAN := FALSE;
    v_sender VARCHAR2(50) := '[email protected]'; -- Sender email address
    CRLF VARCHAR2(2):= CHR(13) || CHR(10);
    RECPT VARCHAR2(255) := '[email protected]'; -- Receptiant email address
    p_stat NUMBER;
    SLP PLS_INTEGER := 300;
    pdirpath VARCHAR2(50) := 'TEST'; -- directory on the server
    pfilename VARCHAR2(50) := 'test01.pdf'; -- pdf file on the server
    BEGIN
    p_stat := 0;
    /***** Check if the file exists ****/
    BEGIN
    v_file_handle := UTL_FILE.FOPEN(pDirPath, pFileName, 'R');
    EXCEPTION
    WHEN UTL_FILE.INVALID_PATH THEN
    p_stat := 01;
    DBMS_OUTPUT.PUT_LINE(SQLERRM ||' '|| p_stat);
    WHEN OTHERS THEN
    p_stat := 02;
    DBMS_OUTPUT.PUT_LINE(SQLERRM ||' '|| p_stat);
    END;
    /***** Try to connect for three times, do sleep in between for 5 minutes *****/
    FOR i IN 1..3 LOOP
    BEGIN
    --open the connection with the smtp server and DO THE handshake
    v_conn:= UTL_SMTP.OPEN_CONNECTION(v_email_server, v_port);
    v_reply :=UTL_SMTP.HELO( v_conn, v_email_server);
    IF 250 = v_reply.code THEN
    b_connected := TRUE;
    EXIT;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_LOCK.SLEEP (SLP);
    END;
    END LOOP;
    IF b_connected = FALSE THEN
    p_stat := 03;
    DBMS_OUTPUT.PUT_LINE(SQLERRM ||' '|| p_stat);
    END IF;
    v_reply := UTL_SMTP.MAIL(v_conn, v_sender);
    IF 250 != v_reply.code THEN
    p_stat := 04;
    DBMS_OUTPUT.PUT_LINE(SQLERRM ||' '|| p_stat);
    END IF;
    v_reply := UTL_SMTP.RCPT(v_conn, RECPT);
    IF 250 != v_reply.code THEN
    p_stat := 05;
    DBMS_OUTPUT.PUT_LINE(SQLERRM ||' '|| p_stat);
    END IF;
    UTL_SMTP.OPEN_DATA ( v_conn);
    v_message := 'Sample Email This is an auto generated mail. Please DO NOT reply TO this mail.'||CHR(10);
    v_msg := 'Date: '|| TO_CHAR( SYSDATE, 'Mon DD yy hh24:mi:ss' )
    || CRLF || 'From: ' || v_sender
    || CRLF || 'Subject: ' || 'Sample file'
    || CRLF || 'To: ' || RECPT
    || CRLF || 'Mime-Version: 1.0'
    || CRLF || 'Content-Type: multipart/mixed; boundary="DMW.Boundary.605592468"' || CRLF ||''
    || CRLF || v_message
    || CRLF ||''
    || CRLF ||'--DMW.Boundary.605592468'
    || CRLF ||'Content-Type: text/plain; NAME="v_message.txt"; charset=US-ASCII'
    || CRLF ||'Content-Disposition: inline; filename="v_message.txt"'
    || CRLF ||'Content-Transfer-Encoding: 7bit' || CRLF || ''
    || CRLF || v_message || CRLF || CRLF || CRLF;
    UTL_SMTP.WRITE_DATA(v_conn,v_msg);
    /***** Prepare the attachment to be sent *****/
    v_Msg := CRLF || '--DMW.Boundary.605592468'
    || CRLF || 'Content-Type: application/octet-stream; NAME="' || pFileName || '"'
    || CRLF || 'Content-Disposition: attachment; filename="' || pFileName || '"'
    || CRLF || 'Content-Transfer-Encoding: 7bit' || CRLF || CRLF;
    UTL_SMTP.WRITE_DATA (v_conn, v_msg);
    LOOP
    BEGIN
    UTL_FILE.GET_LINE(v_file_handle, v_line);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
    v_msg := '*** truncated ***' || CRLF;
    v_msg := v_line || CRLF;
    UTL_SMTP.WRITE_DATA ( v_conn, v_msg );
    END LOOP;
    UTL_FILE.FCLOSE(v_file_handle);
    v_msg := CRLF;
    UTL_SMTP.WRITE_DATA ( v_conn, v_msg );
    v_msg := CRLF || '--DMW.Boundary.605592468--' || CRLF;
    UTL_SMTP.WRITE_DATA ( v_conn, v_msg );
    UTL_SMTP.CLOSE_DATA( v_conn );
    UTL_SMTP.QUIT( v_conn );
    EXCEPTION
    WHEN OTHERS THEN
    p_stat := 06;
    END;
    I'm not sure why my PDF is getting cut off towards the end, any help would be much appreciated.
    Thank you very much.

    Hi,
    I managed to make it work, I changed the attach_base64 as per your recommendations but made my own slight change :-
    PROCEDURE attach_base64_fromfile
    (conn IN OUT NOCOPY utl_smtp.connection,
                        filename IN VARCHAR2,
    floc IN VARCHAR2,
                   mime_type IN VARCHAR2 DEFAULT 'application/octet',
                        inline IN BOOLEAN DEFAULT TRUE,
                        last IN BOOLEAN DEFAULT FALSE) IS
    i PLS_INTEGER;
    len PLS_INTEGER;
    fh Utl_File.File_Type;
    buf raw(32767);
    BEGIN
    begin_attachment(conn, mime_type, inline, filename, 'base64');
    fh := Utl_File.Fopen (
    location => floc,
    filename => filename,
    open_mode => 'r');
    BEGIN
    Utl_File.Get_Raw (
    file => fh,
    buffer => buf);
    i := 1;
    len := utl_raw.LENGTH(buf);
    WHILE (i < len) LOOP
    IF (i + MAX_BASE64_LINE_WIDTH < len) THEN
    utl_smtp.write_raw_data(conn, utl_encode.base64_encode(buf));
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    END IF;
    i := i + MAX_BASE64_LINE_WIDTH;
    END LOOP;
    EXCEPTION
    WHEN no_data_found THEN NULL;
    END;
    Utl_File.Fclose ( file => fh );
    end_attachment(conn, LAST);
    END;
    and created another procedure to call send_mail.attach_base64_fromfile :-
    CREATE OR REPLACE PROCEDURE send_email_attachment IS
    conn utl_smtp.connection;
    BEGIN
    conn := Send_Mail.begin_mail(
    sender => '[email protected]', -- sender email address
    recipients => '[email protected]', -- recipient email address
    subject => 'Attachment Test',
    mime_type => Send_Mail.MULTIPART_MIME_TYPE);
    send_mail_vv.attach_base64_fromfile(
    conn => conn,
    filename => 'test.pdf', -- file name
    floc => 'TEST', -- file location
    mime_type => 'application/octet',
    inline => TRUE);
    Send_Mail.end_attachment( conn => conn );
    Send_Mail.end_mail( conn => conn );
    END;
    Thanks for all your help.

  • Limiting the amount of records or pages that gets generated by a report

    Post Author: jjurroz
    CA Forum: General
    Hey guys,I'm using CR 8.5.3I have a quick question that hopefully one of your can help me out with. I have a report that works perfectly and uses a couple different parameters for sorting etc.. I'm using an SQL database and for a particular report, after inputting the correct parameter values the report would generate for example 12,000 records on 2000 pages. What I'm trying to do is create a new parameter that would limit either the amount of pages that gets generated or the amount of records. I think I'd rather limit the amount of records to start off with and I would like it to be from a list of predefined amounts. I.E. "ALL", "First 10", "First 50". Essentially I'm trying to create a report that gives me a subset or sample of the main report so that it could get printed to pdf and sent to customer for review. Any help would be greatly appreciated! Regards,Jose

    Post Author: jjurroz
    CA Forum: General
    I can only go to 'TopN/Sort Group Expert' menu option if I add a summary field, otherwise the option is greyed out. If I do add a summary field and go to 'TopN/Sort Group Expert' I have no formula button. I can select TopN from a drop down but then I have to hard code the N value. I'm start to wonder whether its even possible to do it dynamically in CR 8.5.   V361:Sorry JJurroz, Here again I have CR XI, so not sure if 8 will do this.  Create a number parameter {? Top_N} then go to Group Sort Expert, you should be able to click on the formula button for Top N and put your parameter {? Top_N} in the formula.
    That should work.

  • IPC 5.0 API doc is not getting generated   -: Note 809820

    Hello friends,
    I have setup development environment for IPC 5.0 on my machine.I used the information provided in PricingUserexitManualV102.pdf which is attached with SAP Note 809820. Everything looks set except for the fact that when i try to generate API documenation (*** <b>Activate the context menu (right mouse click) on
    build_api_doc.xml and select Run As -> Ant Build</b> ***), then its not getting generated and i get the IOException. Please can some one guide me how to generate API docs?
    Many Thanks,
    Dipender Singh (Dips)

    I have been able to resolve it. I just configured by path and java_home. ( it was done to setup installation of J2EE server slim edition). While doing this when i again tried to generate the docs it happened like .. as if using winzip.
    Regards,
    Dipender

  • Spool not getting generated in OO ALV report

    Hi,
    I developed a report in which we are giving output in same selection screen through OO ALV.
    But,when we are scheduling that report in background,spool is not getting generated.
    Waiting for your reply.
    BR,
    Praveen

    Hi Aparna,
    I tried NEW-PAGE PRINT ON.
    I am pasting source code extract below:
       IMPORT DATA = ME->IT_FINAL2 FROM MEMORY ID SY-CPROG.
        FREE MEMORY ID SY-CPROG.
        CHECK ME->IT_FINAL2 IS NOT INITIAL.
        CHECK LO_DOCK IS INITIAL.
        CREATE OBJECT LO_DOCK
          EXPORTING
            REPID = SY-REPID
            DYNNR = SY-DYNNR
            RATIO = 70
            SIDE  = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM
            NAME  = 'DOCK_CONT'.
        IF SY-SUBRC NE 0.
          MESSAGE 'Error in Docking Control' TYPE 'S'.
        ENDIF.
        IF LO_ALV IS INITIAL.
          TRY.
              LO_CONT ?= LO_DOCK.
              CALL METHOD CL_SALV_TABLE=>FACTORY
                EXPORTING
                  LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
                  R_CONTAINER    = LO_CONT
                  CONTAINER_NAME = 'DOCK_CONT'
                IMPORTING
                  R_SALV_TABLE   = LO_ALV
                CHANGING
                  T_TABLE        = ME->IT_FINAL2.
            CATCH CX_SALV_MSG.
          ENDTRY.
      CLEAR LR_COLUMN.
          TRY.
              LR_COLUMNS = LO_ALV->GET_COLUMNS( ).
              LR_COLUMN = LR_COLUMNS->GET_COLUMN( 'KSCHL' ).
              LR_COLUMN->SET_LONG_TEXT( 'Cond.Type' ).
    CATCH CX_SALV_NOT_FOUND.
          ENDTRY.
    NEW-PAGE PRINT ON.
            LO_ALV->DISPLAY( ).
            NEW-PAGE PRINT OFF.
    I am not getting spool list while executing it in background.
    BR,
    Praveen

  • MC.9 - spool is not getting generated

    Hi Experts,
    When i execute MC.9 transaction in foreground i am able to view the report output. but when i execute it in background spool is not getting generated.
    Please provide me any solution for this issue.
    Thanks
    Pallavi

    Hi
    I have checked list of versions in the 'select version' button.  But my question is when i select 'execute in background', it is not generated spool. Is there any relation between spool and version. If there is, please explain me what it mean and how it relates.
    As i am new to this module i wanted to know it, in brief detailed.
    Thanks
    Pallavi

  • Transportation lane KEY not getting generated in the table

    Transportation lane KEY not getting generated in the table
    Hi folks,
    The issue is like this :
    We have a weekly workorders upload program from legacy systems to SAP-APO. The legacy planners send a .CSV file containing material-wise workroders. A customised zee program picks these quantities & writes them in Prod.planned keyfigures in SNP planning book. This process is done for the manufacturing locations only.
    Lately workorders for two particular material M1 & M2 had failed to get upload. It gives the error 'NO VALID SOURCE OF SUPPLY COULD BE FOUND' in its Job log. We did some debugging & found that for successful materials the  TRPID is getting generated in the table /SAPAPO/V_TRPROD  whereas this TRPID is missing for M1 & M2. Why this is happening is our main concern. We tried deleting the PPM & creating this again, assuming that the PPMID is the precursor for generating this TRPID, but this yielded no results.
    ____ for successful upload______________
    se16 --> /SAPAPO/V_TRPROD
    Version = 000
    LOCTO = LOCID KEY for manufacturing location
    MATID = MATID KEY of successfully loaded workorder
    Enter
    This gives the following results
    TRPID = TRPID KEY
    LOCFR = LOCID KEY for manufacturing location
    LOCTO = LOCID KEY for manufacturing location
    MATID = MATID KEY for successfully loaded workorder
    ( This seems a self-lane, i.e both TO & FROM location are same)
    ____ for unsuccessful upload________
    se16 --> /SAPAPO/V_TRPROD
    Version = 000
    LOCTO = LOCID KEY for manufacturing location
    MATID = MATID KEY for unsuccessfully loaded workorder
    Enter
    This gives the following results
    Error = No Table entries found for specified KEYS
    We are perplexed why this TRPID is not getting generated for these two particular material M1 & M2?
    We have deleted their PPM & re-created them to cross-check if the PPMID KEY is the trigger for generating the TRPID key. This didn't work!
    Please let us know in case someone faced a similar issue.
    Many Thanks.
    Kumar
    Edited by: Blue Lotus on Jun 9, 2011 2:44 PM

    Yes Anand.
    We deleted the PPM & created it again, which didn't work.
    Later on we deleted the product itself from APO & re-CIFed it from R3 & then re-created the PPM.
    The PPMID which was missing earlier is now getting created! However no luck with the TRPID.
    Why this TRPID is not getting generated in our only concern
    Regards
    Kumar

  • Purchase Requisition not getting generated in APO

    Hi,
    I am facing an issue in APO. Once I confirm a sales order, I have to run the Product Heuristic in APO to generate the purchase requisition through rrp3. The problem is the purchase requisition is getting generated without the PR number. The line does not show the number and also the purchase req is not reflecting in ECC. Please refer the screenshot. Kindly help me with this.
    Thanks & Regards,
    Raja S

    Hi Guys,
    Sorry for the delayed response. Now got another issue. My CIF model for a Sales Order is not getting activated. I also cleared the queue in APO through /sapapo/cq and then start running the CIF. But it runs for a long period.
    What could be the other possible issues with CIF model activation?
    I am getting a message box like the below when try to activate the CIF. I keep ignoring the message and trying to run the CIF. But still I am unable to resolve. Kindly help
    After resolving this only, I can go for the above mentioned issue. I sincerely thank all your support.
    Regards
    Raja S

Maybe you are looking for