Problem in PO SAP Script, producing a  PDF  format.

Hi,
Description: We have developed a Purchase Order script. Both the Print Program and SAP Script are customised i.e., we are no longer using the standard MEDRUCK. The print preview is fine and when we take a print out the output looks good.
Problem: When the output type is changes to External Send using the Messages tab in the transaction ME23N, the output is given to a PDF file. In this output the vertical lines are not coming properly. The vertical lines are printed using the VLINE statement of sap script.
Solution Required for: Could any one please tell me why are we getting this problem and a possible solution for this.
Code:
M9   &VLINE&,,&GT_EKPO-EBELP(Z)&,,&VLINE&,,<TX>&GT_EKPO-IDNLF(C14)&</>   
=    ,,&VLINE&,,<TX>&GT_EKPO-TXZ01(C40)&</>,,&VLINE&,,&GT_EKPO-MENGE(C.0)&
=    ,,&GT_EKPO-MEINS(3)&,,&VLINE&,,
=  &GT_EKPO-NETPR(9.2)&                 
=    ,,&VLINE&,,&GT_EKPO-NETWR(9.2)&,,&VLINE&                           
Thanks and Regards,
Raghavendra Goutham.
NOTE: Helpfull answers will be rewarded definitely.

Hi,
Best practise is 1st you FRAME the window with boxes.........
Example.....
/*   BEGIN OF CHANGE LDEEPAK 09/12/2005.
/:   IF &VBDKR-VBTYP& = 'O' OR &VBDKR-VBTYP& = 'S' OR &VBDKR-VBTYP& = '6'.
/:   BOX YPOS '0.0' CM WIDTH '25.4' CM HEIGHT '0.85' CM FRAME 4 TW
/:   BOX YPOS '0' CM XPOS '4.4'CM WIDTH '0'CM HEIGHT '0.85'CM FRAME 4 TW
/:   BOX YPOS '0' CM XPOS '8.35'CM WIDTH '0'CM HEIGHT '0.85'CM FRAME 4 TW
/:   BOX YPOS '0' CM XPOS '11.6'CM WIDTH '0'CM HEIGHT '0.85'CM FRAME 4 TW
/:   BOX YPOS '0' CM XPOS '19.65'CM WIDTH '0'CM HEIGHT '0.85'CM FRAME 4 TW
B     <K>CUSTOMER NO.</>            <K> CONTRACT NO. / SALES ORDER NO.</>
=     <K>  ORIGINAL INVOICE NO.</>  ,,<K>  CUSTOMER PO.</>
=                               ,,,,<K>TERMS</>
/:   BOX YPOS '3.25'CM WIDTH '25.4'CM HEIGHT '0.95'CM FRAME 0 TW INTENSITY 8
/:   BOX YPOS '5.1'CM WIDTH '25.4'CM HEIGHT '0.95'CM FRAME 0 TW INTENSITY 8
/:   BOX YPOS '6.95'CM WIDTH '25.4'CM HEIGHT '0.95'CM FRAME 0 TW INTENSITY 8
/:   BOX YPOS '8.85'CM WIDTH '25.4'CM HEIGHT '0.95'CM FRAME 0 TW INTENSITY 8
/:   BOX YPOS '10.6'CM WIDTH '25.4'CM HEIGHT '0.95'CM FRAME 0 TW INTENSITY 8
Like this you can give commands.
Later you can code for getting the values in to window.
Here while populating the values you need to use TABS to place the value in correct position.
Thanks.
If this helps you reward with points.
Message was edited by: Deepak333 k

Similar Messages

  • To convert Sap Script output to PDF format and send it via email.

    Hi Friends,
    Could any one please tell me, how to convert the Sap Script output to PDF format and send it via email. If any one have the code, kindly mail me to [email protected]
    Thanks & Regards,
    John

    Plese check this sample code from other thread.
    REPORT zzz_jaytest .
    Types Declaration
    TYPES : BEGIN OF ty_pa0001,
    pernr TYPE pa0001-pernr,
    bukrs TYPE pa0001-bukrs,
    werks TYPE pa0001-werks,
    END OF ty_pa0001.
    Internal Table Declaration
    DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
    i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
    i_content_txt TYPE soli_tab, "Content
    i_content_bin TYPE solix_tab, "Content
    i_objhead TYPE soli_tab,
    Work Area Declaration
    w_pa0001 TYPE ty_pa0001, "For pa0001 Details
    w_res TYPE itcpp, "SAPscript output
    "parameters
    w_otf TYPE itcoo, "For OTF
    w_pdf TYPE solisti1, "For PDF
    w_transfer_bin TYPE sx_boolean, "Content
    w_options TYPE itcpo, "SAPscript output
    "interface
    Variable Declaration
    v_len_in TYPE so_obj_len,
    v_size TYPE i.
    Constants Declaration
    CONSTANTS : c_x TYPE c VALUE 'X', "X
    c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
    c_otf TYPE sx_format VALUE 'OTF', "OTF
    c_pdf TYPE sx_format VALUE 'PDF', "PDF
    c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
    c_bin TYPE char10 VALUE 'BIN', "BIN
    c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
    "File Name
    c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
    START-OF-SELECTION.
    Selecting the records from pa0001
    SELECT pernr bukrs werks FROM pa0001
    INTO TABLE i_pa0001 UP TO 10 ROWS.
    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
    Opening the form
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    form = c_form
    device = c_printer
    language = sy-langu
    OPTIONS = w_options
    IMPORTING
    RESULT = w_res.
    LOOP AT i_pa0001 INTO w_pa0001.
    Writting into the form
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    element = 'MAIN'
    window = 'MAIN'.
    ENDLOOP.
    Closing the form
    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.
    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.
    The extension is put the it_mailpack-obj_name parameter of 'SO_NEW_DOCUMENT_ATT_SEND_API1'.

  • Converting sap script output into pdf format?

    Hi all,
    I have modified the standard purchase order script form MEDRUCK . Now i need to generate the output into pdf format.
    This is not only limited to  spool requests , But also  when the user creates the purchase  order and clicks on print or print preview the output should be in pdf format.
    Please help on where and what code has to be written for this requirement?
    Thanks, 
    Aravind.

    Hi
    I don't know which is your release, but I don't think it's possible to create a preview in pdf format, but u can create a pdf file instead of the spool and then open it automatically, this is an example:
    - A) Open form
    IF P_PDF = 'X'.
              XDEVICE        = 'PRINTER'.
    * Get OTF
              ITCPO-TDGETOTF = 'X'.
          ENDIF.
          CALL FUNCTION 'OPEN_FORM'
               EXPORTING
                    DEVICE                      = XDEVICE
                    DIALOG                      = 'X'
                    FORM                        = 'ZFI_CL_EC_MOVI'
                    OPTIONS                     = ITCPO
                    MAIL_SENDER                 = LVS_SENDER
                    MAIL_RECIPIENT              = LVS_RECIPIENT
               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.
            EXIT.
          ENDIF.
    B) Close FORM
    CALL FUNCTION 'CLOSE_FORM'
             TABLES
                  OTFDATA                  = T_OTF
             EXCEPTIONS
                  UNOPENED                 = 1
                  BAD_PAGEFORMAT_FOR_PRINT = 2
                  SEND_ERROR               = 3
                  SPOOL_ERROR              = 4
                  OTHERS                   = 5.
        IF SY-SUBRC <> 0.
          MESSAGE I208(00) WITH 'Errore chiusura stampa'(A02).
        ELSE.
          PERFORM DOWNLOAD_PDF.
        ENDIF.
    C) Create PDF and open it:
    FORM DOWNLOAD_PDF.
      DATA: BIN_FILESIZE TYPE I.
      DATA: T_FILE_PDF     TYPE STANDARD TABLE OF TLINE,
            DOCTAB_ARCHIVE TYPE STANDARD TABLE OF  DOCS.
      DATA: FILE_TABLE     TYPE FILETABLE WITH HEADER LINE.
      DATA: RC          TYPE I,
            USER_ACTION TYPE I.
      DATA: TITLE    TYPE STRING,
            FILENAME TYPE STRING.
      CHECK P_PDF = 'X'.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
           IMPORTING
                BIN_FILESIZE           = BIN_FILESIZE
           TABLES
                OTF                    = T_OTF
                DOCTAB_ARCHIVE         = DOCTAB_ARCHIVE
                LINES                  = T_FILE_PDF
           EXCEPTIONS
                ERR_CONV_NOT_POSSIBLE  = 1
                ERR_OTF_MC_NOENDMARKER = 2
                OTHERS                 = 3.
      IF SY-SUBRC <> 0.
        MESSAGE I208(00) WITH 'Errore conversione PDF'(A03).
        EXIT.
      ENDIF.
      TITLE = 'Creare File'(T02).
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
         EXPORTING
           WINDOW_TITLE            = TITLE
           DEFAULT_EXTENSION       = '*.pdf'
        CHANGING
          FILE_TABLE              = FILE_TABLE[]
          RC                      = RC
          USER_ACTION             = USER_ACTION
        EXCEPTIONS
          FILE_OPEN_DIALOG_FAILED = 1
          CNTL_ERROR              = 2
          ERROR_NO_GUI            = 3
          OTHERS                  = 4
      IF SY-SUBRC <> 0.
        MESSAGE I208(00) WITH 'Errore creazione PDF'(A04).
        EXIT.
      ELSE.
        IF USER_ACTION = 9. EXIT. ENDIF.
        IF RC = 1.
          READ TABLE FILE_TABLE INDEX 1.
        ENDIF.
      ENDIF.
      MOVE FILE_TABLE-FILENAME TO FILENAME.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
           BIN_FILESIZE            = BIN_FILESIZE
           FILENAME                = FILENAME
           FILETYPE                = 'BIN'
        CHANGING
          DATA_TAB                = T_FILE_PDF
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22
      IF SY-SUBRC <> 0.
        MESSAGE I208(00) WITH 'Errore creazione PDF'(A04).
        EXIT.
      ELSE.
        MESSAGE S208(00) WITH 'File creato con successo'(S01).
      ENDIF.
      CHECK P_OPEN = 'X'.
      CALL FUNCTION 'CALL_BROWSER'
           EXPORTING
                URL                    = FILE_TABLE-FILENAME
           EXCEPTIONS
                FRONTEND_NOT_SUPPORTED = 1
                FRONTEND_ERROR         = 2
                PROG_NOT_FOUND         = 3
                NO_BATCH               = 4
                UNSPECIFIED_ERROR      = 5
                OTHERS                 = 6.
      IF SY-SUBRC <> 0.
        MESSAGE S208(00) WITH 'Impossibile aprire file'(A05).
      ENDIF.
    ENDFORM.                    " DOWNLOAD_PDF
    Max

  • Dispalying SAP script output in landscape format

    Hello All,
    Could anyone please tell me the step by step process to display a SAP Script output in landscape format?
    Also is it possible to display a column name in 2 lines if it does not fit into 1 line.
    Regards
    Indrajit.

    Hi,
    Here is the way to print the SAPSCRIPT in landscape ..
    Goto SE71, then give you layout name then press change, then press the Header button(CAP ICON), then you will get the Header infomation, then select the Basic Settings pushbutton, then there we have an option to Print the Layout in  Portrait format or Landscapr format, then select the LANDSCAPR format Radio button then activate it
    Regards
    Sudheer

  • Download SAP Script as MS word format

    Can we download SAP Script in MS word format? If so Please suggest me the way.

    I'm not very sure on how it can be achieved, but this can help you.
    Spool to word -> http://sap4.com/codigofuente/102/396.html

  • How to save sap script output in  pdf document

    hi abapers
    how to save the output of sap script in sap so that can retrieve the saved document later.
    i have to save the rcia output from sap script in pdf document in sap so that it can be retrieved later
    how to use dms

    PDF Creation + connection to DMS
    cheers
    Aveek

  • Sap script convert to pdf and then send to email

    Hi,
    good day sap guys
    ive dev the sap scipt for customer statemnet one which is used the t.code is f.27.
    i need to convert the sap script to pdf and then send to email.
    plz let me know..
    how to do it.
    regards
    chandu

    Hi,
       I script program use the following (go to the "call function 'CLOSE_FORM'")
    data: binfilesize type i.
      data: pdftab type table of tline with header line.
      data: i_itcpp like itcpp.
      data: g_t_otfdata type standard table of itcoo with header line.
      call function 'CLOSE_FORM'
       IMPORTING
         RESULT  = i_itcpp
          tables
            otfdata = g_t_otfdata[]
          exceptions
            others  = 1.
      if sy-subrc ne 0.
        retcode = sy-subrc.
        perform protocol_update.
      endif.
      call function 'CONVERT_OTF'
    exporting
    format = 'PDF'
    importing
    bin_filesize = binfilesize
    BIN_FILE =
    tables
    otf = g_t_otfdata[]
    lines = pdftab[].
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    concatenate file_path  '.pdf' into filename.
    call function 'GUI_DOWNLOAD'
      exporting
      bin_filesize = binfilesize
      filename = filename
      filetype = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
      tables
      data_tab = pdftab[]
    FIELDNAMES =
      exceptions
      file_write_error = 1
      no_batch = 2
      gui_refuse_filetransfer = 3
      invalid_type = 4
      no_authority = 5
      unknown_error = 6
      header_not_allowed = 7
      separator_not_allowed = 8
      filesize_not_allowed = 9
      header_too_long = 10
      dp_error_create = 11
      dp_error_send = 12
      dp_error_write = 13
      unknown_dp_error = 14
      access_denied = 15
      dp_out_of_memory = 16
      disk_full = 17
      dp_timeout = 18
      file_not_found = 19
      dataprovider_exception = 20
      control_flush_error = 21
      others = 22
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.

  • Problem while printing SAP Script

    Hi All,
    I have one scenario, in which I have to copy the Standard SAP Script  form (HR_ALL_FIX) client '000' and import in the development server as custom SAP script(ZHR_ALL_FIX)  and making change in main window the text. Instead of  "Yours Faithfully" text I have changed it to 'Warm Regards'.
    When I try to view the print preview of the script from PP40 tcode,  the output is overlapped.
    Instead of 'warm regards' to be displayed at the end of the page, its being printed in between somewhere.
    No other changes I have made.
    Any inputs and help will be really helpful.
    Thanks in advance

    I am still facing the problem . tried everything. Have only changed the language while copying from DE to EN.
    Also, just creating a Z form without ANY change at all( even the printer used to check print preview is the same)... and attaching it to OOVM transaction and then checking the print preview - TEXT comes randomly (in different order)
    Any help will be really appreciated and rewarded..
    Awaiting help.
    Edited by: HeenaChampaneri on Apr 15, 2010 8:39 AM

  • Sap script output to pdf

    Hi All,
    I have one report prg wich gives op in sap script.
    I want same output in pdf and have to save on hard disk.
    please suggest me wat procedure i have to follow.
    It's urgent

    A very common requirement for programmers writing ABAP code for printing using SAPScript Forms is to redirect output to a PDF (Adobe Acrobat) file. I struggled for a few days trying to find a solution to this. Though I found quite a few examples on the web, it was difficult figuring out which technique was optimal. This tip is borne out of these struggles.
    This is an example of how to use ABAP code to save output of a print routine using a SAPScript form into PDF format and also display it within the SAP frontend itself. This routine proves extremely useful to provide users the ability to save local copies of output and preview it within the user-friendly Acrobat Reader control, all without leaving the SAP frontend or your program. Since function modules are used, the code is portable and this technique can be used in any other ABAP program as well.
    Two function modules, Z_DS_CREATE_LOCAL_PDF_FILE and Z_DS_CALL_PDF_VIEWER need to be created. I have used a function group called Z5_DS_PDF for this purpose. The function group contains the ABAP objects code for declaration and implementation of a class that encapsulates the Acrobat application functionality. The function group also contains a screen '0901', that epresents our PDF viewer and one PBO and one PAI block for the same screen.
    Note: The following example has been stripped of essential error-handling for the sake of simplicity and the programmer is assumed to possess knowledge of creation of function groups, function modules, screens and SAPScript forms. ABAP objects or custom controls knowledge is not mandatory. Be patient when trying this out and follow all instructions thoroughly. The results will be worth the effort.
    Steps to follow to get this example running:
    1) Create a function group (Example : Z5_DS_PDF)
    2) Define the top include and place the code listed below into it (LZ5_DS_PDFTOP)
    3) Create screen '0901' in function group with three elements:
    a) Pushbutton CLOSE at the top with function code 'CLO' (this is to exit preview screen)
    b) Custom control container (Large- spanning entire screen) named MY_CONTAINER
    c) The customary OK code field called OK_CODE
    Note: The names of the elements should be exactly as described above
    4) Create one output and one input module in the flow logic of screen '0901' for which the code is provided below
    5) Define two function modules with the following signatures:
    a) FUNCTION Z_DS_CREATE_LOCAL_PDF_FILE
    EXPORTING
    REFERENCE(AFILENAME) LIKE RLGRAP-FILENAME
    TABLES
    OTF_LINES STRUCTURE ITCOO
    b) FUNCTION Z_DS_CALL_PDF_VIEWER
    IMPORTING
    VALUE(FILENAME) TYPE STRING
    Code is provided below.
    6) Compile and activate the function group
    7) Create a simple SAPScript form with one page and one window
    8) Define one element in the text for the main window called 'HELLO' and some static text in it
    9) Check and activate the form
    10) Create the example program (Example : Z5_DS_SCRIPT2PDF) with the below code
    11) Run the example
    NOTES: I tested this code in R/3 version 4.6C but it should work in all 4.6 setups. I'm pretty sure some of the ABAP objects code I have used may not work with R/3 4.0 versions and earlier. Also, it works perfectly only when Acrobat Reader is installed on the presentation server. I have checked it with Acrobat versions 4 and 5 but I haven't had the opportunity to check it with Acrobat Reader 6.
    Code
    Code inside top include LZ5_DS_PDFTOP of function group Z5_DS_PDF
    FUNCTION-POOL Z5_DS_PDF.                    "MESSAGE-ID ..
          CLASS CL_GUI_PDF  DEFINITION                                  *
    CLASS CL_GUI_PDF DEFINITION
      INHERITING FROM CL_GUI_CONTROL.
      PUBLIC SECTION.
        TYPES:
          COL_TYPE  TYPE INT4.
        METHODS:
          CONSTRUCTOR
            IMPORTING
              !PARENT            TYPE REF TO CL_GUI_CONTAINER
              VALUE(SHELLSTYLE)  TYPE I OPTIONAL
              VALUE(DISP_MODE)   TYPE I OPTIONAL
              VALUE(LIFE_TIME)   TYPE I OPTIONAL
              VALUE(NAME)        TYPE STRING OPTIONAL
            EXCEPTIONS
              CNTL_ERROR
              CNTL_INSTALL_ERROR.
        METHODS:
          LOADFILE
            IMPORTING
              VALUE(FILENAME) TYPE STRING
            EXCEPTIONS
              FILE_NOT_FOUND.
        METHODS:
          REFRESH.
        METHODS:
          DISPATCH REDEFINITION.
    ENDCLASS.
    DATA: MY_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: MY_PDF TYPE REF TO CL_GUI_PDF.
    data: ok_code like sy-ucomm.
    data: file_name type string.
    custom control class implementation
    CLASS CL_GUI_PDF IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        DATA:
          CTRL_NAME(80) TYPE C.
        IF NOT CL_GUI_OBJECT=>ACTIVEX IS INITIAL.
          CTRL_NAME = '{CA8A9780-280D-11CF-A24D-444553540000}'.
        ELSE.
          RAISE CNTL_ERROR.
        ENDIF.
        CALL METHOD SUPER->CONSTRUCTOR
          EXPORTING
            CLSID        = CTRL_NAME
            SHELLSTYLE   = SHELLSTYLE
            PARENT       = PARENT
            LIFETIME     = LIFE_TIME
            NAME         = NAME
          EXCEPTIONS
            CNTL_SYSTEM_ERROR = 1
            OTHERS            = 2.
        CASE SY-SUBRC.
          WHEN 1.
            RAISE CNTL_INSTALL_ERROR.
          WHEN 2.
            RAISE CNTL_ERROR.
        ENDCASE.
        CALL METHOD CL_GUI_CFW=>SUBSCRIBE
          EXPORTING
            REF = ME
            SHELLID = ME->H_CONTROL-SHELLID
          EXCEPTIONS
            OTHERS = 1.
        IF SY-SUBRC NE 0.
          RAISE CNTL_ERROR.
        ENDIF.
      ENDMETHOD.
      METHOD LOADFILE.
        CALL METHOD ME->CALL_METHOD
          EXPORTING
            METHOD = 'LoadFile'
            P_COUNT = 1
            P1      = FILENAME.
      ENDMETHOD.
      METHOD REFRESH.
        CALL METHOD ME->CALL_METHOD
          EXPORTING
            METHOD = 'Refresh'
            P_COUNT = 0.
      ENDMETHOD.
      METHOD DISPATCH.
        CALL METHOD CL_GUI_CFW=>FLUSH.
        IF SY-SUBRC NE 0.
          RAISE CNTL_ERROR.
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    End of code for LZ5_DS_PDFTOP
    Code for Function Module Z_DS_CREATE_LOCAL_PDF_FILE
    FUNCTION Z_DS_CREATE_LOCAL_PDF_FILE .
    ""Local interface:
    *"  EXPORTING
    *"     REFERENCE(AFILENAME) LIKE  RLGRAP-FILENAME
    *"  TABLES
    *"      OTF_LINES STRUCTURE  ITCOO
      DATA: PDF_LINES
      LIKE TLINE OCCURS 1000 WITH HEADER LINE,
       ARCH LIKE TOA_DARA, NO_LINES TYPE I.
      CALL FUNCTION 'CONVERT_OTF'
           EXPORTING
                FORMAT       = 'PDF'
           IMPORTING
                BIN_FILESIZE = NO_LINES
           TABLES
                OTF          = OTF_LINES
                LINES        = PDF_LINES.
      CALL FUNCTION 'DOWNLOAD'
           EXPORTING
                BIN_FILESIZE = NO_LINES
                FILENAME     = 'c:test.pdf'
                FILETYPE     = 'BIN'
           IMPORTING
                ACT_FILENAME = AFILENAME
           TABLES
                DATA_TAB     = PDF_LINES.
    ENDFUNCTION.
    End of Code for Z_DS_CREATE_LOCAL_PDF_FILE
    Code for Function Module Z_DS_CALL_PDF_VIEWER
    FUNCTION Z_DS_CALL_PDF_VIEWER .
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(FILENAME) TYPE  STRING
      FILE_NAME = FILENAME.
      IF MY_CONTAINER IS INITIAL.
        CREATE OBJECT MY_CONTAINER
                  EXPORTING
                   CONTAINER_NAME              = 'MY_CONTAINER'.
        CREATE OBJECT MY_PDF
        EXPORTING
            NAME = 'MY_PDF'
            PARENT = MY_CONTAINER.
      ENDIF.
      CALL SCREEN 901. " Ensure screen is created as per instructions
    ENDFUNCTION.
    End of Code for Z_DS_CALL_PDF_VIEWER
    Flow Logic for screen '0901'
    PROCESS BEFORE OUTPUT.
      MODULE INIT.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_0901.
    End of Flow Logic for screen '0901'
    PBO module INIT for screen '0901'
    MODULE init OUTPUT.
        call method my_pdf->loadfile
              exporting filename = file_name.
    ENDMODULE.                 " init  OUTPUT
    End of PBO module INIT for screen '0901'
    PAI module USER_COMMAND_901 for screen '0901'
    MODULE USER_COMMAND_0901 INPUT.
    case ok_code.
    when 'CLO'.
       set screen 0.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0901  INPUT
    End of PAI module USER_COMMAND_901 for screen '0901'
    Example program Z5_DS_SCRIPT2PDF
    *& Report  Z5_DS_SCRIPT2PDF                                            *
    *& This report works only if the function modules                      *
    *& Z_DS_CREATE_LOCAL_PDF_FILE and Z_DS_CALL_PDF_VIEWER already exist   *
    *& Also use an already existing simple SAPScript Form that contains a  *
    *& window "MAIN" and rework printing code if necessary, remember to    *
    *& change the output device name in OPTIONS-TDDEST                     *
    REPORT  Z5_DS_SCRIPT2PDF.
    PARAMETERS: FORM LIKE RSSCF-TDFORM DEFAULT 'Z5_DS_HELLO2'. "your form
    DATA: OTF_LINES LIKE ITCOO OCCURS 1000 WITH HEADER LINE,
          OPTIONS TYPE ITCPO, FILENAME LIKE RLGRAP-FILENAME,
          FILENAME_S TYPE STRING.
    START-OF-SELECTION.
      OPTIONS-TDDEST = 'LP01'.
    Replace 'LP01' above with your default output device
      OPTIONS-TDCOPIES = 1.
      OPTIONS-TDGETOTF = 'X'. " the key to returning OTF data
    Open the SapScript Form with the name "form"                         *
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
                FORM         = FORM    " name of form (SE71)
                OPTIONS      = OPTIONS
                DIALOG       = ' '.
    Execute the element "HELLO" in window MAIN
    - Nothing happens if /E HELLO is not declared in MAIN
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'HELLO'  "execute element /E HELLO
                TYPE    = 'BODY'. "normal output
    Close the current SapScript Form
      CALL FUNCTION 'CLOSE_FORM'
           TABLES
                 OTFDATA      = OTF_LINES. " Retrieve all the OTF so far
    Code for PDF Formatting and creation of local File
      CALL FUNCTION 'Z_DS_CREATE_LOCAL_PDF_FILE'
           IMPORTING
                AFILENAME = FILENAME
           TABLES
                OTF_LINES = OTF_LINES.
      FILENAME_S = FILENAME.
    Code to launch Adobe Acrobat inplace in SAPGUI
      CALL FUNCTION 'Z_DS_CALL_PDF_VIEWER'
           EXPORTING
                FILENAME = FILENAME_S.
    End of example program Z5_DS_SCRIPT2PDF

  • Font problem in reports produced in PDF format

    Dear all,
    All our reports are developed by developer suite 10g (under windows) and deployed on an Application Server 10g (on Linux).
    We had a problem with displaying the arabic letters, but this was solved by following the steps in the metalink Note no 726205.1 for generating arabic pdf reports on unix.
    Now, the problem is that the font used in the reports is ARIAL, but when the reports are displayed (in PDF format) the font is TAHOMA. This font conversion happens in both Arabic and English reports !
    I wonder how can I correct this behaviour.
    Thanks in advance for your time.
    Naglaa

    Steve,
    I remember that fonts in PDF generated by Oracle Reports is a big topic and a subject of many Metalink notes (metalink.oracle.com).
    Note.210318.1 Ext/Pub How To use font embedding in Reports 9i for PDF output
    Note.207711.1 Ext/Pub How to Use Font Subsetting in Reports 9i for PDF Output
    Note 232975.1 "Windows/Unix Font Issues: What Information is Required to address the Issue and How to Work Around Issue"
    Especially on Unix and Linux systems, there are some font mapping required. I suggest to run this question on the Reports forum here on OTN where I think you have better chances for an answer.
    Frank

  • Problem in pinting sap script

    what is this syntex in sap script plz explain BOX XPOS '0'CM YPOS '0'CM WIDTH '2'CM HEIGHT '3.5'CM FRAME 10 TW.   what is 'frame 10 tw' is here?

    hi,
    the syntax implies,
    BOX
    this draws a box at the specified  position with the specified size.
    xpos ypos upper---upper left corner of the box
    width Width of the box.
    height: Height of the box.
    frame: Thickness of frame around the box. Default: 0 (no frame).
    intensity : grayscale value of box contents as % .
    TW (twip)  · PT (point)    · IN (inch)    · MM (millimeter)   · CM (centimeter)   · LN (line)   · CH (character).
    tw is an unit of measurement
    BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    Regards
    Jayapriya

  • Facing problem while migrating sap scripts

    Hi all,
    My scenario is to migrate the script from one server to another server using the program RSTXSCRP.
    Iam able to import the txt file,iam getting message that "Object imported and activated".
    But when i try to open the same form in se71,its giving me error message that "Form XXXXXX language JA is inconsistent in the text file".
    Iam getting this message only if the original language of the script is Japanese(JA),for all forms in EN i am able to migrate to other system.
    Please advice.
    Regards,
    Sravanthi Chilal

    first create the sap script , means copy the standard script form DE to  JA language then you can use same name and migrate the script.

  • Problem in saving  SAP Script

    Hi all,
    i have saved  sap script in local object($tmp) so i have to save  the same script in package  i could not able to transfer it to package
    please let me know how to do it
    thanks in advance

    Hi,
    when saving standard text in so10,
    it won't ask for request!
    1. goto se09 and create a new
    customizing rqeuest.
    2. after that
    in the object list,
    go in edit mode
    and a new window will come
    where u can add the objects(in table control)
    3. there u put
    program id = R3TR
    object type = Form
    object name = Form,YHRS_FNF_LTR,E
    where
    YHRS_FNF_LTR = name of script
    E = english language
    it helps..
    or goto SE03.
    In that object directory..
    Change object directory entries...
    Cheers,
    Simha.

  • SAP SCRIPT FORMS with UNICODE FORMAT ??

    Hi guru's,
    this is sunny newly joined in sap forum,am ABAP doveloper .
    now am extensivelly working on upgrradation project(4.6B TO ECC6.0) , my work perticularlly on UNICODE
    >> now am working on  SAP SCRIPT FORMS, so could you please let me know how to check the scripts in UNICODE FORMAT .
    >> Is that usefull to check with UCCHECK
    Its urgent
    Best Regards
    Sunny..

    SAP Scripts needs no checks. but you have to keep attention to the fact, that the spoollists must be converted manually by a report written by SAP, and this report is not able to transform sapscripts which are still in the spool. After unicode conversion every sapscript spoollist is lost!

  • Problem selecting tray when printing according to PDF format

    When printing a PDF file according to the PDF format the program is not selecting the proper tray for legal size documents.  Everything is printed on letter size paper. 

    You need to tell your printer what tray to use. Reader doesn't tell the printer what tray to use, it is the printer driver. If you are asserting that you have properly set the printer driver to print to a tray while using the Print command in Reader, you will need to tell us what OS? What version of Reader? What printer? What printer driver? How and when you are setting the printer driver info into the Print Dialog box.

Maybe you are looking for

  • Is there a way to use the find/replace tool to select the actual step in the TestStand sequence instead of just listing matching values in the find window?

    The purpose of this is to be able to select many steps that are scattered throughout a sequence so I can change the step type one time.  I could do this now, but it would take me 30 minutes to click through the sequence and select all of the steps be

  • [BPC 10] Member/property specific formatting

    Hi, I am trying to use specific member/property formatting in an input form in BPC 10. My account dimension has a property called format and I have used 3 different indicators, T,R and P. In my input form I have activated the EPMFormattingSheet and u

  • HELP!  Can't get rid of blue apple menu

    I got a new iMac for Christmas and I was trying to move bookmarks and such from Firefox to the new computer. I was following instructions through them using terminal. Now, I have this blue apple heading up the apple menu instead of the normal gray/bl

  • Why do I have plymouth in boot?

    Hello, I just upgraded an old system whats only supposed to run as a server so only uses textmode. After fixing all the problems the upgrade caused, it stopped booting because it wanted to spawn /bin/plymouth: no such file or directiory Where does th

  • 20 GIG Zen Touch MP3 huge probl

    I am just trying to install the cd on my windows xp computer and get this message on all the installtions: "the application failed to start because LZ32.DLL was not found" how the heck do I fix this and actually get to use my Mp3 player? I called cre