Script output dimensions are changing

hi,
I have developed a script in fico. when i am selecting one output printer type it si coming fine. when i am selecting other printer output will be changing and data is moving. Please help for this problem.
K. Kishore

check the FORMAT of that O/p Device in SPAD Tcode.
Regards
Prabhu

Similar Messages

  • EA1 - DBMS_OUTPUT prints to Script Output window

    All,
    I saw another post about the window switching from the DBMS Output window to the script window after a script is executed (I don't like that either), but this is different.
    My DBMS Output is being output to the Script Output window.
    Example:
    begin
       dbms_output.put_line('Hello World');
    end;Yields (in Script Output):
    anonymous block completed
    Hello WorldDan
    Modified Subject
    Message was edited by:
    dmcghan

    This is definitely a change from 1.2.1.31.12, where even running as a script the DBMS Output was displayed on the DBMS Output tab.
    However, while this makes DBMS Output inconsistent (where it appears depends on how you run it) it does make scripts that produce DBMS Output and other output consistent (all output goes to script output).
    For example, if you were writing scripts like the following (assuming the PL/SQL generates DBMS Output), the output will now be consistent:
    select count('x') records from my_interface;
    begin
    process_my_interface;
    end;
    select count('x') records from my_interface;
    With the way the DBMS Output and Script Output tabs are set up now, either DBMS Output or Script Output has to be inconsistent when in comes to displaying DBMS Output. I think that the way 1.5 EA1 works is inconsistent in a more manageable way (largely because reconstructing a single stream of output from more complex cases of the example above would be difficult).

  • Dimension name changed in dev

    Hi guys,
            If i changed the dimension name in dev and want to transport to integration system which is having data in cube.Do i need to delete the data in integration system or while transporting it will delete automatically.

    dear Ajay,
    you mean change the description right ?
    since the 'techincal name' determined by system.
    and you didn't change the characteristics inside right ?
    if so you should have no need to delete the data, you can transport it. system won't automatically delete data, if characteristics inside dimension are changed, you may have error in transport.
    hope this helps.

  • Changes are not reflected in Script output

    Hi All,
    i am facing a problem in SAPscript.
    I have made a Zscript by copying standard script F110_FR_CHEQUE. I have made the changes in the script as per requirement in development client and transported it to testing client to test (As i dont have any data in development client). But, surprisingly, when i run the program and check the output, the changes are not reflected in the script output.
    First i thought that my script was not triggered thats whay i m not getting any change, but later i changed the dimension of one of the window, in which some hard coded text is written, the differece i found was that, window size is changed, but the text written in that window is still same (what was in standard script.) .
    I am using standard texts for hard coding in script. Standard texts have been transported in testing client also.
    please help me in this regard.

    Hi,
    Could you plese Check NACE whether your script is confiugring or not.
    If it is configured well then Check Standard Text is available or not in Test client by open it in SO10.
    Check all the paragrah formats applied to Standard text are transferred to Test client which are in SE72.
    IF it is available in SO10 then debug the print program for that windows any standard conditions are calling to print the text.

  • How can change the font in the script output and the data grid ?

    How can change the font in the script output and the data grid in Sql Developer?

    You can't easily unless you have the latest version (2.1.1).
    If you do have this version then changing the font in the Tools/Preferences menu under the code editor/fonts section will also change the font of the data grid.
    For details of changing the fonts in an earlier version then see Sue's post below.
    http://sueharper.blogspot.com/2010/03/back-to-basics-changing-font-setting-in.html

  • Apple TV names are changing in "show airgroup servers" output on random basis

    Q: Randomly Apple TV names are changing in "show airgroup servers".
    A: Example:
    ========
    (Controller) #  show airgroup servers
    AirGroup Servers
    MAC                IP              Type  Host Name       Service   VLAN  Wired/Wireless  Role          Group  Username  AP-Name
    1c:1a:c0:91:34:9b  10.240.160.29   mDNS  MIT200-2        airplay   29    wired           yrdsb-w-role                   0/0/2
    9c:20:7b:c5:3f:89  10.240.160.32   mDNS  Confern-Room-1  airplay   29    wired           yrdsb-w-role                   0/0/2   
    14:99:e2:0e:b9:15  10.240.160.33   mDNS  Confern-room-2  airplay   29    wired           yrdsb-w-role                   0/0/2   
    (Controller) #  show airgroup servers
    AirGroup Servers
    MAC                IP              Type  Host Name       Service   VLAN  Wired/Wireless  Role          Group  Username  AP-Name
    1c:1a:c0:91:34:9b  10.240.160.29   mDNS  MIT200-2        airplay   29    wired           yrdsb-w-role                   0/0/2
    9c:20:7b:c5:3f:89  10.240.160.32   mDNS  ios200-2        airplay   29    wired           yrdsb-w-role                   0/0/2    <<<<<<<--------  changing the name
    14:99:e2:0e:b9:15  10.240.160.33   mDNS  Confern-room-2  airplay   29    wired           yrdsb-w-role                   0/0/2   
    (Controller) #  show airgroup servers
    AirGroup Servers
    MAC                IP              Type  Host Name       Service   VLAN  Wired/Wireless  Role          Group  Username  AP-Name
    1c:1a:c0:91:34:9b  10.240.160.29   mDNS  MIT200-2        airplay   29    wired           yrdsb-w-role                   0/0/2
    9c:20:7b:c5:3f:89  10.240.160.32   mDNS  ios200-2        airplay   29    wired           yrdsb-w-role                   0/0/2   
    14:99:e2:0e:b9:15  10.240.160.33   mDNS  Confern-room-6  airplay   29    wired           yrdsb-w-role                   0/0/2    <<<<<<<--------  changing the name
    This issue is found in the following scenarios:
    1. When apple TVs are in the same vlan. 
    In the above example, as the both 10.240.160.33 and 10.240.160.32 are wired and they are in same VLAN, their multicast packets reach each other even though AirGroup is there. 
    So they are acting as sleep proxy server for each other. However, It should not cause any issue for mirroring application. When user selects a ATV(Confern-room-6/ios200-2) from his iPad for mirroring, it should be getting displayed on the ATV which ever he has chosen.  
    2. When the option sleep proxy is enabled.
    AirGroup Service Information
    Service        Status
    airplay        Enabled
    airprint       Enabled
    itunes         Disabled
    remotemgmt     Disabled
    sharing        Disabled
    chat           Disabled
    googlecast     Disabled
    DIAL           Enabled
    DLNA Media     Disabled
    DLNA Print     Disabled
    allowall       Disabled
    SonosServices  Disabled
    sleep proxy    Enabled
    In this case, one apple tv is acting as sleep proxy for other apple tv and causing this problem. 

    Q: Randomly Apple TV names are changing in "show airgroup servers".
    A: Example:
    ========
    (Controller) #  show airgroup servers
    AirGroup Servers
    MAC                IP              Type  Host Name       Service   VLAN  Wired/Wireless  Role          Group  Username  AP-Name
    1c:1a:c0:91:34:9b  10.240.160.29   mDNS  MIT200-2        airplay   29    wired           yrdsb-w-role                   0/0/2
    9c:20:7b:c5:3f:89  10.240.160.32   mDNS  Confern-Room-1  airplay   29    wired           yrdsb-w-role                   0/0/2   
    14:99:e2:0e:b9:15  10.240.160.33   mDNS  Confern-room-2  airplay   29    wired           yrdsb-w-role                   0/0/2   
    (Controller) #  show airgroup servers
    AirGroup Servers
    MAC                IP              Type  Host Name       Service   VLAN  Wired/Wireless  Role          Group  Username  AP-Name
    1c:1a:c0:91:34:9b  10.240.160.29   mDNS  MIT200-2        airplay   29    wired           yrdsb-w-role                   0/0/2
    9c:20:7b:c5:3f:89  10.240.160.32   mDNS  ios200-2        airplay   29    wired           yrdsb-w-role                   0/0/2    <<<<<<<--------  changing the name
    14:99:e2:0e:b9:15  10.240.160.33   mDNS  Confern-room-2  airplay   29    wired           yrdsb-w-role                   0/0/2   
    (Controller) #  show airgroup servers
    AirGroup Servers
    MAC                IP              Type  Host Name       Service   VLAN  Wired/Wireless  Role          Group  Username  AP-Name
    1c:1a:c0:91:34:9b  10.240.160.29   mDNS  MIT200-2        airplay   29    wired           yrdsb-w-role                   0/0/2
    9c:20:7b:c5:3f:89  10.240.160.32   mDNS  ios200-2        airplay   29    wired           yrdsb-w-role                   0/0/2   
    14:99:e2:0e:b9:15  10.240.160.33   mDNS  Confern-room-6  airplay   29    wired           yrdsb-w-role                   0/0/2    <<<<<<<--------  changing the name
    This issue is found in the following scenarios:
    1. When apple TVs are in the same vlan. 
    In the above example, as the both 10.240.160.33 and 10.240.160.32 are wired and they are in same VLAN, their multicast packets reach each other even though AirGroup is there. 
    So they are acting as sleep proxy server for each other. However, It should not cause any issue for mirroring application. When user selects a ATV(Confern-room-6/ios200-2) from his iPad for mirroring, it should be getting displayed on the ATV which ever he has chosen.  
    2. When the option sleep proxy is enabled.
    AirGroup Service Information
    Service        Status
    airplay        Enabled
    airprint       Enabled
    itunes         Disabled
    remotemgmt     Disabled
    sharing        Disabled
    chat           Disabled
    googlecast     Disabled
    DIAL           Enabled
    DLNA Media     Disabled
    DLNA Print     Disabled
    allowall       Disabled
    SonosServices  Disabled
    sleep proxy    Enabled
    In this case, one apple tv is acting as sleep proxy for other apple tv and causing this problem. 

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

  • Reg : Sending Script output to email

    Hi,
    I need to send script output to email.I have written the code for this functionality.
    Functional guy has created output type ,but that output type is red in clor and when I click process log " it says Parameter DEVICE= is invalid "
    Is there anything to be done from abap point for this error.
    Actually I used these 2 fun.modules
    DATA: LVF_DEVICE LIKE ITCPP-TDDEVICE.
    DATA: LVS_ITCPO TYPE ITCPO,
    LVF_DIALOG(1) TYPE C VALUE ' ',
    LVS_RECIPIENT LIKE SWOTOBJID,
    LVS_SENDER LIKE SWOTOBJID,
    LVS_SNAST TYPE SNAST,
    LVF_PROGRAM LIKE SY-REPID,
    LVS_COMM_TYPE TYPE AD_COMM,
    LVS_COMM_VALUES TYPE SZADR_COMM_VALUES.
    DATA:
    W_DEPT LIKE KNVK-ABTNR, "Department
    W_PRSNR LIKE KNVK-PRSNR. "Person number
    reset return code
    RETCODE = 0.
    IF NOT NAST-TCODE IS INITIAL AND NAST-NACHA EQ '5'.
    SELECT SINGLE * FROM USR21 WHERE BNAME = SY-UNAME.
    CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
    EXPORTING
    strategy = nast-tcode
    address_number = Kna1-adrnr
    IMPORTING
    comm_type = lvs_comm_type
    comm_values = lvs_comm_values
    TABLES
    STRATEGY_TABLE =
    EXCEPTIONS
    address_not_exist = 1
    person_not_exist = 2
    no_comm_type_found = 3
    internal_error = 4
    parameter_error = 5
    OTHERS = 6.
    convert communication data
    Always INT
    LVS_COMM_TYPE = 'INT'.
    clear LVS_COMM_VALUES-ADSMTP-SMTP_ADDR.
    Get Contact persons number from KNVK
    SELECT SINGLE * FROM KNVK WHERE KUNNR EQ NAST-PARNR
    AND ABTNR EQ W_DEPT.
    Get it from ADR6 table always
    Select single * from adr6 where addrnumber = kna1-adrnr
    AND PERSNUMBER = KNVK-PRSNR.
    IF SY-SUBRC EQ 0 AND adr6-Smtp_addr NE ' '.
    LVS_COMM_VALUES-ADSMTP-SMTP_ADDR = adr6-Smtp_addr.
    ENDIF.
    ENDIF.
    MOVE-CORRESPONDING nast TO LVS_SNAST .
    MOVE sy-repid TO LVF_PROGRAM.
    CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
    EXPORTING
    pi_comm_type = lvs_comm_type
    pi_comm_values = lvs_comm_values
    pi_country = kna1-land1
    pi_repid = LVF_PROGRAM
    pi_snast = LVS_SNAST
    IMPORTING
    pe_itcpo = lvs_itcpo
    pe_device = lvf_device
    pe_mail_recipient = lvs_recipient
    pe_mail_sender = lvs_sender
    EXCEPTIONS
    comm_type_not_supported = 1
    recipient_creation_failed = 2
    sender_creation_failed = 3
    OTHERS = 4.
    fill structure itcpo
    ITCPO = LVS_ITCPO.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    APPLICATION = 'TX'
    ARCHIVE_INDEX = TOA_DARA
    ARCHIVE_PARAMS = ARC_PARAMS
    DEVICE = LVF_DEVICE
    DIALOG = ' '
    FORM = TNAPR-FONAM
    LANGUAGE = NAST-SPRAS
    OPTIONS = LVS_ITCPO
    MAIL_SENDER = LVS_SENDER
    MAIL_RECIPIENT = LVS_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
    OTHERS = 8.
    IF SY-SUBRC NE 0.
    CASE SY-SUBRC.
    WHEN 7.
    RETCODE = SY-SUBRC.
    SYST-MSGID = 'VN'.
    SYST-MSGNO = '096'.
    SYST-MSGTY = 'E'.
    SYST-MSGV1 = NAST-KSCHL.
    SYST-MSGV2 = NAST-KAPPL.
    PERFORM PROTOCOL_UPDATE.
    WHEN OTHERS.
    RETCODE = SY-SUBRC.
    PERFORM PROTOCOL_UPDATE.
    ENDCASE.
    ENDIF.
    and one more query is :
    I want to know weather
    "Are there any settings need to be done by BASIS people."
    If Anyone has any idea plz reply.

    Hi
    Use the below peace of code,I was used to send sales order confirmation script output as email.
    Change History
    Programmer   Date     Change Request Description
    FKHURRAM     9/16/02  DU1K920151     Upgrade changes.
                                         Use ADRC for Address Data
                 Print of an order confirmation by SAPscript
    REPORT rvador01 LINE-COUNT 100 MESSAGE-ID vn.
    TABLES: komk,                          "Communicationarea for conditions
            komp,                          "Communicationarea for conditions
            komvd,                         "Communicationarea for conditions
            vbco3,                         "Communicationarea for view
            vbdka,                         "Headerview
            vbdpa,                         "Itemview
            vbdpau,                        "Subitemnumbers
            conf_out,                      "Configuration data
            sadr,                          "Addresses
            tvag,                          "Reason for rejection
            vedka,                         "Servicecontract head data
            vedpa,                         "Servicecontract position data
            vedkn,                         "Servicecontract head notice data
            vedpn,                         "Servicecontract pos. notice data
            vbpa,                          "Sales Document: Partner
            kna1,                          "General Data in Customer Master
            riserls,                       "Serialnumbers
            komser,                        "Serialnumbers for print
            tvbur,                         "Sales office
            tvko,                          "Sales organisation
            adrs,                          "Communicationarea for Address
            fpltdr.                        "billing schedules
    INCLUDE yzrvadtabl.
    *INCLUDE RVADTABL.
    INCLUDE yzrvdirekt.
    *INCLUDE RVDIREKT.
    INCLUDE yzvedadata.
    *INCLUDE VEDADATA.
    DATA: retcode   LIKE sy-subrc.         "Returncode
    DATA: repeat(1) TYPE c.
    DATA: xscreen(1) TYPE c.               "Output on printer or screen
    DATA: BEGIN OF steu,                   "Controldata for output
            vdkex(1) TYPE c,
            vdpex(1) TYPE c,
            kbkex(1) TYPE c,
            kbpex(1) TYPE c,
          END OF steu.
    DATA: BEGIN OF tvbdpa OCCURS 0.        "Internal table for items
            INCLUDE STRUCTURE vbdpa.
    DATA: END OF tvbdpa.
    DATA: BEGIN OF tkomv OCCURS 50.
            INCLUDE STRUCTURE komv.
    DATA: END OF tkomv.
    DATA: BEGIN OF tkomvd OCCURS 50.
            INCLUDE STRUCTURE komvd.
    DATA: END OF tkomvd.
    DATA: BEGIN OF tvbdpau OCCURS 5.
            INCLUDE STRUCTURE vbdpau.
    DATA: END   OF tvbdpau.
    DATA: BEGIN OF tkomcon OCCURS 50.
            INCLUDE STRUCTURE conf_out.
    DATA: END   OF tkomcon.
    DATA: BEGIN OF tkomservh OCCURS 1.
            INCLUDE STRUCTURE vedka.
    DATA: END   OF tkomservh.
    DATA: BEGIN OF tkomservp OCCURS 5.
            INCLUDE STRUCTURE vedpa.
    DATA: END   OF tkomservp.
    DATA: BEGIN OF tkomservhn OCCURS 5.
            INCLUDE STRUCTURE vedkn.
    DATA: END   OF tkomservhn.
    DATA: BEGIN OF tkomservpn OCCURS 5.
            INCLUDE STRUCTURE vedpn.
    DATA: END   OF tkomservpn.
    DATA: BEGIN OF tkomser OCCURS 5.
            INCLUDE STRUCTURE riserls.
    DATA: END   OF tkomser.
    DATA: BEGIN OF tkomser_print OCCURS 5.
            INCLUDE STRUCTURE komser.
    DATA: END   OF tkomser_print.
    DATA: BEGIN OF tfpltdr OCCURS 5.
            INCLUDE STRUCTURE fpltdr.
    DATA: END   OF tfpltdr.
    DATA: pr_kappl(01)   TYPE c VALUE 'V'. "Application for pricing
    DATA: BEGIN OF char_val OCCURS 0,
            atnam LIKE cabn-atnam,
            atwrt LIKE ausp-atwrt,
          END OF char_val.
    FORM entry USING return_code us_screen.
      CLEAR retcode.
      xscreen = us_screen.
      PERFORM processing.
      IF retcode NE 0.
        return_code = 1.
      ELSE.
        return_code = 0.
      ENDIF.
    ENDFORM.                    "ENTRY
          FORM PROCESSING                                               *
    FORM processing.
      PERFORM get_data.
      CHECK retcode = 0.
      PERFORM form_open USING xscreen vbdka-land1.
      CHECK retcode = 0.
      PERFORM logo_selection.
      PERFORM form_title_print.
      CHECK retcode = 0.
      PERFORM write_header_info.
      PERFORM validity_print.
      CHECK retcode = 0.
      PERFORM header_data_print.
      CHECK retcode = 0.
      PERFORM header_serv_print.
      CHECK retcode = 0.
      PERFORM header_notice_print.
      CHECK retcode = 0.
      PERFORM header_inter_print.
      CHECK retcode = 0.
      PERFORM header_text_print.
      CHECK retcode = 0.
      PERFORM item_print.
      CHECK retcode = 0.
      PERFORM end_print.
      CHECK retcode = 0.
      PERFORM form_close.
      CHECK retcode = 0.
    *********************changes on 12/04/2007****************
      TABLES: tsp01.
      TYPES: BEGIN OF t_spool,
             rqident TYPE tsp01-rqident,
            END OF t_spool.
      DATA: i_spool TYPE STANDARD TABLE OF t_spool,
            wa_spool TYPE t_spool.
      SELECT  rqident FROM tsp01
      INTO TABLE i_spool
    WHERE rqowner = sy-uname.
      SORT i_spool DESCENDING BY rqident.
      LOOP AT i_spool INTO wa_spool.
      ENDLOOP.
    data: l_rqident type tsp01-rqident.
    SELECT SINGLE rqident FROM tsp01 INTO l_rqident
    WHERE rqowner = sy-uname.
    DATA: l_spoolno LIKE tsp01-rqident VALUE '0000024884'.
      TYPES: l_ty_tab_pdf TYPE tline OCCURS 0.
      DATA: l_pdf TYPE l_ty_tab_pdf,
            l_spool TYPE tsp01-rqident.
    Type for binary attachment table.
      TYPES: l_ty_tab_objbin TYPE solisti1 OCCURS 0.
      DATA: l_objbin TYPE l_ty_tab_objbin.
    l_spool = l_spoolno.
      l_spool = l_rqident.
      l_spool = wa_spool-rqident.
    **/ Call the standard function
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'             "#EC ARGCHECKED
          EXPORTING
            src_spoolid                    = l_spool
            no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
         IMPORTING
           pdf_bytecount                  = numbytes
           pdf_spoolid                    = pdfspoolid
          LIST_PAGECOUNT                 =
           btc_jobname                    = jobname
           btc_jobcount                   = jobcount
          TABLES
            pdf                            = l_pdf
          EXCEPTIONS
            err_no_abap_spooljob           = 1
            err_no_spooljob                = 2
            err_no_permission              = 3
            err_conv_not_possible          = 4
            err_bad_destdevice             = 5
            user_cancelled                 = 6
            err_spoolerror                 = 7
            err_temseerror                 = 8
            err_btcjob_open_failed         = 9
            err_btcjob_submit_failed       = 10
            err_btcjob_close_failed        = 11
            OTHERS                         = 12.
      IF sy-subrc <> 0.
        WRITE: / 'error', sy-subrc.
      ENDIF.
    **/ Convert the PDF format to the table type required for the
    *attachment.
      CALL FUNCTION 'QCE1_CONVERT'
        TABLES
          t_source_tab         = l_pdf
          t_target_tab         = l_objbin
        EXCEPTIONS
          convert_not_possible = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
        WRITE: / 'error', sy-subrc.
      ENDIF.
      TABLES : soli.
      TABLES : zpsdsalrep.
      DATA: v_email TYPE soli-line.
      DATA: v_email1 TYPE soli-line.
      DATA: l_adrnr LIKE kna1-adrnr.
      DATA: l_objky TYPE nast-objky.
      DATA: l_zzterrmg TYPE zpsdsalrep-zzterrmg.
      DATA: l_zsupervisor TYPE zpsdsalrep-zsupervisor.
      DATA: l_kunnr TYPE kna1-kunnr.
      DATA: l_kunnr1 TYPE vbak-kunnr.
      SELECT SINGLE kunnr FROM vbak INTO l_kunnr1
             WHERE vbeln = nast-objky.
      SELECT SINGLE adrnr FROM kna1 INTO l_adrnr
             WHERE kunnr = l_kunnr1.
      CHECK sy-subrc IS INITIAL.
      SELECT SINGLE smtp_addr FROM adr6 INTO v_email
             WHERE addrnumber = l_adrnr.
      SELECT SINGLE zzterrmg FROM zpsdsalrep INTO l_zzterrmg
             WHERE zzsalesrep = l_kunnr1.
      SELECT SINGLE zsupervisor FROM zpsdsalrep INTO l_zsupervisor
          WHERE  zzterrmg = l_zzterrmg.
      SELECT SINGLE kunnr FROM kna1 INTO l_kunnr
            WHERE sortl = l_zsupervisor.
      SELECT SINGLE adrnr FROM kna1 INTO l_adrnr
             WHERE kunnr = l_kunnr.
      CHECK sy-subrc IS INITIAL.
      SELECT SINGLE smtp_addr FROM adr6 INTO v_email1
             WHERE addrnumber = l_adrnr.
      DATA: l_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
      DATA: l_objtxt    LIKE solisti1 OCCURS   0 WITH HEADER LINE.
      DATA: l_objpack   LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
      DATA: l_doc_chng  LIKE sodocchgi1.
      DATA: l_objhead   LIKE solisti1 OCCURS   0 WITH HEADER LINE.
      DATA: l_tab_lines LIKE sy-tabix.
      CONSTANTS: k_true TYPE boolean_flg VALUE 'X'.
      DATA: l_mail TYPE somlreci1-receiver.
      DATA: l_mail1 TYPE somlreci1-receiver.
      DATA: k_mail2 TYPE somlreci1-receiver.
      DATA: k_mail TYPE somlreci1-receiver.
      l_mail = v_email.
      l_mail1 = v_email1.
      k_mail2 = text-006.
      k_mail = text-007.
    Creation of the document to be sent
    File Name
      l_doc_chng-obj_name = 'SENDFILE'.
    Mail Subject
      l_doc_chng-obj_descr = text-001.
    Completing the recipient list
      l_reclist-receiver = l_mail.
      l_reclist-rec_type = 'U'.
      APPEND l_reclist.
      l_reclist-receiver = l_mail1.
      l_reclist-rec_type = 'U'.
      APPEND l_reclist.
      l_reclist-receiver = k_mail.
      l_reclist-rec_type = 'U'.
      APPEND l_reclist.
      l_reclist-receiver = k_mail2.
      l_reclist-rec_type = 'U'.
      APPEND l_reclist.
    Mail Contents
      l_objtxt = text-002.
      APPEND l_objtxt.
      CLEAR l_objtxt.     " put in a blank line
      APPEND l_objtxt.
      l_objtxt = text-003.
      APPEND l_objtxt.
      l_objtxt = text-004 .
      APPEND l_objtxt.
    Calculate email size in bytes
      DESCRIBE TABLE l_objtxt LINES l_tab_lines.
      READ TABLE l_objtxt INDEX l_tab_lines.
      l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_objtxt ).
    Creation of the entry for the compressed document
    for the email text
      CLEAR l_objpack-transf_bin.
      l_objpack-head_start = 1.
      l_objpack-head_num = 0.
      l_objpack-body_start = 1.
      l_objpack-body_num = l_tab_lines.
      l_objpack-doc_type = 'RAW'.
      APPEND l_objpack.
    Creation of the document attachment
    (Assume that the data in OBJBIN is in BMP format)
      DESCRIBE TABLE l_objbin LINES l_tab_lines.
      l_objhead = text-001  .
      APPEND l_objhead.
      CLEAR l_objpack.
    **/ Creation of the entry for the compressed/attached document
      l_objpack-transf_bin = k_true.
      l_objpack-head_start = 1.
      l_objpack-head_num = 1.
      l_objpack-body_start = 1.
      l_objpack-body_num = l_tab_lines.
      l_objpack-doc_type = 'PDF'.
      l_objpack-obj_name = text-005.
      l_objpack-obj_descr = text-001.
      l_objpack-doc_size = l_tab_lines * 255.
      APPEND l_objpack. "/ .
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' "/ .
        EXPORTING
          document_data              = l_doc_chng
          put_in_outbox              = 'X'
        TABLES
          packing_list               = l_objpack
          object_header              = l_objhead
          contents_bin               = l_objbin
          contents_txt               = l_objtxt
          receivers                  = l_reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc <> 0.
        WRITE: / 'unsuccessful', sy-subrc.
      ELSE.
        WRITE:  / 'successful'.
      ENDIF.
    **/Take_note it is a requirement to do a commit work for the
    email to go into transaction SOST.
      COMMIT WORK.   "/Take_note .
    ENDFORM.                    "PROCESSING
          S U B R O U T I N E S                                         *
          FORM ALTERNATIVE_ITEM                                         *
          A text is printed, if the item is an alternative item.        *
    FORM alternative_item.
      CHECK vbdpa-grpos CN '0'.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'ALTERNATIVE_ITEM'
        EXCEPTIONS
          element = 1
          window  = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    "ALTERNATIVE_ITEM
          FORM CHECK_REPEAT                                             *
          A text is printed, if it is a repeat print for the document.  *
    FORM check_repeat.
      CLEAR repeat.
      SELECT * INTO *nast FROM nast WHERE kappl = nast-kappl
                                    AND   objky = nast-objky
                                    AND   kschl = nast-kschl
                                    AND   spras = nast-spras
                                    AND   parnr = nast-parnr
                                    AND   parvw = nast-parvw
                                    AND   nacha BETWEEN '1' AND '4'.
        CHECK *nast-vstat = '1'.
        repeat = 'X'.
        EXIT.
      ENDSELECT.
    ENDFORM.                    "CHECK_REPEAT
          FORM DELIVERY_DATE                                            *
          If the delivery date in the item is different to the header   *
          date and there are no scheduled quantities, the delivery date *
          is printed in the item block.                                 *
    FORM delivery_date.
      IF vbdka-lfdat =  space AND
         vbdpa-lfdat NE space AND
         vbdpa-etenr_da = space.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'ITEM_DELIVERY_DATE'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
      ENDIF.
    ENDFORM.                    "DELIVERY_DATE
          FORM DIFFERENT_CONSIGNEE                                      *
          If the consignee in the item is different to the header con-  *
          signee, it is printed by this routine.                        *
    FORM different_consignee.
      CHECK vbdka-name1_we NE vbdpa-name1_we
        OR  vbdka-name2_we NE vbdpa-name2_we
        OR  vbdka-name3_we NE vbdpa-name3_we
        OR  vbdka-name4_we NE vbdpa-name4_we.
      CHECK vbdpa-name1_we NE space
        OR  vbdpa-name2_we NE space
        OR  vbdpa-name3_we NE space
        OR  vbdpa-name4_we NE space.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'ITEM_CONSIGNEE'
        EXCEPTIONS
          element = 1
          window  = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    "DIFFERENT_CONSIGNEE
          FORM DIFFERENT_REFERENCE_NO                                   *
          If the reference number in the item is different to the header*
          reference number, it is printed by this routine.              *
    FORM different_reference_no.
      CHECK vbdpa-vbeln_vang NE vbdka-vbeln_vang
        OR  vbdpa-vbtyp_vang NE vbdka-vbtyp_vang.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'ITEM_REFERENCE_NO'
        EXCEPTIONS
          element = 1
          window  = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    "DIFFERENT_REFERENCE_NO
          FORM DIFFERENT_TERMS                                          *
          If the terms in the item are different to the header terms,   *
          they are printed by this routine.                             *
    FORM different_terms.
      DATA: us_vposn   LIKE vedpa-vposn.
      DATA: us_text(1) TYPE c.             "Flag for Noticetext was printed
      IF vbdpa-zterm NE vbdka-zterm AND
         vbdpa-zterm NE space.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'ITEM_TERMS_OF_PAYMENT'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
      ENDIF.
      IF vbdpa-inco1 NE space.
        IF vbdpa-inco1 NE vbdka-inco1 OR
           vbdpa-inco2 NE vbdka-inco2.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_TERMS_OF_DELIVERY'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        ENDIF.
      ENDIF.
    Print different validity-data for the position
      READ TABLE tkomservp WITH KEY vbdpa-posnr.
      IF sy-subrc EQ 0.
        vedpa = tkomservp.
        IF vedpa-vbegdat NE space       AND
           vedpa-venddat NE space       AND
           NOT vedpa-vbegdat IS INITIAL AND
           NOT vedpa-venddat IS INITIAL.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_TERMS_OF_SERV1'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        ELSEIF vedpa-vbegdat NE space AND
               NOT vedpa-vbegdat IS INITIAL.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_TERMS_OF_SERV2'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        ELSE.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_TERMS_OF_SERV3'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        ENDIF.
      ENDIF.
    Notice-rules for the positions.
      MOVE vbdpa-posnr TO us_vposn.
      CLEAR us_text.
      LOOP AT tkomservpn WHERE vposn = us_vposn.
        vedpn = tkomservpn.
        IF us_text IS INITIAL.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_TERMS_OF_NOTTXT'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
          us_text = charx.
        ENDIF.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'ITEM_TERMS_OF_NOTICE'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
      ENDLOOP.
      IF NOT us_text IS INITIAL.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'EMPTY_LINE'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
      ENDIF.
    ENDFORM.                    "DIFFERENT_TERMS
          FORM END_PRINT                                                *
    FORM end_print.
      PERFORM get_header_prices.
      CALL FUNCTION 'CONTROL_FORM'
        EXPORTING
          command = 'PROTECT'.
      PERFORM header_price_print.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'END_VALUES'.
      CALL FUNCTION 'CONTROL_FORM'
        EXPORTING
          command = 'ENDPROTECT'.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'SUPPLEMENT_TEXT'
        EXCEPTIONS
          element = 1
          window  = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    "END_PRINT
          FORM FORM_CLOSE                                               *
          End of printing the form                                      *
    FORM form_close.
      CALL FUNCTION 'CLOSE_FORM'
        EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
        retcode = 1.
      ENDIF.
      SET COUNTRY space.
    ENDFORM.                    "FORM_CLOSE
          FORM FORM_OPEN                                                *
          Start of printing the form                                    *
    -->  US_SCREEN  Output on screen                                   *
                     ' ' = printer                                      *
                     'X' = screen                                       *
    -->  US_COUNTRY County for telecommunication and SET COUNTRY       *
    FORM form_open USING us_screen us_country.
      INCLUDE yzrvadopfo.
    INCLUDE RVADOPFO.
    ENDFORM.                    "FORM_OPEN
          FORM FORM_TITLE_PRINT                                         *
          Printing of the form title depending of the field VBTYP       *
    FORM form_title_print.
      CASE vbdka-vbtyp.
        WHEN 'A'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_A'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'B'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_B'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'C'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_C'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'E'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_E'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'F'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_F'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'G'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_F'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'H'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_H'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'K'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_K'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'L'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_L'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN OTHERS.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_OTHERS'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
      ENDCASE.
      IF repeat NE space.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'REPEAT'
            window  = 'REPEAT'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
      ENDIF.
    ENDFORM.                    "FORM_TITLE_PRINT
          FORM GET_DATA                                                 *
          General provision of data for the form                        *
    FORM get_data.
      DATA: us_veda_vbeln     LIKE veda-vbeln.
      DATA: us_veda_posnr_low LIKE veda-vposn.
      CALL FUNCTION 'RV_PRICE_PRINT_REFRESH'
        TABLES
          tkomv = tkomv.
      CLEAR komk.
      CLEAR komp.
      vbco3-mandt = sy-mandt.
      vbco3-spras = nast-spras.
      vbco3-vbeln = nast-objky.
      vbco3-kunde = nast-parnr.
      vbco3-parvw = nast-parvw.
      CALL FUNCTION 'RV_DOCUMENT_PRINT_VIEW'
        EXPORTING
          comwa = vbco3
        IMPORTING
          kopf  = vbdka
        TABLES
          pos   = tvbdpa.
    Fetch servicecontract-data and notice-data for head and position.
      us_veda_vbeln     = vbdka-vbeln.
      us_veda_posnr_low = posnr_low.
      CALL FUNCTION 'SD_VEDA_GET_PRINT_DATA'
        EXPORTING
          i_document_number = us_veda_vbeln
          i_language        = sy-langu
          i_posnr_low       = us_veda_posnr_low
        TABLES
          print_data_pos    = tkomservp
          print_data_head   = tkomservh
          print_notice_pos  = tkomservpn
          print_notice_head = tkomservhn.
      PERFORM get_controll_data.
      PERFORM sender.
      PERFORM check_repeat.
      PERFORM tvbdpau_create.
    ENDFORM.                    "GET_DATA
          FORM GET_ITEM_BILLING_SCHEDULES                               *
          In this routine the billing schedules are fetched from the    *
          database.                                                     *
    FORM get_item_billing_schedules.
      REFRESH tfpltdr.
      CHECK NOT vbdpa-fplnr IS INITIAL.
      CALL FUNCTION 'BILLING_SCHED_PRINTVIEW_READ'
        EXPORTING
          i_fplnr    = vbdpa-fplnr
          i_language = nast-spras
        TABLES
          zfpltdr    = tfpltdr.
    ENDFORM.                    "GET_ITEM_BILLING_SCHEDULES
    *&      Form  ITEM_BILLING_SCHEDULES_PRINT
          This routine prints the billing shedules of a salesdocument    *
          position.                                                      *
    FORM  item_billing_schedules_print.
      DATA: first_line(1) TYPE c.
      first_line = charx.
      LOOP AT tfpltdr.
        fpltdr = tfpltdr.
      Output of the following printlines
        IF NOT fpltdr-perio IS INITIAL.
        periodische Fakturen
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_BILLING_SCHEDULE_PERIODIC'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        bei periodischen nur eine Zeile
          EXIT.
        ELSEIF fpltdr-fareg CA '14'.
        prozentuale Teilfakturierung
          IF NOT first_line IS INITIAL.
            CLEAR first_line.
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'ITEM_BILLING_SCHEDULE_PERCENT_HEADER'
              EXCEPTIONS
                element = 1
                window  = 2.
            IF sy-subrc NE 0.
              PERFORM protocol_update.
            ENDIF.
          ELSE.
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'ITEM_BILLING_SCHEDULE_PERCENT'
              EXCEPTIONS
                element = 1
                window  = 2.
            IF sy-subrc NE 0.
              PERFORM protocol_update.
            ENDIF.
          ENDIF.
        ELSEIF fpltdr-fareg CA '235'.
        wertmäßige  Teilfakturierung
          IF NOT first_line IS INITIAL.
            CLEAR first_line.
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'ITEM_BILLING_SCHEDULE_VALUE_HEADER'
              EXCEPTIONS
                element = 1
                window  = 2.
            IF sy-subrc NE 0.
              PERFORM protocol_update.
            ENDIF.
          ELSE.
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'ITEM_BILLING_SCHEDULE_VALUE'
              EXCEPTIONS
                element = 1
                window  = 2.
            IF sy-subrc NE 0.
              PERFORM protocol_update.
            ENDIF.
          ENDIF.
        ELSEIF fpltdr-fareg CA '3'.
        Schlußrechnung
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "ITEM_BILLING_SCHEDULES_PRINT
    *eject
          FORM GET_ITEM_CHARACTERISTICS                                 *
          In this routine the configuration data item is fetched from   *
          the database.                                                 *
    FORM get_item_characteristics.
      REFRESH tkomcon.
      CHECK NOT vbdpa-cuobj IS INITIAL.
      CALL FUNCTION 'CUD0_GET_CONFIGURATION'                    "#EC EXISTS
        EXPORTING
          instance      = vbdpa-cuobj
          language      = nast-spras
        TABLES
          configuration = tkomcon
        EXCEPTIONS
          OTHERS        = 4.
    ENDFORM.                    "GET_ITEM_CHARACTERISTICS
          FORM GET_ITEM_PRICES                                          *
          In this routine the price data for the item is fetched from   *
          the database.                                                 *
    FORM get_item_prices.
      CLEAR: komp,
             tkomv.
      IF komk-knumv NE vbdka-knumv.
        CLEAR komk.
        komk-mandt = sy-mandt.
        komk-kalsm = vbdka-kalsm.
        komk-kappl = pr_kappl.
        komk-waerk = vbdka-waerk.
        komk-knumv = vbdka-knumv.
        komk-vbtyp = vbdka-vbtyp.
      ENDIF.
      komp-kposn = vbdpa-posnr.
      CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
        EXPORTING
          comm_head_i = komk
          comm_item_i = komp
          language    = nast-spras
        IMPORTING
          comm_head_e = komk
          comm_item_e = komp
        TABLES
          tkomv       = tkomv
          tkomvd      = tkomvd.
    ENDFORM.                    "GET_ITEM_PRICES
          FORM GET_HEADER_PRICES                                        *
          In this routine the price data for the header is fetched from *
          the database.                                                 *
    FORM get_header_prices.
      CALL FUNCTION 'RV_PRICE_PRINT_HEAD'
        EXPORTING
          comm_head_i = komk
          language    = nast-spras
        IMPORTING
          comm_head_e = komk
        TABLES
          tkomv       = tkomv
          tkomvd      = tkomvd.
    ENDFORM.                    "GET_HEADER_PRICES
    *&      Form  HEADER_DATA_PRINT
          Printing of header data like terms, weights ....               *
    FORM header_data_print.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'HEADER_DATA'
        EXCEPTIONS
          element = 1
          window  = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                               " HEADER_DATA_PRINT
          FORM HEADER_PRICE_PRINT                                       *
          Printout of the header prices                                 *
    FORM header_price_print.
      LOOP AT tkomvd.
        AT FIRST.
          IF komk-supos NE 0.
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'ITEM_SUM'.
          ELSE.
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'UNDER_LINE'
              EXCEPTIONS
                element = 1
                window  = 2.
            IF sy-subrc NE 0.
              PERFORM protocol_update.
            ENDIF.
          ENDIF.
        ENDAT.
        komvd = tkomvd.
        IF komvd-koaid = 'D'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TAX_LINE'.
        ELSE.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'SUM_LINE'.
        ENDIF.
      ENDLOOP.
      DESCRIBE TABLE tkomvd LINES sy-tfill.
      IF sy-tfill = 0.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'UNDER_LINE'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
      ENDIF.
    ENDFORM.                    "HEADER_PRICE_PRINT
          FORM HEADER_TEXT_PRINT                                        *
          Printout of the headertexts                                   *
    FORM header_text_print.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'HEADER_TEXT'
        EXCEPTIONS
          element = 1
          window  = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    "HEADER_TEXT_PRINT
          FORM ITEM_CHARACERISTICS_PRINT                                *
          Printout of the item characteristics -> configuration         *
    FORM item_characteristics_print.
      LOOP AT tkomcon.
        conf_out = tkomcon.
        IF sy-tabix = 1.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_LINE_CONFIGURATION_HEADER'
            EXCEPTIONS
              OTHERS  = 1.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        ELSE.
          CALL FUNCTION 'WRITE_FORM'
            EXPOR

  • SQL Worksheet - Script output is restricted to 5000 rows

    Hello,
    till now only 5000 rows are currently supported in a script results.
    I have read, this count will be a preference in future releases. Is there such a release and if "yes" how can I change this count of rows?
    Script Output of SQL Worksheet is the only possibility in SQL Developer I know, to export data from a query, that is a join of multiple tables, into flat file. Is there another one?
    Thanks,
    Tzonka

    You can run your query as a statement (F9) and the results will be displayed in the Results tab. In the Results tab, you can right-click, select Export and then Text. This will allow you to export the results of the query into a text file (or the clipboard). This will enclose values with " and separate with tabs (allowing alternatives is another "wait for a later release" function).
    This will produce the equivalent output of creating the view and exporting the data from the view tab as suggested by Sharon, without having to go to the effort of creating the view.
    If by "flat file" you mean exactly what you would get with a spool from SQL*Plus, then the Script tab is your only option and you are restricted to the 5000 rows.

  • Color shell/script output in bash/zsh

    So, I wanted to have an easy way to color my script output. In zsh there is a color module, but as far as I know it does only bold for special effects. Also there are some scripts around that let you call a predefined array, but there aren't any where you can combine options easily, like both bold and italic. ansi-color comes close, but it has almost 250 lines of code and I thought it could be done more efficiently. So here's color, both in a zsh and a bash variant (the shebang and the way of defining an array being the only difference).
    Save as "color" in your path, or wrap it in a function to store in either .bashrc or .zshrc. color --help for instructions. Let me know what you think, if it has bugs or if the coding can be more efficient or better (I did this mostly as a programming exercise, it's not *that* useful.
    ZSH color
    #!/bin/zsh
    color-usage() {
    cat <<"USAGE"
    Usage: color [OPTIONS] <color>
    -b|--bold for bold text
    -i|--italic for italic text
    -u|--underline for underlined text
    -f|--flash for blinking text, not possible together with --bg
    -r|--reverse to switch fg and bg colors
    -/--bg <color> for background color
    -d|--dark for fainted / less intense colors (your terminal may not support this)
    -x|--invisible for invisible text (your terminal may not support this)
    -ff|--fastflash for fast blinking text (your terminal may not support this), not possible together with --bg
    Color can be: black, red, green, yellow, blue, magenta, cyan, white and lightblack, lightred etc.
    Use "color" without specifying the color to reset to default.
    Notes:
    1. You can not use blink in combination with --bg, but you can do -r instead and define <color> as desired bg-color. Example: color -f -r blue lets black text blink on blue background. This means you have the bg color as text color, which can't be changed."
    2. Append $(color) behind the string you have formatted, or the color sequence may stay in effect, especially in bash.
    3. You can combine options like -b -i -f, but be sensible; -x -f is not sensible; neither is -d lightred.
    Examples:
    echo "This is $(color -f -i lightred)blinking italic lightred text$(color)"
    echo "This is $(color -bg blue white)white text on blue bg$(color)"
    echo "This shows words in $(color green)green $(color magenta)magenta $(color)and the rest normal"
    echo "This shows $(color -f -r cyan)bold blinking text on cyan background$(color)"
    USAGE
    # Define and create array "colors"
    typeset -Ag colors
    colors=( black "0" red "1" green "2" yellow "3" blue "4" magenta "5" cyan "6" white "7" )
    # Loop to read options and arguments
    while [ $1 ]; do
    case "$1" in
    '-h'|'--help') color-usage;;
    '-b'|'--bold') mode="${mode}1;";;
    '-d'|'--dark') mode="${mode}2;";;
    '-i'|'--italic') mode="${mode}3;";;
    '-u'|'--underline') mode="${mode}4;";;
    '-f'|'--flash') mode="${mode}5;";;
    '-ff'|'--fastflash') mode="${mode}6;";;
    '-r'|'--reverse') mode="${mode}7;";;
    '-x'|'--invisible') mode="8;";;
    '-bg'|'--bg') case "$2" in
    light*) bgc=";10${colors[${2#light}]}"; shift;;
    black|red|green|yellow|blue|magenta|cyan|white) bgc=";4${colors[$2]}"; shift;;
    esac;;
    'reset') reset=true;;
    *) case "$1" in
    light*) fgc=";9${colors[${1#light}]}";;
    black|red|green|yellow|blue|magenta|cyan|white) fgc=";3${colors[$1]}";;
    *) echo The color loop is buggy or you used it wrong;;
    esac;;
    esac
    shift
    done
    # Set color sequence
    mode="${mode%;}" # strip ";" from mode string if it ends with that
    echo -e "\e[${mode:-0}${fgc}${bgc}m" # (default value for mode = 0, so if nothing was set, go default; -e to please bash)
    unset mode intensity bgc fgc # clean up
    BASH color
    #!/bin/bash
    color-usage() {
    cat <<"USAGE"
    Usage: color [OPTIONS] <color>
    -b|--bold for bold text
    -i|--italic for italic text
    -u|--underline for underlined text
    -f|--flash for blinking text, not possible together with --bg
    -r|--reverse to switch fg and bg colors
    -/--bg <color> for background color
    -d|--dark for fainted / less intense colors (your terminal may not support this)
    -x|--invisible for invisible text (your terminal may not support this)
    -ff|--fastflash for fast blinking text (your terminal may not support this), not possible together with --bg
    Color can be: black, red, green, yellow, blue, magenta, cyan, white and lightblack, lightred etc.
    Use "color" without specifying the color to reset to default.
    Notes:
    1. You can not use blink in combination with --bg, but you can do -r instead and define <color> as desired bg-color. Example: color -f -r blue lets black text blink on blue background. This means you have the bg color as text color, which can't be changed."
    2. Append $(color) behind the string you have formatted, or the color sequence may stay in effect, especially in bash.
    3. You can combine options like -b -i -f, but be sensible; -x -f is not sensible; neither is -d lightred.
    Examples:
    echo "This is $(color -f -i lightred)blinking italic lightred text$(color)"
    echo "This is $(color -bg blue white)white text on blue bg$(color)"
    echo "This shows words in $(color green)green $(color magenta)magenta $(color)and the rest normal"
    echo "This shows $(color -f -r cyan)bold blinking text on cyan background$(color)"
    USAGE
    # Define and create array "colors"
    declare -A colors
    colors=( [black]="0" [red]="1" [green]="2" [yellow]="3" [blue]="4" [magenta]="5" [cyan]="6" [white]="7" )
    # Loop to read options and arguments
    while [ $1 ]; do
    case "$1" in
    '-h'|'--help') color-usage;;
    '-b'|'--bold') mode="${mode}1;";;
    '-d'|'--dark') mode="${mode}2;";;
    '-i'|'--italic') mode="${mode}3;";;
    '-u'|'--underline') mode="${mode}4;";;
    '-f'|'--flash') mode="${mode}5;";;
    '-ff'|'--fastflash') mode="${mode}6;";;
    '-r'|'--reverse') mode="${mode}7;";;
    '-x'|'--invisible') mode="8;";;
    '-bg'|'--bg') case "$2" in
    light*) bgc=";10${colors[${2#light}]}"; shift;;
    black|red|green|yellow|blue|magenta|cyan|white) bgc=";4${colors[$2]}"; shift;;
    esac;;
    'reset') reset=true;;
    *) case "$1" in
    light*) fgc=";9${colors[${1#light}]}";;
    black|red|green|yellow|blue|magenta|cyan|white) fgc=";3${colors[$1]}";;
    *) echo The color loop is buggy or you used it wrong;;
    esac;;
    esac
    shift
    done
    # Set color sequence
    mode="${mode%;}" # strip ";" from mode string if it ends with that
    echo -e "\e[${mode:-0}${fgc}${bgc}m" # (default value for mode = 0, so if nothing was set, go default; -e to please bash)
    unset mode intensity bgc fgc # clean up

    Soemthing like this will work

  • SQL Developer formatting script output

    Im new to sql developer. I have been unable to format the script output to decrease the width of the column below.
    All numeric columns seem to use 22 underscores. I would like to format this to make it more presentable to users.
    I have tried column, substr, and the various trims. While these work in native unix, they do not seem to work in
    SQL Developer. Up till now I have found SQL Developer to be a very usefull tool. I hope this is just a matter of me not
    having enough knowledge of the product and not a problem with it.
    Any and all assistance greatly appreciated.
    MACCNO
    3021202

    788184 wrote:
    What I need is to produce the following (column is numeric 5)
    HEAD1
    12345
    instead of what comes out currently
    HEAD1
    12345
    Yes, have checked preferences but could not see anything to change.
    Edited by: 788184 on 12/08/2010 19:55I think the problem is related to SQL*PLUS. SQL Developer tries to mimick SQL*PLUS whan you run something as a script. The mimicking s not perfect though.
    The size of this line depends on the typeof the database field. For numbers a larger line is taken. For varchar2 it depends from the size of the values or the header.
    If you are absolutly sure that data inside this column is always smaller, then you could try the following thing.
    select cast(HEAD1 as varchar2(5)) as HEAD1 from yourTableBe careful since this will do a number to string conversion. But since it seems to be for reporting purposes that should be ok.

  • Creating data output based on changes to fields

    Hi
    I am using SQL Server 2008 R2 BIDS and need to produce a weekly report whos output only shows changes from the previous weeks report and not sure if this can be done or where to start so any help very much appreciated.
    The scenario is this.
    I have a table where data is uploaded automatically (date created) and there are three main fields that can change. There are over two thousand rows added at each upload.
    Column1 will be the date created
    Column 2 will be a monetary value
    Column 3 will be a reference number
    In the example above with one reference number the first three rows there is no Amount change so each time the report is run this would not be included in the output. In Row 4 there is an amount change so this row should be included in the report output.Row
    5 changes again so the next time the report runs this should show in report output. There is no change to Amount in Row 6 or 7 so these should not show in the next report output.
    If the report was run on 20/03/2015 then there would be no output as no previous changes
    Similarly if the next report was run on 10/04/2015 then it should show the changes on 26/03/2015 and 09/04/2015.
    There could be NULL value in the Amount column and again if at some stage an Amount was uploaded then this would show a change and should be included in the next time the report run.
    Any changes to data from automatic upload then need to manually adjusted and to save a user comparing thousand of rows i was hoping that by creating a report to only highlight changes would be a great time saver.
    I hope i have explained this okay and any thoughts or assitance would be great
    Thanks
    John

    Hi
    I have put the query into SQL Server Management studio to test using the table field names but it doesnt seem to giving me the expected output. This returned over 111392 rows. I have filtered this to just show the reuslts for tency_seq_no 200002 which
    returns 57 rows.
    DECLARE @InputDate Date = '2015-04-09'
    ;WITH cte AS
    SELECT *,ROW_NUMBER() OVER(ORDER BY trans_date)
    -ROW_NUMBER() OVER(PARTITION BY grs_val_trans ORDER BY trans_date) rn
    FROM hratrans
    SELECT MIN(trans_date)as DateCreated, grs_val_trans, tency_seq_no, rn FROM cte
    WHERE rn <> 0 and trans_date < @InputDate and con_sou_cd = 'HB' and tency_seq_no = '200002'
    GROUP BY RN,grs_val_trans,tency_seq_no
    This is in fact showing all weekly transactions over the past year for this particular tency_seq_no.
    However i only want the report to show any changes since the last time the report was run. So in the image shown below for tency_seq_no 200002 if i select 09/04/2015 as the input date i would want two rows in the output showing -62.11 both on the 09/04/2015
    as this was a change from the previous -61.11 recorded on 26/03/2015.
    The image below just shows part of the table hratrans
    Likewise if i had used an input date of 12/03/2015 at -60.71 then there would be no output for this as the previous date of 05/03/2015 was also -60.71.
    Thanks
    John

  • In which table scripts and smartforms are stored

    in which tables scripts and smartforms are stored
    eg scripts in tadir.

    Hi this may be of some help.
    SD
    SALES ORDER/ENQUIRY/QUOTATION
    Output type         : BA00
    ScriptForm Name     : RVORDER01
    Driver Program Name : RVADOR01
    smartform name
    DELIVERY NOTE
    Output type         : LD00
    ScriptForm Name     : RVDELNOTE
    Driver Program Name : RVADDN01
    smartform name      : LE_SHP_DELNOTE
    Smartform Driver Pgm: RLE_DELNOTE
    INVOICE
    Output type         : RD00
    ScriptForm Name     : RVINVOICE01
    Driver Program Name : RVADIN01
    smartform name      : LB_BIL_INVOICE
    Smartform Driver Pgm: RLB_INVOICE
    MM
    PUCHASE ORDER/RFQ/CONTRACT
    Output type         : NEU
    ScriptForm Name     : MEDRUCK
    Driver Program Name : SAPMF06P
    smartform name      : /SMB40/MMPO_L
    smartform driver program: /SMB40/FM06P
    GOODS RECEIPT
    Output type         : WE01
    ScriptForm Name     : WESCHEINVERS1
    smartform name      : /SMB40/MMGR1_A
    smartform driver program: /SMB40/M07DR
    GOODS ISSUE
    Output type         : WA01
    ScriptForm Name     : WA_SCHEINVERS1
    smartform name      : /SMB40/MMGI1_A
    smartform driver program: /SMB40/M07DR
    FI Forms
    Account Statement   : F140_ACC_STAT_01
    Cheque Printing     : F110_PRENUM_CHEK
    Balance Confirmation: F130_confirm_01
    Dunning Form:         F150_DUNN_01
    check the link below it provides steps to convert sap scripts to smartforms
    http://www.ficoexpertonline.com/downloads/Iyer_SmartForms.pdf
    SMARTFORMS -Driver Program
    PO: /SMB40/FM06P
    SO: /SMB40/RVADOR01
    GR: /SMB40/M07DR
    with regards,
    Hema Sundara.
    pls give points if u find this helpful.

  • Dimensions are saving as .xls instead of .xlsx

    I am on BPC 7.0.  My dimensions are currently saving as .xls (Excel 2003) files when I process the dimesnion from Admin.  How can I change this so that the dimensions will save as .xlsx (Excel 2007) files?  I have tried opening the dimension file in Excel 2007, then saving it as an .xlsx file, but when I try to open the dimension from Admin afterward, it does not recognize the file. 
    Any help would be appreciated.  Thanks.

    Hi Khristina,
    The SP2 does support excel 2007 format. However, there are few catches.
    When you process dimension for the first time, a message window will pop up asking to select the version, 2003 or earlier, or 2007. Once this option has been selected. It creates an entry in the table tblDefaults and cannot be changed later.
    If you have selected 2003 or earlier, then the dimensions will be saved with .xls extension. In this case, all the excel versions (including 2007) can open the dimension sheets.
    If you have selected 2007, the dimensions will be saved with .xlsx extension. In this case, the dimension sheets can be opened only if your system has 2007. If any system has 2003 or earlier version, then they will not be able to open the dimension sheets.
    Hope this helps you.

  • 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

Maybe you are looking for