Ihave created a script, i need to email in pdf format.

Hi Experts,
There are 2 criterias...
1. criteria
I have created a script, i need to mail it. Please give me a step by step guide to perform it .. . Please give the comments in all the functional module to be used.
Do we have to write a separate program to send email or in the same program. i'll post my program along with this mail. I'm using this program to display report after delivery on that particular date.
REPORT  ZREPORTTOEMAIL LINE-SIZE 400.
data : count, i  type i.
TABLES :  VBFA,         "Sales Document Flow
          VBAK,
          KNA1,
          VBKD,
          VBAP,
          LIPS,
          LIKP,
          KONP,
          KOMK,
          KOMP,
          zkna1,
          konv.
data : l_vbeln like vbfa-vbeln,
       l_posnr like vbfa-posnn,
       l_KNUMV like vbak-KNUMV,
       L_BILL_ITEM LIKE vbfa-posnn ,
       l_netwr like vbrp-netwr,
       l_MWSBP like vbrp-mwsbp.
DATA: BEGIN OF TKOMV OCCURS 50.
        INCLUDE STRUCTURE KOMV.
DATA: END OF TKOMV.
DATA: BEGIN OF TKOMVD OCCURS 50.
        INCLUDE STRUCTURE KOMVD.
DATA: END OF TKOMVD.
TYPE-POOLS: SLIS.
DATA: FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
      HEADING  TYPE SLIS_T_LISTHEADER,
      LAYOUT   TYPE SLIS_LAYOUT_ALV,
      EVENTS   TYPE SLIS_T_EVENT,
      REPNAME  LIKE SY-REPID,
      F2CODE   LIKE SY-UCOMM VALUE  '&ETA',
      G_SAVE(1) TYPE C,
      G_EXIT(1) TYPE C,
      G_VARIANT LIKE DISVARIANT,
      GX_VARIANT LIKE DISVARIANT.
DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
DATA: BEGIN OF itab occurs 0,
        kunnr like likp-kunnr,      "ship to party
        NAME2   LIKE  KNA1-NAME1,   "text
        ORT01   LIKE  KNA1-ORT01,   "City
        BSTNK   LIKE  VBAK-BSTNK,   "customer P O
        BSTDK   LIKE  VBAK-BSTDK,   "date
        vbeln like likp-vbeln,      "delivery
        ernam like likp-ernam,      "person
        vstel like likp-vstel,      "shipping point
        vkorg like likp-vkorg,      "sales org
        lfdat like likp-lfdat,      "delivery date
        kunag like likp-kunag,      "sold to party
        NAME1   LIKE  KNA1-NAME1,   "text
        bil_to like VBAK-KUNNR,
        name3 like kna1-name1,
        traid like likp-traid,      "transport/vehicle no
        BOLNR LIKE LIKP-BOLNR,
        wadat_ist like likp-wadat_ist, "good mov. date
        posnr like lips-posnr,      "item
        matnr like lips-matnr,      "material
        arktx like lips-arktx,      "item text
        matkl like lips-matkl,      "mat group
        werks like lips-werks,      "plant
        lgort like lips-lgort,      "stoage location
        lfimg like lips-lfimg,      "del qty
        MEINS LIKE LIPS-MEINS,
        vrkme like lips-vrkme,      "sales unit
        UMVKZ LIKE LIPS-UMVKZ,
        UMVKN LIKE LIPS-UMVKN,
        charg like lips-charg,      "batch
        vgbel like lips-vgbel,      "reference doc
        mtart like lips-mtart,      "mat type
        vkbur like lips-vkbur,      "sales office
        vkgrp like lips-vkgrp,      "sales group
        vtweg like lips-vtweg,      "Distribution Channel
        spart like lips-spart,      "division
        billno like vbak-vbeln,
        basic like komvd-kwert,
        budat like bkpf-budat,
        fin_amt like vbrp-NETWR,
END OF itab.
data : begin of jtab occurs 0,
kunnr like likp-kunnr,
name2 like kna1-name2,
vbeln like likp-vbeln,
zkunnr like zkna1-zkunnr,
zname like zkna1-zname,
end of jtab.
SELECTION-SCREEN SKIP 1 .
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS   : ABC FOR LIKP-WADAT_IST DEFAULT SY-DATUM
                              NO INTERVALS   .
SELECT-OPTIONS   : S_MATNR FOR  LIPS-MATNR NO INTERVALS   .
SELECT-OPTIONS   : S_VKORG FOR  LIKP-VKORG NO INTERVALS.
SELECT-OPTIONS   : S_VSTEL FOR  LIKP-VSTEL NO INTERVALS.
SELECT-OPTIONS   : S_VKBUR FOR  LIKP-VKBUR NO INTERVALS.
SELECT-OPTIONS   : S_VKGRP FOR  LIPS-VKGRP.
SELECT-OPTIONS   : S_SPART FOR  LIPS-SPART.
SELECT-OPTIONS   : S_VBELN3 FOR  LIKP-VBELN.
SELECT-OPTIONS   : S_MATKL FOR  LIPS-MATKL NO INTERVALS,
                   S_KUNAG FOR LIKP-KUNAG.
SELECTION-SCREEN  END OF BLOCK BLOCK1.
select * from likp into corresponding fields of itab
              WHERE  WADAT_IST IN ABC
              AND    VBELN IN S_VBELN3
              AND    VKORG IN S_VKORG
              and VSTEL in S_VSTEL
              AND VKBUR IN S_VKBUR
              and lfart like 'Z%'
              AND    VBTYP = 'J'
              AND KUNAG IN S_KUNAG.
select * from lips into corresponding fields of itab
                WHERE VBELN =  ITAB-VBELN
                AND   MATNR IN S_MATNR
                AND   MATKL IN S_MATKL
                AND VKBUR IN S_VKBUR
                AND VKGRP IN S_VKGRP
                AND SPART IN S_SPART.
IF ITAB-VRKME = 'RM' AND ITAB-MEINS = 'KG'.
ITAB-LFIMG = ITAB-LFIMG * ( ITAB-UMVKZ / ITAB-UMVKN ).
ITAB-VRKME = 'KG'.
ENDIF.
SELECT SINGLE BSTNK BSTDK INTO (ITAB-BSTNK,ITAB-BSTDK) FROM VBAK
                 WHERE VBELN = ITAB-VGBEL.
SELECT SINGLE NAME1 ORT01 FROM KNA1 INTO (ITAB-NAME2,ITAB-ORT01)
                             WHERE KUNNR = ITAB-KUNNR.
SELECT SINGLE NAME1 FROM KNA1 INTO ITAB-NAME1
                             WHERE KUNNR = ITAB-KUNAG.
