Attach picture in SAPSCRIPT form

Hi, do anyone know how to attach picture in SAPSCRIPT form?
Pls guide step by step or provide code example .
Thanks.

If I want to attach graphic/pic dynamically to Vendor in RFQ (Request for Quotation) print form, how to attach?
FYI, I develop RFQ in sapscript form.
Thanks.

Similar Messages

  • Corrupt file attachment when sending sapscript form by mail

    i have requirment to send sapscript through mail but when open my attachment it is giving file is corrupted.let me know where i am wrong
    i am specifying the code here
    CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         format                      = 'PDF'
    *     MAX_LINEWIDTH               = 132
    *     ARCHIVE_INDEX               = ' '
    *     COPYNUMBER                  = 0
    *     ASCII_BIDI_VIS2LOG          = ' '
    *     PDF_DELETE_OTFTAB           = ' '
    *     PDF_USERNAME                = ' '
       IMPORTING
         bin_filesize                = binfilesize
    *     BIN_FILE                    =
        TABLES
          otf                         = datab[]
          lines                       = pdftab[]
       EXCEPTIONS
         ERR_MAX_LINEWIDTH           = 1
         ERR_FORMAT                  = 2
         ERR_CONV_NOT_POSSIBLE       = 3
         ERR_BAD_OTF                 = 4
         OTHERS                      = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH it_pdf[].
      CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
        EXPORTING
          line_width_dst              = '255'
        TABLES
          content_in                  = pdftab[]
          content_out                 = it_pdf[]
        EXCEPTIONS
          err_line_width_src_too_long = 1
          err_line_width_dst_too_long = 2
          err_conv_failed             = 3
          OTHERS                      = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        "Subject of the mail.
        w_document_data-obj_name  = 'MAIL_TO_HEAD'.
        w_document_data-obj_descr = 'Regarding Mail Program by SAP ABAP'.
        "Body of the mail
        w_body_msg = 'This is body of mail msg.'.
        APPEND w_body_msg TO i_body_msg.
        CLEAR  w_body_msg.
        "Write Packing List for Body
        DESCRIBE TABLE i_body_msg LINES g_tab_lines.
        w_packing_list-head_start = 1.
        w_packing_list-head_num   = 0.
        w_packing_list-body_start = 1.
        w_packing_list-body_num   = g_tab_lines.
        w_packing_list-doc_type   = 'RAW'.
        APPEND w_packing_list TO i_packing_list.
        CLEAR  w_packing_list.
        "Write Packing List for Attachment
        w_packing_list-transf_bin = 'X'.
        w_packing_list-head_start = 1.
        w_packing_list-head_num   = 0.
        w_packing_list-body_start = 1.
        DESCRIBE TABLE it_pdf LINES w_packing_list-body_num.
        w_packing_list-doc_type   = 'PDF'.
        w_packing_list-obj_descr  = 'PDF Attachment'.
        w_packing_list-obj_name   = 'PDF_ATTACHMENT'.
        w_packing_list-doc_size   = w_packing_list-body_num * 255.
        APPEND w_packing_list TO i_packing_list.
        CLEAR  w_packing_list.
        "Fill the document data and get size of attachment
        w_document_data-obj_langu  = sy-langu.
        READ TABLE i_body_msg INTO w_body_msg INDEX g_tab_lines.
        w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_body_msg ).
        "Receivers List.
        w_receivers-rec_type   = 'U'."Internet address
        w_receivers-receiver   = p_mail.
        w_receivers-com_type   = 'INT'.
        w_receivers-notif_del  = 'X'.
        w_receivers-notif_ndel = 'X'.
        APPEND w_receivers TO i_receivers .
        CLEAR:w_receivers.
        "Function module to send mail to Recipients
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = w_document_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          IMPORTING
            sent_to_all                = g_sent_to_all
          TABLES
            packing_list               = i_packing_list
            contents_bin               = it_pdf
            contents_txt               = i_body_msg
            receivers                  = i_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.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          MESSAGE 'Mail Successfully Sent' type 'S'.
        ENDIF.
    Edited by: sam_ins123524 on Oct 8, 2010 9:31 AM
    Edited by: sam_ins123524 on Oct 8, 2010 9:33 AM
    Moderator message: subject corrected for you, please use a more descriptive one next time, also use code tags.
    Edited by: Thomas Zloch on Oct 8, 2010 10:51 AM

    Hi,
    Once you get otf data, Use FM 'SX_OBJECT_CONVERT_OTF_PDF' to convert it to PDF. Then use CONTENT_BIN to send mail.
    Refer below code:
    * Converting OTF data to single line
      LOOP AT I_OTF INTO WA_OTF.
        CONCATENATE WA_OTF-TDPRINTCOM WA_OTF-TDPRINTPAR INTO WA_PDF.
        MOVE WA_PDF TO WA_CONTENT_TXT.
        APPEND WA_CONTENT_TXT TO I_CONTENT_TXT.
        CLEAR: WA_CONTENT_TXT.
      ENDLOOP.
    * Converting to PDF Format
      CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
        EXPORTING
          FORMAT_SRC      = C_OTF
          FORMAT_DST      = C_PDF
          DEVTYPE         = C_PRINTER
        CHANGING
          TRANSFER_BIN    = WA_TRANSFER_BIN
          CONTENT_TXT     = I_CONTENT_TXT
          CONTENT_BIN     = I_CONTENT_BIN
          OBJHEAD         = WA_OBJHEAD
          LEN             = V_LEN_IN.
    *- Send mail
        CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
          EXPORTING
            DOCUMENT_DATA                    = L_WA_DOCUMENT_DATA
          TABLES
            OBJECT_CONTENT                   = I_CONTENT_BIN
            RECEIVERS                        = L_I_RECEIVERS.

  • Is it possible to attach photos to a form prior to submission?  For example, if I have an employee in the field completing a property inspection, can photos of the property be submitted along with the form?

    I have to inspect properties for my business and have created a form that describes the condition of the property.  This form is great for my agents in the field, however, it would be really great if they could attach photos of the property to accompany the submission.  Is this possible?  Can it be considered on the wish list?

    Hi,
    Yes, you can create a file attachment field in the form and have your employee upload the pictures.
    Thanks,
    Wenlan

  • Include PDF file in a SAPscript Form

    Here is a good one.  Anyone ever heard of this.  I need to somehow import a PDF file into an ABAP program and include it in a sapscript form. 
    Requirment:
    Customer sends a PDF file to our system. We need to take this PDF file and include into a "quote" sapscript form and fax it back to the customer.
    If anyone has any other ideas of how I can accomplish this task........PLEASE let me know.  Thanks.
    Regards,
    Rich Heilman

    i solved a similiar problem by following:
    - catch the sapsript-data in otf-format by setting
      itcpo-tdgetotf = 'X' at CALL FUNCTION 'OPEN_FORM'
    - read the pdf-file from it's source
      (i.e. content server)in an internal table
    - send the fax with function-module SO_DOCUMENT_SEND_API1.
      at least in 4.6c you can add attachements to the fax.
      the fax-body is the otf, the attachements are
      the pdf-files.
    i suppose that your fax-software is able to send the pdf-attachements.
    here is some coding i copied from my program. i simplified it to show the main steps, so it won't run immediatly. the form assumes that the otf is filled in table ZT_OTFDATE, the pdf in ZT_PDFDATA and the PDF-filesize is in Z_PDFSIZE.
    *&      Form  FAX
    FORM fax CHANGING pe_subrc.
      DATA
      : ls_docdata TYPE sodocchgi1
      , ls_sadrfd  TYPE sadrfd
      , l_len TYPE i
      , lt_packlist TYPE TABLE OF sopcklsti1 WITH HEADER LINE
      , lt_head TYPE TABLE OF solisti1 WITH HEADER LINE
      , lt_text TYPE TABLE OF solisti1 WITH HEADER LINE
      , lt_bin  TYPE TABLE OF solisti1 WITH HEADER LINE
      , lt_recv TYPE TABLE OF somlreci1 WITH HEADER LINE
      , l_lines TYPE i
    OTF-Body
      CLEAR lt_packlist.
      DESCRIBE TABLE zt_otfdata LINES l_lines.
      lt_packlist-transf_bin = 'X'.
      lt_packlist-head_start = 1.
      lt_packlist-head_num   = 1.
      lt_packlist-doc_type   = 'OTF'.
      lt_packlist-obj_name   = 'Letter'.
      lt_packlist-obj_descr  = 'Letter'.
      lt_packlist-body_start = 1.
      lt_packlist-body_num   = l_lines.
      lt_packlist-doc_size   = lt_packlist-body_num * 255.
      APPEND lt_packlist.
      APPEND tnapr-fonam TO lt_head.
      APPEND LINES OF zt_otfdata TO lt_bin.
    Attachement
      CLEAR lt_packlist.
      lt_packlist-transf_bin = 'X'.
      lt_packlist-doc_type   = 'PDF'.
      lt_packlist-obj_name   = 'filename'.
      lt_packlist-obj_descr  = 'a filedescription'.
      lt_packlist-head_start = 2.
      lt_packlist-head_num   = 1.
      DESCRIBE TABLE lt_bin LINES l_lines.
      lt_packlist-body_start = l_lines + 1.
      DESCRIBE TABLE zt_PDFDATA LINES l_lines.
      lt_packlist-body_num   = l_lines.
      lt_packlist-doc_size   = Z_PDFSIZE.
      APPEND lt_packlist.
      APPEND 'filename' TO lt_head.
      APPEND LINES OF zt_pdfdata TO lt_bin.
    Receiver
      ls_sadrfd-rec_state = itcpo-tdteleland.
      ls_sadrfd-rec_fax   = itcpo-tdtelenum.
      lt_recv-receiver     = ls_sadrfd.
      lt_recv-rec_type     = 'F'.     " F=FAX U=Email
      APPEND lt_recv.
    DOCUMENT HEADER
      CLEAR ls_docdata.
      ls_docdata-obj_name    = 'fax name'
      ls_docdata-obj_descr   = 'fax description'.
      ls_docdata-obj_langu   = sy-langu.
      ls_docdata-obj_sort    = sy-datum.
      ls_docdata-obj_expdat  = sy-datum + 7.
      ls_docdata-sensitivty  = 'O'.
      ls_docdata-obj_prio    = '1'.
    ls_docdata-NO_CHANGE   = ''.
      ls_docdata-priority    = ls_docdata-obj_prio.
      ls_docdata-expiry_dat  = ls_docdata-obj_expdat.
    ls_docdata-PROC_TYPE   = ''.
    ls_docdata-PROC_NAME   = ''.
    ls_docdata-PROC_SYST   = ''.
    ls_docdata-PROC_CLINT  = ''.
    ls_docdata-SKIP_SCREN  = ''.
    ls_docdata-TO_DO_OUT   = ''.
    ls_docdata-FREE_DEL    = ''.
      ls_docdata-doc_size    = l_len.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data                    = ls_docdata
        PUT_IN_OUTBOX                    = ' '
        SENDER_ADDRESS                   = SY-UNAME
        SENDER_ADDRESS_TYPE              = 'B'
      IMPORTING
        SENT_TO_ALL                      =
        NEW_OBJECT_ID                    =
        SENDER_ID                        =
        TABLES
          packing_list                     = lt_packlist
          object_header                    = lt_head
          contents_bin                     = lt_bin
          contents_txt                     = lt_text
        CONTENTS_HEX                     =
        OBJECT_PARA                      =
        OBJECT_PARB                      =
          receivers                        = lt_recv
        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.
        pe_subrc = sy-subrc.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.

  • How Sapscript form can be send by mail

    Hello all,
    I want to send a Sapscript form by mail.
    I think it should first be converted to PDF form and than need to be send by mail.
    I have created a z form which is a copy of standard for medruck and also have changed the standard program SAPFM06P. So I need to add functionality in z program so that i can send the sapscript form by mail.
    Can any body let me know the complete process how can i do it?
    Thanks

    Hi,
    Just follow the below code . I am giving the code which starts from OPEN_FORM. After that one submit program is there u can see the code.
    *&      Form  display_layout
          text
    -->  p1        text
    <--  p2        text
    FORM display_layout.
      CALL FUNCTION 'OPEN_FORM'
       EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
         device                            = 'PRINTER'
      DIALOG                            = 'X'
         form                              = 'YFIL_DUNN_01'
      LANGUAGE                          = SY-LANGU
       options                           = itcpo
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
       EXCEPTIONS
         canceled                          = 1
         device                            = 2
         form                              = 3
         options                           = 4
         unclosed                          = 5
         mail_options                      = 6
         archive_error                     = 7
         invalid_fax_number                = 8
         more_params_needed_in_batch       = 9
         spool_error                       = 10
         OTHERS                            = 11
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT i_tab INTO wa_tab.
        CALL FUNCTION 'WRITE_FORM'
         EXPORTING
           element                     = '531'
      FUNCTION                       = 'SET'
      TYPE                           = 'BODY'
           window                      = 'MAIN'
    IMPORTING
       pending_lines                  = wa_tab.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'CLOSE_FORM'
       IMPORTING
         result                         = itcpp
        RDI_RESULT                     =
      TABLES
        OTFDATA                        =
         EXCEPTIONS
           unopened                       = 1
           bad_pageformat_for_print       = 2
           send_error                     = 3
           spool_error                    = 4
           OTHERS                         = 5.
      IF sy-subrc = 0.
        IF ( itcpp-userexit IS INITIAL AND
            NOT itcpp-tdspoolid IS INITIAL ).
          p_spool = itcpp-tdspoolid.
          SUBMIT yfir_mailsend_pdf_attachment WITH p_spool = p_spool
                                              WITH p_kunnr = p_kunnr.
        ENDIF.
      ENDIF.
    ENDFORM.                    " display_layout
    *&      Form  modify_duedate
          text
    -->  p1        text
    <--  p2        text
    FORM modify_duedate.
      SELECT SINGLE mat_rec_no
                    mat_rec_date FROM yfi_matno
                    INTO (v_mat_rec_no, v_mat_rec_date)
                    WHERE vbeln = wa_tab-vbeln.
      CHECK sy-subrc EQ 0.
      SELECT SINGLE zterm
                    FROM vbrk INTO  v_zterm
                    WHERE vbeln EQ wa_tab-vbeln.
      CHECK sy-subrc EQ 0.
      SELECT SINGLE zdays
                    FROM yfi_payment INTO v_zdays
                    WHERE zterm EQ v_zterm.
      IF sy-subrc EQ 0.
        wa_tab-zfbdt_due = ( v_mat_rec_date + v_zdays ).
        wa_tab-due_days = ( sy-datum - wa_tab-zfbdt_due ).
       IF wa_tab-due_days LE 0.
         wa_tab-due_days = 'N/A'.
       ENDIF.
        IF ( wa_tab-umskz = 'A' AND wa_tab-shkzg = 'H' ).
          wa_tab-zfbdt = ' '.
          wa_tab-zfbdt_due = ''.
          wa_tab-due_days = ''.
        ENDIF.
        MODIFY i_tab FROM wa_tab INDEX sy-tabix.
        CLEAR: v_mat_rec_no, v_mat_rec_date, v_zterm, v_zdays.
      ENDIF.
    ENDFORM.                    " modify_duedate
    SUBMIT PROGRAM :
    REPORT yfir_mailsend_pdf_attachment MESSAGE-ID yf.
    *& Program Name   : *
    & Author         :
    *& Creation Date  : *
    *& Program Type   :                                                   *
    *& SAP Release    : *
    *& Description    :     *
    *& Transport No   :                                                   *
    *& Transaction    :                                                   *
    *&  Send document with OTF/ALI attachment from spool to externalreci-
    *&  pient. OTF/ALI document is converted to PDF/HTML format duringthe
    *&  SAPconnect send process.
    *&  This report serves as example documentation for the function
    *&  modules SO_NEW_DOCUMENT_ATT_SEND_API1 and SO_DOCUMENT_SEND_API1.
    *&  Following this example you should be able to develop your own
    *&  report to send documents with all kinds of attachments.
    Creation of the entry for the compressed document
    *& TABLES:
    TABLES : kna1,
            adr6.
    *& INTERNAL TABLES:
    ***********PDF Declaration*******
    DATA: BEGIN OF i_spool OCCURS 0,
            rqident  LIKE tsp01-rqident,
            rqo1name LIKE tsp01-rqo1name,
            rqclient LIKE tsp01-rqclient,
          END   OF i_spool.
    *& VARIABLES :
    DATA: client LIKE tst01-dclient,
          name LIKE tst01-dname,
          objtype LIKE rststype-type,
          type LIKE rststype-type.
    DATA: spoolno LIKE tsp01-rqident,
         download TYPE c VALUE 'X', "AS CHECKBOX DEFAULT 'X',
         p_file LIKE rlgrap-filename
                         VALUE 'C:\Invoice.pdf',               "#EC NOTEXT
          otf LIKE itcoo OCCURS 100 WITH HEADER LINE,
         cancel,
          pdf LIKE tline OCCURS 100 WITH HEADER LINE,
          doctab LIKE docs OCCURS 1 WITH HEADER LINE,
          numbytes TYPE i,
          arc_idx LIKE toa_dara,
          pdfspoolid LIKE tsp01-rqident,
          jobname LIKE tbtcjob-jobname,
          jobcount LIKE tbtcjob-jobcount,
          is_otf.
    Data Declaration
    DATA: docdata    LIKE sodocchgi1,
          objpack    LIKE sopcklsti1 OCCURS  1 WITH HEADER LINE,
          objhead    LIKE solisti1   OCCURS  1 WITH HEADER LINE,
          objtxt     LIKE solisti1   OCCURS 10 WITH HEADER LINE,
          objbin     LIKE solisti1   OCCURS 10 WITH HEADER LINE,
          objhex     LIKE solix      OCCURS 10 WITH HEADER LINE,
          reclist    LIKE somlreci1  OCCURS  1 WITH HEADER LINE.
    *objpack-head_start = 1.
    *objbin = '  |  '. APPEND objbin.
    *DATA: listobject LIKE abaplist   OCCURS  1 WITH HEADER LINE.
    DATA: tab_lines  TYPE i,
          doc_size   TYPE i,
          att_type   LIKE soodk-objtp.
    objpack-head_start = 1.
    *& PARAMETERS:
    PARAMETERS : p_spool LIKE tsp01-rqident NO-DISPLAY,
                 p_kunnr LIKE kna1-kunnr NO-DISPLAY.
    *& M A I N   P R O C E S S
    *& START OF SELECTION.
    START-OF-SELECTION.
      SELECT SINGLE
      adr6~addrnumber
      adr6~smtp_addr
      FROM adr6
      INNER JOIN kna1
      ON kna1~adrnr = adr6~addrnumber
      INTO CORRESPONDING FIELDS OF adr6
      WHERE kna1~kunnr = p_kunnr.
      IF sy-subrc = 0.
    Create receiver list
        reclist-receiver = adr6-smtp_addr. "<-- customer address
        reclist-rec_type = 'U'.
        APPEND reclist.
      ENDIF.
    ***Convert Spool request to PDF
      PERFORM pdf_convert.
      docdata-obj_name  = 'MAIL_AEIW'.
      docdata-obj_descr = 'Dunning'.
      Main Text
      objtxt = 'Hi,'.
      APPEND objtxt.
      objtxt = 'Dunning'.
      APPEND objtxt.
      objtxt = 'Regards'.
      APPEND objtxt.
      Write Packing List (Main)
      DESCRIBE TABLE objtxt LINES tab_lines.
      READ     TABLE objtxt INDEX tab_lines.
      docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
      CLEAR objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num   = 0.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = 'RAW'.
      APPEND objpack.
    Create Message Attachment
      Write Packing List (Attachment)
      att_type = 'PDF'.
      DESCRIBE TABLE objbin LINES tab_lines.
      READ     TABLE objbin INDEX tab_lines.
    *objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
      objpack-doc_size = tab_lines * 255.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num   = 1.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = att_type.
      objpack-obj_name   = 'ATTACHMENT'.
      objpack-obj_descr  = 'Attached Document'.
      APPEND objpack.
    *check for not maintaining customer address
      IF reclist IS INITIAL.
        MESSAGE e000 WITH 'Please Maintain Customer e-Mail ID'.
        LEAVE LIST-PROCESSING.
      ELSE.
    Send Message
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data                     = docdata
             put_in_outbox                     = 'X'
        commit_work                       = 'X'     "used from rel.6.10
      IMPORTING
        SENT_TO_ALL                        =
        NEW_OBJECT_ID                     =
          TABLES
            packing_list                      = objpack
            object_header                     = objhead
            contents_bin                      = objbin
            contents_txt                      = objtxt
        CONTENTS_HEX                      = objhex
        OBJECT_PARA                        =
        OBJECT_PARB                        =
            receivers                         = 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.
          MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
                  WITH docdata-obj_name.
        ELSE.
          WRITE 'Mail sent successfully'.
        ENDIF.
      ENDIF.
      WRITE: / 'End of Program'.
    *&      Form  pdf_convert
          text
    -->  p1        text
    <--  p2        text
    FORM pdf_convert.
      DATA: date1   LIKE sy-datum,
            time1   LIKE sy-uzeit,
            period1 LIKE tsp01-rqcretime.
      date1 = sy-datum.
      time1 = sy-uzeit.
      date1 = date1 - 1.
      CONCATENATE date1 time1 INTO period1.
      SELECT rqident
             rqo1name
             rqclient FROM tsp01 INTO TABLE i_spool
                            WHERE rqowner   = sy-uname AND
                                  rqclient  = sy-mandt AND
                                  rqident   = p_spool.
      IF sy-subrc <> 0.
        WRITE: / 'No Spool Request created today'(003)
                COLOR COL_NEGATIVE.
        EXIT.
      ENDIF.
      SORT i_spool DESCENDING BY rqident.
      READ TABLE i_spool INDEX 1.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                authority     = 'SP01'
                client        = i_spool-rqclient
                name          = i_spool-rqo1name
                part          = 1
             IMPORTING
              CHARCO        =
              CREATER       =
              CREDATE       =
              DELDATE       =
              MAX_CREDATE   =
              MAX_DELDATE   =
              NON_UNIQ      =
              NOOF_PARTS    =
              RECTYP        =
              SIZE          =
              STOTYP        =
                  type          = type
                  objtype       = objtype
             EXCEPTIONS
                  fb_error      = 1
                  fb_rsts_other = 2
                  no_object     = 3
                  no_permission = 4.
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid                    = i_spool-rqident
            no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
          IMPORTING
            pdf_bytecount                  = numbytes
            pdf_spoolid                    = pdfspoolid
          OTF_PAGECOUNT                  =
            btc_jobname                    = jobname
            btc_jobcount                   = jobcount
          TABLES
            pdf                            = pdf
          EXCEPTIONS
            err_no_otf_spooljob            = 1
            err_no_spooljob                = 2
            err_no_permission              = 3
            err_conv_not_possible          = 4
            err_bad_dstdevice              = 5
            user_cancelled                 = 6
            err_spoolerror                 = 7
            err_temseerror                 = 8
            err_btcjob_open_failed         = 9
            err_btcjob_submit_failed       = 10
            err_btcjob_close_failed        = 11.
      CASE sy-subrc.
        WHEN 0.
        WHEN 1.
          WRITE: / 'Error On Spool Job'(002)
                COLOR COL_NEGATIVE.
          EXIT.
        WHEN 2.
          WRITE: / 'No Permission'(003)
                COLOR COL_NEGATIVE.
          EXIT.
        WHEN 3.
          WRITE: / 'Conversion Not Possible'(004)
                COLOR COL_NEGATIVE.
          EXIT.
        WHEN OTHERS.
          WRITE: / 'Incorrect Destination Device'(005)
                    COLOR COL_NEGATIVE.
          EXIT.
      ENDCASE.
      CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
           EXPORTING
                line_width_src              = 134
                line_width_dst              = 255
           TABLES
                content_in                  = pdf
                content_out                 = objbin
           EXCEPTIONS
                err_line_width_src_too_long = 1
                err_line_width_dst_too_long = 2
                err_conv_failed             = 3
                OTHERS                      = 4.
    ENDFORM.                    " pdf_convert

  • Sending sapscript form to an external mail

    i need to send sapscript form to an external mail like for example a yahoo mail from SAP. i need an ABAP code that performs this function. its urgent, please

    1) REPORT PROGRAM  - RSTXPDFT4 ,
    FIRST GENERATE SPOOL REQUEST THEN DOWNLOAD SAPSCRIPT TO PDF FILE ON LOCAL PC.
    2) copy this code to send this downloaded form to external mail -
    *& Report  ZGILL_SENDMAIL_PDF                                          *
    REPORT  ZGILL_SENDMAIL_PDF                      .
    INCLUDE ZGILL_INCMAIL.  "SEE BELOW FOR INCLUDE PROGRAM CODE.
    * DATA
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    data : path like PCFILE-PATH.
    data : extension(5) type c.
    data : name(100) type c.
    * SELECTION SCREEN
    PARAMETERS : receiver TYPE somlreci1-receiver lower case DEFAULT '[email protected]'.
    PARAMETERS : p_file LIKE rlgrap-filename
    OBLIGATORY DEFAULT 'C:TEMPSALARY_SLIP1.PDF'.
    * AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR p_file.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    file_name = p_file.
    * START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM ml_customize USING 'Tst' 'Testing'.
    PERFORM ml_addrecp USING receiver 'U'.
    PERFORM upl.
    PERFORM doconv TABLES itab objbin.
    PERFORM ml_prepare USING 'X' extension name.
    PERFORM ml_dosend.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    * FORM
    FORM upl.
    file_name = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_name
    filetype = 'BIN'
    TABLES
    data_tab = itab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    path = file_name.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    * CHECK_DOS_FORMAT =
    IMPORTING
    * DRIVE =
    EXTENSION = extension
    NAME = name
    * NAME_WITH_EXT =
    * PATH =
    EXCEPTIONS
    INVALID_DRIVE = 1
    INVALID_EXTENSION = 2
    INVALID_NAME = 3
    INVALID_PATH = 4
    OTHERS = 5
    ENDFORM. "upl
    **********************iNCLUDE pROGRAM*********************************************
    *&  Include           ZGILL_INCMAIL                                    *
    * Data
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    * FORM
    FORM ml_customize USING objname objdesc.
    *----------- Clear Variables
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    *--------- Set Variables
    docdata-obj_name = objname.
    docdata-obj_descr = objdesc.
    ENDFORM. "ml_customize
    * FORM
    FORM ml_addrecp USING preceiver prec_type.
    CLEAR reclist.
    reclist-receiver = preceiver.
    reclist-rec_type = prec_type.
    APPEND reclist.
    ENDFORM. "ml_customize
    * FORM
    FORM ml_addtxt USING ptxt.
    CLEAR objtxt.
    objtxt = ptxt.
    APPEND objtxt.
    ENDFORM. "ml_customize
    * FORM
    FORM ml_prepare USING bypassmemory whatatt_type whatname.
    IF bypassmemory = ''.
    *--------- Fetch List From Memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listobject
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'LIST_FROM_MEMORY'.
    ENDIF.
    CALL FUNCTION 'TABLE_COMPRESS'
    * IMPORTING
    * COMPRESSED_SIZE =
    TABLES
    in = listobject
    out = objbin
    EXCEPTIONS
    OTHERS = 1
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'TABLE_COMPRESS'.
    ENDIF.
    ENDIF.
    * Header Data
    * Already Done Thru FM
    * Main Text
    * Already Done Thru FM
    * Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    * Packing Info Attachment
    att_type = whatatt_type..
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = whatname.
    APPEND objpack.
    * Receiver List
    * Already done thru fm
    ENDFORM. "ml_prepare
    * FORM
    FORM ml_dosend.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    * IMPORTING
    * SENT_TO_ALL =
    * NEW_OBJECT_ID =
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    * CONTENTS_HEX = objhex
    * OBJECT_PARA =
    * object_parb =
    receivers = 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.
    MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    ENDFORM. "ml_customize
    * FORM
    FORM ml_spooltopdf USING whatspoolid.
    DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    *-------------- Call Function
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = whatspoolid
    TABLES
    pdf = pdf
    EXCEPTIONS
    err_no_otf_spooljob = 1
    OTHERS = 12.
    *------------- Convert
    PERFORM doconv TABLES pdf objbin.
    ENDFORM. "ml_spooltopdf
    * FORM
    FORM doconv TABLES
    mypdf STRUCTURE tline
    outbin STRUCTURE solisti1.
    *-------- Data
    DATA : pos TYPE i.
    DATA : len TYPE i.
    *------------ Loop And Put Data
    LOOP AT mypdf.
    pos = 255 - len.
    IF pos > 134. "length of pdf_table
    pos = 134.
    ENDIF.
    outbin+len = mypdf(pos).
    len = len + pos.
    IF len = 255. "length of out (contents_bin)
    APPEND outbin.
    CLEAR: outbin, len.
    IF pos < 134.
    outbin = mypdf+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND outbin.
    ENDIF.
    ENDFORM. "doconv
    ***********************INCLUDE END*********************************

  • Sending sapscript form through Email

    Hi,
         I modifyed a std sapscript form for customer statement and that output i want to send to the customer through Email.So now i need a help for further what are the steps need to be do for sending that form by email.Pls be in details so that for me easy to solve this.
    Thanks,
    Rajendra.

    Hi ,
        I  am using the below code to send the form output by mail but it is not working for me.pls correct my code where i want to change so that i can solve my issues.
    DATA: itcpo LIKE itcpo,
    tab_lines LIKE sy-tabix.
    Variables for EMAIL functionality
    DATA: maildata LIKE sodocchgi1.
    DATA: mailpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: mailbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.
    DATA: solisti1 LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    parameter: p_email1 like somlreci1-receiver .
    PERFORM send_form_via_email.
    FORM SEND_FORM_VIA_EMAIL *
    FORM send_form_via_email.
    CLEAR: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
    REFRESH: mailtxt, mailbin, mailpack, mailhead, mailrec.
    Creation of the document to be sent File Name
    maildata-obj_name = 'TEST'.
    Mail Subject
    maildata-obj_descr = 'Subject'.
    Mail Contents
    mailtxt-line = 'Here is your file'.
    APPEND mailtxt.
    Prepare Packing List
    PERFORM prepare_packing_list.
    Set recipient - email address here!!!
    mailrec-receiver =  p_email1.
    mailrec-rec_type = 'U'.
    APPEND mailrec.
    Sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = maildata
    put_in_outbox = ' '
    TABLES
    packing_list = mailpack
    object_header = mailhead
    contents_bin = mailbin
    contents_txt = mailtxt
    receivers = mailrec
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    operation_no_authorization = 4
    OTHERS = 99.
    ENDFORM.
    Form PREPARE_PACKING_LIST
    FORM prepare_packing_list.
    CLEAR: mailpack, mailbin, mailhead.
    REFRESH: mailpack, mailbin, mailhead.
    DESCRIBE TABLE mailtxt LINES tab_lines.
    READ TABLE mailtxt INDEX tab_lines.
    maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
    Creation of the entry for the compressed document
    CLEAR mailpack-transf_bin.
    mailpack-head_start = 1.
    mailpack-head_num = 0.
    mailpack-body_start = 1.
    mailpack-body_num = tab_lines.
    mailpack-doc_type = 'RAW'.
    APPEND mailpack.
    Creation of the document attachment
    This form gets the OTF code from the SAPscript form.
    If you already have your OTF code, I believe that you may
    be able to skip this form. just do the following code, looping thru
    your SOLISTI1 and updating MAILBIN.
    PERFORM get_otf_code.
    LOOP AT solisti1.
    MOVE-CORRESPONDING solisti1 TO mailbin.
    APPEND mailbin.
    ENDLOOP.
    DESCRIBE TABLE mailbin LINES tab_lines.
    mailhead = 'TEST.OTF'.
    APPEND mailhead.
    Creation of the entry for the compressed attachment
    mailpack-transf_bin = 'X'.
    mailpack-head_start = 1.
    mailpack-head_num = 1.
    mailpack-body_start = 1.
    mailpack-body_num = tab_lines.
    mailpack-doc_type = 'OTF'.
    mailpack-obj_name = 'TEST'.
    mailpack-obj_descr = 'Subject'.
    mailpack-doc_size = tab_lines * 255.
    APPEND mailpack.
    ENDFORM.
    Form GET_OTF_CODE
    FORM get_otf_code.
    DATA: BEGIN OF otf OCCURS 0.
    INCLUDE STRUCTURE itcoo .
    DATA: END OF otf.
    DATA: itcpo LIKE itcpo.
    DATA: itcpp LIKE itcpp.
    CLEAR itcpo.
    itcpo-tdgetotf = 'X'.
    Start writing OTF code
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    form = 'Z2006FICSE'
    language = sy-langu
    options = itcpo
    dialog = ' '
    EXCEPTIONS
    OTHERS = 1.
    CALL FUNCTION 'START_FORM'
    EXCEPTIONS
    error_message = 01
    OTHERS = 02.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    window = 'MAIN'
    EXCEPTIONS
    error_message = 01
    OTHERS = 02.
    Close up Form and get OTF code
    CALL FUNCTION 'END_FORM'
    EXCEPTIONS
    error_message = 01
    OTHERS = 02.
    MOVE-CORRESPONDING itcpo TO itcpp.
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
    result = itcpp
    TABLES
    otfdata = otf
    EXCEPTIONS
    OTHERS = 1.
    Move OTF code to structure SOLI form email
    CLEAR solisti1. REFRESH solisti1.
    LOOP AT otf.
    solisti1-line = otf.
    APPEND solisti1.
    ENDLOOP.
    ENDFORM.
       Hope i can expect the feedback soon from you guys.
    Thanks,
    Rajendra.

  • Email a SAPScript Form

    Hi All,
    Is it possible to send a Sapscript form or a smartform form as an email,
    We need to be able to email out the form using a function Module.
    Even if we are able to send it as an attachment , it should be fine,
    Did not find any function Module that would do this.
    Appreciate any input.,
    Thank you
    Lalitha

    it is possible in both smartforms and scrits
    For Scripts
    Retrieve the OTF table from the FM CLOSE_FORM then , convert OTF to PDF using FM 'SX_OBJECT_CONVERT_OTF_PDF' then I attach and send mail with 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    For smartform check this link
    Create Smartform and Email it

  • SAPScript form an rogram for  "Invoice for Payment"

    Hi Friends,
               Please tell me the Program Name and  SAPScript form name for following condition -
    <b>
    Customer service receives the order from the customer and place the order (document "Invoce for payment"). </b>
    Thanks & Regards
    Kishor

    If you want to change the standard script format, then you have copy program and form. And attach the same in config.
    Form : ZF110_PRENUM_CHCK
    Program : ZRFFOUS_C
    Regds
    Manohar

  • SAPSCRIPT FORMS and THEIR PROGRAMS

    When a production order is printed, a cove page is generated by a form ZPSFC_PRINT_LAY. ZPSFC_PRINT_LAY is designed to print necessary information regarding all operations, including base rate and etc. I modified ZPSFC_PRINT_LAY to include one more piece of information and now I am trying to modify its program that calls all the tables and has created the form itself. I am having difficulty in finding it. The form is not mentioned under nace. I also checked the TNAPR and it is not there. Where do I find a program for sapscript form ZPSFC_PRINT_LAY that is used for Production Order Cover Sheet? PLEASE HELP! THANKS!

    Hi,
    You can't find production order lay out sets link with print programs in TNAPR.
    Please use T/code : OPK8 to configure the Print Shop Papers .
    You have to assing your custom Print programs and sap scripts by using above transaction.
    Please go through the attached link this will show you the stp-by-step procedure how to attach shop floor papers:
    <a href="http://www.sap-basis-abap.com/sappp013.htm">Print Shop Papers - Configure new / existing SAP Printers</a>
    Regards,
    Lanka

  • Sending sapscript form by email

    dear experts
    i want to send  sapscript forms by email from sap. how is it done. is there any configuration that needs to be done

    Hello,
    I have done in case where we are sending to an external mail id.
    Check the code it may help u.
    REPORT Z_SCRIPT .
    DATA: itcpo LIKE itcpo,
          tab_lines LIKE sy-tabix.
    Variables for EMAIL functionality
    DATA: maildata   LIKE sodocchgi1.
    DATA: mailpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: mailhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: mailbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: mailtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: mailrec    LIKE somlrec90 OCCURS 0  WITH HEADER LINE.
    DATA: solisti1   LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    PERFORM send_form_via_email.
          FORM  SEND_FORM_VIA_EMAIL                                      *
    FORM  send_form_via_email.
      CLEAR:    maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
      REFRESH:  mailtxt, mailbin, mailpack, mailhead, mailrec.
    Creation of the document to be sent File Name
      maildata-obj_name = 'TEST'.
    Mail Subject
      maildata-obj_descr = 'Subject'.
    Mail Contents
      mailtxt-line = 'Here is your file'.
      APPEND mailtxt.
    Prepare Packing List
      PERFORM prepare_packing_list.
    Set recipient - email address here!!!
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      APPEND mailrec.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data              = maildata
                put_in_outbox              = ' '
           TABLES
                packing_list               = mailpack
                object_header              = mailhead
                contents_bin               = mailbin
                contents_txt               = mailtxt
                receivers                  = mailrec
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                operation_no_authorization = 4
                OTHERS                     = 99.
    ENDFORM.
         Form  PREPARE_PACKING_LIST
    FORM prepare_packing_list.
      CLEAR:    mailpack, mailbin, mailhead.
      REFRESH:  mailpack, mailbin, mailhead.
      DESCRIBE TABLE mailtxt LINES tab_lines.
      READ TABLE mailtxt INDEX tab_lines.
      maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
    Creation of the entry for the compressed document
      CLEAR mailpack-transf_bin.
      mailpack-head_start = 1.
      mailpack-head_num = 0.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'RAW'.
      APPEND mailpack.
    Creation of the document attachment
    This form gets the OTF code from the SAPscript form.
    If you already have your OTF code, I believe that you may
    be able to skip this form.  just do the following code, looping thru
    your SOLISTI1 and updating MAILBIN.
      PERFORM get_otf_code.
      LOOP AT solisti1.
        MOVE-CORRESPONDING solisti1 TO mailbin.
        APPEND mailbin.
      ENDLOOP.
      DESCRIBE TABLE mailbin LINES tab_lines.
      mailhead = 'TEST.OTF'.
      APPEND mailhead.
    Creation of the entry for the compressed attachment
      mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 1.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'OTF'.
      mailpack-obj_name = 'TEST'.
      mailpack-obj_descr = 'Subject'.
      mailpack-doc_size = tab_lines * 255.
      APPEND mailpack.
    ENDFORM.
         Form  GET_OTF_CODE
    FORM  get_otf_code.
      DATA: BEGIN OF otf OCCURS 0.
              INCLUDE STRUCTURE itcoo .
      DATA: END OF otf.
      DATA: itcpo LIKE itcpo.
      DATA: itcpp LIKE itcpp.
      CLEAR itcpo.
      itcpo-tdgetotf = 'X'.
    Start writing OTF code
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
                form     = 'Z08V3_COLLI'
                language = sy-langu
                options  = itcpo
                dialog   = ' '
           EXCEPTIONS
                OTHERS   = 1.
      CALL FUNCTION 'START_FORM'
           EXCEPTIONS
                error_message = 01
                OTHERS        = 02.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                window        = 'MAIN'
           EXCEPTIONS
                error_message = 01
                OTHERS        = 02.
    Close up Form and get OTF code
      CALL FUNCTION 'END_FORM'
           EXCEPTIONS
                error_message = 01
                OTHERS        = 02.
      MOVE-CORRESPONDING itcpo TO itcpp.
      CALL FUNCTION 'CLOSE_FORM'
           IMPORTING
                result  = itcpp
           TABLES
                otfdata = otf
           EXCEPTIONS
                OTHERS  = 1.
    Move OTF code to structure SOLI form email
      CLEAR solisti1. REFRESH solisti1.
      LOOP AT otf.
        solisti1-line = otf.
        APPEND solisti1.
      ENDLOOP.
    ENDFORM.
    I am sending to [email protected].
    So proceed in similar manner and let me know if u face any problem.
    Regards

  • Printout is distinct font  in different printer but same SAPscript form

    Dear experts,
    I have one SAPscript form ,Pintout in pinter HP2200 and HP4100, but printout is distinct font.
    Could you help me?
    Thanks and regards,
    collysun

    Hi,
    just ask your basis people to check whether the page format has been attached to the second printer's device type. the page format should be attached to the printer. else font differences occur.
    Kumar

  • SAPSCRIPT form - Text is not porperly displayed

    hi all,
    in my SAPSCRIPT form, I am getting a text from PERFORM stmt. in the PERFORM , the text is coming correct, but in the form , it is showing only half of the text.
    the code
    FORM get_text TABLES ts_intab STRUCTURE itcsy
                         ts_outtab STRUCTURE itcsy.
    DATA: l_haul_text(500) TYPE c,  
               l_haul_long(250) TYPE c.
    l_haul_long = l_haul_text+0(250).
        LOOP AT ts_outtab.
          CASE ts_outtab-name.
            WHEN 'L_HAUL_LONG'.
              ts_outtab-value = l_haul_long.
              MODIFY ts_outtab.
          ENDCASE.
        ENDLOOP.
    Then in the form, just display
    /:  PERFORM GET_TEXT IN PROGRAM
    /:   USING &VBDKL-VBELN&
    /:   CHANGING &L_HAUL_LONG&
    /:  ENDPERFORM
    &L_HAUL_LONG&
    while debugging, the text is correct till TS_OUTTAB but when it comes to the form L_HAUL_LONG, it is truncated.......what should i do..
    Kindly help.
    THnaks

    answered

  • Addint new field to the standard sapscript form.

    FOR SALES INVOICE DOCUMENT FORM PRINTING
    TRANSACTION CODE: VF01
    OUTPUT TYPE : FJCI
    PROGRAM NAME: RVADAUS1
    SAPSCRIPT FORM NAME: SD_EXPORT_FJCI
    ENTRY ROUTINE: ENTRY_FJCI.
    STRUCTURE USED FOR THIS OUTPUT TYPE = V55EFJCI
    THE QUERY IS AS FOLLOWS:
    I WANT TO ADD DATA MODE OF TRANSPORT FROM THE INVOICE DOCUMENT. THE TABLE AND FIELD IS T618-BEZEI.
    SO I COPIED THE STANDARD FORM TO ZSD_EXPORT_FJCI AND THE STANDARD PROGRAM TO ZRVADAUS1.
    I SUCCESSFULLY FETCHED THAT FIELD DATA.
    I APPEND THE STRUCTURE 'ZAV55EFJCI' TO ADD THE ADDITIONAL T618-BEZEI FIELD.
    AND WRITE MY SELECT QUERY IN THE ENTRY_FJCI FORM ROUTINE.
    THE CODE IS AS FOLLOWS:
    data: begin of it_mode_of_tp occurs 1,
          bezei type t618t-bezei,
          end of it_mode_of_tp.
    select a~bezei as zzbezei into table it_mode_of_tp from t618t as a
    inner join
    eikp as b on aexpvz = bexpvz and aland1 = baland inner join vbrk as
    c on bexnum = cexnum
    where cvbeln = nast-objky and aspras = nast-spras .
    loop at it_mode_of_tp.
       v55efjci-zzbezei = it_mode_of_tp-bezei.
    endloop.
    BUT THE DATA FOR THAT IS NOT GETTING DISPLAYED.
    THIS WAS THE FIRST METHOD I FOLLOWD.
    THE SECOND METHOD I DID WAS AS FOLLOWS:
    FORM ENTRY_FJCI.
         PERFORM PROCESSING.
    ENDFORM
    FORM PROCESSING.
         PERFORM PRINT_DOCUMENT.
    ENDFORM.
    FORM PRINT_DOCUMENT.
           CALL FUNCTION 'RV_EXPORT_DOCUMENT_PRINT'
    ENDFORM.
    IN THIS FUNCTION THE DATA IS GETTING FETCHED FROM THE DATABASE TABLES AND STORED IN THE STRUCURE V55EFJCI.
    SO I COPIED THAT FUNCTION.
    IN THIS FUNCTION , THEIR IS A INCLUDE PROGRAM 'LV55EF11' FOR FETCHING DATA FOR ENTRY_FJCI FORM ROUTINE.
    I COPIED THAT PROGRAM CODE , AND CREATED MY OWN INCLUDE PROGRAM (WHICH I AM STORING IT IN ANOTHER Z PACKAGE.)
    AND WRITTEN MY ABOVE CODE IN THAT PROGRAM. BUT WHEN I DO THIS, NOITHING GETS DISPLAYED , EVEN THE PREVIOUSLY COMING DATA ALSO NOT GETTING DISPLAYED.
    HOW SHOULD I PROCEED.

    you said you copied layout(form) SD_EXPORT_FJCI to ZSD_EXPORT_FJCI,
    you updated program to fetch datat & populate v55efjci-zzbezei field.
    Now
    - you need to modify layout(form) ZSD_EXPORT_FJCI via SE71 to insert your field in one of the windows where it has to be printed (sap script knowledge is required here).
    - you need to either modify SAP output type FJCI to use your program/layout(form) or you need to create your own output type and assign your form/program to it, and in addition to that if you define your own output type - yo have to add it to output determination procedure, to access sequences, add condition records to condition table... so it's picked up by the invoice.

  • In mail, how do I attach pictures or documents as icons that open full size

    in mail, how do I attach pictures or documents as icons that will open full size?

    Try Option + click the picture and choose Show as Icon

