cancel
Showing results for 
Search instead for 
Did you mean: 

Document Name in Email

Former Member
0 Kudos

Hi All,

I am using an output type with transmission medium as External Send inorder to send an email with a pdf attachment.

I want to change the name of the attchment document as per my requirement.

How do i go about this.

P.S. I am using (in NACE) Application - EF

I have created a new output type with the same program as for NEU.

Program Name: SAPFM06P ( i have created a Z program)

Regards,

Riya.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hiii

you can do it like following code

IF h_transf_type = 'X'.            " Binary=PDF/ALI?
      t_pak_list-transf_bin = 'X'.
      t_pak_list-head_start = 1.
      t_pak_list-head_num   = 0.
      t_pak_list-body_start = 1.
      t_pak_list-body_num   = h_tab_cntr.
      t_pak_list-doc_type   = h_real_type.
      t_pak_list-obj_name   = 'ATTACHMENT'. ---------------->>>>>here you can give name

      t_pak_list-obj_descr  = 'Document'(001). ---------------->>>>>here you can give description

      t_pak_list-doc_size   = ( h_tab_cntr - 1 )
                            * 255 + STRLEN( t_con_bin ).
    ELSE.
      DESCRIBE TABLE t_con_text LINES h_tab_cntr.
      READ TABLE t_con_text INDEX h_tab_cntr.
      t_pak_list-transf_bin = ' '.     " Binary=RAW
      t_pak_list-head_start = 1.
      t_pak_list-head_num   = 0.
      t_pak_list-body_start = h_body_start.
      t_pak_list-body_num   = h_tab_cntr.
      t_pak_list-doc_type   = h_real_type.
      t_pak_list-obj_name   = 'ATTACHMENT'(002).  ---------------->>>>>here you can give name

      t_pak_list-obj_descr  = 'Report'(003).  ---------------->>>>>here you can give description
      t_pak_list-doc_size   = ( h_body_num - 1 )
                            * 255 + STRLEN( t_con_text ).
    ENDIF.
    APPEND t_pak_list.
  ENDIF.


* Send the EMAIL out with SAP function...
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = h_doc_data
      put_in_outbox              = 'X'
*      commit_work                = 'X'
    TABLES
      packing_list               = t_pak_list
      contents_bin               = t_con_bin
      contents_txt               = t_con_text
      receivers                  = t_receivers
    EXCEPTIONS

regards

twinkal

Former Member
0 Kudos

Which function module is getting called while sending mail?

In object description, You can specify name of teh attachement; try it.