*select single vbeln POSNN into (itab-billno,L_BILL_ITEM)  from vbfa where VBELV = itab-vbeln
*and POSNV = itab-posnr and VBTYP_N in ('M','U').
select vbeln POSNN from vbfa up to 1 rows into (itab-billno,L_BILL_ITEM)   where VBELV = itab-vbeln
and POSNV = itab-posnr and VBTYP_N in ('M','U') order by vbeln DESCENDING .
endselect.
select single * from vbfa where vbelv = itab-billno and posnv = l_bill_item and
vbtyp_n = 'N'.
if sy-subrc = 0.
clear : itab-billno, l_bill_item.
endif.
select single budat from bkpf into itab-budat where xblnr = itab-billno and
blart = 'RV'.
select single NETWR MWSBP into (l_netwr, l_MWSBP) from vbrp where vbeln = itab-billno
and posnr = l_bill_item.
itab-fin_amt = l_netwr + l_MWSBP.
clear : l_netwr, l_MWSBP.
select single kunnr from vbpa into itab-bil_to where
vbeln = itab-BILLNO and PARVW = 'RE'.
select single name1 into itab-name3 from kna1
where kunnr = itab-bil_to.
*select single VBELV POSNV from vbfa into (l_vbeln,l_posnr)
*where VBELN = itab-vbeln and
*POSNN = itab-posnr and VBTYP_N = 'J'.
*select single VBELN POSNN from vbfa into (l_vbeln,l_posnr)
*where VBELV = itab-vbeln and
*POSNV = itab-posnr and VBTYP_N = 'M'.
select VBELN POSNN from vbfa up to 1 rows into (l_vbeln,l_posnr)
where VBELV = itab-vbeln and
POSNV = itab-posnr and VBTYP_N = 'M' order by vbeln DESCENDING.
endselect.
select single * from vbfa where vbelv = l_vbeln and posnv = l_posnr and
vbtyp_n = 'N'.
if sy-subrc = 0.
clear : l_vbeln, l_posnr.
endif.
if sy-subrc = 0.
*select single KNUMv into l_KNUMv from vbak where vbeln = l_vbeln
select single KNUMv into l_KNUMv from vbRk where vbeln = l_vbeln
select * from konv where knumv = l_knumv and kposn = l_posnr and
kschl in ('ZR00','ZR01','ZR02','ZOBC').
itab-basic = itab-basic + KONV-KBETR.
ENDSELECT.
else.
*select single KNUMv into l_KNUMv from ekko where ebeln = itab-vgbel.
*select single KBETR from konv into itab-basic where knumv = l_knumv
*and kposn = itab-posnr and kschl = 'P101'.
select single KNUMv into l_KNUMv from VBRK where VBELN = itab-BILLNO.
select * from konv where knumv = l_knumv and kposn = l_BILL_ITEM AND
kschl in ('ZR00','ZR01','ZR02','ZOBC').
itab-basic = itab-basic + KONV-KBETR.
ENDSELECT.
*zkna1-zkunnr = itab-kunnr.
*insert zkna1.
endif.
     clear : l_vbeln, L_BILL_ITEM, L_POSNR.
APPEND ITAB.
clear : itab-basic, itab-lfimg.
     ENDSELECT.
          clear : itab.
ENDSELECT.
<b>perform zscript.</b>
*&      Form  zscript
      text
-->  p1        text
<--  p2        text
FORM zscript .
CALL FUNCTION 'OPEN_FORM'
EXPORTING
  APPLICATION                       = 'TX'
  ARCHIVE_INDEX                     =
  ARCHIVE_PARAMS                    =
  DEVICE                            = 'PRINTER'
  DIALOG                            = 'X'
   FORM                              = 'ZREPORT2EMAIL'
   LANGUAGE                          = SY-LANGU
  OPTIONS                           =
  MAIL_SENDER                       =
  MAIL_RECIPIENT                    =
  MAIL_APPL_OBJECT                  =
  RAW_DATA_INTERFACE                = '*'
  SPONUMIV                          =
IMPORTING
  LANGUAGE                          =
  NEW_ARCHIVE_PARAMS                =
  RESULT                            =
EXCEPTIONS
  CANCELED                          = 1
  DEVICE                            = 2
  FORM                              = 3
  OPTIONS                           = 4
  UNCLOSED                          = 5
  MAIL_OPTIONS                      = 6
  ARCHIVE_ERROR                     = 7
  INVALID_FAX_NUMBER                = 8
  MORE_PARAMS_NEEDED_IN_BATCH       = 9
  SPOOL_ERROR                       = 10
  CODEPAGE                          = 11
  OTHERS                            = 12
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'MANU'
   FUNCTION                       = 'SET'
   TYPE                           = 'BODY'
   WINDOW                         = 'MAIN'
IMPORTING
  PENDING_LINES                  =
EXCEPTIONS
  ELEMENT                        = 1
  FUNCTION                       = 2
  TYPE                           = 3
  UNOPENED                       = 4
  UNSTARTED                      = 5
  WINDOW                         = 6
  BAD_PAGEFORMAT_FOR_PRINT       = 7
  SPOOL_ERROR                    = 8
  CODEPAGE                       = 9
  OTHERS                         = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
  RESULT                         =
  RDI_RESULT                     =
TABLES
  OTFDATA                        =
EXCEPTIONS
  UNOPENED                       = 1
  BAD_PAGEFORMAT_FOR_PRINT       = 2
  SEND_ERROR                     = 3
  SPOOL_ERROR                    = 4
  CODEPAGE                       = 5
  OTHERS                         = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.                    " zscript
The above one is first criteria just to understand how to send mail to the customers.
<b>Second criteria</b> is i have to send the mail to the particular customer with only their details, the process should continue until it sends to all the customers with their details for that particular date.
Please help me out.
I have seen so many posts in the sdn but not able to understand the functional modules, how they declare that and how does it works...
Please provide me a good material to understand the functional module and to declare them.
Please solve this query i'll reward them with very good points.
Thanks in advance.
A.Rafique.

Hi babar haroon,
Thanks for the link.....
I went through that link, i created smart form but i was not able to get the results because the pgm gets terminated after executing. I'll show u the code, the code is active. Please check out and tell me if  i have missed anything in the code...
*& Report  ZZZ_TEST3
REPORT  ZZZ_TEST3.
*internal table declarations
data: i_otf type itcoo occurs 0 with header line,
      i_tline type table of tline with header line,
      i_receivers type table of somlreci1 with header line,
      i_record like solisti1 occurs 0 with header line,
