TX F110 change sapscript form

Hi.
I have development a Z sapscript form, it´s a copy from F110_PRENUM_CHCK. How I can to do for change it to my new sapcript form, for TX F110?.
Thanks in advance.
Regards.

Hello,
1. Goto trxn FBZP.
2. Click on "Pymt Methods in Company Codes".
3. Select the company code & payment method for which you want to configure the Form. (Generally it will be C)
4. Double click on the entry, expand the "Form Data" section. Here you will be able to add the Z-Form name.
Please contact a functional guy in case of any doubts.
BR,
Suhas

Similar Messages

  • How to change the Development Class of the SAPSCRIPT FORM

    Hi All,
          I have transported the old form which needs to be deleted in Test System. Is that possible to create a TR for deletion and send it to Test enivronment?..
         Also is it possible to change the development class for a form?
         Please help me on this. Urgent!...
    Regards,
    Ramkumar.

    Yes, it is possible to change the development class for forms..
    Use SE03, transport organiser tools
    goto node OBJECT DIRECTORY ENTRY
    select node "Change object directory entries"
    Execute
    goto the next text box after data element, type FORM, give your SAPSCRIPT form name and tick the check box execute... now rightclick on your form and chenge development class..
    Now coming to your second question is is not possible to delete a FORM that it is already transported to QA and Production, only way to do this is by doing client copy.. basis will do it for you..
    Close the thread once your question is answered.
    Regards,
    SaiRam

  • Change Page in Sapscript form

    Hi,
    I have a custom report with a sapscript form that contains a list of records from KNA1 table. I would like to have a different page for every different KNA1-KUNNR (change page at new kunnr). Is this possible and how?
    Thanks

    Hi,
    Kindly follow the below steps::
    1.declare first field in ur internal table as 'KUNNR'.
    2.once u get the required data into ur internal table to print, SORT the internal table with KUNNR.
    3.LOOP the internal table to print and use CONTROL BREAK event (AT END OF KUNNR) to trigger new page for every new KUNNR.
    4.In Control Break event (AT END OF KUNNR) call the Function Module 'CONTROL_FORM', which will trigger a new page in the output.
    eg:
    call function 'OPEN_FORM'      --> to Open the Form
    LOOP AT itab.
         call function 'WRITE_FORM'
           exporting
              element = 'ITEM_DET'.
        AT END OF KUNNR.
           CALL FUNCTION 'CONTROL_FORM'
                EXPORTING
                   COMMAND = 'NEW-PAGE'.
        ENDAT.
    endloop.
    Hope it helps!!
    Rgds,
    Pavan

  • Change in SAPScript form not reflect in old orders

    Hi Expert,
       I have modified the layout of a sales order SAPScript form. For newly created one, I can get the new sales order printed with new layout. But for those who already exists, even though I go to the sales order, Extra -> Output -> Header to delete the original output, and manually add the output type again, the printout are always shown with old layout. I just wonder how can I have my old sales order printed with the new layout, thanks!

    Kumar,
    Remove and add the query into the workbook again, save the work, close and reopen. You should get it working again.
    Workbook also saves the format details and does not work well sometimes. So every time you do any format changes to the query, it is advisable to remove and add back the query into the workbook.
    Hope it helps
    _RJA

  • SAPScript form coding changed automatically during transport

    Hi,
    I have developped  a SAPScript form in dev. and worked well.
    After I had transport it to testing environnment to test it there, I found out that my SAPScript coding
    was modified: some new lines code have been added replacing the original code while others have been just deleted.
    When I checked the attribute of the SAPScript, I notice that these modifications have been added automatically by user DDIC!
    I really do not understand how this could be.
    Any idea is welcome.
    Thanks,
    Charas

    Hi Charas,
    Note that SAPScripts are client specific, so make sure you import your script to each and every QA client. Inform your basis that the transport is not a cross client object. So, he will import to all the QA client.
    Or check with your Basis, to which QA client the transport has been imported to, go to SCC1 transcation code and copy it over to required QA client.
    I guess, above information will help you to close the thread.
    Regards,
    SaiRam

  • 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

  • Call a function module from within a sapscript form

    not being an ABAPer i have the task of changing the Invoice SAPScript form.
    i have made the necessary changes - just about... but they have asked that i include the VAT Number on the Invoice....
    not too bad apart from different company codes have different vat numbers...
    not knowing a better way to retrieve data from table V_001_B - i am using the print program -RFKORD50, is there a better way of getting the VAT Number by company code? I figured if i could call the FM to return the value, all well and good.., they do not want the print program changed if possible so was looking at alternate methods....
    or am i trying to reinvent the wheel here?

    thank you both!  helpful answers! :o)
    anyway! 
    i have written the program which is called from the SAPScript:
        /:       PERFORM GET_VATNUMBER IN PROGRAM ZFI_F140_OPERATIONS
        /:       USING &BKPF-BUKRS&
        /:       CHANGING &VATNUMBER&
        CE       VAT Registration No : &VATNUMBER&
        REPORT zfi_f140_operations.
        FORM get_vatnumber TABLES in_par  STRUCTURE itcsy
                                  out_par STRUCTURE itcsy.
          DATA: lv_co_code TYPE bukrs,
                lv_vat_no  TYPE stceg.
          READ TABLE in_par WITH KEY name = 'BKPF-BUKRS'.
          MOVE in_par-value TO lv_co_code.
          SELECT SINGLE stceg FROM t001
            INTO lv_vat_no WHERE bukrs = lv_co_code.
          out_par-name = 'VATNUMBER'.
          WRITE lv_vat_no TO out_par-value.
          CONDENSE out_par-value.
          MODIFY out_par INDEX 1.
        ENDFORM.              
    it is not working and i cannot work out why... 
    i have not been ABAPing for very long but have had a go.... 
    any thoughts as to what i have done wrong?
    or point me where i should be looking?  thank you!

  • 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.

  • Sapscript form printing

    i am having a problem with a sapscript form for payment advice. its in germany but i want it in english. how do i convert it to english. the name of the form is F110_D_DTA. Its a standard form. if there is anyone who has this form in english please send it to my email: [email protected]

    Hi Chingarande,
    You can also try this.
    GO to SE71->Administrative Data. In language Attributes change the option "Translate to all languages" from "Do not ranslate".
    Ashven

  • Convert SAPSCRIPT forms to PDF

    We need to do a report that can generate several pdfs from a payment run (SAP-FI), so we need to have one pdf  for each payment in the run (they are in SAPSCRIPT form).
    The program that we use is copy of "J_1AF012" and the we use "SX_OBJECT_CONVERT_OTF_PDF" function to obtain the pdf form, but the changes that we did in the standard were:
    a) in the "OPEN_SAPSCRIPT"
    *&      Form  OPEN_SAPSCRIPT
          text                                                           *
    FORM OPEN_SAPSCRIPT.
      ITCPO-TDIMMED    = '*'.              " kz sofort drucken
      ITCPO-TDDELETE   = '*'.              " kz freigbe nach Druck
      ITCPO-TDLIFETIME = '7'.              " verfalltage
      ITCPO-TDPREVIEW  = 'X'.              " druckansicht
    Setting the options
      w_options-tdcopies = 1 ."Number of copies
      w_options-tdnoprev = c_x."No print preview
      w_options-tdgetotf = c_x."Return of OTF table
      w_options-tddest =   c_locl."Spool: Output device
      CALL FUNCTION 'OPEN_FORM'            " open form for output
           EXPORTING FORM    = S_FORM
                     DIALOG  = 'X'
                     LANGUAGE = 'S'
                   OPTIONS = ITCPO
                     OPTIONS = w_options
                    DEVICE  = 'PRINTER'
                     DEVICE  = c_printer
           IMPORTING
                     RESULT  = W_RES.
    ENDFORM.                               " OPEN_SAPSCRIPT
    b) In the "CLOSE_SAPSCRIPT" :
    FORM CLOSE_SAPSCRIPT.
      C_ORDEN = C_ORDEN + 1.
      shift C_ORDEN left deleting leading space.
      CONCATENATE C_PATH C_NAME1 C_ORDEN C_EXTENSION INTO C_NAME.
      CALL FUNCTION 'CLOSE_FORM'
      IMPORTING
              RESULT = w_res
              TABLES
                    otfdata = i_otf
              EXCEPTIONS
                    unopened = 1
                    bad_pageformat_for_print = 2
                    send_error = 3
                    spool_error = 4
                    codepage = 5
                    OTHERS= 6.
      IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    c) And we added these functions:
    Converting OTF data to single line
      LOOP AT i_otf INTO w_otf.
            CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
                                                  INTO w_pdf.
            APPEND w_pdf TO i_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 = w_transfer_bin
                content_txt = i_content_txt
                content_bin = i_content_bin
                objhead = i_objhead
                len = v_len_in
            EXCEPTIONS
                err_conv_failed = 1
            OTHERS = 2.
      v_size = v_len_in.
    Downloading the PDF File
      CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
                bin_filesize = v_size
                filename = c_name
                filetype = c_bin
            TABLES
                data_tab = i_content_bin.
    When we run the program the error is a dump with:
    "DBIF_RSQL_INVALID_CURSOR
    CX_SY_OPEN_SQL_DB        "
    and aparenttly is due to the cursor in BKPF table is closed (or missing) in some of those functions.
    We use the "open_form" and "close_form" for each payment document, and we could generate only the first pdf and then the program cancel (to the second pdf) with this mentioned error.
    We are on R/3 4.70, 620, and Informix Database.
    Please, could you kindly help us???
    Best regards,

    Hola Grisel!
    Estoy tratando de armar en pdf las órdenes de pago, pudiste hacerlo? Como lo lograste?
    Gracias de antemano por cualquier info que me puedas brindar.
    Saludos
    Eduardo Puricelli
    Hi Grisel,
    I'm trying to build in pdf payment orders, could you? As you did it?
    Thanks in advance for any info you can give me.
    Greetings
    Eduardo Puricelli

  • 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

  • Sapscript form print as PDF

    Hello,
    is there a way to setup a printer that we can print sapscript form into a PDF file?
    We don't want to go over the spool request and use RSTXPDFT4.
    I have already setup a printer with device type PDF1, Host Spool Access Method F:Printing on Frontend Computer and Host Printer __Default. But for some reasons it doesn't work. We are running SAP Enterprise 470.
    Any help?
    Thanks
    Anne

    You must choose a FILE printer. See these notes:
    [Note 576973 - Creating a file printer on a Windows PC|http://service.sap.com/sap/support/notes/576973]: steps to add a Windows (if it's Vista, see note 1164132) printer of type Generic/Text only, and to create an output device in SAP to print to this printer. It does not explain that we may just change the port of an existing printer.
    [Note 1164132 - Front-end printing on Windows printer with FILE port|http://service.sap.com/sap/support/notes/1164132]: note 576973 applied to Windows XP and before, but it doesn't work anymore on Windows VISTA because the dialog box to enter the file name is no more displayed. A change in SAPGUI 7.10 was made (and it works only with access method G) to display a SAP dialog box to enter file name.

  • How to do calculation to a variable in Sapscript form

    Hi experts,
    My question looks simple but I failed to solve it. Supposed in the Sapscript form there are two variables: &it_tab-qty1&, &it_tab-qty2&. I need to add the first variable's value to the second one, I tried as below in Sapscript form editor:
    /: &it_tab-qty2& = &it_tab-qty2& + &it_tab-qty1&
    But it doesn't work. Could you please tell me the syntax to do such calculation in Sapscript? I cannot modify the print program so I have to modify the Sapscript form instead.
    Thanks a lot.
    Yu

    Yes, you need to write an external program using SE38 to perform the calculation.
    The syntax in SAPscript:
    /* all the var define in the SAPscript is char string type
    /: define &v1& = &it_tab-qty1&
    /: define &v2& = &it_tab-qty2&
    /: define &v3& = ''
    /* GET_COMPNAME is the form name & Z001 is the program name
    /: PERFORM GET_COMPNAME IN PROGRAM Z001
    /: USING &v1&
    /: USING &v2&
    /: CHANGING &v3&
    /: ENDPERFORM.
    The syntax in program Z001 (Created by SE38):
    REPORT ZFIR001.
    FORM GET_COMPNAME tables in_tab structure itcsy
                                                     out_tab structure itcsy.
      data : p_1 TYPE CHAR80,
               p_1 TYPE CHAR80,
               p_3 TYPE CHAR80.
      retrieve data from the SAPscript
        READ table in_tab index 1.
        MOVE in_tab-value to p_1.
        READ table in_tab index 2.
        MOVE in_tab-value to p_1.
      Write the code to convert p_1 & p_2 to numeric and perform the addition to p_3
      After that convert the p_3 to char.
      send data back to the SAPscript
        read table out_tab index 1.
        move p_3 to out_tab-value.
        modify out_tab index sy-tabix.
    ENDFORM.

  • SAPScript Form Layout Error after HRSP Upgrade

    Hi SAP Experts,
    I hope someone can shed some of your inputs in the error that we have in our SAPScript form.
    A window in our SAPScript form does not display at all when a report is generated.
    Funny thing is that we did not make any change to the said form and this error is consistent across all our SAP environments - Dev, QA and Prod.
    This has started happening after we had the SAP HRSP upgrade last weekend.
    We tried checking the form configuration and we cannot find anything wrong in it.
    We tried to check for SAPScript versions but we found out that this is not available in SE71, unlike for programs in SE38.
    Has anyone of you encountered this problem?
    Hope I can get some expert inputs from the community on this issue.
    Thanks!

    Managed to find out the root cause of the SAPScript error. There was a new line that was added in the form layout after the HRSP upgrade. As to how it was added, it was unknown. But was able to resolve and fix the issue already.

  • Printing Street4 Street5 in SAPScript form BA00

    Hello All,
    I am trying to print additional lines of street address (i.e. Street4 and Street5) in the sales order confirmation SAPScript form (BA00) output. I see that the structure VBDKA is being used to display the Ship-to-party address details. However, it does not have the additional street fields in it.
    How can I print these additional street lines?
    Any help will be greatly appreciated.
    Thanks,
    Rugmani

    In the INFO1 page of the SAPScript form I inserted the following code:
    /:   IF &VBDKA-LAND1_WE& NE &SPACE&.               
    /*   * Ship-To Address (not identical to Sold-To)  
    /:   ADDRESS DELIVERY PARAGRAPH AS                 
    /:     ADDRESSNUMBER &VBDKA-ADRNR&                               
    /:   ENDADDRESS         
    /:   ELSE.               
    /*   * Output Partner (Sold-To)                                               
    /:   ADDRESS PARAGRAPH AS                                                     
    /:     TITLE    &VBDKA-ANRED&                                                 
    /:     NAME     &VBDKA-NAME1&, &VBDKA-NAME2&, &VBDKA-NAME3&, &VBDKA-NAME4&    
    /:     STREET   &VBDKA-STRAS&                                                 
    /:     POBOX    &VBDKA-PFACH&  CODE &VBDKA-PSTL2&                             
    /:     CITY     &VBDKA-ORT01&, &VBDKA-ORT02&                                  
    /:     POSTCODE &VBDKA-PSTLZ&                                                 
    /:     COUNTRY  &VBDKA-LAND1&                                                 
    /:     REGION   &VBDKA-REGIO&                                                 
    /:     FROMCOUNTRY &VBDKA-SLAND&                                              
    /:   ENDADDRESS                                                               
    /:   ENDIF.                                                                   
    However, I do not see the additional street lines filled in the form output.
    Is there something wrong with my code? I think VBDKA structure does not accomodate the additional street lines. Is there any other structure that I can use? Do I have to change anything in the print program?
    Thanks,
    Rugmani

Maybe you are looking for

  • Select from an Internal Table.

    Following is my urgent requirement: I have an Internal Table ITAB with several possible entries of Company Code under its field BUKRS. From this ITAB I want to display only those records for which the column 'Company Code' occur more than twice and t

  • Installing iTunes on Faculty/Staff XP computers

    As preparation for joining iTunesU, we will be needing to install iTunes on our faculty/staff computers. We're running Windows XP and users do not have administrator privileges. We do not want to have to install the software on the computers individu

  • How to install iOS 5 if you already have 6 of them on the Iphone 3GS

    How to install iOS 5, if you have already installed iOS 6 on the Iphone 3GS. Terribly buggy. It is impossible to use.

  • I can not open Firefox.

    I can not open Firefox. When I click on the icon nothing happens. I tried rloading and this didn't help. I have been using Firefox for years and have never had this problem.

  • JBuilder/jdk1.4 beta issues?

    Has anyone had success getting the beta2 of the 1.4 jdk to work with JBuilder? I get a wierd "Wrong" version compiler error when I use it. If I set up JBuilder to actually run under the 1.4 jdk, then I get a "class not found" for java.lang.Object. I