To avoid the attachment for the body content while sending email from ABAP
SAP Version : 4.7
When i tried to send an external email from the abap report program, the body content of the mail is coming as an attachment for the same. I need to avoid this. Please give the suggestion. Am attaching the code.
DECLARATION PART *
TYPE-POOLS : SLIS.
TABLES : VBAK.
DECLARATION FOR ALV.
DATA : F_FIELD TYPE SLIS_T_FIELDCAT_ALV,
W_FIELD TYPE SLIS_FIELDCAT_ALV,
L_HEADER TYPE SLIS_T_LISTHEADER,
W_HEADER TYPE SLIS_LISTHEADER,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv.
TYPES : BEGIN OF T_VBAK,
VBELN LIKE VBAK-VBELN,
VKGRP LIKE VBAK-VKGRP,
KUNNR LIKE VBAK-KUNNR,
ERDAT LIKE VBAK-ERDAT,
VTWEG LIKE VBAK-VTWEG,
LIFSK LIKE VBAK-LIFSK,
VKBUR LIKE VBAK-VKBUR,
END OF T_VBAK.
TYPES : BEGIN OF T_VBAP,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
WERKS LIKE VBAP-WERKS,
ARKTX LIKE VBAP-ARKTX,
KWMENG LIKE VBAP-KWMENG,
CUOBJ LIKE VBAP-CUOBJ,
NETWR LIKE VBAP-NETWR,
ZSCHL_K LIKE VBAP-ZSCHL_K,
KONDM LIKE VBAP-KONDM,
ZZURWN LIKE VBAP-ZZURWN,
END OF T_VBAP.
TYPES : BEGIN OF T_LIPS,
VBELN LIKE LIPS-VBELN,
POSNR LIKE LIPS-POSNR,
VGBEL LIKE LIPS-VGBEL,
VGPOS LIKE LIPS-VGPOS,
END OF T_LIPS.
TYPES : BEGIN OF T_KNA1,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
ADRNR LIKE KNA1-ADRNR,
END OF T_KNA1.
TYPES : BEGIN OF T_VBKD,
VBELN LIKE VBKD-VBELN,
POSNR LIKE VBKD-POSNR,
BSTKD LIKE VBKD-BSTKD,
BSTDK LIKE VBKD-BSTDK,
KURSK LIKE VBKD-KURSK, " CURRENCY CHECK
BZIRK LIKE VBKD-BZIRK, " SALES DISTRICT
KDGRP LIKE VBKD-KDGRP,
IHREZ LIKE VBKD-IHREZ,
END OF T_VBKD.
TYPES : BEGIN OF T_LIKP,
VBELN LIKE LIKP-VBELN,
ERDAT LIKE LIKP-ERDAT,
END OF T_LIKP.
TYPES : BEGIN OF T_ADR6,
ADDRNUMBER LIKE ADR6-ADDRNUMBER,
SMTP_ADDR LIKE ADR6-SMTP_ADDR,
END OF T_ADR6.
DATA : BEGIN OF IT_CUST OCCURS 0,
KUNNR LIKE VBAK-KUNNR,
END OF IT_CUST.
TYPES : BEGIN OF T_VBUP,
VBELN LIKE VBUP-VBELN,
POSNR LIKE VBUP-POSNR,
KOSTA LIKE VBUP-KOSTA,
WBSTA LIKE VBUP-WBSTA,
END OF T_VBUP.
TYPES : BEGIN OF T_TVLST,
LIFSP LIKE TVLST-LIFSP,
VTEXT LIKE TVLST-VTEXT,
END OF T_TVLST.
TYPES : BEGIN OF T_CONFIG.
INCLUDE STRUCTURE CONF_OUT.
TYPES : END OF T_CONFIG.
DATA : TMP LIKE VBAK-KUNNR.
DATA : NAME_TEXT LIKE THEAD-TDNAME.
DATA : TLINE1 LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA : TMP_BRAKET LIKE CONF_OUT-ATWRT,
TMP_BRAKET1 LIKE CONF_OUT-ATWRT.
DATA : BEGIN OF IT_FINAL OCCURS 0,
WERKS LIKE VBAP-WERKS,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
KUNNR LIKE VBAK-KUNNR,
NAME1 LIKE KNA1-NAME1,
VBELN1 LIKE LIKP-VBELN,
ERDAT LIKE LIKP-ERDAT,
LIFSK LIKE VBAK-LIFSK,
ZZURWN LIKE VBAP-ZZURWN,
IHREZ LIKE VBKD-IHREZ,
ERDAT1 LIKE VBAK-ERDAT,
NETWR(25) type C,
BSTKD LIKE VBKD-BSTKD,
BSTDK LIKE VBKD-BSTDK,
SALORD(17) TYPE C,
PUMP_TYPE LIKE CONF_OUT-ATWRT,
PUMP_SIZE LIKE CONF_OUT-ATWRT,
VTEXT LIKE TVLST-VTEXT,
KWMENG(25) TYPE C,
FOOTER(330) TYPE C,
ITMTXT(330) TYPE C,
END OF IT_FINAL.
DATA : IT_VBAK TYPE STANDARD TABLE OF T_VBAK,
IT_VBAP TYPE STANDARD TABLE OF T_VBAP,
IT_VBKD TYPE STANDARD TABLE OF T_VBKD,
IT_LIKP TYPE STANDARD TABLE OF T_LIKP,
IT_LIPS TYPE STANDARD TABLE OF T_LIPS,
IT_VBUP TYPE STANDARD TABLE OF T_VBUP,
IT_KNA1 TYPE STANDARD TABLE OF T_KNA1,
IT_ADR6 TYPE STANDARD TABLE OF T_ADR6,
IT_FINAL1 LIKE IT_FINAL OCCURS 0 with header line,
IT_TVLST TYPE STANDARD TABLE OF T_TVLST,
IT_CONFIG TYPE STANDARD TABLE OF T_CONFIG,
W_VBAK TYPE T_VBAK,
W_VBAP TYPE T_VBAP,
W_VBKD TYPE T_VBKD,
W_LIKP TYPE T_LIKP,
W_ADR6 TYPE T_ADR6,
W_LIPS TYPE T_LIPS,
W_VBUP TYPE T_VBUP,
W_KNA1 TYPE T_KNA1,
W_TVLST TYPE T_TVLST,
W_CONFIG TYPE T_CONFIG.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
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,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
SELECTION-CRITERIA *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : R2 RADIOBUTTON GROUP G1 USER-COMMAND radio DEFAULT 'X',
R1 RADIOBUTTON GROUP G1 .
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-002.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '[email protected]'.
PARAMETERS : P_VTWEG LIKE W_VBAK-VTWEG ,
P_WERKS LIKE W_VBAP-WERKS.
select-options : s_vkgrp for w_vbak-vkgrp,
s_ERDAT for w_LIKP-ERDAT.
selection-screen end of block b2.
Initialization
INITIALIZATION.
s_vkgrp-sign = 'I'.
s_vkgrp-option = 'BT'.
s_vkgrp-low = '313'.
s_vkgrp-high = '324'.
APPEND s_vkgrp.
s_erdat-sign = 'I'.
s_erdat-option = 'BT'.
s_erdat-low = '20080108'.
s_erdat-high = '20080108'.
s_erdat-low = '20070101'.
s_erdat-high = sy-datum.
APPEND s_erdat.
selection-screen validations
AT SELECTION-SCREEN.
Validation for Plant.
IF p_werks NE '7210'.
MESSAGE : 'Plant entered should be 7210' TYPE 'E'.
ENDIF.
START OF SELECTION *
start-of-selection.
GETTING THE DATA FROM THE DATABASE TABLE
PERFORM DATA_FETCH.
FILLING THE FINAL INTERNAL TABLE
PERFORM FILL_FINAL.
GETTING THE LIST FOR SENDING MAIL OR DISPLAY.
IF R1 = 'X'.
Populate table with details to be entered into .xls file
LOOP AT IT_CUST.
PERFORM build_xls_data_table using it_cust-kunnr.
ENDLOOP.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
ELSEIF R2 = 'X'.
PERFORM LIST_DISPLAY.
ENDIF.
END OF SELECTION *
end-of-selection.
*& Form DATA_FETCH
text
--> p1 text
<-- p2 text
FORM DATA_FETCH .
SELECT VBELN
VKGRP
KUNNR
ERDAT
VTWEG
LIFSK
VKBUR
INTO TABLE IT_VBAK
FROM VBAK
WHERE VTWEG = P_VTWEG
AND VKGRP IN S_VKGRP
AND LIFSK NE ''.
IF IT_VBAK[] IS NOT INITIAL.
SELECT LIFSP
VTEXT
INTO TABLE IT_TVLST
FROM TVLST
FOR ALL ENTRIES IN IT_VBAK
WHERE LIFSP = IT_VBAK-LIFSK
AND SPRAS = 'EN'.
SELECT VBELN
POSNR
MATNR
WERKS
ARKTX
KWMENG
CUOBJ
NETWR
ZSCHL_K
KONDM
ZZURWN
INTO TABLE IT_VBAP
FROM VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN
AND WERKS = P_WERKS.
SELECT KUNNR
NAME1
ADRNR
INTO TABLE IT_KNA1
FROM KNA1
FOR ALL ENTRIES IN IT_VBAK
WHERE KUNNR = IT_VBAK-KUNNR.
SELECT VBELN
POSNR
BSTKD
BSTDK
KURSK
BZIRK
KDGRP
INTO TABLE IT_VBKD
FROM VBKD
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
IF IT_VBAP[] IS NOT INITIAL.
SELECT VBELN
POSNR
VGBEL
VGPOS
INTO TABLE IT_LIPS
FROM LIPS
FOR ALL ENTRIES IN IT_VBAP
WHERE VGBEL = IT_VBAP-VBELN
AND VGPOS = IT_VBAP-POSNR.
ENDIF.
IF IT_LIPS[] IS NOT INITIAL.
SELECT VBELN
ERDAT
INTO TABLE IT_LIKP
FROM LIKP
FOR ALL ENTRIES IN IT_LIPS
WHERE VBELN = IT_LIPS-VBELN
AND ERDAT IN S_ERDAT.
SELECT VBELN
POSNR
KOSTA
WBSTA
INTO TABLE IT_VBUP
FROM VBUP
FOR ALL ENTRIES IN IT_LIPS
WHERE VBELN = IT_LIPS-VBELN
AND POSNR = IT_LIPS-POSNR
AND KOSTA EQ 'C'
AND WBSTA NE 'C'.
ENDIF.
IF IT_KNA1[] IS NOT INITIAL.
SELECT ADDRNUMBER
SMTP_ADDR
INTO TABLE IT_ADR6
FROM ADR6
FOR ALL ENTRIES IN IT_KNA1
WHERE ADDRNUMBER = IT_KNA1-ADRNR.
ENDIF.
ENDFORM. " DATA_FETCH
*& Form LIST_DISPLAY
text
--> p1 text
<-- p2 text
FORM LIST_DISPLAY .
REFRESH F_FIELD.
IF R2 = 'X'.
W_FIELD-col_pos = 1.
W_FIELD-fieldname = 'WERKS'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Plant'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 2.
W_FIELD-fieldname = 'VBELN'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Sales Order'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 3.
W_FIELD-fieldname = 'KUNNR'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer Code'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 4.
W_FIELD-fieldname = 'NAME1'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer Name'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 5.
W_FIELD-fieldname = 'VBELN1'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Number'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 6.
W_FIELD-fieldname = 'ERDAT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Date'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 7.
W_FIELD-fieldname = 'LIFSK'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Block'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 8.
W_FIELD-fieldname = 'PUMP_TYPE'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Pump Type'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 9.
W_FIELD-fieldname = 'PUMP_SIZE'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_l = 'Pump Size'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 10.
W_FIELD-fieldname = 'ZZURWN'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Pump Srno'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 11.
W_FIELD-fieldname = 'IHREZ'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Indent No.'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 12.
W_FIELD-fieldname = 'ERDAT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Order Booking Dt'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 13.
W_FIELD-fieldname = 'NETWR'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C710'.
W_FIELD-seltext_m = 'Net Value'.
w_field-do_sum = 'X'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 14.
W_FIELD-fieldname = 'KWMENG'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C710'.
W_FIELD-seltext_m = 'Qty'.
w_field-do_sum = 'X'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 15.
W_FIELD-fieldname = 'BSTKD'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer PONO'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 16.
W_FIELD-fieldname = 'BSTDK'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer PODT'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 17.
W_FIELD-fieldname = 'SALORD'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Sales Order/Item'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 18.
W_FIELD-fieldname = 'VTEXT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Block Desc.'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 19.
W_FIELD-fieldname = 'FOOTER'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Footer Text'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 20.
W_FIELD-fieldname = 'ITMTXT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Item Text'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
PERFORM SORT_FIELD.
PERFORM LAYOUT_DISPLAY.
PERFORM GRID_DISPLAY.
ENDIF.
ENDFORM. " LIST_DISPLAY
*& Form FILL_FINAL
text
--> p1 text
<-- p2 text
FORM FILL_FINAL .
REFRESH IT_FINAL.
LOOP AT IT_VBUP INTO W_VBUP.
READ TABLE IT_LIPS INTO W_LIPS WITH KEY VBELN = W_VBUP-VBELN POSNR = W_VBUP-POSNR.
READ TABLE IT_LIKP INTO W_LIKP WITH KEY VBELN = W_LIPS-VBELN.
IF SY-SUBRC EQ 0.
READ TABLE IT_VBAP INTO W_VBAP WITH KEY VBELN = W_LIPS-VGBEL POSNR = W_LIPS-VGPOS.
READ TABLE IT_VBAK INTO W_VBAK WITH KEY VBELN = W_VBAP-VBELN.
READ TABLE IT_VBKD INTO W_VBKD WITH KEY VBELN = W_VBAK-VBELN.
READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = W_VBAK-KUNNR.
READ TABLE IT_TVLST INTO W_TVLST WITH KEY LIFSP = W_VBAK-LIFSK.
IT_FINAL-WERKS = W_VBAP-WERKS.
IT_FINAL-VBELN = W_VBAP-VBELN.
IT_FINAL-KUNNR = W_VBAK-KUNNR.
IT_FINAL-NAME1 = W_KNA1-NAME1.
IT_FINAL-VBELN1 = W_LIKP-VBELN.
IT_FINAL-ERDAT = W_LIKP-ERDAT.
IT_FINAL-LIFSK = W_VBAK-LIFSK.
IT_FINAL-ZZURWN = W_VBAP-ZZURWN.
IT_FINAL-IHREZ = W_VBKD-IHREZ.
IT_FINAL-ERDAT1 = W_VBAK-ERDAT.
IT_FINAL-NETWR = W_VBAP-NETWR.
IT_FINAL-BSTKD = W_VBKD-BSTKD.
IT_FINAL-BSTDK = W_VBKD-BSTDK.
IT_FINAL-POSNR = W_VBAP-POSNR.
IT_FINAL-VTEXT = W_TVLST-VTEXT.
IT_FINAL-KWMENG = W_VBAP-KWMENG.
CONCATENATE W_VBAP-VBELN W_VBAP-POSNR INTO IT_FINAL-SALORD SEPARATED BY '/'.
IF W_VBAP-CUOBJ NE '000000000000000000'.
REFRESH IT_CONFIG.
CALL FUNCTION 'VC_I_GET_CONFIGURATION'
EXPORTING
INSTANCE = W_VBAP-CUOBJ
LANGUAGE = SY-LANGU
TABLES
CONFIGURATION = IT_CONFIG
EXCEPTIONS
INSTANCE_NOT_FOUND = 1
INTERNAL_ERROR = 2
NO_CLASS_ALLOCATION = 3
INSTANCE_NOT_VALID = 4
OTHERS = 5.
IF SY-SUBRC = 0.
READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_TYPE'.
IT_FINAL-PUMP_TYPE = W_CONFIG-ATWRT.
CLEAR W_CONFIG.
READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_SIZE' .
IT_FINAL-PUMP_SIZE = W_CONFIG-ATWRT.
CLEAR W_CONFIG.
ENDIF.
ENDIF.
move w_vbap-vbeln to name_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ZKT1'
language = 'E'
name = name_text
object = 'VBBK'
TABLES
lines = tline1
EXCEPTIONS
OTHERS = 8.
LOOP AT TLINE1.
CONCATENATE IT_FINAL-FOOTER TLINE1-TDLINE+0(65) INTO IT_FINAL-FOOTER.
CLEAR : TLINE1.
ENDLOOP.
clear : name_text,tline1[].
concatenate w_vbap-vbeln w_vbap-posnr into name_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ZKT3'
language = 'E'
name = name_text
object = 'VBBP'
TABLES
lines = tline1
EXCEPTIONS
OTHERS = 8.
LOOP AT TLINE1.
CONCATENATE IT_FINAL-ITMTXT TLINE1-TDLINE+0(65) INTO IT_FINAL-ITMTXT.
CLEAR : TLINE1.
ENDLOOP.
APPEND IT_FINAL.
ENDIF.
CLEAR : IT_FINAL,W_VBAP,W_VBKD,W_VBUP,W_LIPS,W_LIKP,W_KNA1,W_VBAK,W_TVLST,name_text,tline1[].
ENDLOOP.
IT_FINAL1[] = IT_FINAL[].
SORT IT_FINAL1 BY KUNNR.
LOOP AT IT_FINAL1.
IF TMP NE IT_FINAL1-KUNNR.
IT_CUST-KUNNR = IT_FINAL1-KUNNR.
APPEND IT_CUST.
clear : tmp,it_cust.
TMP = IT_FINAL1-KUNNR.
ENDIF.
CLEAR : IT_FINAL1.
ENDLOOP.
ENDFORM. " FILL_FINAL
*& Form LAYOUT_DISPLAY
text
--> p1 text
<-- p2 text
FORM LAYOUT_DISPLAY .
W_LAYOUT-colwidth_optimize = 'X'.
ENDFORM. " LAYOUT_DISPLAY
*& Form GRID_DISPLAY
text
--> p1 text
<-- p2 text
FORM GRID_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = F_FIELD
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = T_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
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. " GRID_DISPLAY
*& Form SORT_FIELD
text
--> p1 text
<-- p2 text
FORM SORT_FIELD .
w_sort-spos = 1.
w_sort-fieldname = 'KUNNR'.
w_sort-up = 'X'.
append w_sort to t_sort.
clear w_sort.
w_sort-spos = 2.
w_sort-fieldname = 'VBELN'.
w_sort-up = 'X'.
append w_sort to t_sort.
clear w_sort.
ENDFORM. " SORT_FIELD
*& Form TOP_OF_PAGE
text
FORM top_of_page.
IF R2 = 'X'.
REFRESH l_header.
w_header-typ = 'S'.
w_header-key = 'Delivery Block : '.
w_header-info = 'Outbound delivery created but not despatched'.
APPEND w_header TO l_header.
CLEAR w_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = l_header.
ENDIF.
ENDFORM. "TOP_OF_PAGE
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table using custcode.
CONSTANTS: con_cret TYPE X VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
data : it_custcode like vbak-kunnr.
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
clear : it_attach,it_attach[].
CONCATENATE 'Customer PONO' 'Customer PODT' 'Sales Order No' 'Item No'
'Pump Type' 'Pump Size' 'Order Value Rs' 'Delivery No.' 'Delivery Dt.'
'Quantity' 'Reasons for not getting Despatch'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
it_custcode = custcode.
CLEAR : W_KNA1,W_ADR6. "Code need to be added once testing is over.
READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = IT_CUSTCODE.
READ TABLE IT_ADR6 INTO W_ADR6 WITH KEY ADDRNUMBER = W_KNA1-ADRNR.
P_EMAIL = W_ADR6-SMTP_ADDR.
LOOP AT it_final where kunnr = it_custcode.
CONCATENATE
IT_FINAL-BSTKD
IT_FINAL-BSTDK
IT_FINAL-VBELN
IT_FINAL-POSNR
IT_FINAL-PUMP_TYPE
IT_FINAL-PUMP_SIZE
IT_FINAL-NETWR
IT_FINAL-VBELN1
IT_FINAL-ERDAT
IT_FINAL-KWMENG
IT_FINAL-VTEXT
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
clear it_final.
ENDLOOP.
if R1 = 'X'.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'AWAITING DESPATCH CLEARANCE'
'XLS'
'Delivery_Block'
'Delivery_Blk'
'[email protected]'
'INT'
changing gd_error
gd_reciever.
endif.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_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: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
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.
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,w_cnt.
DESCRIBE TABLE it_attach LINES w_cnt.
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[] = pit_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
object_header = objhead
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.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'We have manufactured the pump/s against your purchase order and regret to inform'.
APPEND it_message.
it_message = 'you that same cannot be despatched for the reason/s indicated below.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'Please find the below attachment "Delivery_Blk.xls" for the details.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'We now request you to send the required detail/s by return mail/post to enable us '.
APPEND it_message.
it_message = 'to despatch the pump/s at the earliest.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'Best Regards'.
APPEND it_message.
it_message = 'O.E. ENGINEER'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY
Hi,
Refer to the following piece of code. This is the simple code to send email with content and attachment.
Declaration
DATA: lwa_hd_change TYPE sood1,
lt_objcont TYPE STANDARD TABLE OF soli,
lwa_objcont TYPE soli,
lt_receivers TYPE STANDARD TABLE OF soos1,
lwa_receivers TYPE soos1 ,
lt_att_cont TYPE STANDARD TABLE OF soli,
lwa_att_cont TYPE soli,
lt_packing TYPE STANDARD TABLE OF soxpl,
lwa_packing TYPE soxpl,
lf_sent TYPE sonv-flag,
lf_size TYPE i.
CONSTANTS: lc_obj(11) TYPE c VALUE 'BOMSouthco',
lc_desc(20) TYPE c VALUE 'BOM Download',
lc_lang(1) TYPE c VALUE 'E',
lc_raw(3) TYPE c VALUE 'RAW',
lc_net(1) TYPE c VALUE 'U',
lc_mail(4) TYPE c VALUE 'MAIL',
lc_xls(3) TYPE c VALUE 'XLS',
lc_ext(3) TYPE c VALUE 'EXT'.
Passing values to the strutures used in SO_OBJECT_SEND function module
lwa_hd_change-objla = lc_lang.
lwa_hd_change-objnam = lc_obj.
lwa_hd_change-objdes = lc_desc.
lwa_hd_change-objlen = 255.
lwa_objcont-line = text-t29.
APPEND lwa_objcont TO lt_objcont.
CLEAR lwa_objcont.
lwa_receivers-recextnam = text-t31.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
lwa_receivers-recextnam = text-t30.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
Passing values for the attachment file
LOOP AT gt_output INTO gwa_output.
CONCATENATE gf_lf gwa_output-matnr gf_etb gwa_output-idnrk gf_etb
gwa_output-type gf_etb gwa_output-menge gf_etb
gwa_output-meins gf_etb gwa_output-comp gf_etb
INTO lwa_att_cont-line.
APPEND lwa_att_cont TO lt_att_cont.
CLEAR lwa_att_cont.
ENDLOOP.
CHECK lt_att_cont IS NOT INITIAL.
DESCRIBE TABLE lt_att_cont LINES lf_size.
lwa_packing-transf_bin = ' '.
lwa_packing-head_start = 1.
lwa_packing-head_num = 0.
lwa_packing-body_start = 1.
lwa_packing-body_num = lf_size.
lwa_packing-file_ext = lc_xls.
lwa_packing-objlen = lf_size * 255.
lwa_packing-objtp = lc_ext.
lwa_packing-objdes = lc_desc.
lwa_packing-objnam = lc_obj.
APPEND lwa_packing TO lt_packing.
CLEAR lwa_packing.
CHECK gf_error IS NOT INITIAL. "Check if unix file is written
FM to send email to the intended recipients
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = lwa_hd_change
object_type = lc_raw
IMPORTING
sent_to_all = lf_sent
TABLES
objcont = lt_objcont
receivers = lt_receivers
packing_list = lt_packing
att_cont = lt_att_cont
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
originator_not_exist = 20
x_error = 21
OTHERS = 22.
IF sy-subrc = 0.
MESSAGE s004 WITH text-t34.
ENDIF.
COMMIT WORK.
Reward if helpful.
Regards,
Ramya
Similar Messages
-
I am using Mail 5.3 with two separate gmail addresses.
One is personal the other is business.
When I send emails from the BUSINESS address, any auto-replies/out of office notices I get come to my PERSONAL INBOX.
I imagine that this is a setting? Please help!Edit the SMTP server list. Add a new one for the business account. Put the correct password and information for it. Give it a description so you will know which server is which. Mke sure the correct server is highlighted in the account selected and check the box to use only that server for that account. Do that for the other account also.
-
Default the sender name while sending email from discoverer 11g viewer
Hi,
Can we put a default value of a sender in the email which are sent from discoverer 11g viewer.??Hello
Yes, you can do this but you have to edit one of the UIX files to do it. The following is taken from my new Discoverer 11h Handbook which will be out later in the year.
If you want to force users to send Discoverer reports from a prespecified e-mail account, use the following workflow:
Locate this file: $MIDDLEWARE_HOME/user_projects/domains/ClassicDomain/servers/WLS_DISCO/tmp/_WL_user/discoverer_11.1.1.2.0/<tmpfolder>/war/Email.uix
NOTE: In my system the name of the tmpfolder was 51oeh7. You may have a different name for <tmpfile> on your system and so may need to do a search for Email.uix.
Make a safe backup of Email.uix.
Find the following line and add the information in bold, changing [email protected] with your default email address:
<contents>
<messageTextInput required="yes" name="sender" disabled="true"
tip="[email protected]" columns="40"
prompt="${uix.data.nls['email.text.sender']}" text="[email protected]"/>
NOTE: In the above, you will be replacing text="${uix.eventResult.sender}" with your default email address like: text="myemail.mycompany.com"
Find the following line and add the line in bold below it:
<formValue name="event" value="sendEmail" />
<formValue name="sender" [email protected] />
NOTE: Make sure the domain name you provide is the same domain you are using for the SMTP server; otherwise, your Discoverer Viewer users will not be able to send e-mail.
Take a backup of the modified file and place it somewhere safe.
Stop and restart the WLS_DISCO server in the WebLogic Server Administration Console.
Notes concerning editing of UIX files:
Never make any changes without first backing up the UIX file you intend to work on. You need to go slowly and carefully, making backups as you go and trying your modifications on a test system first.
Any changes you make to a UIX file will not be supported by Oracle, and if you run into any problems with changes you make to a UIX file, you will be on your own, which is why you need a backup.
If you need future support, you will need to be able to prove that the issue you are encountering is not because of any changes you have made. You will basically need to have a clean instance to prove that the issue is still there.
Any upgrades or patches that you subsequently apply may overwrite any custom changes that you have made to the UIX files. It will be your responsibility to keep copies of any changes you have made, and it will be your responsibility to make sure these changes are still valid after any upgrade or patch.
NOTE: I cannot be held responsible if you tamper with your UIX files and mess up your system. You have been warned! That said, there are many examples for editing UIX files on Oracle’s Support site. So long as you are careful and heed the warnings mentioned, you should be fine
Best wishes
Michael -
When I try to send an email from my iCloud account on my IPAD I get the message that a copy has been saved to outbox as my storage limit has been reached. It works fine on the main computer but not on the ipad. How can I mend this?
I have just encountered exactly the same issue for the last 24 hrs - mail goes to outbox from iPad yet send OK from icloud account on my powerbook. Tried resetting the push email settings on the iPad but no chnage.
-
To send email from Abap code in which we have notepad as an attachment.
Hi All,
I am facing one problem. I am sending a notepad as an attachment to a mail.
The reciepents name is in the distribution list. When I checked the notepad, Headers and the record are coming in the same line .
But it should come in the different line.
Here is the code.....
TYPE-POOLS: SLIS.
My final table is i_output.
TYPES: begin of TY_EMAIL,
field1(1) type c,
field2(8) type c,
field3(12) type c,
field4(34) type c,
field5(10) type c,
end of TY_EMAIL.
DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
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,
GD_ERROR TYPE SY-SUBRC,
GD_RECIEVER TYPE SY-SUBRC.
DATA: IT_EMAIL TYPE STANDARD TABLE OF TY_EMAIL WITH HEADER LINE.
START-OF-SELECTION.
PERFORM get_data.
PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
TABLES IT_MESSAGE
IT_ATTACH
USING 'subject of mail'
'TXT'
'FILENAME'
CHANGING GD_ERROR
GD_RECIEVER.
END-OF-SELECTION.
form get_data.
CONCATENATE 'HEADER1'
'HEADER2'
'HEADER3'
'HEADER4'
'HEADER5'
INTO IT_ATTACH SEPARATED BY '~'
APPEND IT_ATTACH.
LOOP AT I_OUTPUT INTO WA_OUTPUT.
IT_EMAIL-FIELD1 = WA_OUPUT-FIELD1.
IT_EMAIL-FIELD2 = WA_OUPUT-FIELD2.
IT_EMAIL-FIELD3 = WA_OUPUT-FIELD3.
IT_EMAIL-FIELD4 = WA_OUPUT-FIELD4.
IT_EMAIL-FIELD5 = WA_OUPUT-FIELD5.
CONDENSE: IT_EMAIL-FIELD1,
IT_EMAIL-FIELD2,
IT_EMAIL-FIELD3,
IT_EMAIL-FIELD4,
IT_EMAIL-FIELD5.
CONCATTENATE: IT_EMAIL-FIELD1
IT_EMAIL-FIELD2
IT_EMAIL-FIELD3
IT_EMAIL-FIELD4
IT_EMAIL-FIELD5
INTO IT_ATTACH SEPERATED BY '~'
APPEND IT_ATTACH.
ENDLOOP.
FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
PIT_ATTACH
USING P_MTITLE
P_FORMAT
P_FILENAME
CHANGING P_ERROR
P_RECIEVER.
DATA: BEGIN OF OBJPARA OCCURS 10 . "
INCLUDE STRUCTURE SELC. "
DATA: END OF OBJPARA. "
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_ATTFILENAME TYPE SO_OBJ_DES ,
LD_RECEIVER LIKE SY-SUBRC.
DATA SENT_ALL LIKE SONV-FLAG.
DATA WARNING_MAIL LIKE SOODK.
LD_MTITLE = P_MTITLE.
LD_FORMAT = P_FORMAT.
LD_ATTFILENAME = P_FILENAME.
Fill the document data and get size of attachment
CLEAR OBJECT_HD.
READ TABLE IT_ATTACH INDEX W_CNT.
OBJECT_HD-DOC_SIZE =
( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
OBJECT_HD-OBJ_LANGU = SY-LANGU.
OBJECT_HD-OBJ_NAME = 'SAPRPT'.
OBJECT_HD-OBJ_DESCR = LD_MTITLE.
OBJECT_HD-SENSITIVTY = 'F'.
CLEAR T_ATTACHMENT.
REFRESH T_ATTACHMENT.
T_ATTACHMENT[] = PIT_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_NAME = LD_ATTFILENAME.
T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
APPEND T_PACKING_LIST.
Receipient Information for SAP Office.
MOVE: 'ZDIPIKA' TO RECEIVERS-RECNAM, "Receipient Name
'C ' TO RECEIVERS-RECESC, "Repeipient Type
' ' TO RECEIVERS-SNDEX, "Send Express
SY-DATUM TO RECEIVERS-RCDAT, "Message Date
SY-UZEIT TO RECEIVERS-RCTIM, "Message Time
'X' TO RECEIVERS-SNDCP. "Send Copy
APPEND RECEIVERS.
Add the recipients email address
CLEAR T_RECEIVERS.
REFRESH T_RECEIVERS.
T_RECEIVERS-RECEIVER = 'ZDIPIKA'. "LD_EMAIL.
T_RECEIVERS-REC_TYPE = 'C'.
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 = OBJECT_HD
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.
IF SY-SUBRC NE 0.
MESSAGE A095(ZZ) WITH LD_ERROR.
ENDIF.
COMMIT WORK.
-- DEQUEUE THE LOCK CREATED BY SO_OBJECT_SEND -
CALL FUNCTION 'SO_DEQUEUE_UPDATE_LOCKS'.
endform. " SEND_FILE_AS_EMAIL_ATTACHMENT
Thanks,
DipikaHi Deepika,
recently i struggled on this and i achieved success by doing as below
remember to keep packlist as RAW type like below:
t_packing_list-doc_type = 'RAW'.
do like this
CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
EXPORTING
ip_solitab = t_attachment[]
IMPORTING
EP_SOLIXTAB = xtext[].
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_data
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
tables
packing_list = t_packing_list
OBJECT_HEADER =
CONTENTS_BIN = objbin
CONTENTS_TXT = it_message
CONTENTS_HEX = xtext
OBJECT_PARA =
OBJECT_PARB =
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
<b>Kindly Reward points if you found this reply helpful</b>,
Cheers,
Chaitanya. -
String gets added to the name of the PDF while sending email
Hi,
I am generating a PDF from a smartform. When i click on the email button on the PDF, it opens outlook with the PDF in the attachment. But i can see some string gets added to the begining of the name of PDF for example if i have named the PDF as 18000012 then while sending email from PDF i can see the name as XXXXX1800012.pdf as the attachment. Is there any way by which i can remove that string.
Thanks,
SonalYou can use text variables in the report description
-
Attaching a BI Publisher report to an email from Apex
Hello,
My Apex application runs reports using a BI Publisher server- using a defined query and rtf template.
The end user clicks on a button and a pdf report opens up- works perfect.
Now, I need the click of the button to send an email having this report as an attachment.
I am familiar with sending email from Apex + attachment.
My problem is to create the report somewhere on the server without opening in a new browser window, then to attach the report that has just been create using BI Publisher to the email.
Does anyone know how this can be accomplished?
Thanks
RaniHi Tony,
Just found out about a completely different solution:
Thanks for your help.
Rani
Solution:
declare
datoteka blob;
st_poste number;
begin
datoteka:=apex_util.get_print_document(
p_application_id=>'183',
p_report_query_name=>'REVIEW_COORD',
p_report_layout_name=>'REVIEW_COORD',
p_report_layout_type=>'rtf',
p_document_format=>'pdf');
st_poste:=apex_mail.send(
p_to=>'[email protected]',
p_from=>'[email protected]',
p_body=>'Test',
p_subj=>'Subject');
apex_mail.add_attachment(
p_mail_id=>st_poste,
p_attachment=>datoteka,
p_filename=>'REVIEW_COORD.pdf',
p_mime_type=>'application/pdf');
apex_mail.push_queue;
end ; -
I recently upgraded both Pages 09 (I believe) and went to OSX 10.9 Maverick .... now I am unable to send a pages document to a friend on gmail. Google rejects the message and attachment with the following explanation -
The reason for the problem:
5.3.0 - Other mail system problem 552-'5.7.0 This message was blocked because its content presents a potential\n5.7.0 security issue.Same Problem here
IWORKS 09 pages, keynote, numbers does not send in MAIL (mac) because of "This message was blocked because its content presents a potentialsecurity issue"
its a problem not only on GMAIL but also Live, Hotmail, Yahoo, and other services...
The problem is that gmail and others haved yet accepted the latest iworks 09 files. its a problem that apple can ask then to fix but its up to the gmail and others to fix it.
Solution!!!:
1 - Send it by exporting to office files
2 - Saving the files as old iwork documents
3 - Command P and save as PDF
4 - Save in icloud and send the URL
So you can still send them but have to take a bit more of your time
i hope you understand my english is not optimal
And if you have any questions feel free to ask me -
I ordered mac OS and I got the email for License and I didnt get the attachement for content code. Please help me getting the content code.
It's a two email process, one email has a locked pdf with the redemption code. The second email has the password to unlock the pdf. They come separetly, so you may have to wait for the 2nd to arrive.
-
Would Like to Get Report of Daily Emails In and Out from Members to a DL
Exchange version : 2007
I am the supervisor for the group and want to quantify this information. I do not need to see the content, just quantity
is it possible ?Well, distribution groups don't really have a concept of "in" or "out". They only serve to distribute messages sent to them -- unless you're asking to know who was a member of the distribution group at the time a message was sent to the DL.
Message tracking logs hold the information you want, though. You'd have to look for EXPAND events that reference the distribution group and take the sender's e-mail address from that event. If the DL is a simple one that's not a member of any other groups
you could also look for RECEIVE events sent to the e-mail address of the group and get the sender's name from that event.
You can use Powershell extract the rows of data from the logs, but you'll have to write the code to get the data out of those rows and into a format you want. Perhaps LogParser could be useful in place of Powershell?
--- Rich Matheisen MCSE&I, Exchange MVP -
How to delete the attachment for a particular to address in outlook using c#
I want to remove the attachments from outlook for a specific to address(for example if to address contain gamil.com then i want to delete the attachments) at the mail sending evevt. When we use multiple to address it give problems. I use the below code.
when i use multiple to address (like, xxx.gmail.com,yyy.yahooo.com) it remove the attachments for both mails.
pls help,
Thanks in advance....
string[] toa = mail.To.Split(';');
for (int a = 0; a <= toa.Count(); a++)
if(toa[a].Contains("gmail.com"))
//remove attachmentsHello,
You can handle the
ItemSend event of the Application class which is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before
the inspector is closed, but after the user clicks the Send button) or when the Send method
for an Outlook item, such as MailItem,
is used in a program.
Use the
Recipients property (a Recipients collection
that represents all the recipients for the Outlook item) of the MailItem class instead of the To property.
Use Recipients(index) or
Recipients.Item(index), where index is the name or index number, to return a single Recipient object. The name can be a string representing
the display name, the alias, or the full SMTP e-mail address of the recipient.
The Recipient class provides the
Address property which returns a string representing the e-mail address of the Recipient.
P.S. You can't remove the attachment for a specific email address. You need to send separate emails individually - with an attachment and without. In the ItemSend event handler you can check out the Recipients list and copy the source item
if you need to send the item without an attachment. Remove the "blocked" recipients from the original mail item and set them on the copied one. Then remove the attachment and send the copy. -
How can I print only the attachment without the email content
How can I print only the attachment without the email content. Every time I send to print, It prints the email itself with the attachment- can I cancel that?
Hello Riklama,
When you first open the attachment (e.g. on your phone) than you can mail only that attachment. Works fine with my husbands blackberry.
Elsy -
Attachment in the Services for the object (Transaction PA30)
Dear Friends
i have uploaded a file (from my desktop)using Services for the object in PA30 transaction for a particular personnel no. . The services for the object is just above the Create Icon in PA30 Transaction.
Now i would like to know where this file is being saved which was upload from my desktop . Later if i remove the file from my desktop even then i can see that file
still being there in the attachment when i click the Services for the object.
Please could any one let me know.
Regards
syamalaHi,
Have a look at this thread.
attachment in PA30
Regards,
Manoj. -
Validate/madatory in order to avoid long time for the program execution.
Below is my selction screen. I would like to do validations for specific fields to make them mandatory fields as well.
Could you please suggeste me what are the fields that I can validate/madatory in order to avoid long time for the program run.
*Program selections
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-h01.
SELECT-OPTIONS : o_as4loc FOR v_as4local,
o_ddlang FOR ddlanguage,
o_vkorg FOR vkorg MEMORY ID vko,
o_auart FOR auart MEMORY ID aat,
o_fdnam FOR fdnam,
o_spart FOR spart MEMORY ID spa,
o_vbeln FOR vbeln MEMORY ID aun,
o_posnr FOR posnr,
o_matnr FOR matnr MEMORY ID mat,
o_pltyp FOR pltyp MEMORY ID vpl,
o_j_3ar FOR j_3arqda,
o_kzr00 FOR kbetr, " -ZR00
o_kalsm FOR kalsmasd,
o_kmwst FOR kbetr, " -MWST
o_kbmen FOR kbmeng,
o_land1 FOR land1 MEMORY ID LND
SELECTION-SCREEN : END OF BLOCK b1.
Thanks in advance.Hi,
Make key fields as well as fields on which there in an index in the database table mandatory.
Regards,
Abhijit G. Borkar -
I am a residential appraiser and recently purchased an ipad 4 to use for my home inspections. Some homes are foreclosed poperties without power and I am unable to get a good interior picture without a flash. Does anyone know of a flash attachment for the ipad 4? I found a flash attachment for the ipad 2, but it does not work with the ipad 4.
I'm sorry to hear that.
I'm not affiliated w/ the developer, just a happy user that gave up fighting the apple podcast app a while ago. I used to have a bunch of smart playlists in itunes for my podcasts, and come home every day and pathologically synced my phone as soon as I walked in the door, and again before I walked out the door in the morning.
Since my wife was doing this too, we were fighting over who's turn it was to sync their phone.
Since I've switched to Downcast, I no longer worry about syncing my phone to itunes at all. I can go weeks between syncs.
Setup a "playlist" in downcast (ex., "Commute") and add podcasts to that playlist. Add another playlist ("walk" or "workout") and add different podcasts to that one.
Set podcast priorities on a per-feed basis (ex., high priority for some daily news feeds, medium priority for some favorite podcasts, lower priority for other stuff). Downcast will play the things in the priority you specify, and within that priority, it will play in date order (oldest to newest).
Allegedly, it will also sync your play status to other devices, although that is not a feature I currently use and can't vouch for. It uses apple's iCloud APIs, so to some extent may be limited by what Apple's APIs can do.
Maybe you are looking for
-
Hello - I am unable to view movies in FLASHPLAYER. I called the Adobe 800 cusomer support number and was guided through uninstalling and reinstalling FLASH PLAYER and also confirming that the latest version of JAVA installed. However, the person I sp
-
Time Machine Error - The backup is too large for the backup disk
I have been using Lion (currently 10.7.1) on my MacBook Pro (13" - early 2011) since it was released. I haven't had any serious problems with it. All of a sudden, I am getting an error in Time Machine. When it tries to run a backup, the error "This
-
Issue: metadata not being placed in the header in DW?
Hi, I'm new to the forums, so hello to everyone. I just want to ask a question regarding metadata and the header tags in dreammweaver pages. When i "Insert" - "Html" - "Head Tags" and then either "description" or "keywords" under these menu's / subme
-
I am worried that I've spend 25 dollars for nothing. I bought an iTunes card earlier today and seem to have lost it. Does anyone know a way I can still redeem it? I have the reciept they gave me when I bought it. Any help would really be apprecia
-
New songs dont appear in itunes
ok heres the deal i have limewire set up to download into my itunes music folder, the folder were all the music is sorted into folders by itunes. When i download a new song it does not show up in itunes i have to manually drag it ito the itunes windo