Spool to attachement

Hi,
I want to attach the spool data in  SO_DYNP_OBJECT_SEND  function module.
In my program I run a ALV report in background and  have to read the spool data and attach it to SO_DYNP_OBJECT_SEND function module .
alv and background job is over. But how to read the spool data and attach it in the above FM
How to do it.
Thanks,
Balamurugan.R

Hi,
Try this. Hope it helps you !.
report UTEST3.
TABLES: tsp01.
parameter: p_spid like tsp01-RQIDENT.
DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
       lt_note_text   LIKE STANDARD TABLE OF soli  WITH HEADER LINE,
       lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
      lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
TYPES: BEGIN OF y_files,
       file(60) TYPE c,
       END OF y_files.
DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
DATA: l_objcont     LIKE soli OCCURS 0 WITH HEADER LINE.
DATA: l_objhead     LIKE soli OCCURS 0 WITH HEADER LINE.
STRUCTURES
DATA: folder_id      LIKE soodk,
      object_id      LIKE soodk,
      link_folder_id LIKE soodk,
      g_document     LIKE sood4,
      g_folmem_data  LIKE sofm2,
      g_header_data  LIKE sood2,
      g_receive_data LIKE soos6,
      g_ref_document LIKE sood4,
      g_new_parent   LIKE soodk,
      l_folder_id    LIKE sofdk,
      v_email(50).
DATA: hd_dat  like sood1.
VARIABLES
DATA: client  LIKE tst01-dclient,
      name    LIKE tst01-dname,
      objtype LIKE rststype-type,
      type    LIKE rststype-type.
DATA: numbytes TYPE i,
      arc_idx LIKE toa_dara,
      pdfspoolid LIKE tsp01-rqident,
      jobname LIKE tbtcjob-jobname,
      jobcount LIKE tbtcjob-jobcount,
      is_otf.
DATA: outbox_flag LIKE sonv-flag VALUE 'X',
      store_flag  LIKE sonv-flag,
      delete_flag LIKE sonv-flag,
      owner       LIKE soud-usrnam,
      on          LIKE sonv-flag VALUE 'X',
      sent_to_all LIKE sonv-flag,
      g_authority LIKE sofa-usracc,
      w_objdes    LIKE sood4-objdes.
DATA: c_file LIKE rlgrap-filename,
      n_spool(6) TYPE n.
DATA: cancel.
DATA: desired_type  LIKE sood-objtp,
      real_type LIKE sood-objtp,
      attach_type LIKE sood-objtp,
      otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
      ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
data : HEADER_MAIL TYPE  SO_OBJ_DES.
CONSTANTS
CONSTANTS: ou_fol LIKE sofh-folrg              VALUE 'O',
           c_objtp    LIKE g_document-objtp    VALUE 'RAW',
           c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
DATA: vg_achou(1) TYPE n.
Fist part: Verify if the spool really exists
  vg_achou = 1.
  DO 60 TIMES.
    SELECT SINGLE * FROM tsp01 WHERE rqident = p_spid .
    IF sy-subrc IS INITIAL.
      CLEAR vg_achou.
      EXIT.
    ELSE.
      WAIT UP TO 1 SECONDS.
    ENDIF.
  ENDDO.
  IF vg_achou = 1.
    RAISE err_no_abap_spooljob. "doesn't exist
  ENDIF.
  client = tsp01-rqclient.
  name   = tsp01-rqo1name.
  CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
       EXPORTING
            authority     = 'SP01'
            client        = client
            name          = name
            part          = 1
       IMPORTING
            type          = type
            objtype       = objtype
       EXCEPTIONS
            fb_error      = 1
            fb_rsts_other = 2
            no_object     = 3
            no_permission = 4
            OTHERS        = 5.
  IF objtype(3) = 'OTF'.
    desired_type = otf.
  ELSE.
    desired_type = ali.
  ENDIF.
  CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
       EXPORTING
            rqident              = p_spid
            desired_type         = desired_type
       IMPORTING
            real_type            = real_type
       TABLES
            buffer               = l_objcont
       EXCEPTIONS
            no_such_job          = 14
            type_no_match        = 94
            job_contains_no_data = 54
            no_permission        = 21
            can_not_access       = 21
            read_error           = 54.
  IF sy-subrc EQ 0.
    attach_type = real_type.
  ENDIF.
  CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
       EXPORTING
            owner     = sy-uname
            region    = ou_fol
       IMPORTING
            folder_id = l_folder_id
       EXCEPTIONS
            OTHERS    = 5.
fill out informations about the header of the email
  CLEAR: g_document.
  g_document-foltp     = l_folder_id-foltp.
  g_document-folyr     = l_folder_id-folyr.
  g_document-folno     = l_folder_id-folno.
  g_document-objtp     = c_objtp.
  g_document-objdes    = header_mail.
  g_document-file_ext  = c_file_ext.
  g_header_data-objdes    = header_mail.
  CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
       EXPORTING
            method      = 'SAVE'
            office_user = sy-uname
       IMPORTING
            authority   = g_authority
       TABLES
            attachments = lt_attachments
       CHANGING
            document    = g_document
            header_data = g_header_data
       EXCEPTIONS
            OTHERS      = 1.
  folder_id-objtp = l_folder_id-foltp.
  folder_id-objyr = l_folder_id-folyr.
  folder_id-objno = l_folder_id-folno.
  object_id-objtp = c_objtp.
  object_id-objyr = g_document-objyr.
  object_id-objno = g_document-objno.
  link_folder_id-objtp = l_folder_id-foltp.
  link_folder_id-objyr = l_folder_id-folyr.
  link_folder_id-objno = l_folder_id-folno.
  REFRESH lt_rec_tab.
  lt_files-file = c_file.
  APPEND lt_files.
  hd_dat-objdes = header_mail.
  CALL FUNCTION 'SO_ATTACHMENT_INSERT'
       EXPORTING
            object_id                  = object_id
            attach_type                = attach_type
            object_hd_change           = hd_dat
            owner                      = sy-uname
       TABLES
            objcont                    = l_objcont
            objhead                    = l_objhead
       EXCEPTIONS
            active_user_not_exist      = 35
            communication_failure      = 71
            object_type_not_exist      = 17
            operation_no_authorization = 21
            owner_not_exist            = 22
            parameter_error            = 23
            substitute_not_active      = 31
            substitute_not_defined     = 32
            system_failure             = 72
            x_error                    = 1000.
  IF sy-subrc > 0.
  ENDIF.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
  EXPORTING
    method             = 'SEND'
TABLES
   ATTACHMENTS        = lt_attachments
  changing
    document           = g_document.
CALL FUNCTION 'SO_OBJECT_DELETE'
  EXPORTING
    folder_id                        = folder_id
    object_id                        = object_id
    OWNER                            = sy-uname
EXCEPTIONS
   COMMUNICATION_FAILURE            = 1
   FOLDER_NOT_EMPTY                 = 2
   FOLDER_NOT_EXIST                 = 3
   FOLDER_NO_AUTHORIZATION          = 4
   FORWARDER_NOT_EXIST              = 5
   OBJECT_NOT_EXIST                 = 6
   OBJECT_NO_AUTHORIZATION          = 7
   OPERATION_NO_AUTHORIZATION       = 8
   OWNER_NOT_EXIST                  = 9
   SUBSTITUTE_NOT_ACTIVE            = 10
   SUBSTITUTE_NOT_DEFINED           = 11
   SYSTEM_FAILURE                   = 12
   X_ERROR                          = 13
   OTHERS                           = 14          .
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks,
Uma
Edited by: G UmaMaheswari on Mar 5, 2010 1:09 PM