Maybe you are looking for

  • Duplicate invoice. Query help needed

    Hi All, We need to build a query which addresses the following condition Some of the invoices were created against the wrong vendors and that money needs to be recovered. Some of them are already recovered while some are not * list out all the duplic

  • Macbook Pro 13 Audio Distorted

    Out of nowhere, any audio (iTunes, Youtube...etc) that I play on the macbook comes out normal initially and then approx. 7-10 sec in the audio starts distorting, slow downs, echoing and then completely goes out. The same thing applies when I plug in

  • HT204053 my mail since downloading mountain lion on my laptop is not coming up in the mail folder

    I upgraded to Mountain Lion on my desktop imac and upgraded on my macbook pro but having problems with my mail not transferring over to my laptop.  I am signed in to icloud and tried everything.  Trying to figure out what is wrong.  Does anyone know

  • Changing where an object pastes....

    I'm self learning Illustrator... mostly by trial and error. I created a few complicated drawings without creating layers and now I'd like to go back and separate the objects into different layers. If I cut and paste the object it pastes into the cent

  • In-Store Issue - Signatures

    To Whom It May Concern: I've tried searching the website for awhile, but have been unable to locate an email address for customer service contact. Today, 11/9/14, I accompanied a friend to the Verizon store on the Avenue in White Marsh, MD to upgrade