on 07-31-2008 4:36 PM
Hi,
A custom form and custom program was created to print the Purchase order information through ME21N, 22n and 23n.
It also has E-mail option. when output medium 5(Simple mail) and 7(External send), email will be send to respective mail-id's with the PDF attachment.
I have issue at the time of saving PO which processed with medium 5. when i save A popup appears "Express document update was terminated received from author". Brief message about it is
"Error Info... 00 671: ABAP/4 processor: COMMIT_IN_POSTING"
In Smartform driver program i am using below function modules to convert OTF into PDF and send through e-mail.
Function Module: CONVERT_OTF.
Function Module: SO_DOCUMENT_SEND_API1.
I am not sure, what i missed out. Can you guys tell is this the correct way to send PDF attachment through E-mail or i missed out any function module for commit.
Regards,
Hemanth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Resolved myself
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Keerthipati Hemanth,
You said that you are saving a PO. While saving you need to lock that PO and save your work and again unlock the PO. With this you will not get the quoted error.
For locking and unlocking the PO use the FMs enqueue and dequeue for that main table which is modified.
Regards,
Shailaja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Keerthi,
just give Express document update was terminated received from author in SDN search box you will get your answer.
Amit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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,
Work Area declarations
WA_OBJHEAD TYPE SOLI_TAB,
W_CTRLOP TYPE SSFCTRLOP,
W_COMPOP TYPE SSFCOMPOP,
W_RETURN TYPE SSFCRESCL,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1,
WA_BUFFER TYPE STRING,u201DTo 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 u2018SSF_FUNCTION_MODULE_NAMEu2019
EXPORTING
FORMNAME = u2018ZTESTu2019
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 = u2018Xu2019.
W_CTRLOP-NO_DIALOG = u2018Xu2019.
W_COMPOP-TDNOPREV = u2018Xu2019.
CALL FUNCTION V_FORM_NAME
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = u2018Xu2019
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 u2018CONVERT_OTFu2019
EXPORTING
FORMAT = u2018PDFu2019
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.
Fehlerhandling
IF SY-SUBRC <> 0.
ENDIF.
LOOP AT I_TLINE.
TRANSLATE I_TLINE USING u2018~u2019.
CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING u2018~u2019.
DO.
I_RECORD = WA_BUFFER.
APPEND I_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH:
I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
o
+
#
*
o
+ Create Message Body
1. Title and Description
I_OBJTXT = u2018test with pdf-Attachment!u2019.
APPEND I_OBJTXT.
DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
READ TABLE I_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = u2019smartformu2019.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = u2019smartformu2019.
WA_DOC_CHNG-SENSITIVTY = u2018Fu2019.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
1. Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
*.
CLEAR I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = u2018RAWu2019.
APPEND I_OBJPACK.
o
+
1. Attachment
(pdf-Attachment)
I_OBJPACK-TRANSF_BIN = u2018Xu2019.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
Länge des Attachment ermitteln
DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
READ TABLE I_OBJBIN INDEX V_LINES_BIN.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE = u2018PDFu2019.
I_OBJPACK-OBJ_NAME = u2019smartu2019.
I_OBJPACK-OBJ_DESCR = u2018testu2019.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = u2018email idu2019.
I_RECLIST-REC_TYPE = u2018Uu2019.
APPEND I_RECLIST.
CALL FUNCTION u2018SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = u2018Xu2019
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = 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.
Another EXample
you may use the FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF' to convert the fom
into PDF.
But first to get the printed form from the spool, use FUNCTION
'RSPO_FIND_SPOOL_REQUESTS'.
Then you may send it to your PC, email, fax, etc by reading the record in
the lines of table IT_PDF_OUTPUT.
Note: You may also use program RSTXPDFT4 as a reference to get code
examples which uses different functions to perform the creation of PDFand
download the form to the PC,etc.
CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
EXPORTING
RQOWNER = SY-UNAME
TABLES
SPOOLREQUESTS = SPOOL_REQUESTS.
READ TABLE SPOOL_REQUESTS INDEX 1.
GD_SPOOL_NR = SPOOL_REQUESTS-RQIDENT.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = GD_SPOOL_NR
NO_DIALOG = C_NO
IMPORTING
PDF_BYTECOUNT = GD_BYTECOUNT
PDF_SPOOLID = PDFSPOOLID
BTC_JOBNAME = JOBNAME
BTC_JOBCOUNT = JOBCOUNT
TABLES
PDF = IT_PDF_OUTPUT
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 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.
CHECK SY-SUBRC = 0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this...
----
Table declaration
----
tables : vbrk. "Billing Document: Header Data
----
Type pool declaration
----
type-pools slis.
----
Selection screen
----
selection-screen begin of block b1 with frame.
select-options : p_date for vbrk-aedat.
selection-screen end of block b1.
----
Types declaration
----
types : begin of t_vbrk,
vbeln type vbrk-vbeln, "Billing Document
aedat type vbrk-aedat, "Changed on(date)
fksto type vbrk-fksto, "Billing document is cancelled
end of t_vbrk.
----
Internal table declaration
----
data : i_vbrk type table of t_vbrk,
w_vbrk type t_vbrk.
----
Field catalog declaration
----
data : i_cat type slis_t_fieldcat_alv,
w_cat like line of i_cat,
t_print type slis_print_alv.
data :top type table of slis_listheader with header line.
data : event type table of slis_alv_event with header line.
----
start of selection
----
top-of-page.
start-of-selection.
perform get_dat.
if sy-subrc = 0.
perform build_cat.
perform alv_print_info.
perform sub_create_spool_id.
perform display_data.
new-page print off.
perform sub_send_mail.
else.
message 'NO DOCUMENT IS CANCELLED IN THE GIVEN PERIOD' type 'S'.
endif.
----
Subroutine GET_DAT
----
form get_dat .
*---To fetch canelled billing documents.
select vbeln
aedat
fksto
from vbrk
into table i_vbrk
where aedat in p_date and fksto = 'X'.
endform. " GET_DAT
----
Subroutine DISPLAY_DATA
----
form display_data .
call function 'REUSE_ALV_EVENTS_GET'
importing
et_events = event[]
.
top-typ = 'H'.
top-info = sy-title.
append top.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_top_of_page = 'NAN'
i_grid_title = 'Alok Arun (Mr.A)'
it_fieldcat = i_cat
it_events = event[]
is_print = t_print
tables
t_outtab = i_vbrk
.
endform. " DISPLAY_DATA
&----
*& Subroutine BUILD_CAT
&----
form build_cat .
w_cat-seltext_l = 'Billing Document'.
w_cat-col_pos = '1'.
w_cat-tabname = 'I_VBRK'.
w_cat-fieldname = 'VBELN'.
w_cat-ref_fieldname = 'VBELN'.
w_cat-hotspot = 'X'.
append w_cat to i_cat.
clear w_cat.
w_cat-seltext_l = 'Cancelled on'.
w_cat-col_pos = '2'.
w_cat-tabname = 'I_VBRK'.
w_cat-fieldname = 'AEDAT'.
w_cat-ref_fieldname = 'AEDAT'.
w_cat-hotspot = 'X'.
append w_cat to i_cat.
clear w_cat.
endform. " BUILD_CAT
&----
*& Form alv_print_info
&----
form alv_print_info .
t_print-no_print_selinfos = 'X'.
t_print-no_coverpage = 'X'.
t_print-no_print_listinfos = 'X'.
*
endform. " alv_print_info
&----
*& Form sub_create_spool_id
&----
form sub_create_spool_id .
data: lv_text(50) type c.
lv_text = sy-title.
new-page line-size sy-linsz
print on destination 'LP01'
cover text lv_text
list name 'LIST NAME SOL MANAGER'(002)
list dataset 'LIST DATASET'(003)
immediately ' '
keep in spool 'X'
new list identification 'X'
no dialog.
endform. " sub_create_spool_id
&----
*& Form sub_send_mail
&----
form sub_send_mail .
data: v_spono like tsp01-rqident.
v_spono = sy-spono.
data:
v_type like soodk-objtp,
i_pdflist like tline occurs 0,
t_print TYPE slis_print_alv,
jobname like tbtcjob-jobname,
jobcount like tbtcjob-jobcount,
numbytes type i,
pdfspoolid like tsp01-rqident,
jobname2 like tbtcjob-jobname,
jobcount2 like tbtcjob-jobcount,
i_compresslist like soli occurs 0.
data: pdf like tline occurs 100 with header line,
objbin like solisti1 occurs 10 with header line.
*--convert into PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = v_spono
no_dialog = ' '
importing
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
btc_jobname = jobname2
btc_jobcount = jobcount2
tables
pdf = pdf
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11.
if sy-subrc <> 0.
endif.
*-- change the width of the pdf table --
call function 'SX_TABLE_LINE_WIDTH_CHANGE'
exporting
line_width_src = 134
line_width_dst = 255
tables
content_in = pdf
content_out = objbin
exceptions
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
others = 4.
if sy-subrc <> 0.
endif.
data: lv_text1(50) type c.
lv_text1 = sy-title.
data : v1(30) value 'Plz find the attachment of', v3(80).
concatenate v1 lv_text1 into v3.
*--declare the internal table for sending of mail
data: li_objpack like sopcklsti1 occurs 2 with header line,
li_objhead like solisti1 occurs 1 with header line,
li_objbin like solisti1 occurs 0 with header line,
li_objtxt like solisti1 occurs 10 with header line,
li_reclist like somlreci1 occurs 10 with header line.
data: lv_docchng like sodocchgi1,
lv_tablines like sy-tabix.
data: lv_report like trdir-name value 'RSCONN01',
lv_text like solisti1-line.
lv_docchng-obj_name = 'LIST'(l01).
li_objtxt-line = 'Dear Sir / Madam,'.
append li_objtxt.
clear li_objtxt.
append li_objtxt.
li_objtxt-line = v3.
append li_objtxt.
clear li_objtxt.
append li_objtxt.
li_objtxt-line = 'Regards'.
append li_objtxt.
clear li_objtxt.
append li_objtxt.
describe table li_objtxt lines lv_tablines.
read table li_objtxt index lv_tablines transporting all fields.
lv_docchng-doc_size = ( lv_tablines - 1 ) * 255 + strlen( li_objtxt ).
*---Object Pack
text content
clear li_objpack-transf_bin.
li_objpack-head_start = 1.
li_objpack-head_num = 0.
li_objpack-body_start = 1.
li_objpack-body_num = lv_tablines.
li_objpack-doc_type = 'RAW'.
append li_objpack.
attachement
describe table objbin lines lv_tablines.
li_objpack-transf_bin = 'X'.
li_objpack-head_start = 1.
li_objpack-head_num = 0.
li_objpack-body_start = 1.
li_objpack-body_num = lv_tablines.
li_objpack-doc_type = 'PDF'.
li_objpack-obj_name = 'ATTACHMENT'(a01).
li_objpack-obj_descr = sy-title.
li_objpack-doc_size = lv_tablines * 255 .
append li_objpack.
lv_docchng-obj_descr = sy-title.
li_reclist-receiver = sy-uname.
li_reclist-rec_type = 'B'.
li_reclist-express = 'X'.
append li_reclist.
clear li_reclist.
if li_reclist[] is initial.
message i030(zgso).
leave list-processing.
endif. " IF li_reclist[] IS INITIAL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = lv_docchng
put_in_outbox = 'X'
commit_work = 'X'
tables
packing_list = li_objpack
object_header = li_objhead
contents_bin = objbin
contents_txt = li_objtxt
receivers = li_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 is initial.
submit (lv_report) with mode = 'INT' and return .
message 'Alert Sent and check it out in T-code : SBWP' type 'S'.
else.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif. " IF sy-subrc IS INITIAL
endform. " sub_send_mail
form nan.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = top[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
endform.
regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below code:
TYPES: BEGIN OF TY_MESS,
TLINE(255) TYPE C,
END OF TY_MESS.
DATA: IT_TLINE TYPE TABLE OF TLINE,
IT_MESS TYPE TABLE OF TY_MESS,
IT_MESSAGE TYPE TABLE OF SOLISTI1,
IT_ATTACHMENT TYPE TABLE OF SOLISTI1,
IT_PACKING_LIST TYPE TABLE OF SOPCKLSTI1,
IT_RECEIVERS TYPE TABLE OF SOMLRECI1.
DATA: WA_TLINE TYPE TLINE,
WA_MESS TYPE TY_MESS,
WA_MESSAGE TYPE SOLISTI1,
WA_ATTACHMENT TYPE SOLISTI1,
WA_PACKING_LIST TYPE SOPCKLSTI1,
WA_RECEIVERS TYPE SOMLRECI1.
DATA: L_SPOOL_NO TYPE TSP01-RQIDENT.
DATA: WA_DOC_DATA TYPE SODOCCHGI1,
L_CNT TYPE I.
Get spool data in internal table using spool no
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = L_SPOOL_NO
TABLES
PDF = IT_TLINE
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Transfer the 132-long strings to 255-long strings
LOOP AT IT_TLINE INTO WA_TLINE.
TRANSLATE WA_TLINE USING ' ~'.
CONCATENATE L_BUFFER WA_TLINE INTO L_BUFFER.
ENDLOOP.
TRANSLATE L_BUFFER USING '~ '.
DO.
WA_MESS = L_BUFFER.
APPEND WA_MESS TO IT_MESS.
SHIFT L_BUFFER LEFT BY 255 PLACES.
IF L_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
L_FORMAT = 'pdf'.
L_ATTDESCRIPTION = P_WA_QMEL_QMNUM.
L_ATTFILENAME = 'filename'.
L_SENDER_ADDRESS = ''.
L_SENDER_ADDRESS_TYPE = ''.
Fill the document data.
WA_DOC_DATA-DOC_SIZE = 1.
Populate the subject/generic message attributes
WA_DOC_DATA-OBJ_LANGU = SY-LANGU.
WA_DOC_DATA-OBJ_NAME = C_OBJECT.
WA_DOC_DATA-OBJ_DESCR = L_MTITLE .
WA_DOC_DATA-SENSITIVTY = 'F'.
Fill the document data and get size of attachment
CLEAR WA_DOC_DATA.
READ TABLE IT_MESS INTO WA_MESS INDEX L_CNT.
WA_DOC_DATA-DOC_SIZE = ( L_CNT - 1 ) * 255 + STRLEN( WA_MESS ).
WA_DOC_DATA-OBJ_LANGU = SY-LANGU.
WA_DOC_DATA-OBJ_NAME = C_OBJECT.
WA_DOC_DATA-OBJ_DESCR = L_MTITLE.
WA_DOC_DATA-SENSITIVTY = 'F'.
CLEAR IT_ATTACHMENT.
REFRESH IT_ATTACHMENT.
IT_ATTACHMENT[] = IT_MESS[].
Describe the body of the message
CLEAR IT_PACKING_LIST.
REFRESH IT_PACKING_LIST.
WA_PACKING_LIST-TRANSF_BIN = SPACE.
WA_PACKING_LIST-HEAD_START = 1.
WA_PACKING_LIST-HEAD_NUM = 0.
WA_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE IT_MESSAGE LINES WA_PACKING_LIST-BODY_NUM.
WA_PACKING_LIST-DOC_TYPE = 'RAW'.
APPEND WA_PACKING_LIST TO IT_PACKING_LIST.
Create attachment notification
WA_PACKING_LIST-TRANSF_BIN = 'X'.
WA_PACKING_LIST-HEAD_START = 1.
WA_PACKING_LIST-HEAD_NUM = 1.
WA_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE IT_ATTACHMENT LINES WA_PACKING_LIST-BODY_NUM.
WA_PACKING_LIST-DOC_TYPE = 'PDF'.
WA_PACKING_LIST-OBJ_DESCR = 'Test Notif'.
WA_PACKING_LIST-OBJ_NAME = 'filename'.
WA_PACKING_LIST-DOC_SIZE = WA_PACKING_LIST-BODY_NUM * 255.
APPEND WA_PACKING_LIST TO IT_PACKING_LIST.
Add the recipients email address
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_DATA
SENDER_ADDRESS = L_SENDER_ADDRESS
SENDER_ADDRESS_TYPE = L_SENDER_ADDRESS_TYPE
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL = 'X'
TABLES
PACKING_LIST = IT_PACKING_LIST
CONTENTS_BIN = IT_ATTACHMENT
CONTENTS_TXT = IT_MESSAGE
RECEIVERS = IT_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.
Hope this piece of code should be helpful. It worked at my side.
Regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.