*Objects to send mail.
      i_objpack like sopcklsti1 occurs 0 with header line,
      i_objtxt like solisti1 occurs 0 with header line,
      i_objbin like solisti1 occurs 0 with header line,
      i_reclist like somlreci1 occurs 0 with header line,
*workarea declaration.
      w_objhead TYPE soli_tab,
      w_ctrlop TYPE ssfctrlop,
      w_compop TYPE ssfcompop,
      w_return TYPE ssfcrescl,
      w_doc_chng typE sodocchgi1,
      w_data TYPE sodocchgi1,
      w_buffer TYPE string,"To convert from 132 to 255
Variables declarations
      v_form_name TYPE rs38l_fnam,
      v_len_in LIKE sood-objlen,
      v_len_out LIKE sood-objlen,
      v_len_outn TYPE i,
      v_lines_txt TYPE i,
      v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
*call function '/1BCDWB/SF00000105'
      exporting
      formname = 'ZZZ_TEST2'
      importing
      fm_name = v_form_name
      exceptions
      no_form = 1
      no_function_module = 2
      others = 3.
      IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      w_ctrlop-getotf = 'X'.
      w_ctrlop-no_dialog = 'X'.
      w_compop-tdnoprev = 'X'.
     CALL FUNCTION '/1BCDWB/SF00000105'
      EXPORTING
        ARCHIVE_INDEX              =
        ARCHIVE_INDEX_TAB          = itab1
        ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         =
        MAIL_APPL_OBJ              =
        MAIL_RECIPIENT             =
        MAIL_SENDER                =
        OUTPUT_OPTIONS             =
        USER_SETTINGS              = 'X'
      IMPORTING
        DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            = wa
        JOB_OUTPUT_OPTIONS         =
      EXCEPTIONS
        FORMATTING_ERROR           = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                 = 3
        USER_CANCELED              = 4
        OTHERS                     = 5
     IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
     ENDIF.
CALL FUNCTION v_form_name
      EXPORTING
      control_parameters = w_ctrlop
      output_options = w_compop
      user_settings = 'X'
      IMPORTING
      job_output_info = w_return
      EXCEPTIONS
      formatting_error = 1
      internal_error = 2
      send_error = 3
      user_canceled = 4
      OTHERS = 5.
      IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      i_otf[] = w_return-otfdata[].
      CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
      format = 'PDF'
      max_linewidth = 132
      IMPORTING
      bin_filesize = v_len_in
      TABLES
      otf = i_otf
      lines = i_tline
      EXCEPTIONS
      err_max_linewidth = 1
      err_format = 2
      err_conv_not_possible = 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.
      ENDIF.
      Convert PDF from 132 to 255.
      LOOP AT i_tline.
      Replacing space by ~
      TRANSLATE i_tline USING '~'.
      CONCATENATE w_buffer i_tline INTO w_buffer.
      ENDLOOP.
Replacing ~ by space
      TRANSLATE w_buffer USING '~'.
      DO.
      i_record = w_buffer.
      Appending 255 characters as a record
      APPEND i_record.
      SHIFT w_buffer LEFT BY 255 PLACES.
      IF w_buffer IS INITIAL.
      EXIT.
      ENDIF.
      ENDDO.
      Refresh: i_reclist,
      i_objtxt,
      i_objbin,
      i_objpack.
      clear w_objhead.
      Object with PDF.
      i_objbin[] = i_record[].
     DESCRIBE TABLE i_objbin LINES v_lines_bin.
      Object with main text of the mail.
      i_objtxt = 'Find attached the output of the smart form.'.
      APPEND i_objtxt.
     DESCRIBE TABLE i_objbin LINES v_lines_txt.
      i_objtxt = 'Regards,'.
      APPEND i_objtxt.
      i_objtxt = 'J.Jayanthi'.
      APPEND i_objtxt.
      DESCRIBE TABLE i_objtxt LINES v_lines_txt.
      Document information.
      w_doc_chng-obj_name = 'Smartform'.
      w_doc_chng-expiry_dat = sy-datum + 10.
      w_doc_chng-obj_descr = 'Smart form output'.
      w_doc_chng-sensitivty = 'F'. "Functional object
      w_doc_chng-doc_size = v_lines_txt * 255.
      Pack to main body as RAW.
      Obj. to be transported not in binary form
      CLEAR i_objpack-transf_bin.
      Start line of object header in transport packet
      i_objpack-head_start = 1.
      Number of lines of an object header in object packet
      i_objpack-head_num = 0.
      Start line of object contents in an object packet
      i_objpack-body_start = 1.
      Number of lines of the object contents in an object packet
      i_objpack-body_num = v_lines_txt.
      Code for document class
      i_objpack-doc_type = 'RAW'.
      APPEND i_objpack.
      Packing as PDF.
      i_objpack-transf_bin = 'X'.
      i_objpack-head_start = 1.
     i_objpack-head_num = 1.
      i_objpack-head_num = 0.
      i_objpack-body_start = 1.
      i_objpack-body_num = v_lines_bin.
      i_objpack-doc_type = 'PDF'.
      i_objpack-obj_name = 'Smartform'.
      CONCATENATE 'Smartform_output' '.pdf'
      INTO i_objpack-obj_descr.
      i_objpack-doc_size = v_lines_bin * 255.
      APPEND i_objpack.
      Document information.
      CLEAR i_reclist.
      e-mail receivers.
     i_reclist-receiver = '[email protected]'.
      i_reclist-receiver = '[email protected]'.
      i_reclist-express = 'X'.
      i_reclist-rec_type = 'U'. "Internet address
      APPEND i_reclist.
      Sending mail.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
      document_data = w_doc_chng
      put_in_outbox = 'X'
      TABLES
      packing_list = i_objpack
      object_header = w_objhead
      contents_hex = i_objbin
      contents_txt = i_objtxt
      receivers = i_reclist
      EXCEPTIONS
      too_many_receivers = 1
      document_not_sent = 2
      document_type_not_exist = 3
      operation_no_authorization = 4
      parameter_error = 5
      x_error = 6
      enqueue_error = 7
      OTHERS = 8.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
Please reply me back, it is very urgent..
Thanks and regards.
A.Rafique

