Workflow PDF attachment Issue

In one of the dev instance here in Client's side we are facing one issue regarding workflow notification attachment.
We have built a custom workflow which send notification with PDF as an attachment.In ebs workflow list when user try to open the attachment we are getting following error
ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at "APPS.WF_NOTIFICATION", line 8114 ORA-06512: at line 1
This error is not occurring in another dev instance and happening at the client side.
Please let me know if any one have come across this error before
I guess this may be some setup at the server side which causing this error.
we are creating custom directory for the above.

hi pavan ,
   i want to send po output in pdf format to external addresses to multiple receipients i have tried and written code in EXIT_SAPMM06E_013 now iam getting pdf for multiple receipients but unable to print dynamic data(main window data) me getting only hardcoded data in smartform. plz correct me and let me know how dynamic data will be passed from into script.
regards,
chandu...

Similar Messages

  • Pdf attachement issue

    When receiving emails, .pdf attachments show as picture in body, require to show as attached file for opening in Notetaker

    Having same issue, please someone respond.

  • How to Send mail woth pdf attachment through workflow

    Hi SDNer's,
           I have a problem with pdf attachment through workflow. Please anybody help me to get solve my issue.

    Hi Suresh,
    I just tried this thing in my systtem and it is working... BADI is trigerred everytime there is a change in the PO... even when you release there is a change in the PO so this BADI will be triggerred....
    I suggest you should implement BADI in your dev system and place a break point in the POST method...
    After that create a PO and release it using ME29N... thereafter when you save the PO... this method will trigger and you will have access to PO details...
    PS: Remember this BADI wont work for transaction ME29...
    Regards
    Gautam

  • Pdf attachment through workflow

    Hi SDNers,
    I need to attach a PDF to send mail in my workflow. Workflow triggers whenever PO changed or release at ME22N or ME21N.
    Which PO has been changed, data PO details need to display in PDF.
    For this I created a smarform by passing PO number. I created attribute for emailaddress, in this i written code. But, when executed manually it is going. but I changed or release from ME22N or ME21N just a body mail is going butwithout attachment.Please suggest me. Here is the code which I have written in the attribute.
    FORM SELECT_TABLE_ADR6 USING SUBRC LIKE SY-SUBRC.
      TYPES: BEGIN OF ty_ekko,
             ebeln TYPE ebeln,
             lifnr TYPE lifnr,
             END OF ty_ekko,
             BEGIN OF ty_lfa1,
             lifnr TYPE lifnr,
             adrnr TYPE adrnr,
             END OF ty_lfa1.
      DATA: it_ekko TYPE STANDARD TABLE OF ty_ekko INITIAL SIZE 0,
            it_lfa1 TYPE STANDARD TABLE OF ty_lfa1 INITIAL SIZE 0,
            wa_ekko TYPE ty_ekko,
            wa_lfa1 TYPE ty_lfa1.
    DATA: gv_form_name TYPE rs38l_fnam,
          gv_bin_filesize TYPE i,
          gv_pos TYPE i,
          gv_len TYPE i,
          gv_tab_lines TYPE i.
    DATA: gc_text(11) TYPE c VALUE 'Form Output',
          gc_tst(3) TYPE c VALUE 'TST',
          gc_testing(20) TYPE c VALUE 'PURCHASE ORDER'.
    DATA: gs_docdata TYPE sodocchgi1,
          gs_ctrlop TYPE ssfctrlop,
          gs_outopt TYPE ssfcompop,
          gs_otfdata TYPE ssfcrescl,
          gs_reclist TYPE somlreci1,
          gs_copy type somlreci1,
          gs_pdf_tab TYPE tline,
          gs_objbin TYPE solisti1,
          GS_OBJTXT TYPE SOLISTI1,
          gs_objpack TYPE sopcklsti1.
    DATA: gt_reclist TYPE TABLE OF somlreci1,
          gt_copy type table of somlreci1,
          gt_pdf_tab TYPE TABLE OF tline,
          gt_otf TYPE TABLE OF itcoo,
          gt_objbin TYPE TABLE OF solisti1,
          GT_OBJTXT  TYPE TABLE OF SOLISTI1,
          gt_objpack TYPE TABLE OF sopcklsti1.
    DATA: G_SMTP_ADDR type AD_SMTPADR.
    DATA: p_plist(40) type C,
          gc_c type  C,
          gc_u type C.
    CLEAR : gv_form_name,
            gs_ctrlop,
            gs_outopt,
            gs_otfdata,
            gv_bin_filesize,
            gv_pos,
            gv_len,
            gv_tab_lines.
      IF OBJECT-_ADR6-CLIENT IS INITIAL
      AND OBJECT-_ADR6-ADDRNUMBER IS INITIAL
      AND OBJECT-_ADR6-PERSNUMBER IS INITIAL
      AND OBJECT-_ADR6-DATE_FROM IS INITIAL
      AND OBJECT-_ADR6-CONSNUMBER IS INITIAL.
        SELECT ebeln lifnr FROM ekko INTO TABLE it_ekko
        WHERE ebeln = object-key-purchaseorder.
        SELECT lifnr adrnr FROM lfa1 INTO TABLE it_lfa1
        FOR ALL ENTRIES IN it_ekko WHERE lifnr = it_ekko-lifnr.
        READ TABLE it_lfa1 INTO wa_lfa1 INDEX 1.
        SELECT SINGLE * FROM ADR6 CLIENT SPECIFIED
            WHERE CLIENT = SY-MANDT
            AND ADDRNUMBER = WA_LFA1-ADRNR.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZMMF_PUR_DOMESTIC001'
        IMPORTING
          fm_name            = gv_form_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      gs_ctrlop-getotf = 'X'.
      gs_ctrlop-device = 'PRINTER'.
      gs_ctrlop-LANGU   = SY-LANGU.
       gs_ctrlop-no_dialog = 'X'.
       gs_outopt-tddest = 'LP01'.
       gs_outOPT-TDIMMED = 'X'.
       gs_OUTOPT-TDRECEIVER = SY-UNAME.
       gs_OUTOPT-TDNOPREV = 'X'.
    CALL FUNCTION gv_form_name
         EXPORTING
           control_parameters = gs_ctrlop
           output_options     = gs_outopt
         user_settings      = us_screen
          user_settings      = ent_retco
         customer           = customer
         bookings           = bookings
         connections        = connections
           i_ebeln            = object-key-purchaseorder
         IMPORTING
           job_output_info    = gs_otfdata
         EXCEPTIONS
           formatting_error   = 1
           internal_error     = 2
           send_error         = 3
           user_canceled      = 4.
    CLEAR gt_otf.
      gt_otf[] = gs_otfdata-otfdata[].
    Convert the OTF DATA to SAP Script Text lines
      CLEAR gt_pdf_tab.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 200
        IMPORTING
          bin_filesize          = gv_bin_filesize
        TABLES
          otf                   = gt_otf
          lines                 = gt_pdf_tab
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
    Data : Order(50) type c,
           sep(10) type c value ' / '.
      CLEAR gs_docdata.
      gs_docdata-obj_name = gc_tst.
        CONCATENATE gc_testing sep 'test mail' into order.
      gs_docdata-obj_descr = order.
      CLEAR : gt_reclist, gs_reclist.
      REFRESH: GT_RECLIST, GT_OBJPACK, GT_OBJBIN.
      clear:  gt_copy, gs_copy.
    IF internal mail id
      gs_reclist-receiver = ADR6-SMTP_ADDR.
      GS_RECLIST-REC_TYPE = 'U'.
      APPEND gs_reclist TO gt_reclist.
    APPEND gs_copy to gt_copy.
    CLEAR : gs_objbin, gs_pdf_tab.
      LOOP AT gt_pdf_tab INTO gs_pdf_tab.
        gv_pos = 255 - gv_len.
        IF gv_pos > 134. "length of pdf_table
          gv_pos = 134.
        ENDIF.
        gs_objbin+gv_len = gs_pdf_tab(gv_pos).
        gv_len = gv_len + gv_pos.
        IF gv_len = 255. "length of out (contents_bin)
          APPEND gs_objbin TO gt_objbin.
          CLEAR: gs_objbin, gv_len.
          IF gv_pos < 134.
            gs_objbin = gs_pdf_tab+gv_pos.
            gv_len = 134 - gv_pos.
          ENDIF.
        ENDIF.
      ENDLOOP.
    IF gv_len > 0.
        APPEND gs_objbin TO gt_objbin.
      ENDIF.
    Filling the details in SAPoffice: Description of Imported
      DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
      CLEAR gs_objbin.
      READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
      IF sy-subrc = 0.
        gs_objpack-transf_bin = 'X'.
        gs_objpack-head_start = 1.
        gs_objpack-head_num = 0.
        gs_objpack-body_start = 1.
        gs_objpack-body_num = gv_tab_lines.
        gs_objpack-doc_type = 'PDF'.
        gs_objpack-obj_name = 'ATTACHMENT'.
        gs_objpack-obj_descr = 'test'.
        APPEND gs_objpack TO gt_objpack.
      ENDIF.
    IF p_plist IS NOT INITIAL.
    gs_reclist-receiver = p_plist.
    gs_reclist-rec_type = gc_c.
    APPEND gs_reclist TO gt_reclist.
    CLEAR gs_reclist.
    ENDIF.
    Populating the reciever list
    gs_reclist-receiver = p_plist.
    gs_reclist-rec_type = gc_c.
    APPEND gs_reclist TO gt_reclist.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        DOCUMENT_DATA                    = gs_docdata
       PUT_IN_OUTBOX                    = 'X'
       COMMIT_WORK                      = 'X'
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
      TABLES
        PACKING_LIST                     = gt_objpack
      OBJECT_HEADER                    =
       CONTENTS_BIN                     = gt_objbin
      CONTENTS_TXT                     =
      CONTENTS_HEX                     =
      OBJECT_PARA                      =
      OBJECT_PARB                      =
        RECEIVERS                        = gt_reclist
    EXCEPTIONS
       TOO_MANY_RECEIVERS               = 1
       DOCUMENT_NOT_SENT                = 2
       DOCUMENT_TYPE_NOT_EXIST          = 3
       OPERATION_NO_AUTHORIZATION       = 4
       PARAMETER_ERROR                  = 5
       X_ERROR                          = 6
       ENQUEUE_ERROR                    = 7
       OTHERS                           = 8.
    IF SY-SUBRC = 0.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    and return.
    ENDIF.

    Hi-
    You need to convert the smartform's OTF data to PDF and then create a SOFM instance. Now bind this SOFM instance to workflow container 'ATTACH_OBJECTS' in your email step and your smartform will be showed as a PDF attachment
    Vinoth

  • Smartform - PDF attachment through E-mail issue

    Hi,
    A custom form and custom program was created to print the Purchase order information through ME21N, 22n and 23n.
    It also has E-mail option. when output medium 5(Simple mail) and 7(External send), email will be send to respective mail-id's with the PDF attachment.
    I have issue at the time of saving PO which processed with medium 5. when i save A popup appears "Express document update was terminated received from author". Brief message about it is
    "Error Info... 00 671: ABAP/4 processor: COMMIT_IN_POSTING"
    In Smartform driver program i am using below function modules to convert OTF into PDF and send through e-mail.
    Function Module: CONVERT_OTF.
    Function Module: SO_DOCUMENT_SEND_API1.
    I am not sure, what i missed out. Can you guys tell is this the correct way to send PDF attachment through E-mail or i missed out any function module for commit.
    Regards,
    Hemanth.
    Edited by: keerthipati hemanth on Jul 31, 2008 1:15 PM
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jul 31, 2008 3:14 PM

    Hi Hemant,
    Below is the code for the  downloading of the smartform into the PDF Format.
    * Program Name : ZPPREP_SHOPFLOOR_VIEWER_ZOOM
    REPORT zppeerep_shorepfloor_viewer_zoom.
    * T A B L E S    D E C L A R A T I O N
    *---Tables Used.
    TABLES: afpo,
            mara,
            marc,
            aufk,
            afko,
            itcoo,
            nast,                          "Messages
            *nast,                         "Messages
            tnapr,                         "Programs & Forms
            addr_key,
            arc_params,                    "Archive parameters
            toa_dara.                      "Archive parameters
    * I N T E R N A L    T A B L E S     D E C L A R A T I O N
    *--Internal Tables Used.
    * D A T A     D E C L A R A T I O N
    *--Global Variables Used.
    DATA: ws_matnr LIKE afpo-matnr,
          ws_werks LIKE aufk-werks,
          ws_mtart LIKE mara-mtart,
          ws_wrkst LIKE mara-wrkst,
          ws_fname TYPE rs38l_fnam,
          ws_ctrlp TYPE ssfctrlop,
          ws_optns TYPE ssfcompop,
          w_padest LIKE tsp03l-padest.                          "BMC01+
    DATA: da_message_printed(1) TYPE c,
          da_preview_processed(1) TYPE c,
          repeat(1) TYPE c,
          da_subrc LIKE sy-subrc.
    DATA: w_otfdata  TYPE ssfcrescl.
    DATA: BEGIN OF it_itcoo OCCURS 0.
            INCLUDE STRUCTURE itcoo.
    DATA: END OF it_itcoo.
    DATA: w_otf  TYPE itcoo.
    *--Data Declaration for Printing Layout
    DATA: ls_itcpo     TYPE itcpo.
    DATA: lf_repid     TYPE sy-repid.
    DATA: lf_device    TYPE tddevice.
    DATA: cf_retcode   TYPE sy-subrc.
    DATA: ls_recipient TYPE swotobjid.
    DATA: ls_sender    TYPE swotobjid.
    DATA: ls_control_param   TYPE ssfctrlop.
    DATA: ls_composer_param  TYPE ssfcompop.
    DATA: ls_addr_key        LIKE addr_key.
    DATA: w_screen(1) TYPE c.
    DATA: xscreen(1) TYPE c.
    DATA: da_mess LIKE vbfs OCCURS 0 WITH HEADER LINE.
    * C O N S T A N T S
    CONSTANTS: c_fas1(8)  TYPE c VALUE 'PRINTFAS',
               c_fas2(15) TYPE c VALUE 'PRINTFASDRAWING',
               c_wip1(8)  TYPE c VALUE 'PRINTWIP',
               c_wip2(15) TYPE c VALUE 'PRINTWIPDRAWING'.
    * S E L E C T I O N - S C R E E N.
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-bl1.
    * Production order
    PARAMETERS: p_aufnr LIKE afpo-aufnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK bl1.
    START-OF-SELECTION.
    *--Begin of Commenting                   "
    *--Get Partially processed orders
      MOVE: sy-mandt         TO nast-mandt,
            'V1'             TO nast-kappl,
            p_aufnr          TO nast-objky,
            p_aufnr          TO nast-parnr,
            sy-langu         TO nast-spras,
            sy-datum         TO nast-erdat,
            '1'              TO nast-nacha,
            '3'              TO nast-vsztp,
            'X'              TO nast-manue,
            sy-uname         TO nast-usnam,
            'DFLT'           TO nast-ldest,
            sy-langu         TO nast-tdspras,
            'Shop Floor Papers' TO nast-tdcovtitle,
            '1'              TO nast-tdarmod,
            'BUS2032'        TO nast-objtype.
    *--Printer settings
      CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
        EXPORTING
          pi_nast       = nast
          pi_repid      = sy-repid
        IMPORTING
          pe_returncode = cf_retcode
          pe_itcpo      = ls_itcpo
          pe_device     = lf_device
          pe_recipient  = ls_recipient
          pe_sender     = ls_sender.
      MOVE-CORRESPONDING ls_itcpo TO ls_composer_param.
      ls_control_param-device      = 'PRINTER'.
      ls_control_param-no_dialog   = 'X'.
      ls_control_param-preview     = 'X'.
      ls_control_param-getotf      = ls_itcpo-tdgetotf.
      ls_control_param-langu       = sy-langu.
    *--End   of Commenting                   "
    *--Start of Addition                     "
      CLEAR:   ws_werks.
      SELECT   SINGLE werks
               INTO   ws_werks
               FROM   aufk
               WHERE  aufnr = p_aufnr.
      CLEAR:   ws_matnr.
      SELECT   SINGLE plnbez
               INTO   ws_matnr
               FROM   afko
               WHERE  aufnr = p_aufnr.
      CLEAR:   marc.
      SELECT   SINGLE matgr
               INTO   marc-matgr
               FROM   marc
               WHERE  matnr = ws_matnr
               AND    werks = ws_werks.
    *--End   of Addition                     "
    *  CHECK NOT ws_matnr IS INITIAL.       
      IF NOT ws_matnr IS INITIAL.          
    *--Start of Addition                    
        SELECT   SINGLE matgr
                 INTO   marc-matgr
                 FROM   marc
                 WHERE  matnr = ws_matnr
                 AND    werks = ws_werks.
    *--Start of Addition BY Rapidigm01_01+
      ELSE.
        marc-matgr = c_wip1.
      ENDIF.
    *--End Of Addition BY Rapidigm01_01+
    *--End   of Addition                     "
    END-OF-SELECTION.
      PERFORM call_smartform.
    * F O R M    R O U T I N E S
    *&      Form  call_smartform
    *       text
    FORM call_smartform.
      CLEAR: ws_ctrlp, ws_optns, ws_fname.
    *--Start of Addition                                 "
      TRANSLATE marc-matgr TO UPPER CASE.
      IF marc-matgr = c_fas1 OR
         marc-matgr = c_fas2.
        PERFORM call_paper_a.
      ELSEIF marc-matgr = c_wip1 OR
             marc-matgr = c_wip2.
        PERFORM call_paper_b.
      ENDIF.
    *--End   of Addition                                 "
    ENDFORM.                    "call_smartform
    *&      Form  call_paper_a
    *       text
    FORM call_paper_a.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
    *>>BC SPARTA03    DATE: 19/05/2008
    *      formname           = 'ZPPSF_SHOP_FLOOR_PAPER_A'  "Rapidigm03_01-
          formname           = 'ZPPSF_SHOP_FLOOR_PAPER_C'  "Rapidigm03_01-
    *<<EC SPARTA03    DATE: 19/05/2008
    *       formname  = 'ZPPSF_SHOP_FLOOR_PAPER_A_2893'   "Rapidigm03_01+
        IMPORTING
          fm_name            = ws_fname
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      CHECK NOT ws_fname IS INITIAL.
      CLEAR w_otfdata.
      ls_control_param-getotf = 'X'.
      CALL FUNCTION ws_fname
        EXPORTING
          archive_index      = toa_dara
          archive_parameters = arc_params
          control_parameters = ls_control_param
          mail_recipient     = ls_recipient
          mail_sender        = ls_sender
          output_options     = ls_composer_param
          user_settings      = ' '
          is_nast            = nast
          aufnr              = p_aufnr
          flag_orig          = 'X'
        IMPORTING
          job_output_info    = w_otfdata
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      LOOP AT w_otfdata-otfdata INTO w_otf.
        APPEND w_otf TO it_itcoo.
      ENDLOOP.
      CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
        TABLES
          otf_table = it_itcoo.
    ENDFORM.                    "call_paper_a
    *&      Form  call_paper_b
    *       text
    FORM call_paper_b.
      DATA: ws_doknr TYPE draw-doknr,
            ws_dokvr TYPE draw-dokvr.
      CLEAR: ws_doknr, ws_dokvr.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZPPSF_SHOP_FLOOR_PAPER_B'
        IMPORTING
          fm_name            = ws_fname
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      CHECK NOT ws_fname IS INITIAL.
      CLEAR w_otfdata.
      ls_control_param-getotf = 'X'.
      CALL FUNCTION ws_fname
        EXPORTING
          archive_index      = toa_dara
          archive_parameters = arc_params
          control_parameters = ls_control_param
          mail_recipient     = ls_recipient
          mail_sender        = ls_sender
          output_options     = ls_composer_param
          user_settings      = ' '
          is_nast            = nast
          aufnr              = p_aufnr
          doknr              = ws_doknr
          dokvr              = ws_dokvr
          flag_orig          = 'X'
        IMPORTING
          job_output_info    = w_otfdata
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      LOOP AT w_otfdata-otfdata INTO w_otf.
        APPEND w_otf TO it_itcoo.
      ENDLOOP.
      CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
        TABLES
          otf_table = it_itcoo.
    ENDFORM.                    "call_paper_b

  • Workflow Step 'In Process'- Send mail with PDF attachment

    Hi,
    have to send mail with PDF attachment.
    I have written a function module with following steps,
    1. Convert SPOOL number to PDF using Function Module 'CONVERT_OTFSPOOLJOB_2_PDF'.
    2. Send mail with PDF attachment using Function Module 'SO_DOCUMENT_SEND_API1'.
    The Function Module is giving required output when tested and called in the report(Background Job).
    When I call this Function Module from Method-> Workflow Task the Workflow steps status is 'In Process' and not ending.
    Could you please help me on this??

    Hi shafath,
    When you try to send mail,  You need to call the function FP_JOB_OPEN before calling the function module to generate the pdf. ( /1B****)  . Is it missing in your code?

  • Sapscript as PDF-Attachment in Workflow

    Hi Experts,
    I am trying to create a new workflow for releasing purchase orders.
    If the workitem passes all the controlling steps of the management, it should be sent automatically as PDF via email to our vendor.
    The problem is, how to get the PDF as an attachment? We are using SAPscript for our PO formular  (and of course the PDF-Attachment should look like the printed version).
    I was already looking in the internet for a solution, but it is really hard to find some answers for this problem.
    Many thanks for your help,
    Christoph

    Hi all,
    many thanks for your help.
    The workflow should run in this way. The purchaser creates an order --> supervisor gets a SAP Mail (workflow user decision step) to accept it --> the supervisor of the supervisor then gets a SAP mail to accept it --> PDF is sent to the vendor (only if everybody signed this PO before).
    I will try following now: I will create a new workflow task to execute a method (for getting the PO as a PDF attachment) and a new workflow container item to store the attachment.
    As next WF step I will use the standard send mail step.
    Are I am right with this soulution (nothing programmed yet, still not so sure how to do it - but hope to find a solution to manage this).
    Many thanks for your help again.
    Chris

  • Want to create program which will trigger workflow with PDF attachement

    Hi Expert,
    I m new for work flow.
    I want to create abap program  which  trigger work flow with PDF attachment.
    Thanks in advanced.
    Regards,
    Laxman Sankhla.

    HI i have written code as per below.
    Now if i m running programe i m getting error  "Unable to create work item container
    (CL_SWF_RUN_WIM_FLOW->_IMPORT_CONTAINER) "
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = FP_FORMOUTPUT-PDF
        APPEND_TO_TABLE       = ' '
       IMPORTING
          OUTPUT_LENGTH         = ZVAR1
        TABLES
          BINARY_TAB            = IT_SOLIX_TAB.
      IF SY-SUBRC = 0 AND NOT IT_SOLIX_TAB[] IS INITIAL .
        SWC_SET_TABLE   CONTAINER 'IT_SOLIX_TAB'  IT_SOLIX_TAB.
        SWC_SET_ELEMENT CONTAINER 'ZVAR1' ZVAR1.
        SWC_SET_ELEMENT CONTAINER  'YBUS2012' OBJ.
        GV_INITIATOR = SY-UNAME.
        CALL FUNCTION 'SWW_WI_START_SIMPLE'
          EXPORTING
           CREATOR                            = GV_INITIATOR
          PRIORITY                           = SWFCO_NO_PRIO
            TASK                               = 'WS99900241'
           CALLED_IN_BACKGROUND               = 'X'
          TABLES
            AGENTS                             = IT_AGENTS
            WI_CONTAINER                       = CONTAINER.
        COMMIT WORK.
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Thanks in advanced
    Laxman Sankhla.

  • Facing problem with logo in the PDF attachment when sending mail...

    hi friends,
    i'm facing problem with logo in the PDF attachment to the mail.
    my requirement:
    1. enter spool number and mail id in the selection screen.
    process:
    1. now the program will fetch the spool data and converts it to PDF.
    2. but when i'm trying to send mail with this PDF as attachment.
    when i open the PDF file from the mail, logo is not coming properly (looks disturbed).
    can anyone help me how to resolve this issue...
    thanks in advance, murashali.

    hi dinakar, thanks for your mail...
    logo looks good in spool/script/smartform.
    even it look good when i download this spool to pdf and to the presentation server as pdf file.
    i'm using CONVERT_OTFSPOOLJOB_2_PDF.
    when i used CONVERT_ABAPSPOOLJOB_2_PDF, is gives a msg - 'spool number not found'.
    here i'm using folloing code to pass pdf to the function module: SO_NEW_DOCUMENT_ATT_SEND_API1.
    code:
    Transfer the 132-long strings to 255-long strings
      lt_mtab_pdf[] = pdf[].
      LOOP AT lt_mtab_pdf INTO lwa_mtab_pdf.
        TRANSLATE lwa_mtab_pdf USING ' ~'.
        CONCATENATE lv_gd_buffer lwa_mtab_pdf INTO lv_gd_buffer.
        CLEAR lwa_mtab_pdf.
      ENDLOOP.
      TRANSLATE lv_gd_buffer USING '~ '.
      DO.
        lwa_mess_att = lv_gd_buffer.
        APPEND lwa_mess_att TO lt_mess_att.
        CLEAR lwa_mess_att.
        SHIFT lv_gd_buffer LEFT BY 255 PLACES.
        IF lv_gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    NOTE: problem i believe is with ''.  i'm getting this tilt symbol () in my pdf internal table.  here in the above code the line   TRANSLATE lv_gd_buffer USING '~ ' is changing the existing tilt to space.  so my logo is getting disturbed.
    even i tried with REPLACE this tilt with other char, but it doent work.
    can you give any idea...

  • STO mail : pdf attachment has an error 'file damage' when try to open it

    Dear expert,
    I need to send an e-mail to the vendor with the sto list as attachment at the email.
    I managed to send email to external addresee and made the pdf attachment, BUT somehow when I open the attachment it has an error says "Adobe Reader could not open xx.pdf because it is either not a supported file type or because the file has been damaged(for axample, it was sent as an email attachment and wasn't corectly decoded)."
    Really need your experties to help me. Here is my abap coding to send email and do the pdf attachment at the new ouptput type to send email.
      TYPES: BEGIN OF lty_drad,
              doknr TYPE drad-doknr,
             END OF lty_drad,
             BEGIN OF lty_recpt,
               smtp_addr  TYPE ad_smtpadr,
             END   OF lty_recpt.
      DATA: lt_doc      TYPE STANDARD TABLE OF docs,
            lt_recpt    TYPE STANDARD TABLE OF lty_recpt,
            lt_tline    LIKE tline OCCURS 0 WITH HEADER LINE,
            lt_data     TYPE solix_tab,
            lt_docu     TYPE STANDARD TABLE OF lty_drad,
            lt_docfiles TYPE STANDARD TABLE OF bapi_doc_files2,
            lw_tline    LIKE LINE OF lt_tline,
            lw_docu     LIKE LINE OF lt_docu,
            lw_docfiles LIKE LINE OF lt_docfiles,
            lw_objdes   TYPE tnati-objdes,
            lt_text     TYPE bcsy_text,
            lw_recpt    TYPE adr6-smtp_addr,
            lw_adrnr    TYPE lfa1-adrnr,
            lw_object   TYPE drad-objky,
            lw_doknr    TYPE drad-doknr,
            lw_return   TYPE  bapiret2,
            lw_xcontent TYPE xstring,
            client    TYPE REF TO if_http_client,
             url       TYPE string,
             lw_subrc  TYPE sysubrc,
             response  TYPE REF TO if_http_response,
             lw_message1 TYPE string,
           sent_to_all TYPE os_boolean,
           bin_filesize type i.
      CONSTANTS: lc_dokar_srm TYPE drad-dokar VALUE 'SRM',
                 lc_type      TYPE so_obj_tp  VALUE 'RAW'.
    CLASS-DEFINITIONS
      DATA: send_request       TYPE REF TO cl_bcs.
      DATA: document           TYPE REF TO cl_document_bcs.
      DATA: sender             TYPE REF TO cl_sapuser_bcs.
      DATA: recipient          TYPE REF TO if_recipient_bcs.
      DATA: exception_info     TYPE REF TO if_os_exception_info,
            bcs_exception      TYPE REF TO cx_bcs.
      RANGES: lr_po_pr   FOR  drad-objky.
      DATA:   lw_banfn   TYPE ekpo-banfn,
              lw_bnfpo   TYPE ekpo-bnfpo.
      IF nast-nacha = '5'. "8
    Create recipient and check if exist
       Get email ID
      start commented by sapnislina 21.12.06
       SELECT SINGLE adrnr FROM lfa1 INTO lw_adrnr
                    WHERE lifnr = p_ekko-lifnr.
       IF sy-subrc NE 0.
         PERFORM protocol_update
           USING '303' 'Address of Vendor:' ekko-lifnr 'not found' space
         p_retco = sy-subrc.
         EXIT.
       ENDIF.
      end commented by sapnislina 21.12.06
       SELECT smtp_addr INTO CORRESPONDING FIELDS OF TABLE lt_recpt
            FROM adr6
           WHERE addrnumber = p_ekko-adrnr. "lw_adrnr.
        IF lt_recpt[] IS INITIAL.
          PERFORM protocol_update
            USING '303' 'Email address(es) does not exist for vendor'
            p_ekko-lifnr space space.
          p_retco = sy-subrc.
          EXIT.
        ENDIF.
        CALL FUNCTION 'CONVERT_OTF_2_PDF'
          EXPORTING
            use_otf_mc_cmd         = 'X'
          IMPORTING
            bin_filesize           = bin_filesize
          TABLES
            otf                    = otfdata[]
            doctab_archive         = lt_doc
            lines                  = lt_tline
          EXCEPTIONS
            err_conv_not_possible  = 1
            err_otf_mc_noendmarker = 2
            OTHERS                 = 3.
        IF sy-subrc <> 0.
        PERFORM protocol_update
            USING '303' 'PO Convertion from OTF to PDF failed'
                  space space space.
          p_retco = sy-subrc.
          EXIT.
        ENDIF.
    Get object description from mail title of output types
       SELECT SINGLE objdes INTO lw_objdes
              FROM tnati
              WHERE spras = sy-langu
              AND   kappl = nast-kappl
              AND   kschl = nast-kschl.
       CONCATENATE lw_objdes ekko-ebeln INTO lw_objdes SEPARATED BY
    space
        DATA L_TXT(255) TYPE C.
        DATA L_TXT2(255) TYPE C.
        CONCATENATE 'STO' EKPO-EBELN 'Created for' EKPO-WERKS '/'
    EKPO-LGORT
        'Supply Plant' EKKO-RESWK into l_txt separated by space.
        lw_objdes = l_txt.
        CONCATENATE 'STO' EKKO-EBELN INTO L_TXT2 SEPARATED BY SPACE.
        APPEND L_TXT2 TO LT_TEXT.
       APPEND lw_objdes TO lt_text.
    Instantiate
        CLASS cl_cam_address_bcs DEFINITION LOAD.
        CLASS cl_abap_char_utilities DEFINITION LOAD.
    insert by sapnislina 22.12.06
      DATA : CONTENT_OUT TYPE SOLIX,
             LINE_WIDTH_SRC TYPE I,
             POS_OUT TYPE I,
             POS_IN TYPE I,
             LEN_OUT TYPE I.
      DATA OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
      DATA : BEGIN OF CONTENT_IN,
                LINE TYPE TLINE,
                DUMMY TYPE TLINE,
             END OF CONTENT_IN.
      TYPES PDF_RAW TYPE X LENGTH 268.
      FIELD-SYMBOLS <PDF_BIN> TYPE PDF_RAW.
      DESCRIBE FIELD CONTENT_IN-LINE LENGTH LINE_WIDTH_SRC IN BYTE MODE.
      REFRESH lt_data.
      CLEAR CONTENT_OUT.
      POS_OUT = 0.
      LOOP AT OTFDATA INTO CONTENT_IN-LINE.
        ASSIGN CONTENT_IN TO <PDF_BIN> CASTING.
        MOVE <PDF_BIN> TO CONTENT_OUT-LINE+POS_OUT.
        ADD LINE_WIDTH_SRC TO POS_OUT.
        WHILE POS_OUT >= 255.
          APPEND CONTENT_OUT TO lt_data.
          CLEAR CONTENT_OUT.
          SUBTRACT 255 FROM POS_OUT.
          IF POS_OUT > 0.
            POS_IN = LINE_WIDTH_SRC - POS_OUT.
            MOVE <PDF_BIN>+POS_IN TO CONTENT_OUT-LINE.
          ENDIF.
        ENDWHILE.
      ENDLOOP.
      IF POS_OUT > 0.
      APPEND CONTENT_OUT TO lt_data.
      ENDIF.
    end inserted by sapnislina 22.12.06
    starting to create attachment to mail
        TRY.
           CLEAR send_request .
    Create persistent send request
            send_request = cl_bcs=>create_persistent( ).
    Build the document
            document = cl_document_bcs=>create_document(
                                i_type    = lc_type  "RAW
                                i_text    = lt_text  "def of output type
                                i_length  = '12'
                                i_subject = lw_objdes ).
    Attached the document object
            CALL METHOD document->add_attachment
              EXPORTING
                i_attachment_type    = 'PDF'
                i_attachment_subject = lw_objdes "definition of output
    type
                i_attachment_size    = '12'
                i_att_content_hex    = lt_data.
    completed first part to attached PO (pdf format) as attachment
    Now attach the PO related attachments to the mail..
    .... need to read from table DRAD and get all the attachment per PO
         at run time
         REFRESH: lr_po_pr."lt_return.
            CLEAR:   lr_po_pr,lw_return.
            MOVE  'ICP'  TO  lr_po_pr.
         CLEAR: lw_object.
    completed second part for PO related attachments
    Now prepare to send mail
    Add document to send request
         CALL METHOD send_request->set_document( document ).
    Get sender object
         sender = cl_sapuser_bcs=>create( sy-uname ).
    Add sender
         CALL METHOD send_request->set_sender
           EXPORTING
             i_sender = sender.
         LOOP AT lt_recpt INTO lw_recpt
                          WHERE NOT smtp_addr IS INITIAL.
          recipient = cl_cam_address_bcs=>create_internet_address(
    lw_recpt ).
    Add recipient with its respective attributes to send request
            CALL METHOD send_request->add_recipient
              EXPORTING
                i_recipient = recipient
                i_express   = 'X'.
            CLEAR recipient.
         ENDLOOP.
    Send the document
        CALL METHOD send_request->send
          RECEIVING
            result              = sent_to_all.
    Catch any exception
          CATCH cx_bcs INTO bcs_exception.
              CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
                EXPORTING
                  msg_arbgb = bcs_exception->msgid
                  msg_nr    = bcs_exception->msgno
                  msg_ty    = bcs_exception->msgty
                  msg_v1    = bcs_exception->msgv1
                  msg_v2    = bcs_exception->msgv2
                  msg_v3    = bcs_exception->msgv3
                  msg_v4    = bcs_exception->msgv4
                EXCEPTIONS
                  OTHERS    = 1.
              p_retco = sy-subrc.
        ENDTRY.
      ENDIF.
      IF NOT result-tdfaxid  IS INITIAL OR                      " 422131
         NOT result-tdmailid IS INITIAL.                        " 422131
        CLEAR syst-msgv1.                                       " 422131
        IF NOT result-tdfaxid IS INITIAL.                       " 422131
          syst-msgv1 = result-tdfaxid.                          " 422131
        ELSEIF result-tdmailid IS INITIAL.                      " 422131
          syst-msgv1 = result-tdmailid.                         " 422131
        ENDIF.                                                  " 422131
        CALL FUNCTION 'NAST_PROTOCOL_UPDATE'                    " 422131
             EXPORTING                                          " 422131
                  msg_arbgb = 'VN'                              " 422131
                  msg_nr    = '095'                             " 422131
                  msg_ty    = 'I'                               " 422131
                  msg_v1    = syst-msgv1                        " 422131
             EXCEPTIONS                                         " 422131
                  OTHERS    = 1.                                " 422131
      ENDIF.                                                    " 422131
      IF result-userexit EQ 'C' OR
          result-userexit EQ 'E'.
        p_retco = '9'.
      ENDIF.
    ENDFORM.                               " ENDE
    end inserted
    Regards
    Nislina

    Hi Nislina,
    Could you please let me know how do you solve this issue.
    Code:
    if lt_binary[] is not initial.
    *     add attachment to document
             call method document->add_attachment
               exporting
                 i_attachment_type      = 'PDF'            
                 i_attachment_subject = 'My Attachment'
                 i_att_content_hex      = lt_binary.
      endif.
    Thanks & Regard's
    Sateesh

  • Problem in sending online interactive form in email as PDF attachment

    Hi,
    I am trying to send online intercative forms as PDF attachment once user fills it and click on send button. But this mail i am trying to send from SAP workflow. For this am using one function module which is accepting the pdfsource context attribute of binary type as Xstring. Once i run the webdynpro application i am getting mail in out look but when i open the attachment i am getting error file is damaged.
    Can you pls help me in solving this, Or any other way for doing the same.
    Here is the code i am using for triggering the RFC from WD
    Zsend_Mail_Attachment_Sev_Input mail = new Zsend_Mail_Attachment_Sev_Input();     
              //to capture the outplacement level entered in the form
              mail.setI_Out_Place_Level(wdContext.currentVn_severancedetailsElement().getVa_outplacement_level().getBytes());
         mail.setI_Bin_Data(wdContext.currentContextElement().getPdfSource());
         wdContext.nodeZsend_Mail_Attachment_Sev_Input().bind(mail);
         try
              wdContext.currentZsend_Mail_Attachment_Sev_InputElement().modelObject().execute();
              wdComponentAPI.getMessageManager().reportSuccess("Notification Sent Successfully.");
         catch (WDDynamicRFCExecuteException e)
              // TODO Auto-generated catch block
              wdComponentAPI.getMessageManager().reportSuccess(" This is inside the mail exception!!"+e);
              e.printStackTrace();
    Here is the function module code
    FUNCTION ZSEND_MAIL_ATTACHMENT_SEV.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_OUT_PLACE_LEVEL) TYPE  XSTRING OPTIONAL
    *"     VALUE(I_BIN_DATA) TYPE  XSTRING OPTIONAL
    *"  TABLES
    *"      T_V_BIN_DATA STRUCTURE  SOLISTI1
    *"      IT_MESSAGE STRUCTURE  SOLISTI1
    Data Declaration
      DATA: gd_cnt TYPE i,
            gd_sent_all(1) TYPE c,
            gd_error TYPE sy-subrc,
            tab_lines LIKE sy-tabix,
            v_subject(255) VALUE 'HI'.
    Structure Declaration
      DATA : BEGIN OF it_file OCCURS 0,
              row(255),
             END OF it_file.
      DATA : BEGIN OF i_split OCCURS 0,
      row(50),
      END OF i_split.
    DESCRIBE TABLE it_message LINES tab_lines.
    READ TABLE it_message INDEX tab_lines.
    Internal Table Declaration
      data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
      DATA : objbin LIKE SOLIX OCCURS 0 WITH HEADER LINE.
      DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
      data : wa_receiver like table of SOMLRECI1 with header line.
      data : it_receiver like table of SOMLRECI1 with header line.
      DATA :   gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
      REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
      CLEAR   : objbin, it_packing_list, wa_receiver, it_receivers.
    gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
    gd_doc_data-obj_langu = sy-langu.
    gd_doc_data-obj_name = 'SENDFILE'.
    gd_doc_data-obj_descr = v_subject.
    gd_doc_data-sensitivty = 'O'.
    APPEND GD_DOC_DATA.
    Appending The Internal Table it_packing_list
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'RAW'.
      it_packing_list-body_num = tab_lines.
      APPEND it_packing_list.
      move i_bin_data to t_v_bin_data.
    ********Add By Anuj
      APPEND t_v_bin_data.
    ********End Add By Anuj
      LOOP AT t_v_bin_data.
        MOVE t_v_bin_data TO objbin-line.
        APPEND objbin.
      ENDLOOP.
      CLEAR it_packing_list.
      DESCRIBE TABLE objbin LINES tab_lines.
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 1.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'PDF'.
      it_packing_list-body_num = tab_lines.
      it_packing_list-doc_size = tab_lines * 255.
      APPEND it_packing_list.
      wa_receiver-receiver = '[email protected]'.
      wa_receiver-rec_type = 'U'.
      wa_receiver-com_type = 'INT'.
      APPEND wa_receiver.
      move wa_receiver[] to it_receiver[].
      append it_receiver.
    *Appending The Internal Table it_receivers
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver to it_receiver.
    append it_receiver.
      Move wa_receiver[] to it_receivers[].
    Clear it_receivers.
      if i_OUT_PLACE_LEVEL NE 0.
    loop at it_receivers into wa_receiver.
       loop at it_receivers into wa_receiver.
    *Function Module To Post The Message To Externa Mail
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receivers
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        clear wa_receiver.
       endloop.
      elseif i_OUT_PLACE_LEVEL eq 0.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receiver
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        clear wa_receiver.
      endif.
    ENDFUNCTION.
    Regards
    Ravindra

    Hi,
    I am trying to send online intercative forms as PDF attachment once user fills it and click on send button. But this mail i am trying to send from SAP workflow. For this am using one function module which is accepting the pdfsource context attribute of binary type as Xstring. Once i run the webdynpro application i am getting mail in out look but when i open the attachment i am getting error file is damaged.
    Can you pls help me in solving this, Or any other way for doing the same.
    Here is the code i am using for triggering the RFC from WD
    Zsend_Mail_Attachment_Sev_Input mail = new Zsend_Mail_Attachment_Sev_Input();     
              //to capture the outplacement level entered in the form
              mail.setI_Out_Place_Level(wdContext.currentVn_severancedetailsElement().getVa_outplacement_level().getBytes());
         mail.setI_Bin_Data(wdContext.currentContextElement().getPdfSource());
         wdContext.nodeZsend_Mail_Attachment_Sev_Input().bind(mail);
         try
              wdContext.currentZsend_Mail_Attachment_Sev_InputElement().modelObject().execute();
              wdComponentAPI.getMessageManager().reportSuccess("Notification Sent Successfully.");
         catch (WDDynamicRFCExecuteException e)
              // TODO Auto-generated catch block
              wdComponentAPI.getMessageManager().reportSuccess(" This is inside the mail exception!!"+e);
              e.printStackTrace();
    Here is the function module code
    FUNCTION ZSEND_MAIL_ATTACHMENT_SEV.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_OUT_PLACE_LEVEL) TYPE  XSTRING OPTIONAL
    *"     VALUE(I_BIN_DATA) TYPE  XSTRING OPTIONAL
    *"  TABLES
    *"      T_V_BIN_DATA STRUCTURE  SOLISTI1
    *"      IT_MESSAGE STRUCTURE  SOLISTI1
    Data Declaration
      DATA: gd_cnt TYPE i,
            gd_sent_all(1) TYPE c,
            gd_error TYPE sy-subrc,
            tab_lines LIKE sy-tabix,
            v_subject(255) VALUE 'HI'.
    Structure Declaration
      DATA : BEGIN OF it_file OCCURS 0,
              row(255),
             END OF it_file.
      DATA : BEGIN OF i_split OCCURS 0,
      row(50),
      END OF i_split.
    DESCRIBE TABLE it_message LINES tab_lines.
    READ TABLE it_message INDEX tab_lines.
    Internal Table Declaration
      data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
      DATA : objbin LIKE SOLIX OCCURS 0 WITH HEADER LINE.
      DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
      data : wa_receiver like table of SOMLRECI1 with header line.
      data : it_receiver like table of SOMLRECI1 with header line.
      DATA :   gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
      REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
      CLEAR   : objbin, it_packing_list, wa_receiver, it_receivers.
    gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
    gd_doc_data-obj_langu = sy-langu.
    gd_doc_data-obj_name = 'SENDFILE'.
    gd_doc_data-obj_descr = v_subject.
    gd_doc_data-sensitivty = 'O'.
    APPEND GD_DOC_DATA.
    Appending The Internal Table it_packing_list
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'RAW'.
      it_packing_list-body_num = tab_lines.
      APPEND it_packing_list.
      move i_bin_data to t_v_bin_data.
    ********Add By Anuj
      APPEND t_v_bin_data.
    ********End Add By Anuj
      LOOP AT t_v_bin_data.
        MOVE t_v_bin_data TO objbin-line.
        APPEND objbin.
      ENDLOOP.
      CLEAR it_packing_list.
      DESCRIBE TABLE objbin LINES tab_lines.
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 1.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'PDF'.
      it_packing_list-body_num = tab_lines.
      it_packing_list-doc_size = tab_lines * 255.
      APPEND it_packing_list.
      wa_receiver-receiver = '[email protected]'.
      wa_receiver-rec_type = 'U'.
      wa_receiver-com_type = 'INT'.
      APPEND wa_receiver.
      move wa_receiver[] to it_receiver[].
      append it_receiver.
    *Appending The Internal Table it_receivers
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver to it_receiver.
    append it_receiver.
      Move wa_receiver[] to it_receivers[].
    Clear it_receivers.
      if i_OUT_PLACE_LEVEL NE 0.
    loop at it_receivers into wa_receiver.
       loop at it_receivers into wa_receiver.
    *Function Module To Post The Message To Externa Mail
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receivers
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        clear wa_receiver.
       endloop.
      elseif i_OUT_PLACE_LEVEL eq 0.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receiver
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        clear wa_receiver.
      endif.
    ENDFUNCTION.
    Regards
    Ravindra

  • In the mail app why can't I see single page pdf attachment created by SSRS R2 on iPad with iOS 8?

    We have reports that are generated using Sql Server Reporting Services 2008 R2 and are distributed to users by email as a PDF attachment.  This worked fine in iOS 7 but ever since users have updated to iOS 8 the single page PDF is missing even though it has the paper clip icon indicating there is an attachment with the email.  If the PDF is multiple pages then the PDF icon would appear but there seems to be a problem with the single page pdf that is embedded on the mail app in iOS 8.
    We've recreated this issue creating a test report and sent it to iPads that have iOS 7, iOS 8 using different models of iPads (2, 3, 4) and the ones that have iOS 7 work fine.  Only the ones that have iOS 8 have this issue.  Also tried changing the format of the file to a PNG, TIFF and again the same results on the iPads with iOS 7 display it correctly.  Another test we did was send the PDF to our personal email and open it on our home iPads we were not able to see the single page PDF on iOS 8.  Looking at the headers of the email I can see the that the Content-Type is multipart/mixed.  When the original is forwarded to oneself on the iPad the attachment is included but the Content-Type is application/ms-tnef.

    Can you check your email headers, I have also noticed this for reports that are generated using Sql Server Reporting Services 2008 R2. It could to be due to the Content-ID header I believe.
    As a single page attachment on iPad will try and display inline, the Content_ID header is possibly affecting this and showing a small blank square as the image instead. Although this isn't defined as inline within the Content-Disposition header and will appear as an attachment on Outlook.

  • Error while opening PDF attachment sent via mail

    Hi,
    I am attaching PDF file to PO in me22n and sending the same file as attachment in the mail to the vendor using class CL_BCS.
    The mail is sent to the vendor successfully and they are able to successfully open the PDF attachment. But in some cases the mail is successfully received but while opening the attachment it is giving the error as file is corrupted.
    Please help me to resolve this issue.
    Thanks and regards,
    Jayashree

    Hi,
    I would like to know what font type, you are using in the forms.
    Ideally it should be HELVETICA .
    If you are using any other font in your style/form,try changing it to HELVETICA & Test.
    Also Check the OTF data at the call of gen. FM,before converting it to PDF.
    Regds,
    AS
    Edited by: abheesawant on Oct 12, 2011 7:48 AM

  • Error message when opening pdf attachment in Outlook 2003

    I have several computers in my network running different version of Adobe Acrobat...Adobe 6.0 standard, Adobe 7.0 standard, Adobe 8.0 standard and pro, and Adobe 9.0 standard and pro. The problem I am having with a few of my end users is that when they receive an e-mail in Outlook 2003 with a pdf attachment from certain companies that we deal with in the insurance industry, they receive an error message saying they can not open the file...
    "Can't create file:XXXXXXXX.pdf. Right click on the folder you want to create the file in, and then click Properties on the shortcut menu to check permission for the folder."
    The strange part about this is they can forward the e-mail to another end user that may or may not be using the same version of Adobe as them, but the other end user has no problem opening and viewing the pdf attachment (also, if the company sending the e-mail sends the same e-mail to another end user who has no issues, they can open it with just fine) Now here is where it gets really strange... if the end user that can view the file saves the file to their hard drive, then sends it back as the same attachment in an e-mail back to the end user that could not open the file originally, now that end user can open and view the pdf attachment. I have three end users that this affecting and they each have a different version of Adobe Acrobat with all of the latest updates. I am stumped and searches so far have revealed no solutions...
    Any ideas?

    The can only open it on their machine if they save the pdf attachment after renaming it. All computers on the network have the latest Outlook 2003 updates, so it puzzles me that only three end users with the same version of Outlook 2003, with the same updates, are not able to view the attachment from Outlook, but the other users can. Also, why do those three end users have to rename the file if the save it to the their computer to be able to view it, but no one else has to. And, it is not every pdf attachment either, just some from certain people that send them an e-mail. Really puzzling issue that I need to get resolved...

  • ICloud lack of preferences and attachment issues

    I've been using iCloud mail for a few weeks after leaving Outlook/Hotmail due to problems. It seems like I've traded off one set is issues for another set with iCloud mail.
    There appears to be no preferences available at all to set up preferred body typefaces and styles, email signature (ie. setting sections in bold or italics), colours or anything like what I could do through Outlook. Even this forum box has more type settings, smileys and indent settings than iCloud
    More annoyingly, any pdfs I attach and send through iCloud mail more often get a renamed to something along the lines of 'ATT000046.pdf'. This creates real issues for me as a freelance designer reliant on jobs being sent to my clients which are precisely named. I cannot work out why some clients receive the correctly named file, and others receive an 'ATT........' one.
    Some files also change to .dat files (a Windows file!?) – this often happens when I zip several pdfs together.
    It's getting really frustrating having no great functionality and the attachment issues too, I'd say iCloud mail is worse than Outlook.
    Can anyone help?

    This has happened to me as well and it's making me seriously consider going back to gmail.  My pdf attachments are being received as .dat files.  Plus, just this morning a pdf that I received came over as a .dat file into my iCloud mailbox.  I forwarded the message to my gmail account and it was a perfect pdf that I opened.
    I got my Mac about a year ago (which I LOVE) and I decided to go all Apple all the time.  But
    -The iCloud email thing has so many quirks, like thei .dat file thing. 
    -The Apple maps aren't as good as the Google Maps app.  I was in NYC this weekend with the family and I tried to use both- Google just worked better (it hurts me to say that).
    -I know that iCloud for documents is the wave of the future (or so they say), but Dropbox just works so effortlessly for my document storage.
    -I know that iWoks is the future, but I can't collaborate with Pages-- my clients all need .doc files and I can't always export to a .doc file.  Sometimes Pages won't let me export, other times things like indentations are off. I got picked for the beta test of iWorks in the cloud and it's nice, but limited in functionality
    I'm wondering if I should be all Apple devices and go back to gmail/google maps/office.  I don't want to do that- I want to be all Apple...not sure what to do because this is driving me crazy. I'm thinking of waiting for iOS7 to come out and see how it works. I know that Apple Maps is being updated too.  Not sure.
    Sorry for the rant.