Similar Messages

  • Reg spool file attachment in Email

    Hi All,
    I am sending the report output to spool and I need to take this spool file and I have to send as a attachment through Email.Could some body let me know how we will do this one thing is the report program runs in back ground (because of this we can not get the spool file to the presentation server).
    Thanks&Regards
    jagan

    Please refer :
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/smartformtoMailasPDF+attachment&
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/savingPDFfilefromspooling+list&
    Regards,
    Anish Thomas
    <b>Pls reward useful answers</b>

  • Convert Screen(spool) to PDF file sending mail with attach file

    Hi :
    I'd like convert spool list to pdf and sending file...
    so, I read thread about spool convert to PDF before,
    and know how to convert Spool to PDF file and send mail with attach file.
    but I have a problem.
    my solution as:
    step 1. Call function: "CONVERT_ABAPSPOOLJOB_2_PDF"
    step 2. Call function: "SO_NEW_DOCUMENT_ATT_SEND_API1"
    then, I got a mail with attached PDF file, but the PDF file display limited 255 line.( SO_NEW_DOCUMENT_ATT_SEND_API1 limited)
    I want to showing word is wider that 255.
    and then I find a manual method as:
    After program finished.
    Function Menu -> system -> List -> Send
    use Prog: "Create Document and Send"
    I use this prog sending mail and attached file ,
    PDF file do <b>NOT</b> have 255 word limit !
    finally. my question is, If I want sending mail as Prog: "Create Document and Send", how to do?
    which Function I have to use?...
    Please help me, Thanks!

    Hi,
    Check this sample code of sending spool as attachment to an email address..
    Parameters.
    PARAMETERS: p_email(50) LOWER CASE.
    PARAMETERS: p_spool LIKE tsp01-rqident.
    Data declarations.
    DATA: plist         LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: document_data LIKE sodocchgi1.
    DATA: so_ali        LIKE soli OCCURS 100 WITH HEADER LINE.
    DATA: real_type     LIKE soodk-objtp.
    DATA: sp_lang       LIKE tst01-dlang.
    DATA: line_size     TYPE i VALUE 255.
    DATA: v_name        LIKE soextreci1-receiver.
    DATA rec_tab        LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    Get the spool data.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
         EXPORTING
              rqident              = p_spool
              first_line           = 1
              last_line            = 0
              desired_type         = '   '
         IMPORTING
              real_type            = real_type
              sp_lang              = sp_lang
         TABLES
              buffer               = so_ali
         EXCEPTIONS
              no_such_job          = 1
              job_contains_no_data = 2
              selection_empty      = 3
              no_permission        = 4
              can_not_access       = 5
              read_error           = 6
              type_no_match        = 7
              OTHERS               = 8.
    IF sy-subrc <> 0.
      MESSAGE s208(00) WITH 'Error'.
      LEAVE LIST-PROCESSING.
    ENDIF.
    Prepare the data.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 0.
    plist-body_num = 0.
    plist-doc_type = 'RAW'.
    plist-obj_descr = 'Test ALV'.
    APPEND plist.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 1.
    DESCRIBE TABLE so_ali LINES plist-body_num.
    plist-doc_type = real_type.
    Get the size.
    READ TABLE so_ali INDEX plist-body_num.
    plist-doc_size = ( plist-body_num - 1 ) * line_size
                     + STRLEN( so_ali ).
    APPEND plist.
    Move the receiver address.
    MOVE: p_email  TO rec_tab-receiver,
          'U'      TO rec_tab-rec_type.
    APPEND rec_tab.
    IF NOT sp_lang IS INITIAL.
      document_data-obj_langu = sp_lang.
    ELSE.
      document_data-obj_langu = sy-langu.
    ENDIF.
    v_name = sy-uname.
    Send the email.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
         EXPORTING
              document_data              = document_data
              sender_address             = v_name
              sender_address_type        = 'B'
         TABLES
              packing_list               = plist
              contents_bin               = so_ali
              receivers                  = rec_tab
         EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              OTHERS                     = 8.
    IF sy-subrc <> 0.
      MESSAGE e208(00) WITH 'Error'.
    ENDIF.
    COMMIT WORK.
    Send the email immediately.
    SUBMIT rsconn01
    WITH mode = 'INT'
    AND RETURN.
    Thanks,
    Naren

  • Create job via program with spool list recipient

    It is quite easy to create a job via SM36 and specify a "spool list recipient" to send the resulting spool in attachment to a distribution list.
    I haven't find the way to have this 'spool list recipient' when I create the job via program (JOB_OPEN or BP_JOB_CREATE ...)
    May be a smart abapper could help me ...

    hi,
    check this sample program which will help u.
    *& Report  ZRC_JOB_TEST                                                *&                                                                     *
    REPORT  ZRC_JOB_TEST                            .
    data : jobcount like TBTCJOB-JOBCOUNT ,
           JOB_WAS_RELEASED like BTCH0000-CHAR1 ,
           SDLSTRTDT like TBTCJOB-SDLSTRTDT ,
           SDLSTRTTM like TBTCJOB-SDLSTRTTM .
    data : l_ebeln like ekko-ebeln ,
           l_ebelp like ekpo-ebelp .
    l_ebeln = '0071005915' .
    l_ebelp = '00010' .
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      DELANFREP              = ' '
      JOBGROUP               = ' '
       JOBNAME                = 'job1'
      SDLSTRTDT              = NO_DATE
      SDLSTRTTM              = NO_TIME
      JOBCLASS               =
    IMPORTING
       JOBCOUNT               = JOBCOUNT
    CHANGING
      RET                    =
    EXCEPTIONS
       CANT_CREATE_JOB        = 1
       INVALID_JOB_DATA       = 2
       JOBNAME_MISSING        = 3
       OTHERS                 = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE .
      submit ZFI_UPD_PO_DELIV_COMP_BDC
      with   ebeln = l_ebeln
      with   ebelp = l_ebelp
      via job 'job1' number jobcount
      and return .
      if sy-subrc = 0 .
         SDLSTRTDT = sy-datum .
         SDLSTRTTM = sy-uzeit + 600 .
         CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
           AT_OPMODE                         = ' '
           AT_OPMODE_PERIODIC                = ' '
           CALENDAR_ID                       = ' '
           EVENT_ID                          = ' '
           EVENT_PARAM                       = ' '
           EVENT_PERIODIC                    = ' '
             JOBCOUNT                          = JOBCOUNT
             JOBNAME                           = 'job1'
           LASTSTRTDT                        = NO_DATE
           LASTSTRTTM                        = NO_TIME
           PRDDAYS                           = 0
           PRDHOURS                          = 0
           PRDMINS                           = 0
           PRDMONTHS                         = 0
           PRDWEEKS                          = 0
           PREDJOB_CHECKSTAT                 = ' '
           PRED_JOBCOUNT                     = ' '
           PRED_JOBNAME                      = ' '
            SDLSTRTDT                         = SDLSTRTDT
            SDLSTRTTM                         = SDLSTRTTM
           STARTDATE_RESTRICTION             = BTC_PROCESS_ALWAYS
            STRTIMMED                         = 'X'
           TARGETSYSTEM                      = ' '
           START_ON_WORKDAY_NOT_BEFORE       = SY-DATUM
           START_ON_WORKDAY_NR               = 0
           WORKDAY_COUNT_DIRECTION           = 0
           RECIPIENT_OBJ                     =
           TARGETSERVER                      = ' '
           DONT_RELEASE                      = ' '
           TARGETGROUP                       = ' '
           DIRECT_START                      =
           IMPORTING
             JOB_WAS_RELEASED                  = JOB_WAS_RELEASED
         CHANGING
           RET                               =
          EXCEPTIONS
            CANT_START_IMMEDIATE              = 1
            INVALID_STARTDATE                 = 2
            JOBNAME_MISSING                   = 3
            JOB_CLOSE_FAILED                  = 4
            JOB_NOSTEPS                       = 5
            JOB_NOTEX                         = 6
            LOCK_FAILED                       = 7
            INVALID_TARGET                    = 8
            OTHERS                            = 9
         IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
      endif .
    ENDIF.

  • Firefighter - assign FF roles Instead of FF IDs

    Hi all, I'm trying to configure SAP FF using Roles instead of FF IDs.
    A problem occurs while defining Firefighters:
    "You are not defined as Owner for the Firefighter Role"
    The problem is that the user is already defined as the owner of the role i'm trying to assign.
    Any help is accepted.
    Regards...

    When I use the report view log as FF admin user I don't see nothing in the spool (sp01)
    attached exsmple spool
                                                                                    FireFightID    Date         Time       Server Name            Transaction Code       Program/Report                                                                               
    -?-         19.06.2008   14:57:03   MTESAP_PRD_01                                 SAPMSYST         
        -?-         19.06.2008   14:57:09   MTESAP_PRD_01                                 Login_Pw                                                                               
    could you help me, please?
    Regards
    Sara

  • F.05 Foreign Currency Valuation

    Hi,
    My user had problem when run F.05, Foreign Currency Valuation.  It was mentioned that no batch input data for screen SAPMF05A 0700 but it was noted that some transaction had taken place & posted.
    As not all the transaction had been posted successfully, I would like to seek your advice how could user post the transaction with error.  Some of the transaction was failed due to Posting period 005 2010 is not open.

    To highlight to users the new features found in the enhanced foreign currency revaluation program:
         Basic instructions given in initial screen (bottom part of screen) to emphasize correct execution of program for open-item accounts (GL, customer and vendor) and GL balances in foreign currency.
    u2022     u2018Bal sheet preparation valuatnu2019 checkbox u2013 This checkbox is applicable only for open-item accounts.  When ticked, the revaluation program updates the valuation difference in the open item document.  FI postings are generated, but reversal is not possible.  When unticked, the revaluation program proceeds to create a batch input session.  Postings are generated after executing the session in SM35.  Reversal of postings is possible (provided that u2018reverse postingsu2019 checkbox is ticked).
    u2022     Revaluation of GL balances in foreign currency will be executed via batch input session because at all times, u2018Bal sheet preparation valuatnu2019 checkbox is not ticked.
         Program has two spool outputs.  The spool xxxx attached to the job in SM37 shows the Message log.  The spool number xxxx u2013 1 shows the calculation, posting proposal and message log.  This second spool can be displayed in transaction SP01.
         To avoid errors and easier monitoring, the foreign currency program will have a minimum of four (4) runs:
    1.   Open item revaluation (Test run)
         Check the spool if there is an error.
         If error, correct and run a test run again.
         Test run should be repeated until there are no errors or   (red light items) found in the message spool.
    2.   Open item revaluation (Actual run) 
         Check the spool if there is an error.
         If error, correct and run a test run again.
    3.   G/L balances revaluation (Test run) 
    4.     G/L balances revaluation (Actual run) 
         If actual run is still executed after the error messages, the validation included in the program will ensure that the documents are not updated (value of BSEG_BDIFF will not change).  No batch session will be created.  Only when errors are corrected will the program be able to post the valuation difference documents.
         If the balance sheet adjustment account is blocked for posting, the program will proceed to create the batch session.  Another validation checks if there are existing batch sessions not processed in the previous month.

  • Oracle Listener Register Issue

    Hi , I have got a problem with registering a test db CBA04 with listener LISTENER_TEST. Initially this DB was configured to the listener -LISTENER. Now, I want to separate this instance to LISTENER_TEST and hence configured this to port 1522 using netmgr.However when I startup the CBA04 instance, it is getting registered to LISTENER running in 1521 port, although this is not registered in listener.ora file of LISTENER.
    Thanks in Advance, the complete spool is attached below.
    Version Details :Oracle 10.2.0.1.0 on Linux
    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2010.09.24 16:22:32 =~=~=~=~=~=~=~=~=~=~=~=
    echo $ORACLE_HOME
    /applns/oracle10g
    -bash-3.00$ echo $ORACLE_SID
    CBA04
    -bash-3.00$ pwd
    /applns/oracle10g/network/admin
    -bash-3.00$ cd
    -bash-3.00$ pwd
    /applns/oracle10g
    -bash-3.00$ l[Kps -ef | grep smon
    oracle    2005 30569  0 16:19 pts/1    00:00:00 grep smon
    oracle   13989     1  0 Sep06 ?        00:03:22 ora_smon_CBA03
    oracle   14123     1  0 Sep06 ?        00:04:50 ora_smon_CMH2
    oracle   14227     1  0 Sep06 ?        00:03:30 ora_smon_MMH2
    oracle   16674     1  0 Sep06 ?        00:02:40 ora_smon_MCSES2
    oracle   18666     1  0 Sep06 ?        00:02:02 ora_smon_CWY02
    oracle   24104     1  0 Sep16 ?        00:00:38 ora_smon_C9W02
    oracle   31240     1  0 15:30 ?        00:00:00 ora_smon_CBA04
    -bash-3.00$ lsnrctl
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 24-SEP-2010 16:19:32
    Copyright (c) 1991, 2005, Oracle.  All rights reserved.
    Welcome to LSNRCTL, type "help" for information.
    LSNRCTL> show current_listener
    Current Listener is LISTENER
    LSNRCTL> status
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                24-SEP-2010 15:30:28
    Uptime                    0 days 0 hr. 49 min. 16 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /applns/oracle10g/network/admin/listener.ora
    Listener Log File         /applns/oracle10g/network/log/listener.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=N850)(PORT=1521)))
    Services Summary...
    Service "C9W02" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "C9W02XDB" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "C9W02_XPT" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "CBA03" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA03XDB" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA03_XPT" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA04" has 1 instance(s).
      Instance "CBA04", status READY, has 1 handler(s) for this service...
    Service "CBA04XDB" has 1 instance(s).
      Instance "CBA04", status READY, has 1 handler(s) for this service...
    Service "CBA04_XPT" has 1 instance(s).
      Instance "CBA04", status READY, has 1 handler(s) for this service...
    Service "CMH2" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CMH2XDB" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CMH2_XPT" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CTSDEV4" has 1 instance(s).
      Instance "CTSDEV4", status UNKNOWN, has 1 handler(s) for this service...
    Service "CWY02" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY02XDB" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY02_XPT" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY2" has 1 instance(s).
      Instance "CWY2", status UNKNOWN, has 1 handler(s) for this service...
    Service "MCSES2" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MCSES2XDB" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MCSES2_XPT" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MMH2" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MMH2XDB" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MMH2_XPT" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MWY1" has 1 instance(s).
      Instance "MWY1", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL> st et current_listener LISTENER_TEST
    Current Listener is LISTENER_TEST
    LSNRCTL> status
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=N850)(PORT=1522)))
    STATUS of the LISTENER
    Alias                     LISTENER_TEST
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                24-SEP-2010 15:29:52
    Uptime                    0 days 0 hr. 50 min. 14 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /applns/oracle10g/network/admin/listener.ora
    Listener Log File         /applns/oracle10g/network/log/listener_test.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=N850)(PORT=1522)))
    Services Summary...
    Service "CBA04" has 1 instance(s).
      Instance "CBA04", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL> exit
    -bash-3.00$ sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 24 16:20:15 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter user-name: sys asy  sysdba
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> shudt  tdown ui  immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    -bash-3.00$ lsnrctl
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 24-SEP-2010 16:21:09
    Copyright (c) 1991, 2005, Oracle.  All rights reserved.
    Welcome to LSNRCTL, type "help" for information.
    LSNRCTL> stat    show current_listener
    Current Listener is LISTENER
    LSNRCTL> status
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                24-SEP-2010 15:30:28
    Uptime                    0 days 0 hr. 50 min. 57 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /applns/oracle10g/network/admin/listener.ora
    Listener Log File         /applns/oracle10g/network/log/listener.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=N850)(PORT=1521)))
    Services Summary...
    Service "C9W02" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "C9W02XDB" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "C9W02_XPT" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "CBA03" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA03XDB" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA03_XPT" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CMH2" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CMH2XDB" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CMH2_XPT" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CTSDEV4" has 1 instance(s).
      Instance "CTSDEV4", status UNKNOWN, has 1 handler(s) for this service...
    Service "CWY02" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY02XDB" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY02_XPT" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY2" has 1 instance(s).
      Instance "CWY2", status UNKNOWN, has 1 handler(s) for this service...
    Service "MCSES2" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MCSES2XDB" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MCSES2_XPT" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MMH2" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MMH2XDB" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MMH2_XPT" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MWY1" has 1 instance(s).
      Instance "MWY1", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL> set currenm t_lio stener LISTENER_TEST
    Current Listener is LISTENER_TEST
    LSNRCTL> status
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=N850)(PORT=1522)))
    STATUS of the LISTENER
    Alias                     LISTENER_TEST
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                24-SEP-2010 15:29:52
    Uptime                    0 days 0 hr. 51 min. 57 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /applns/oracle10g/network/admin/listener.ora
    Listener Log File         /applns/oracle10g/network/log/listener_test.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=N850)(PORT=1522)))
    Services Summary...
    Service "CBA04" has 1 instance(s).
      Instance "CBA04", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL> exit
    -bash-3.00$ cd network
    -bash-3.00$ cd admin
    [m-bash-3.00$ cat listener.ora
    # listener.ora Network Configuration File: /applns/oracle10g/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    LISTENER1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = N850)(PORT = 1521))
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = /applns/oracle10g)
          (PROGRAM = extproc)
        (SID_DESC =
          (GLOBAL_DBNAME = CWY2)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = CWY2)
        (SID_DESC =
          (GLOBAL_DBNAME = MWY1)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = MWY1)
        (SID_DESC =
          (GLOBAL_DBNAME = CTSDEV4)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = CTSDEV4)
    SID_LIST_LISTENER1 =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = CTSDEV4)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = CTSDEV4)
        (SID_DESC =
          (GLOBAL_DBNAME = CWY2)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = CWY2)
        (SID_DESC =
          (GLOBAL_DBNAME = MBA3)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = MBA3)
        (SID_DESC =
          (GLOBAL_DBNAME = MWY1)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = MWY1)
        (SID_DESC =
          (GLOBAL_DBNAME = CTSDEV2)
          (ORACLE_HOME = /applns/oracle9204)
          (SID_NAME = CTSDEV2)
        (SID_DESC =
          (GLOBAL_DBNAME = MCSES2)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = MCSES2)
        (SID_DESC =
          (GLOBAL_DBNAME = CBA03)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = CBA03)
    LISTENER_TEST =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = N850)(PORT = 1522))
    SID_LIST_LISTENER_TEST =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = CBA04)
          (ORACLE_HOME = /applns/oracle10g)
          (SID_NAME = CBA04)
    -bash-3.00$ ps -ef | grep lsnr
    oracle    2237 30569  0 16:22 pts/1    00:00:00 grep lsnr
    oracle   31208     1  0 15:29 ?        00:00:00 /applns/oracle10g/bin/tnslsnr LISTENER_TEST -inherit
    oracle   31299     1  0 15:30 ?        00:00:01 /applns/oracle10g/bin/tnslsnr LISTENER -inherit
    -bash-3.00$ ps -ef | grep -i smon
    oracle    2247 30569  0 16:22 pts/1    00:00:00 grep -i smon
    oracle   13989     1  0 Sep06 ?        00:03:22 ora_smon_CBA03
    oracle   14123     1  0 Sep06 ?        00:04:50 ora_smon_CMH2
    oracle   14227     1  0 Sep06 ?        00:03:30 ora_smon_MMH2
    oracle   16674     1  0 Sep06 ?        00:02:40 ora_smon_MCSES2
    oracle   18666     1  0 Sep06 ?        00:02:02 ora_smon_CWY02
    oracle   24104     1  0 Sep16 ?        00:00:38 ora_smon_C9W02
    -bash-3.00$ sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 24 16:22:49 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter user-name: sys as sysdba
    Enter password:
    Connected to an idle instance.
    SQL> startup;
    ORACLE instance started.
    Total System Global Area  536870912 bytes
    Fixed Size              2022144 bytes
    Variable Size            142607616 bytes
    Database Buffers       390070272 bytes
    Redo Buffers              2170880 bytes
    Database mounted.
    Database opened.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    -bash-3.00$ lsnrctl
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 24-SEP-2010 16:23:14
    Copyright (c) 1991, 2005, Oracle.  All rights reserved.
    Welcome to LSNRCTL, type "help" for information.
    LSNRCTL> show current_listener
    Current Listener is LISTENER
    LSNRCTL> status
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                24-SEP-2010 15:30:28
    Uptime                    0 days 0 hr. 52 min. 53 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /applns/oracle10g/network/admin/listener.ora
    Listener Log File         /applns/oracle10g/network/log/listener.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=N850)(PORT=1521)))
    Services Summary...
    Service "C9W02" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "C9W02XDB" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "C9W02_XPT" has 1 instance(s).
      Instance "C9W02", status READY, has 1 handler(s) for this service...
    Service "CBA03" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA03XDB" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA03_XPT" has 1 instance(s).
      Instance "CBA03", status READY, has 1 handler(s) for this service...
    Service "CBA04" has 1 instance(s).
      Instance "CBA04", status READY, has 1 handler(s) for this service...
    Service "CBA04XDB" has 1 instance(s).
      Instance "CBA04", status READY, has 1 handler(s) for this service...
    Service "CBA04_XPT" has 1 instance(s).
      Instance "CBA04", status READY, has 1 handler(s) for this service...
    Service "CMH2" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CMH2XDB" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CMH2_XPT" has 1 instance(s).
      Instance "CMH2", status READY, has 1 handler(s) for this service...
    Service "CTSDEV4" has 1 instance(s).
      Instance "CTSDEV4", status UNKNOWN, has 1 handler(s) for this service...
    Service "CWY02" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY02XDB" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY02_XPT" has 1 instance(s).
      Instance "CWY02", status READY, has 1 handler(s) for this service...
    Service "CWY2" has 1 instance(s).
      Instance "CWY2", status UNKNOWN, has 1 handler(s) for this service...
    Service "MCSES2" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MCSES2XDB" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MCSES2_XPT" has 1 instance(s).
      Instance "MCSES2", status READY, has 1 handler(s) for this service...
    Service "MMH2" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MMH2XDB" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MMH2_XPT" has 1 instance(s).
      Instance "MMH2", status READY, has 1 handler(s) for this service...
    Service "MWY1" has 1 instance(s).
      Instance "MWY1", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL> set current_listener LISTENER_TEST
    Current Listener is LISTENER_TEST
    LSNRCTL> status
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=N850)(PORT=1522)))
    STATUS of the LISTENER
    Alias                     LISTENER_TEST
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                24-SEP-2010 15:29:52
    Uptime                    0 days 0 hr. 53 min. 47 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /applns/oracle10g/network/admin/listener.ora
    Listener Log File         /applns/oracle10g/network/log/listener_test.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=N850)(PORT=1522)))
    Services Summary...
    Service "CBA04" has 1 instance(s).
      Instance "CBA04", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL> exit
    -bash-3.00$ ls
    [00m[00mlistener0901058AM5614.bak[00m   [00mlistener1009242PM4434.bak[00m  [00msqlnet0903029AM4938.bak[00m   [00msqlnet1009243PM1721.bak[00m     [00mtnsnames1003241PM2143.bak[00m
    [00mlistener0901059AM0632.bak[00m   [00mlistener1009242PM4807.bak[00m  [00msqlnet0903029AM5811.bak[00m   [00msqlnet1009243PM2624.bak[00m     [00mtnsnames1005262PM2110.bak[00m
    [00mlistener09030210AM0112.bak[00m  [00mlistener1009243PM1638.bak[00m  [00msqlnet1002036PM4913.bak[00m   [00msqlnet1009243PM5857.bak[00m     [00mtnsnames10061410AM5549.bak[00m
    [00mlistener0903029AM4938.bak[00m   [00mlistener1009243PM1721.bak[00m  [00msqlnet1002036PM5058.bak[00m   [00msqlnet.log[00m                  [00mtnsnames1006181PM5148.bak[00m
    [00mlistener0903029AM5811.bak[00m   [00mlistener1009243PM2624.bak[00m  [00msqlnet1003088AM4917.bak[00m   [00msqlnet.ora[00m                  [00mtnsnames1009223PM2039.bak[00m
    [00mlistener1002036PM4913.bak[00m   [00mlistener1009243PM5857.bak[00m  [00msqlnet1003241PM2143.bak[00m   [00mtnsnames0901058AM5614.bak[00m   [00mtnsnames1009242PM4434.bak[00m
    [00mlistener1002036PM5059.bak[00m   [00mlistener.ora[00m               [00msqlnet1005262PM2108.bak[00m   [00mtnsnames0901059AM0632.bak[00m   [00mtnsnames1009242PM4807.bak[00m
    [00mlistener1003088AM4917.bak[00m   [00mlistener.ora.cpy[00m           [00msqlnet10061410AM5549.bak[00m  [00mtnsnames09030210AM0112.bak[00m  [00mtnsnames1009243PM1638.bak[00m
    [00mlistener1003241PM2143.bak[00m   [00;34msamples[00m                    [00msqlnet1006181PM5148.bak[00m   [00mtnsnames0903029AM4939.bak[00m   [00mtnsnames1009243PM1721.bak[00m
    [00mlistener1005262PM2108.bak[00m   [00mshrept.lst[00m                 [00msqlnet1009223PM2039.bak[00m   [00mtnsnames0903029AM5811.bak[00m   [00mtnsnames1009243PM2624.bak[00m
    [00mlistener10061410AM5549.bak[00m  [00msqlnet0901058AM5614.bak[00m    [00msqlnet1009242PM4434.bak[00m   [00mtnsnames1002036PM4913.bak[00m   [00mtnsnames1009243PM5857.bak[00m
    [00mlistener1006181PM5148.bak[00m   [00msqlnet0901059AM0632.bak[00m    [00msqlnet1009242PM4807.bak[00m   [00mtnsnames1002036PM5059.bak[00m   [00mtnsnames.ora[00m
    [00mlistener1009223PM2039.bak[00m   [00msqlnet09030210AM0112.bak[00m   [00msqlnet1009243PM1638.bak[00m   [00mtnsnames1003088AM4917.bak[00m
    -bash-3.00$
    Thanks
    SSN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    -bash-3.00$ export ORACLE_SID=CBA04
    -bash-3.00$ sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 24 18:29:57 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter user-name: sys as sysdba
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> show parameter listener;
    NAME TYPE VALUE
    local_listener string
    remote_listener string
    SQL>

  • No page displayed

    when i try with url http://localhost:7001/DefaultWebApp/mepsdls/login/login.jsp,
    it referred login.jsp file but no page displayed,
    because of the following error (Error message at last....)
    Please revert me,
    where i should make/place directory "spool"? And how to set any path/classpath
    to locate....??? if any..........
    Please note the Directory Structure......
    On Production server, (Sun OS)
    \export\home\app\bea\wlserver\config\mydomain\applications\DefaultWebApp
    \export\home\app\bea\wlserver\config\mydomain\applications\DefaultWebApp\WEB-INF\classes
    \export\home\app\spool\secadmin.debug
    on my PC (Windows 2000)
    C:\bea\MEPS-Dls\mydomain\applications\DefaultWebApp
    C:\bea\MEPS-Dls\mydomain\applications\DefaultWebApp\WEB-INF\classes
    But i don't know, where i should make/place directory "spool"
    see attachment for the errors

    Well, the UWL is not 100% necessary.
    But let's start from basics. This all depends on what kind of application is supposed to open, when you click the item. What happens if you click the item in Business Workplace? Is there some web based application (web dynpro?), or is there just a normal SAP transaction?
    In the extended notification configuration you can define that "where" the application should start. For example if you have a web dynpro application, you can define the host of web dynpro in SWNCONFIG (I think that it was in the general settings). Or if it is a transaction, you could open the transaction in webgui.
    Another option is that you remove the links from the mail (if you don't get them working). This is also possible, just configure it in SWNCONFIG or SWNADMIN. For example you can modify the text of the mail to "You have new work items in Business workplace, please go there and process the items...", and no links in mail. => The users are just informed to process their items, but they cannot do it directly from the mail. Of course this is not that  cool...

  • What happens to attachment in a PO when it is converted to PDF using SPOOL.

    Hi Experts,
    While converting a PO to PDF using a spool number, it works fine but i have a question as If the PO has an attachment, does the spool take care of that also?
    If not how to download the attachment as well.
    Thanks & Regards,
    K

    Hi Shan,
    No in ME21N there is a tab called Attachment, by which we can attach a note or something(I am thou not sure why this is done), yes a script is generated into a PDF but this attachment which is part of PO does it get attached or we need to do somthing to attach it to PDF was my question?
    Cheers,
    K
    Edited by: Ken Thompson on Sep 29, 2008 5:58 AM

  • Convert the spool to xls format and email through attachment to the user

    Hi all,
    When I execute a report in background, I get spool. I need to convert the spool to xls format and email through attachment to the user.The xls file should not be saved on local system.
    If I use the Spool Recepient tab in SM37 it mails the spool list as .txt file to the mail receipient. But I need to send it as an .xls file.
    Can any one help me on this

    Did you get the solution? i have the same problem.

  • Can a spool file be sent as an attachment in the decision step?

    Hi,
    I have z program that runs in background and produces a spool file. Normally, I can use tcode SP01 to display this file. At the end of this z program, I call SWW_WI_START_SIMPLE to send a workflow into SAP inbox. I want to know if I somhow can send the spool file along also? I read about attachment and SOFM object but still can't figure out what I need to do yet. Please help.
    Thank you,
    TH

    Hi Th,
    Check this code if helpful.
    FORM pdf_conversion.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = spoolno
                no_dialog                = ' '
           IMPORTING
                pdf_bytecount            = numbytes
                pdf_spoolid              = pdfspoolid
                btc_jobname              = jobname
                btc_jobcount             = jobcount
           TABLES
                pdf                      = 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.
    ENDFORM.                    " PDF_CONVERSION
          FORM SPOOL                                                    *
    FORM spool.
      PERFORM display.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
               destination            = 'LOCL'
                immediately            = ' '
                new_list_id            = 'X'
                expiration             = '9'
                in_parameters          = p_pripar
                layout                 = 'X_65_132'
                line_count             = 65
                line_size              = 132
                mode                   = 'DEFVALS'
                no_dialog              = 'X'
           IMPORTING
                out_parameters         = p_pripar
                valid                  = val
           EXCEPTIONS
                archive_info_not_found = 1
                invalid_print_params   = 2
                invalid_archive_params = 3
                OTHERS                 = 4.
      NEW-PAGE PRINT ON NEW-SECTION PARAMETERS p_pripar NO DIALOG.
      PERFORM display.
      NEW-PAGE PRINT OFF.
      CLEAR t_filename_tx.
      CONCATENATE 'c:\temp\' p_mat '.pdf' INTO t_filename_tx.
      CONDENSE t_filename_tx.
      SELECT * FROM tsp01 INTO TABLE t_tsp01
           WHERE rqowner EQ sy-uname.
      SORT t_tsp01  BY rqcretime DESCENDING.
      LOOP AT t_tsp01.
        spoolno = t_tsp01-rqident.
        EXIT.
      ENDLOOP.
      IF sy-subrc EQ 0.
        PERFORM pdf_conversion.
      ENDIF.
    sending that inernal to mail
    FUNCTION z_p_traveler_workflow.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(V_FILE_PATH) LIKE  RLGRAP-FILENAME
    *"     REFERENCE(DOKNR) LIKE  CRVD_A-DOKNR
    *"     REFERENCE(DOKVR) LIKE  CRVD_A-DOKVR
    *"  TABLES
    *"      PDF STRUCTURE  TLINE
    D A T A
      DATA: w_gd_doc_data LIKE sodocchgi1.
    internal table for body content of the email
      DATA: t_message LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    internal table for receivers of email
      DATA: t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
    internal table for attachment data
      DATA: t_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    *internal table for Information about structure of data tables
      DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
    internal tables for attachment data
      DATA: t_xi_pdf LIKE tline OCCURS 0  WITH HEADER LINE,
            t_xi_temp LIKE bapiqcmime OCCURS 0  WITH HEADER LINE,
            t_xi_mime(255) TYPE c OCCURS 0  WITH HEADER LINE,
            t_html LIKE solisti1   OCCURS 0  WITH HEADER LINE.
    for splitting of the filepath
      DATA : BEGIN OF t_split OCCURS 0,
                row(50),
             END OF t_split.
      DATA:  w_tab_lines LIKE sy-tabix,
             w_subject TYPE so_obj_des,                " for email header
             w_file_path1 TYPE string.                 "file path
      DATA : w_lines       TYPE i,
             w_temp(500)   TYPE c,
             w_offset      TYPE p,
             w_lineslen(2) TYPE p,
             w_mimelen(2)  TYPE p,
             w_tabix       LIKE sy-tabix.
      DATA : w_len      TYPE i,
             w_index    LIKE sy-index,
             w_doc_type TYPE  so_obj_tp,
             w_filename TYPE  so_obj_des .
    internal table for gettting personal numbers of quality engineers
      DATA: BEGIN OF t_ztptwf2 OCCURS 0,
            pernr LIKE ztptwf2-pernr,        "personal number
            END OF t_ztptwf2.
    internal table for gettting userids of quality engineers
      DATA: BEGIN OF t_pa0105 OCCURS 0,
            usrid LIKE pa0105-usrid,       " user id of the quality engineer
            END OF t_pa0105.
    move file path to w_file_path
      w_file_path1 = v_file_path.
    *assign subject of the email
      w_subject = text-006.                  "Travaler Document to Approve
    refreshing the internal tables
      REFRESH : t_objbin, t_packing_list, t_split.
      CLEAR   : t_objbin, t_packing_list, t_split.
      CLEAR   : t_xi_pdf, t_xi_temp.
      REFRESH : t_xi_pdf, t_xi_temp.
      CLEAR: w_temp, w_offset, t_xi_temp.
    move attachment data to t_xi_pdf[].
      t_xi_pdf[] = pdf[].
    Reformat the line to 255 characters wide
      DESCRIBE TABLE t_xi_pdf   LINES  w_lines.
      DESCRIBE FIELD t_xi_pdf   LENGTH w_lineslen.
      DESCRIBE FIELD t_xi_temp  LENGTH w_mimelen.
      LOOP AT t_xi_pdf.
        w_tabix = sy-tabix.
        MOVE t_xi_pdf TO w_temp+w_offset.
        IF w_tabix = w_lines.
          w_lineslen = strlen( t_xi_pdf ).
        ENDIF.
        w_offset = w_offset + w_lineslen.
        IF w_offset GE w_mimelen.
          CLEAR t_xi_temp.
          t_xi_temp = w_temp(w_mimelen).
          APPEND t_xi_temp.
          SHIFT w_temp BY w_mimelen PLACES.
          w_offset = w_offset - w_mimelen.
        ENDIF.
        IF w_tabix = w_lines.
          IF w_offset GT 0.
            CLEAR t_xi_temp.
            t_xi_temp = w_temp(w_offset).
            APPEND t_xi_temp.
          ENDIF.
        ENDIF.
      ENDLOOP.
    *move data from t_xi_temp to t_xi_mime
      LOOP AT t_xi_temp.
        t_xi_mime(255) = t_xi_temp-line.
        APPEND t_xi_mime.
        CLEAR  t_xi_mime.
      ENDLOOP.
    *move data from t_xi_mime[] to t_html[]
      t_html[] = t_xi_mime[].
    *move data from t_html[] to t_objbin.
      LOOP AT t_html.
        t_objbin-line = t_html-line.
        APPEND t_objbin.
        CLEAR t_objbin.
      ENDLOOP.
    *fill the body of email
      t_message = text-005.                        "Mail with PDF attachment
      APPEND t_message.
      CLEAR t_message.
      t_message = text-004.    "Please double click the attachment to verify
      APPEND t_message.
      CLEAR t_message.
      concatenate 'COPY FOR VIEWING ONLY-NOT TO BE'
              'USED/PRINTED FOR PRODUCTION' into t_message separated by
    space.
      APPEND t_message.
      CLEAR t_message.
      IF NOT doknr IS INITIAL.
        CONCATENATE text-001                     "The Document
                    doknr
                    text-002                     "and Version
                    dokvr
                    text-003 INTO                "is changed
                t_message SEPARATED BY space.
        APPEND t_message.
        CLEAR t_message.
      ENDIF.
      DESCRIBE TABLE t_message LINES w_tab_lines.
      READ     TABLE t_message INDEX w_tab_lines.
      w_gd_doc_data-doc_size = ( w_tab_lines - 1 ) *
                                               255 + STRLEN( t_message ).
      w_gd_doc_data-obj_langu  = sy-langu.
      w_gd_doc_data-obj_name   = 'SENDFILE'.
      w_gd_doc_data-obj_descr  = w_subject.
      w_gd_doc_data-sensitivty = 'O'.
      CLEAR t_packing_list.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 0.
      t_packing_list-body_start = 1.
      t_packing_list-doc_type   = 'RAW'.
      t_packing_list-body_num   = w_tab_lines.
      APPEND t_packing_list.
      IF NOT w_file_path1 IS INITIAL.
        w_len = strlen( w_file_path1 ) - 3.
        w_doc_type = w_file_path1+w_len(3) .
        TRANSLATE w_doc_type TO UPPER CASE .
        SPLIT w_file_path1 AT '\' INTO TABLE t_split .
        DESCRIBE TABLE t_split LINES w_index .
        READ TABLE t_split INDEX w_index .
        w_filename = t_split-row .
        w_len = strlen( w_filename ) - 4.
        w_filename = w_filename(w_len) .
        DESCRIBE TABLE t_objbin LINES w_tab_lines.
        t_packing_list-transf_bin = 'X'.
        t_packing_list-head_start = 1.
        t_packing_list-head_num   = 1.
        t_packing_list-body_start = 1.
        t_packing_list-doc_type   = w_doc_type.
        t_packing_list-body_num   = w_tab_lines.
        t_packing_list-doc_size   = w_tab_lines * 255.
        t_packing_list-obj_descr  = w_filename.
        APPEND t_packing_list.
      ENDIF.
    fill the Receivers
      SELECT * FROM ztptwf2 INTO TABLE t_ztptwf2.
      IF NOT t_ztptwf2[] IS INITIAL.
        SELECT usrid FROM pa0105 INTO TABLE t_pa0105 FOR ALL ENTRIES IN
      t_ztptwf2 WHERE pernr = t_ztptwf2-pernr AND subty = '0001' .
        LOOP AT t_pa0105.
          t_receivers-receiver = t_pa0105-usrid.
          t_receivers-rec_type = 'B'.
          APPEND t_receivers .
          CLEAR t_receivers.
        ENDLOOP.
      ENDIF.
      IF  NOT t_receivers[] IS INITIAL.
    Call the FM to post the message to SAPMAIL
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
             EXPORTING
                  document_data              = w_gd_doc_data
                  commit_work                = 'X'
             TABLES
                  packing_list               = t_packing_list
                  contents_txt               = t_message
                  contents_bin               = t_objbin
                  receivers                  = t_receivers
             EXCEPTIONS
                  too_many_receivers         = 1
                  document_not_sent          = 2
                  document_type_not_exist    = 3
                  operation_no_authorization = 4
                  parameter_error            = 5
                  x_error                    = 6
                  enqueue_error              = 7
                  OTHERS                     = 8.
      ENDIF.
      FREE: t_objbin,t_message,t_packing_list,t_receivers.
    i hope this code will solve your problem.
    Sankar

  • Convert spool to pdf and send in email sometimes attachment duplicated.

    Hi all, I have a process that creates a spool, converts it to a pdf and then attaches it to an email. My problem is that sometimes, the same attachment is duplicated.
    The process seems to work fine in debug mode (the attachment changes for each loop) but when I run it in the background, every few emails, it will duplicate an attachment.
    I have noticed that the size of the pdf seems to change properly but that the content of the pdf does not match.  So, it is like it gets the correct size of the pdf but not the body.
    This is code that a consultant wrote and I am pretty new to abap/sap. I have changed some of the code because it was trying to handle an endless loop (I figured it should not have to handle (be in) an endless loop). I changed that code and it is working but this previous issue still exists. Thanks for your help.
    *&      Form  PROCESS_EMPLOYEE
    FORM process_employee .
    * process appraisal only
      IF it_final[] IS NOT INITIAL .
    *                READ DISTRIBUTION LIST                                *
        REFRESH : it_email, it_idlient. 
    *Sort by supervisor
        SORT it_final[] BY supervisor.
        LOOP AT it_final INTO wa_final .
          APPEND wa_final TO it_final1 .
          AT END OF supervisor .
    * Perform to create the PDF from the Output
           report = 'zhr_pm_appemail'.
           PERFORM create_pdf using report.
    ** Perform to email the PDF attachment
    ** to the supervisor and the Mailing list
            subject = 'Performance Appraisals'.
            PERFORM process_email using subject.
            REFRESH it_final1 .
            CLEAR it_final1 .
            CLEAR wa_final .
            FREE MEMORY ID 'MEM'.
          ENDAT .
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " PROCESS_EMPLOYEE
    *&      Form  CREATE_PDF
    FORM create_pdf using report.
      DATA:  spoolno TYPE tsp01-rqident.
      DATA : p_repid TYPE sy-repid .
      DATA: v_len  TYPE i , v_len1  TYPE i .
      DATA: v_temp(8) TYPE c .
      DATA: p_uname TYPE sy-uname .
      DATA: it_tsp01 TYPE STANDARD TABLE OF tsp01 WITH HEADER LINE .
    *  DATA: it_pdf TYPE tline OCCURS 0 WITH HEADER LINE .
      TABLES: tsp01.
      DATA: var  TYPE c .
    *-- STRUCTURES
      DATA:
        lc_rq2name TYPE tsp01-rq2name.
      DATA:
        mstr_print_parms TYPE pri_params,
        mc_valid(1)      TYPE c,
        mi_bytecount     TYPE i,
        mi_length        TYPE i,
        mi_rqident       TYPE tsp01-rqident.
    *-- INTERNAL TABLES
      DATA:
        mtab_pdf    TYPE tline OCCURS 0 WITH HEADER LINE,
        mc_filename TYPE rlgrap-filename.
    *-- SELECTION SCREEN
      DATA:
        p_linsz TYPE sy-linsz VALUE 80, " Line size
        p_paart TYPE sy-paart VALUE 'X_65_80'.  " Paper Format
        p_uname = sy-uname .
        var = var + 1.
        p_repid = report.
    * START-OF-SELECTION .
      concatenate p_repid+0(9)
                  p_uname+0(3)
            into mc_filename
       separated by '_'.
    translate mc_filename to upper case.
    *-- Setup the Print Parmaters
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          authority              = space
          copies                 = '1'
          cover_page             = space
          data_set               = space
          department             = space
          destination            = space
          expiration             = '1'
          immediately            = space
          new_list_id            = 'X'
          no_dialog              = 'X'
          user                   = sy-uname
        IMPORTING
          out_parameters         = mstr_print_parms
          valid                  = mc_valid
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
    IF sy-subrc = 0 .
    *--Make sure that a printer destination has been set up. If this is not done the PDF module abends.
    *-- Explicitly set line width, and output format so that
    *-- the PDF conversion comes out OK
      mstr_print_parms-linsz = p_linsz.
      mstr_print_parms-paart = p_paart.
            EXPORT it_final1 it_email p_email1 p_sender p_date vl_nmth
            TO MEMORY ID 'MEM' .
          IF report =   'zhr_pm_appandprogemail'.
             SUBMIT zhr_pm_appandprogemail TO SAP-SPOOL WITHOUT SPOOL DYNPRO
          SPOOL PARAMETERS mstr_print_parms
          VIA SELECTION-SCREEN AND RETURN.
          ENDIF.
          IF report =   'zhr_pm_appemail'.
             SUBMIT zhr_pm_appemail TO SAP-SPOOL WITHOUT SPOOL DYNPRO
          SPOOL PARAMETERS mstr_print_parms
          VIA SELECTION-SCREEN AND RETURN.
          ENDIF.
    ENDIF.
    *Find out what the spool number is that was just created
      perform get_spool_number using p_repid p_uname changing mi_rqident.
    *converting the spool request into pdf
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid              = mi_rqident
          no_dialog                = space
          dst_device               = mstr_print_parms-pdest
        IMPORTING
          pdf_bytecount            = mi_bytecount
        TABLES
          pdf                      = it_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.
    *  call function 'DOWNLOAD'
    *    exporting
    *      bin_filesize      = mi_bytecount
    *      filename          = mc_filename
    *      filetype          = 'BIN'
    *    importing
    *      act_filename      = mc_filename
    *    tables
    *      data_tab          = it_mess_att.
      CHECK sy-subrc = 0.
    * Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf INTO wa_pdf.
        TRANSLATE wa_pdf USING ' ~'.
        CONCATENATE v_gd_buffer wa_pdf INTO v_gd_buffer.
        CLEAR wa_pdf .
      ENDLOOP.
      TRANSLATE v_gd_buffer USING '~ '.
      DO.
        it_mess_att = v_gd_buffer.
       APPEND it_mess_att.
        SHIFT v_gd_buffer LEFT BY 255 PLACES.
        IF v_gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.                    " CREATE_PDF
    * FORM get_spool_nunber *
    * Get the most recent spool created by user/report                      *
    form get_spool_number using f_repid
          f_uname changing f_rqident.
      data:
            lc_rq2name TYPE rlgrap-filename.
      concatenate f_repid+0(6)
                  f_repid+7(3)
                  f_uname+0(3)
            into lc_rq2name.
    *   separated by '_'.
    translate lc_rq2name to upper case.
      select * from tsp01 where rq2name = lc_rq2name
        order by rqcretime descending.
          f_rqident = tsp01-rqident.
          exit.
          endselect.
          if sy-subrc ne 0.
            clear f_rqident.
          endif.
    endform. " get spool number
    *&      Form  SEND_MAIL
    FORM send_email USING p_email subject.
      REFRESH it_mess_bod.
    * Default subject matter
      gd_subject         = text-019 ."'Subject'.
      gd_attachment_desc = text-020 ."'Performance Appraisal'.
      IF subject =   'Performance Appraisals and Progression I'.
        gd_attachment_desc = 'PerfAppAndProg'.
      ENDIF.
      IF subject =   'Performance Appraisals'.
        gd_attachment_desc = 'PerfAppraisal'.
      ENDIF.
    * If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    * Send file by email as .pdf
      PERFORM send_file_as_email_attachment
                                   TABLES it_mess_bod
                                          it_mess_att
                                    USING p_email
                                          subject
                                          'PDF'
                                          gd_attachment_desc
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 CHANGING gd_error
                                          gd_reciever.
    ENDFORM.                    " SEND_MAIL
    *       FORM process_email                                            *
    FORM process_email using subject.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      CHECK gd_recsize > 0.
      PERFORM send_email USING p_email1 subject.
    *  perform send_email using p_email2.
    ENDFORM.                    "process_email
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       Send email
    FORM send_file_as_email_attachment TABLES it_message
                                              it_attach
                                        USING p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     CHANGING p_error
                                              p_reciever.
      CLEAR : ld_email , ld_mtitle , ld_format , ld_attdescription  ,
        ld_attfilename , ld_sender_address , ld_sender_address_type ,
        w_doc_data.
      REFRESH: t_packing_list.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      LOOP AT it_email.
    * Add the recipients email address
        t_receivers-receiver = it_email.
        t_receivers-rec_type = 'U'.
        t_receivers-com_type = 'INT'.
        t_receivers-notif_del = 'X'.
        t_receivers-notif_ndel = 'X'.
        APPEND t_receivers.
      ENDLOOP.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
    *            CONTENTS_HEX               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
      IF sy-subrc = 0.
        PERFORM update_infotype_0019 .
      ENDIF.
    * Populate zerror return code
    *  ld_error = sy-subrc.
    **  stop .
    *  READ TABLE t_receivers WITH KEY retrn_code = '0' .
    *  IF sy-subrc = 0 .
    *    v_update_flag = '1' .
    *    EXPORT v_update_flag TO MEMORY ID 'MEM2' .
    *  ENDIF .
    ** Populate zreceiver return code
    *  LOOP AT t_receivers.
    *    ld_receiver = t_receivers-retrn_code.
    *  ENDLOOP.
    ENDFORM.                    "send_file_as_email_attachment
    *&      Form  GET_NEXT_MONTH
    FORM get_next_month .
      CLEAR v_month .
      v_month = vl_nmth+4(2).
      REFRESH it_t247 .
      CLEAR it_t247 .
      CALL FUNCTION 'IDWT_READ_MONTH_TEXT'
        EXPORTING
          langu = 'E'
          month = v_month
        IMPORTING
          t247  = it_t247.
      CLEAR v_mon_text .
      v_mon_text = it_t247-ltx .
    ENDFORM.                    " GET_NEXT_MONTH
    Edited by: Katie Doody on Feb 24, 2010 12:30 AM

    Thank you for your response, this has allowed me to identify the problem. It is when I create the spool by using the code below. If I add a wait after this, the program works successfully. Is there another way to write the data to create a spool within my initial program rather than doing the submit? Could it be that it is putting data in memory?
    SUBMIT zhr_pm_appandprogemail TO SAP-SPOOL WITHOUT SPOOL DYNPRO
          SPOOL PARAMETERS mstr_print_parms
          VIA SELECTION-SCREEN AND RETURN.
    *& Report  ZHR_PM_APPANDPROGEMAIL
    REPORT  ZHR_PM_APPANDPROGEMAIL
            NO STANDARD PAGE HEADING
            LINE-SIZE 80
            LINE-COUNT 65(8).
    *        MESSAGE-ID zhr.
    * INTERNAL TABLES DECLARATION
    DATA: it_pdf TYPE tline OCCURS 0 ." WITH HEADER LINE .
    * WORK AEA DECLARATION
    DATA: wa_pdf TYPE tline .
    * Spool to PDF conversions
    *DATA: "gd_spool_nr TYPE tsp01-rqident,
    *      gd_destination TYPE rlgrap-filename,
    *      gd_bytecount TYPE tst01-dsize,
    DATA:v_update_flag TYPE c .                                   "flag for updating infotype 41 last appraisal date
    DATA: v_gd_buffer TYPE string.
    DATA: BEGIN OF it_final1 OCCURS 0 ,
            supervisor      TYPE persno ,
            pernr           TYPE persno ,
            ename           TYPE pa0001-ename ,
            subgroup        TYPE persk ,
            stext           TYPE t503t-ptext ,
            lastapp         TYPE dats ,
            lastjob         TYPE dats ,
            email           TYPE ztype,
            darxx(5)        TYPE c,
            progression(1)  TYPE c,
            supervisor_desc(50) TYPE c,
          END OF it_final1 .
    DATA:   t_packing_list TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents TYPE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers TYPE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment TYPE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header TYPE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data TYPE sodocchgi1 .
    DATA: gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA: v_flag TYPE c VALUE '1' .
    DATA: BEGIN OF it_final OCCURS 0 ,
            subgroup       TYPE persk ,
            supervisor     TYPE persno ,
            pernr          TYPE persno ,
            ename          TYPE pa0001-ename ,
            stext          TYPE t503t-ptext ,
            lastapp        TYPE dats ,
            lastjob        TYPE dats ,
            email          TYPE ztype,
            progression(1) TYPE c,
            supervisor_desc(50) TYPE c,
          END OF it_final .
    DATA:it_t247 TYPE STANDARD TABLE OF t247 WITH HEADER LINE .
    DATA: it_email TYPE STANDARD TABLE OF zemail WITH HEADER LINE.
    *VARIABLE DECLARATION
    DATA: p_date   TYPE sy-datum ,               "excution date
          vl_date  TYPE sy-datum ,
          p_email1 TYPE somlreci1-receiver ,     "receiver
          p_sender TYPE somlreci1-receiver .     "sender
    DATA:  w_recsize TYPE i.
    DATA: gd_recsize TYPE i.
    DATA : vl_nmth TYPE sy-datum.
    DATA: v_month(2) TYPE n .
    DATA: v_mon_text TYPE t247-ltx .
    *START OF SELECTION
    START-OF-SELECTION .
      REFRESH t_receivers.
      IMPORT it_final1 it_email p_email1 p_sender p_date vl_nmth FROM MEMORY ID 'MEM'.
      PERFORM get_next_month .
      LOOP AT it_final1 .
        IF  it_final1-progression IS NOT INITIAL.
          MOVE-CORRESPONDING it_final1 TO it_final .
          APPEND it_final .
          CLEAR  it_final .
    *   Add the recipients email address
          t_receivers-receiver = it_final1-email.
          t_receivers-rec_type = 'U'.
          t_receivers-com_type = 'INT'.
          t_receivers-notif_del = 'X'.
          t_receivers-notif_ndel = 'X'.
          APPEND t_receivers.
        ENDIF.
      ENDLOOP .
      PERFORM write_output .
    *END OF SELECTION
    END-OF-SELECTION .
    *&      Form  WRITE_OUTPUT
    FORM write_output .
      DATA: l_date(14) TYPE c ,
            l_date_temp(14) TYPE c ,
            v_date(10) TYPE c ,
            v_date1(20) TYPE c ,
            v_date1_temp(20) TYPE c ,
            f_date(10) TYPE c.
      DATA: lv_stext TYPE t503t-ptext .
      CLEAR : v_date, v_date1.
      CONCATENATE p_date+4(02) p_date+6(02) p_date+0(04)'.' INTO v_date.
      CONCATENATE v_mon_text p_date+0(4) INTO l_date_temp SEPARATED BY space.
      CONCATENATE l_date_temp '.' INTO l_date.
      CONCATENATE v_mon_text vl_nmth+6(2) INTO v_date1_temp SEPARATED BY space.
      CONCATENATE v_date1_temp ',' INTO v_date1_temp.
      CONCATENATE v_date1_temp vl_nmth(4) INTO v_date1_temp SEPARATED BY space.
      CONCATENATE v_date1_temp '.' INTO v_date1.
      CONDENSE l_date .
      FORMAT INTENSIFIED ON.
      SKIP 4.
      WRITE:/(80) text-001 CENTERED .         "'METROPOLITAN UTILITIES DISTRICT'.
      WRITE:/(80) text-002 CENTERED .         "'OMAHA NEBR.'.
      SKIP 2.
      WRITE:/(80) text-003 CENTERED .        "'Inter-Departmental Communication'.
      FORMAT INTENSIFIED OFF.
      WRITE  :/(80) v_date CENTERED using edit mask '__/__/____'.   " v_date.
      SKIP 2.
      WRITE: /10 text-004.                     "'SUBJECT:   Performance Appraisals and Progression Increase'.
      SKIP 1.
      WRITE: /10 text-005, it_final1-supervisor_desc.  "'TO: Supervisor'.
      SKIP 1.
      WRITE: /10 text-006.                     "'FROM:      Anne M. Undajon, Director of Compensation and Benefits'.
      SKIP 2.
      WRITE:/10 text-007 .                       "'Listed below are the employees in your area who are due a '.
      WRITE:/10 text-008 ,l_date.                "'Performance Appraisal during the month of ',l_date.'.      "v_mon_text , P_date+0(4)
      WRITE:/10 text-009 .                       "'These employees are also eligible for a progression increase.
      WRITE:/10 text-010 .                       "' A performance appraisal form can be found on-line in the MUD '.
      WRITE:/10 text-011 .                       "'template section. The Performance Appraisal is to be completed '
      WRITE:/10 text-012 .                       "'and discussed with the employee by the immediate supervisor.'
      SKIP 2.
      WRITE:/10 text-013.                        "Signed forms should be returned to the Human Resource Department by '.
      WRITE:/10 v_date1.
      SKIP 2 .
      SORT it_final[] BY subgroup .
      LOOP AT it_final .
        CLEAR: lv_stext .
        lv_stext =  it_final-stext.
        AT NEW subgroup .
          TRANSLATE lv_stext TO UPPER CASE .
          WRITE:/(80) lv_stext CENTERED .
          SKIP 2 .
          WRITE: 10 text-014 .                      "'Employee name' .
          WRITE: 32 text-015 .                      "'Job Date' .
          WRITE :44 text-016 .                      "'Last Appraisal' .
          WRITE :59 text-021 .                      "'Employee' .
          WRITE :/10 '--------------------' , 32'----------', 44 '--------------', 59 '--------'.
        ENDAT .
        WRITE:/10 it_final-ename .
        WRITE: 32 it_final-lastjob using edit mask '__/__/____'.
        CONCATENATE it_final-lastapp+4(02) it_final-lastapp+6(02) it_final-lastapp+0(04) INTO f_date.
        WRITE :44 f_date using edit mask '__/__/____'.
        SHIFT it_final-pernr left deleting leading '0'.
        WRITE : 59 it_final-pernr.
        SKIP 2 .
      ENDLOOP.
      SKIP 4.
      WRITE :10 text-017.             "'Anne M. Undajon'.
      FORMAT INTENSIFIED ON.
      WRITE:/10 text-018.              "'Director of Compensation & Benefits'.
      FORMAT INTENSIFIED OFF.
    ENDFORM.                    " WRITE_OUTPUT
    *&      Form  GET_NEXT_MONTH
    FORM get_next_month .
      CLEAR v_month .
      v_month = vl_nmth+4(2).
      REFRESH it_t247 .
      CLEAR it_t247 .
      CALL FUNCTION 'IDWT_READ_MONTH_TEXT'
        EXPORTING
          langu = 'E'
          month = v_month
        IMPORTING
          t247  = it_t247.
      CLEAR v_mon_text .
      v_mon_text = it_t247-ltx .
    ENDFORM.                    " GET_NEXT_MONTH
    Edited by: Katie Doody on Feb 24, 2010 4:07 PM

  • Converting spool to PDF and attaching in a mail

    Hi ,
    My requirement is I have to execute my program in background and the spool created should be sent to the user as an email attachment. Please help.
    Moderator message: FAQ, please (re)search and try yourself before asking.
    Edited by: Thomas Zloch on Jul 12, 2010 2:54 PM

    Hi Sunanda,
    You can schedule your program in background in SM36 Tcode. If you goto SM36, you can find one button 'Spool list recipient'. If you click that button, you can give the Recipient ID there.
    Once the job is finished and spool is generated, that spool will be sent as an attachment to the recipient.
    you can give external email address as well. (Press F4 in Recipient box).
    Thanks,
    J.

  • Convert spool to xls and send the attachment through email

    Hello,
    I have a requirement to convert spool to xls and then send the xls as an attachment through email,how sould i go about it,which fm can i use please advice..
    Thanks.

    Please check the links
    Re: Spool to XLS
    Re: converting spool data to xls file format.
    Regards
    Satish Boguda

  • Convert spool to PDF and send as email attachment

    When i try to convert SAP spool to PDF and send it as email attachment,  size of PDF document becomes large as compared to size of the PDF cocument i download using the same spool.
    I am using following FMs.
    CONVERT_ABAPSPOOLJOB_2_PDF to convert spool to PDF
    and
    SO_NEW_DOCUMENT_ATT_SEND_API1 to send email with attchment.
    some times size of attchment exceeds 2MB and email results in error in SAP connect (SOST).
    Any idea on how to compress the PDF attchment??
    Thanks

    Hi Venkat,
    Can you plesae assist me.
    I have a requirement to convert spool to pdf
    send an email to users
    issue is that attachement is big cant go through
    I have used compress, but when I open the pdf file error that file was not correclty decoded
    please assist, anyone

Maybe you are looking for

  • ACR 4.1 Color space(s)

    Windows XP Bridge CS3 ACR 3.7 and previous used to give the option to convert to various colour spaces (profiles I always get confused here). I've noticed that my Canon raw files show up in bridge as "colour mode RGB" If I edit in ACR4.1 and save; th

  • Why can't Pages "save as" Word?

    I'm trying to like Pages in lieu of my long use of Appleworks, but I can't figure out how to do a document in Pages and save it as Word. I do this all the time in Appleworks to interface with the PC folks, but I can't seem to find out how to do it in

  • Itouch 3G 64GB How do I skip my configuation apple id set up?

    Okay restarted my ipod touch 3rd gen 64gb and continued setting up my configuration, when I got to the Apple ID section and tried signing in it could not do it becuase there was a problem connecting to the server (Im guesing its a problem with my wif

  • How to install a new oracle 9i  in the same server where a 8i is installed

    Hello and sorry for been an inexperience dba. Now I need to install 9i oracle version in the same server (solaris os-5.9) where is previously installed a 8i. I'm reading the installation guide and I know that I have to make two different oracle home,

  • Apply MVC to a Swing app?

    Folks, I got inspired by this thread: http://forum.java.sun.com/thread.jspa?threadID=5244847&start=23&tstart=0 and wrote the below version of MineSweeper (winmine.exe) in Swing as a learning exercise. I'm about half way through my TODO list, and the