Similar Messages

  • Send spool id output (sap script) via email in PDF format

    Dear friends,
    Looking for sample program to send spool id output of sapscript via email in PDF format.
    Regards,
    Praveen Lobo

    Hi,
    Try this code..
    * 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.
    * Check the return code.
    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 = 'Spool data'.
    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.
    * Subject.
    document_data-obj_descr = 'Spool attached'.
    * 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 in sending email'.
    ENDIF.
    COMMIT WORK.
    * Send the email immediately.
    SUBMIT rsconn01
    WITH mode = 'INT'
    AND RETURN.
    * Success message.
    MESSAGE s208(00) WITH 'Email sent'.
    Thanks
    Naren

  • I would like to build a drag n drop interface and have the results sent to my email in PDF format. Is this possible?

    I would like to build a drag n drop interface and have the results sent to my email in PDF format. Is this possible?

    Captivate is not really designed to do what you want in this instance.  It's more targeted at allowing a user to complete an assessment and then track whether or not they passed.  So it's only really set up to send information in a format that the LMS will understand and interpret as Pass/Faill and what the score was.
    You really need something more flexible than that. So I think you would need to get a programmer involved and have the solution custom made.  In my experience, any time you try to diverge Captivate from what it was designed to do, and you need to get other IT professionals involved, you can kiss thousands of dollars goodbye before you have a workable solution.

  • Send email in pdf format

    i have a function which returns purchase orders list.
    in my program i want my program sends the purchase order document through email in pdf format when i select an order from the list.
    how can i do that.

    This reference program might help:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

  • Send collective invoice via (Single mail)email in pdf format

    Hi All,
    Please suggest me the solution option for the below requirement.
    The requirement is to send collective invoice to the customer via email in PDF format in a single email at the end of the day.ie they like to have a tool where they
    can enter the output type,date and other relavant info and the program should collect all the invoice and convert it to PDF and send it in single mail to customer.
    Please let me know i can use any Standard tool for this purpose.ALso is it possible to write a Zprogram reprocess the output type by using any FM? 
    Also suggest if you have any feasible solutions.
    Regards
    Raja

    Hi All,
    thanks for your comments. Sorry its my mistake that i have asked in general.
    I am looking for the following options.
    1. Any stanard program which can be used partially for my requirement?
    2. If i have to go for a new tool, then i should write a code for reprocess the output types and then convert in to one single PDF and then send it to customer in one single email.
    Here i am struck how to write an program to reprocess the ouput types? i hope the next steps can be easily implemented evenhough some watch outs are there like 'how to make a single PDF file' and some technical constraints like max size that can be send.
    Thanks and let me know your inputs.
    Regards,
    Raja

  • Why can't I share documents via email in pdf format any longer?

    Why can't I share documents via email in pdf format any longer?

    I am guessing you are using an iPad, iPhone or iPod touch. This is the forum for MacBooks, the computer, so the mail works differently.
    You will want to ask your question in the correct forum.
    Using iPad
    Using iPhone
    iPod touch

  • Email in PDF format through ALV

    Hi Everybody,
    I have a query related to simple ALV report...i want to send a email of the output list of my ALV report in pdf format to a certain person's email id...
    Please can anybody suggest me how to do this?
    Its very urgent....
    With regards,
    Asish

    The code below demonstrates how to retrieve a spool request and email it as a PDF document. Please note
    for the below program to process a spool request the program must be executed in background otherwise no
    spool request will be created. Once you have had a look at this there is an modified version of the program
    which works in both background and foreground. Also see transaction SCOT for SAPConnect administration.
    *& Report ZSPOOLTOPDF *
    *& Converts spool request into PDF document and emails it to *
    *& recipicant. *
    *& Execution *
    *& This program must be run as a background job in-order for the write *
    *& commands to create a Spool request rather than be displayed on *
    *& screen *
    REPORT zspooltopdf.
    PARAMETER: p_email1 LIKE somlreci1-receiver
    DEFAULT '[email protected]',
    p_sender LIKE somlreci1-receiver
    DEFAULT '[email protected]',
    p_delspl AS CHECKBOX.
    *DATA DECLARATION
    DATA: gd_recsize TYPE i.
    Spool IDs
    TYPES: BEGIN OF t_tbtcp.
    INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
    wa_tbtcp TYPE t_tbtcp.
    Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
    gd_eventparm LIKE tbtcm-eventparm,
    gd_external_program_active LIKE tbtcm-xpgactive,
    gd_jobcount LIKE tbtcm-jobcount,
    gd_jobname LIKE tbtcm-jobname,
    gd_stepcount LIKE tbtcm-stepcount,
    gd_error TYPE sy-subrc,
    gd_reciever TYPE sy-subrc.
    DATA: w_recsize TYPE i.
    DATA: gd_subject LIKE sodocchgi1-obj_descr,
    it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    gd_sender_type LIKE soextreci1-adr_typ,
    gd_attachment_desc TYPE so_obj_nam,
    gd_attachment_name TYPE so_obj_des.
    Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
    gd_destination LIKE rlgrap-filename,
    gd_bytecount LIKE tst01-dsize,
    gd_buffer TYPE string.
    Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
    INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
    c_no(1) TYPE c VALUE ' ',
    c_device(4) TYPE c VALUE 'LOCL'.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Write statement to represent report output. Spool request is created
    if write statement is executed in background. This could also be an
    ALV grid which would be converted to PDF without any extra effort
    WRITE 'Hello World'.
    new-page.
    commit work.
    new-page print off.
    IF sy-batch EQ 'X'.
    PERFORM get_job_details.
    PERFORM obtain_spool_id.
    Alternative way could be to submit another program and store spool
    id into memory, will be stored in sy-spono.
    *submit ZSPOOLTOPDF2
    to sap-spool
    spool parameters %_print
    archive parameters %_print
    without spool dynpro
    and return.
    Get spool id from program called above
    IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
    PERFORM convert_spool_to_pdf.
    PERFORM process_email.
    if p_delspl EQ 'X'.
    PERFORM delete_spool.
    endif.
    IF sy-sysid = c_dev.
    wait up to 5 seconds.
    SUBMIT rsconn01 WITH mode = 'INT'
    WITH output = 'X'
    AND RETURN.
    ENDIF.
    ELSE.
    SKIP.
    WRITE:/ 'Program must be executed in background in-order for spool',
    'request to be created.'.
    ENDIF.
    FORM obtain_spool_id *
    FORM obtain_spool_id.
    CHECK NOT ( gd_jobname IS INITIAL ).
    CHECK NOT ( gd_jobcount IS INITIAL ).
    SELECT * FROM tbtcp
    INTO TABLE it_tbtcp
    WHERE jobname = gd_jobname
    AND jobcount = gd_jobcount
    AND stepcount = gd_stepcount
    AND listident '0000000000'
    ORDER BY jobname
    jobcount
    stepcount.
    READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
    IF sy-subrc = 0.
    message s004(zdd) with gd_spool_nr.
    gd_spool_nr = wa_tbtcp-listident.
    MESSAGE s004(zdd) WITH gd_spool_nr.
    ELSE.
    MESSAGE s005(zdd).
    ENDIF.
    ENDFORM.
    FORM get_job_details *
    FORM get_job_details.
    Get current job details
    CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
    IMPORTING
    eventid = gd_eventid
    eventparm = gd_eventparm
    external_program_active = gd_external_program_active
    jobcount = gd_jobcount
    jobname = gd_jobname
    stepcount = gd_stepcount
    EXCEPTIONS
    no_runtime_info = 1
    OTHERS = 2.
    ENDFORM.
    FORM convert_spool_to_pdf *
    FORM convert_spool_to_pdf.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = gd_spool_nr
    no_dialog = c_no
    dst_device = c_device
    IMPORTING
    pdf_bytecount = gd_bytecount
    TABLES
    pdf = it_pdf_output
    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.
    CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
    LOOP AT it_pdf_output.
    TRANSLATE it_pdf_output USING ' ~'.
    CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
    ENDLOOP.
    TRANSLATE gd_buffer USING '~ '.
    DO.
    it_mess_att = gd_buffer.
    APPEND it_mess_att.
    SHIFT gd_buffer LEFT BY 255 PLACES.
    IF gd_buffer IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    ENDFORM.
    FORM process_email *
    FORM process_email.
    DESCRIBE TABLE it_mess_att LINES gd_recsize.
    CHECK gd_recsize > 0.
    PERFORM send_email USING p_email1.
    perform send_email using p_email2.
    ENDFORM.
    FORM send_email *
    --> p_email *
    FORM send_email USING p_email.
    CHECK NOT ( p_email IS INITIAL ).
    REFRESH it_mess_bod.
    Default subject matter
    gd_subject = 'Subject'.
    gd_attachment_desc = 'Attachname'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
    it_mess_bod = 'Message Body text, line 1'.
    APPEND it_mess_bod.
    it_mess_bod = 'Message Body text, line 2...'.
    APPEND it_mess_bod.
    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 .xls speadsheet
    PERFORM send_file_as_email_attachment
    tables it_mess_bod
    it_mess_att
    using p_email
    'Example .xls documnet attachment'
    'PDF'
    gd_attachment_name
    gd_attachment_desc
    p_sender
    gd_sender_type
    changing gd_error
    gd_reciever.
    ENDFORM.
    FORM delete_spool *
    FORM delete_spool.
    DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
    ld_spool_nr = gd_spool_nr.
    CHECK p_delspl c_no.
    CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
    EXPORTING
    spoolid = ld_spool_nr.
    ENDFORM.
    *& 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.
    DATA: ld_error TYPE sy-subrc,
    ld_reciever TYPE sy-subrc,
    ld_mtitle LIKE sodocchgi1-obj_descr,
    ld_email LIKE somlreci1-receiver,
    ld_format TYPE so_obj_tp ,
    ld_attdescription TYPE so_obj_nam ,
    ld_attfilename TYPE so_obj_des ,
    ld_sender_address LIKE soextreci1-receiver,
    ld_sender_address_type LIKE soextreci1-adr_typ,
    ld_receiver LIKE sy-subrc.
    data: t_packing_list like sopcklsti1 occurs 0 with header line,
    t_contents like solisti1 occurs 0 with header line,
    t_receivers like somlreci1 occurs 0 with header line,
    t_attachment like solisti1 occurs 0 with header line,
    t_object_header like solisti1 occurs 0 with header line,
    w_cnt type i,
    w_sent_all(1) type c,
    w_doc_data like sodocchgi1.
    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.
    REFRESH 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.
    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_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.
    Populate zerror return code
    ld_error = sy-subrc.
    Populate zreceiver return code
    LOOP AT t_receivers.
    ld_receiver = t_receivers-retrn_code.
    ENDLOOP.
    ENDFORM.
    Reward points if useful.

  • PO output sending to vendor via email by PDF Format

    Hi All,
    Business needs to send the PO output in PDF Format to multiple vendor contact via email. They also needs soem text in the body of the mail.
    Is it possible to config via standard SAP or we need to develop a customed program?
    Suppose If it is possible via standard SAP can some one post the detailed steps.
    Thanks in Advance
    Regards
    Karthick

    External Send - Sending PO by email
    In order to send PO, your Basis team must configure the system first so that external email can be send out from SAP.  If it is not configured, no settings you do on MM will work.
    1. You must maintain email address in vendor master data.
    2. The same applies to your user master data.  For the output type for default values, a communication strategy needs 
    to be maintained in the Customizing that supports the e-mail. You can find the definition of the communication strategy in the 
    Customizing via the following path: 
    (SPRO -> IMG -> SAP Web Application Server -> Basic Services -> Message Control -> Define Communication Strategy). 
    As a default, communication strategy CS01 is delivered. This already contains the necessary entry for the external communication. Bear in mind that without a suitable communication strategy it is not possible to communicate with a partner via Medium 5 (external sending).
    3. Use the standard SAP environment (program 'SAPFM06P', FORM routine 'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
    4. In the condition records for the output type (for example, Transaction MN04), use medium '5' (External send).
    5. You can use Transaction SCOT to trigger the output manually. The prerequisite for a correct sending is that the node is set correctly. This is not described here, but it must have already been carried out.
    6. To be able to display, for example, the e-mail in Outlook, enter PDF as the format in the node

  • I need to change a pdf format to data? help?

    I really need to change a pdf tax return into a data return so I can amend it, the tax program I used will not let me transfer a pdf, I saw some choices when I went to save it under the name but I don't know which one would be data. Thanks hope someone can help,

    That's probably not possible at all. Contact the IRS for advice on how to file a new, correct return.

  • To send output as email in PDF format

    I am using Function module <b>so_new_document_att_send_api1</b> to send my report output as Email.
    Please tell me how to send it in PDF format.

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

  • Needs content not in pdf format

    Hi all,,
    I have an ABAP program where i could send mails to the recipients.
    But the recipients are able to receive the content of the mails only in attached pdf format.
    But could not get into the body of the mail.
    I had passed packing_list-Document type = 'RAW' in  in so_document_send_API1
    What should i need to do in the settings..
    will be awarded..

    Hi Naveena,
    given below is a sample code to send mail with both body and an attachment.
    pack-doc_type is RAW for sending the body.
    vérifier qu'une adresse a été rentrée
      CHECK NOT s_execut IS INITIAL.
    Zone objet du mail
      CLEAR str_docdata.
      str_docdata-obj_name  = text-m01.
      str_docdata-obj_descr = text-m03.
    Alim table des destinataires
      LOOP AT s_execut.
        tbl_dest-rec_type = 'U'.
        tbl_dest-receiver = s_execut-low.
        APPEND tbl_dest.
        CLEAR  tbl_dest.
      ENDLOOP.
    Alim tbl_text pour corps du mail
    "ne pas répondre"
      CLEAR tbl_text.
      REFRESH tbl_text.
      tbl_text-line = text-m02.
      APPEND tbl_text.
      CLEAR tbl_text.
    saut de ligne
      APPEND tbl_text.
    nb de lignes lues / en anomalie / … qui seront dans le corps du texte
      WRITE p_filpar TO tbl_text-line NO-ZERO LEFT-JUSTIFIED.
      IF tbl_text-line IS INITIAL.
        tbl_text-line = '0'.
      ENDIF.
      CONCATENATE text-cr1 tbl_text-line INTO tbl_text-line
                                        SEPARATED BY space.
      APPEND tbl_text.
      CLEAR tbl_text.
      WRITE p_filali TO tbl_text-line NO-ZERO LEFT-JUSTIFIED.
      IF tbl_text-line IS INITIAL.
        tbl_text-line = '0'.
      ENDIF.
      CONCATENATE text-cr1 tbl_text-line INTO tbl_text-line
                                        SEPARATED BY space.
      APPEND tbl_text.
      CLEAR tbl_text.
      WRITE p_recycl TO tbl_text-line NO-ZERO LEFT-JUSTIFIED.
      IF tbl_text-line IS INITIAL.
        tbl_text-line = '0'.
      ENDIF.
      CONCATENATE text-cr2 tbl_text-line INTO tbl_text-line
                                        SEPARATED BY space.
      APPEND tbl_text.
      CLEAR tbl_text.
      WRITE w_enr_10 TO tbl_text-line NO-ZERO LEFT-JUSTIFIED.
      IF tbl_text-line IS INITIAL.
        tbl_text-line = '0'.
      ENDIF.
      CONCATENATE text-cr3 tbl_text-line INTO tbl_text-line
                  SEPARATED BY space.
      APPEND tbl_text.
      CLEAR tbl_text.
      WRITE w_enr_20 TO tbl_text-line NO-ZERO LEFT-JUSTIFIED.
      IF tbl_text-line IS INITIAL.
        tbl_text-line = '0'.
      ENDIF.
      CONCATENATE text-cr4 tbl_text-line INTO tbl_text-line
                  SEPARATED BY space.
      APPEND tbl_text.
      CLEAR tbl_text.
      APPEND tbl_text.
      WRITE text-cr5 TO tbl_text-line NO-ZERO LEFT-JUSTIFIED.
      APPEND tbl_text.
      CLEAR tbl_text.
      CLEAR w_lines.
      DESCRIBE TABLE tbl_text LINES w_lines.
      CLEAR tbl_pack.
      REFRESH tbl_pack.
      tbl_pack-head_start = 1.
      tbl_pack-head_num   = 0.
      tbl_pack-body_start = 1.
      tbl_pack-body_num   = w_lines.
      tbl_pack-doc_type   = 'RAW'.
      tbl_pack-obj_name   = text-m01.  "Program name
      tbl_pack-doc_size   = ( w_lines - 1 ) * 255 + STRLEN( tbl_text-line ).
      APPEND tbl_pack.
    Alim tbl_text pour pièce jointe
    - en-tête des colonnes
      CLEAR tbl_text.
      CONCATENATE text-ti1 text-ti2 text-ti3 text-ti4
                  kst_retours
             INTO tbl_text-line SEPARATED BY ';'.
      APPEND tbl_text.
    contenu des colonnes
      LOOP AT tbl_compte_rendu.
        CLEAR tbl_text.
        CONDENSE tbl_compte_rendu-text1.
        CONCATENATE tbl_compte_rendu-text1
                    tbl_compte_rendu-text2
                    tbl_compte_rendu-text3
                    tbl_compte_rendu-text4
                    tbl_compte_rendu-text5
                    tbl_compte_rendu-text6
                    kst_retours
               INTO tbl_text-line SEPARATED BY ';'.
        APPEND tbl_text.
      ENDLOOP.
      DESCRIBE TABLE tbl_text LINES w_lines2.
      CLEAR tbl_pack.
      tbl_pack-head_start = 1.
      tbl_pack-head_num   = 0.
      tbl_pack-body_start = w_lines + 1.
      tbl_pack-body_num   = w_lines + w_lines2.
      tbl_pack-doc_type   = 'CSV'.
      tbl_pack-obj_name   = text-m07.
      tbl_pack-obj_descr  = text-m08.
      tbl_pack-doc_size   = ( w_lines2 - 1 ) * 255
                             + STRLEN( tbl_text-line ).
      APPEND tbl_pack.
    Envoi du mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = str_docdata
          put_in_outbox              = space
          commit_work                = 'X'
        TABLES
          packing_list               = tbl_pack
          contents_txt               = tbl_text
          receivers                  = tbl_dest
        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.
    Message was edited by:
            Alvaro Tejada Galindo

  • Need Smartform materials in PDF Format

    Hi Guys,
    Please give me the links to download the SMARTFORM materials in PDF format.
    I am new to smartforms so i need all the materials to learn SMARTFORMS.
    Regards,
    Chandru

    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Subtotals - Check the link...
    Re: Subtotal with Table Node in smartforms
    Go through these SAP Standard programs also,
    sf_example_01
    sf_example_02
    sf_example_03.

  • Email attachment PDF format

    Gurus,
    Can any body logic for the below requirement for my Report. Report is also pasted. Thanks!
    Create a table as given in the requirement
    Table:
    Cleint   Jobname Email ID  Active  Subject Text  Body Text
                                                       SO10           SO10
    ·         The email part should contain the entire log and spool if available.
    ·         Once you have the job list, loop on the list and check if the job is defined in your custom table
    o   If you find an entry then
    §  Read the Job Log and convert it to HTML
    §  Read the spool if available and convert it to pdf
    §  Create an email with
    ·         To: Mail id from your custom table
    ·         Subject [ below: ]
    o   Then write the entire job log.
    o   Give one blank line
    o   If spool list is available the write else write
    o   Give one blank line
    o   Write
    ·         Attachment should contain the PDF attachment of the spool.
    o   If the email fails then Write (donu2019t give message) the Job name and message that email failed.
    o   If you donu2019t find a mail ID for the job Write (donu2019t give message) the Job name and message that email not found.
    ·         Continue to the next Job in your list.
    REPORT ZJOB_MONITORING.
    T A B L E S
    TABLES: tbtco.
    T Y P E - S P O O L S
    TYPE-POOLS: slis.
    T Y P E  D E C L A R A T I O N S
    *TYPES: BEGIN OF type_tbtco,
           include TYPE tbtco,
          END OF type_tbtco.
    TYPES: BEGIN OF type_output,
           STRTTIME TYPE tbtco-STRTTIME,
           strtdate TYPE tbtco-strtdate,
           jobname  TYPE tbtco-jobname,
           line     TYPE string,
           END OF type_output.
    S T R U C T U R E S
    DATA: s_tbtco  TYPE tbtco,
          s_joblog TYPE zsbb_uc4_joblog,
          s_output TYPE type_output.
    I N T E R N A L  T A B L E S
    DATA: i_tbtco  TYPE STANDARD TABLE OF tbtco,
          i_joblog TYPE STANDARD TABLE OF zsbb_uc4_joblog,
          i_output TYPE STANDARD TABLE OF type_output.
    DATA: Begin of itab_jobname OCCURS 0,
          jobname type tbtco-jobname,
          end of itab_jobname.
    DATA: Begin of itab_user OCCURS 0,
          jobname type tbtco-sdluname,
          end of itab_user.
    DATA: Begin of itab_stat OCCURS 0,
          jobname type tbtco-status,
          end of itab_stat.
    DATA: Begin of itab_uzeit occurs 0,
          uzeit type sy-uzeit,
          end of itab_uzeit.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    DATA : t_fieldcat TYPE slis_t_fieldcat_alv.
    S E L E C T I O N  S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_strtda FOR sy-datum,
                    s_lstrun FOR sy-uzeit OBLIGATORY,
                    s_jobnam FOR tbtco-jobname,
                    s_user   FOR tbtco-sdluname,
                    s_status FOR tbtco-status.
    PARAMETERS: p_email AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK bl1.
    "                         AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_JOBNAM-LOW.
      PERFORM f4_JOBNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_JOBNAM-HIGH.
      PERFORM f4_JOBNAM-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_user-low.
      PERFORM f4_USER-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_user-high.
      PERFORM f4_USER-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_status-low.
      PERFORM f4_STATUS-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_status-high.
      PERFORM f4_STATUS-HIGH.
    S T A R T  O F  S E L E C T I O N
    START-OF-SELECTION.
      PERFORM select_data.
    If email is checked.
    Send the output table as an email attachment to the distribution list.
    Get the email list from the config table. " ask from where to get it
      IF p_email = 'X'.
    Call FM 'SO_OBJECT_SEND'.
    Fill the fields which are not commented accordingly.
    CALL FUNCTION 'SO_OBJECT_SEND'
       EXPORTING
         OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
         OBJECT_TYPE      = 'RAW'
         OWNER            = SY-UNAME
       TABLES
         OBJCONT          = TEXT
         OBJPARA          = OBJPARA
         RECEIVERS        = RECEIVERS
       EXCEPTIONS
         OTHERS           = 01.
    IF SY-SUBRC NE 0.
       RAISE ERROR.
    ENDIF.
    ENDIF.
    Prepare the ALV Report.
    PERFORM alv_grid_display.
    *&      Form  alv_grid_display
          text
    FORM alv_grid_display .
    alv required data objects.
      DATA: w_repid    TYPE syrepid,
            x_layout   TYPE slis_layout_alv,
            t_event    TYPE slis_t_event,
           t_fieldcat TYPE slis_t_fieldcat_alv,
            w_title    TYPE lvc_title,
            w_print    TYPE slis_print_alv,
            w_comm    TYPE slis_formname,
            flag       TYPE c VALUE 'N'.
      REFRESH t_fieldcat.
      REFRESH t_event.
      CLEAR   x_layout.
      CLEAR   w_title.
    Field Catalog
    PERFORM set_fieldcat2 USING:
       1 'strttime'   'BTCXTIME'   space           t_fieldcat ,
       2 'jobname'    'BTCJOB'     space           t_fieldcat ,
       3 'line'        space       'Job Log'       t_fieldcat .
    *PERFORM set_fieldcat2 USING:
       1 'strttime'   'BTCXTIME'   space     'I_OUTPUT'      t_fieldcat ,
       2 'jobname'    'BTCJOB'     space     'I_OUTPUT'      t_fieldcat ,
       3 'line'        space       'Job Log' 'I_OUTPUT'      t_fieldcat .
      PERFORM set_fieldcat.
    Layout
      x_layout-zebra = 'X'.
      x_layout-colwidth_optimize = 'X'.
    GUI Status
      w_repid = sy-repid .
    Top of page heading
    PERFORM set_top_page_heading USING t_heading t_event flag.
    call the FM 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = w_repid
         is_layout                         = x_layout
         it_fieldcat                       = t_fieldcat
        IT_SORT                           =
         i_save                            = 'X'
         it_events                         = t_event
       TABLES
          t_outtab                         = i_output
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " alv_grid_display
    *&      Form  set_top_page_heading
          text
    FORM set_top_page_heading  USING
                               t_heading TYPE slis_t_listheader
                               t_events  TYPE slis_t_event
                               flag      TYPE c.
      DATA: x_heading TYPE slis_listheader,
            x_event   TYPE LINE OF slis_t_event.
    Report title
      CLEAR t_heading[].
      CLEAR x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'Job Details'(002).
      APPEND x_heading TO t_heading.
    Name of the report program
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Report ID:'.
      x_heading-info = sy-repid.
      APPEND x_heading TO t_heading.
    User who is running the report
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'User: '.
      x_heading-info = sy-uname.
      APPEND x_heading TO t_heading.
    Date of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Date: '.
      WRITE sy-datum TO x_heading-info.
      APPEND x_heading TO t_heading.
    Time of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Time: '.
      WRITE sy-uzeit TO x_heading-info.
      APPEND x_heading TO t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-form = 'TOP_OF_PAGE'.
      APPEND x_event TO t_events.
    ENDFORM.                    " set_top_page_heading
    *&      Form  set_fieldcat2
          text
    FORM set_fieldcat2  USING
                        p_colpos p_fieldname p_ref_fieldname
                        p_seltext_m
                        p_tabname
                        t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
    the ref_fieldname given is a data element.
      IF NOT p_ref_fieldname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      wa_fieldcat-tabname = 'I_OUTPUT'.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                    " set_fieldcat2
    *&      Form  F4_JOBNAM-LOW
          text
    -->  p1        text
    <--  p2        text
    FORM F4_JOBNAM-LOW .
      SELECT jobname FROM tbtco
                  INTO TABLE itab_jobname.
      DELETE ADJACENT DUPLICATES FROM itab_jobname.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield             = 'jobname'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_jobnam-low'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG               = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_jobname
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_JOBNAM-LOW
    *&      Form  F4_JOBNAM-HIGH
          text
    -->  p1        text
    <--  p2        text
    FORM F4_JOBNAM-HIGH .
      SELECT jobname FROM tbtco
                    INTO TABLE itab_jobname.
      DELETE ADJACENT DUPLICATES FROM itab_jobname.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield             = 'jobname'
      PVALKEY                = ' '
         DYNPPROG              = 'sy-repid'
         DYNPNR                = '1000'
         DYNPROFIELD           = 's_jobnam-high'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG               = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_jobname
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_JOBNAM-HIGH
    *&      Form  F4_USER-LOW
          text
    -->  p1        text
    <--  p2        text
    FORM F4_USER-LOW .
      SELECT sdluname  FROM tbtco
                    INTO TABLE itab_user.
      DELETE ADJACENT DUPLICATES FROM itab_user.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'user'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_user-low'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_user
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_USER-LOW
    *&      Form  F4_USER-HIGH
          text
    -->  p1        text
    <--  p2        text
    FORM F4_USER-HIGH .
      SELECT sdluname  FROM tbtco
                    INTO TABLE itab_user.
      DELETE ADJACENT DUPLICATES FROM itab_user.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'user'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_user-high'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_user
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_USER-HIGH
    *&      Form  F4_STATUS-LOW
          text
    -->  p1        text
    <--  p2        text
    FORM F4_STATUS-LOW .
      SELECT status  FROM tbtco
                    INTO TABLE itab_stat.
      DELETE ADJACENT DUPLICATES FROM itab_stat.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'status'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_status-low'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_stat
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_STATUS-LOW
    *&      Form  F4_STATUS-HIGH
          text
    -->  p1        text
    <--  p2        text
    FORM F4_STATUS-HIGH .
      SELECT status  FROM tbtco
                    INTO TABLE itab_stat.
      DELETE ADJACENT DUPLICATES FROM itab_stat.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'status'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_status-high'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
      VALUE_ORG              = 'C'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab              = itab_stat
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_STATUS-HIGH
    *&      Form  SELECT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT_DATA .
    select the entries from the table TBTCO
    as per the selection screen
      SELECT * FROM tbtco
               INTO TABLE i_tbtco
               WHERE STRTTIME IN s_lstrun AND
                     strtdate IN s_strtda AND
                     jobname  IN s_jobnam AND
                     sdluname IN s_user   AND
                     status   IN s_status.
    Get the job details for the above jobs.
      LOOP AT i_tbtco INTO s_tbtco.
        CALL FUNCTION 'ZSBB_UC4_JOB_READ_LOG'
          EXPORTING
            client                = sy-mandt
            jobcount              = s_tbtco-jobcount
            joblog                = s_tbtco-joblog
            jobname               = s_tbtco-jobname
          TABLES
            joblog_tab            = i_joblog
          EXCEPTIONS
            cant_read_joblog      = 1
            jobcount_missing      = 2
            joblog_does_not_exist = 3
            joblog_is_empty       = 4
            joblog_name_missing   = 5
            jobname_missing       = 6
            job_does_not_exist    = 7
            OTHERS                = 8.
    Write the Error handling as needed.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ELSE.
    Append entries to main table.
          s_output-STRTTIME = s_tbtco-STRTTIME.
          s_output-jobname  = s_tbtco-jobname.
          LOOP AT  i_joblog INTO s_joblog.
            s_output-line = s_joblog-text.
            APPEND s_output TO i_output.
            CLEAR s_output.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " SELECT_DATA
    *&      Form  SET_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    form SET_FIELDCAT .
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      wa_fieldcat-col_pos = 1.
      wa_fieldcat-fieldname = 'STRTTIME'.
      wa_fieldcat-seltext_m = 'Start Time'.
      wa_fieldcat-tabname = 'I_OUTPUT'.
    wa_fieldcat-reptext = p_reptext.
      APPEND wa_fieldcat to t_fieldcat.
      wa_fieldcat-col_pos = 2.
      wa_fieldcat-fieldname = 'JOBNAME'.
      wa_fieldcat-seltext_m = 'Job Name'.
      wa_fieldcat-tabname = 'I_OUTPUT'.
    wa_fieldcat-reptext = p_reptext.
      APPEND wa_fieldcat to t_fieldcat.
      wa_fieldcat-col_pos = 3.
      wa_fieldcat-fieldname = 'LINE'.
      wa_fieldcat-seltext_m = 'Job Log'.
      wa_fieldcat-tabname = 'I_OUTPUT'.
      APPEND wa_fieldcat to t_fieldcat.
    endform.                    " SET_FIELDCAT
    Edited by: venkata on Aug 12, 2008 4:13 PM

    solved

  • Schedule Xcelsius dashboard as -email in PDF format

    Hi,
    is there a way to schedule Xcelsius document in PDF form to end users as e-mail from BOE server the same way you can schedule crystal report, for example.
    I can right click on crystal report on BOE and select schedule but this is not available fro Xelsius documents?
    JP

    Hi,
    is there a way to schedule Xcelsius document in PDF form to end users as e-mail from BOE server the same way you can schedule crystal report, for example.
    I can right click on crystal report on BOE and select schedule but this is not available fro Xelsius documents?
    JP

  • What do I need to make a PDF of an email in Outlook 2003

    What do I need to make a PDF of an email in Outlook 2003

    Hi Nancy,
    Allow me to gather more detail from you so I can assist you better!
    Are you using CreatePDF (https://createpdf.acrobat.com/app.html) to convert your email into PDF format? If not - what are you using?
    Regards, Stacy

Maybe you are looking for

  • Can't log in because a card valid

    Someone please help me,when I try to log into my account on my iphone 4s it says that I need a any type of credit card/prepaid card,when I typed it in correctly it happen to say "Your payment method was declined.Please enter valid payment method info

  • Duplex Printing, needs pdf to end in even

    Hi all, i just started Designing forms in  LC and have designed a dynamic form  , i need some help on this. If the pdf ends with odd page how can i make it to end it with even (like adding a blank page if the pdf's end with odd number so as to make i

  • Surface Pro 3 Windows 8.1 Question

    I have imaged a surface pro 3 with MDT but when swiping to the left there is no screen setting and I don't see an option for auto-brightness. Also, it doesn't appear that the surface will auto-rotate between landscape and portrait. Has anyone else se

  • Can't Edit library image in Photoshop  =(

    I just installed Captivate 2 After recording my first demo, I tried to edit the slide (the "background" image in the library using the EDIT IN command. This command opens MSPaint (gahh! what a horrible program!). There is no way that I can see to tel

  • Macbook Pro (Late 2008),  Migration from old MBP, Cannot Switch GraphicCard

    Hello, I just got my new Macbook Pro (new 2008 version). I have a complete Time Machine Backup from my old Macbook Pro (2007) so I inserted Mac OS X Install DVD and told it to install from Time Machine. It took about 2-3 hours, but worked very well,