Maybe you are looking for

  • ITunes simply doesn't recognize either of my ipods

    Have had iTunes and multiple ipods - haven't synced either of my ipods in awhile, and when I plug either of them into the computer (which has always worked fine in the past), absolutely nothing happens. No error messages, no weirdness, nothing. The i

  • Safari/Windows Media Player problem.

    I have a bit of a problem at the moment with viewing video content on some sites - when I click the link/button/whatever this message appears - "Safari can't display content on this page Some content on this page requires an Internet plug-in that Saf

  • Preserving 'White' areas, but not backgrounds, in an image trace

    Hi there all I've got a little graphic that I'm working on at the moment. I am trying to trace it using the Image Trace feature in illustrator. Everything's hunky dory apart from the fact that the original graphic has a lot of white features on it th

  • How to Open Or read SQL Server log file .ldf

    Hi all, How to Open Or read SQL Server log file .ldf When ever we create database from sql server, it's create two file. (1) .mdf (2) .ldf. I want to see what's available inside the .ldf file. Thanks, Ashok

  • License question EP Rapid Assembler

    Hi, i've installed EP with Rapid Assembler (EP 6.0 SP2) and Oracle SID POR. The License Information inside the portal shows "System ID E00". I know that the Rapid Assembler images are setup with E00 but they should have been changed to POR during ins