on 10-31-2013 3:15 AM
hi,
please give some info reg how to send fax to vendors with their delivery report status .
thanks and regards
sreenath
hi,
i used
CALL FUNCTION 'SO_DOCUMENT_SEND_API1' for sending FAX but the exact output iam not getting like its not reflecting like FAX it i can see in SOST but any other function moudle i can use for sending of FAX let me know please.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
form send_mail.
DATA: l_qty(17).
DATA: l_sender TYPE soextreci1-receiver,
text_mail TYPE catsxt_longtext_itab,
ls_text like line of text_mail.
DATA: it_mailpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE, " Dist details
it_mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE," Header data
it_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE, " Rec List
it_mailtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE, " Mail Text
it_att_data LIKE solisti1 OCCURS 0 WITH HEADER LINE, " Attachment data
it_doc_att LIKE sodocchgi1. " Attri of new doc
data: gt_objpack type table of sopcklsti1, " SAPoffice: Description of Imported Object Components
gs_objpack type sopcklsti1,
gt_objtxt like solisti1 occurs 10.
DATA: att_size TYPE i, " att Size
mailtxt_size TYPE i. " Text in mail size
LOOP AT outtab.
CLEAR: gv_new, l_qty.
AT END OF CARRIER .
gv_new = c_x.
ENDAT.
APPEND INITIAL LINE TO text_mail.
CLEAR: ls_text.
l_qty = outtab-qty.
CONCATENATE
'ORDER :' outtab-order# INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'MATERIAL :' outtab-material INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'MATERIAL DES : ' outtab-mat_desc INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'QTY :' l_qty outtab-uom INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'CUSTOMER NAME :' outtab-cust_name INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'CUSTOMER ADDRESS :' outtab-cust_address
outtab-cust_city
outtab-cust_state
outtab-cust_zip INTO ls_text SEPARATED BY space.
append ls_text to text_mail.
CONCATENATE
'CUSTOMER PO :' outtab-cust_po INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'DELV DATE :' outtab-del_create INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'ETA :' outtab-eta INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'DRV TIME :' outtab-drvtm INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'LOAD TIME :' outtab-load_time INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'TRAILER :' outtab-trailer INTO ls_text.
append ls_text to text_mail.
IF gv_new = c_x.
READ TABLE LT_TAB into Ls_TAB with key lifnr = outtab-carrier.
IF sy-subrc is INITIAL.
IF Ls_TAB-smtp_addr is not INITIAL.
clear: l_sender, it_mailpack, it_mailhead,
it_reclist, it_mailtxt, it_att_data, it_doc_att,
gt_objpack, gs_objpack, gt_objtxt .
it_reclist-receiver = Ls_TAB-smtp_addr . "pt_adsmtp-smtp_addr.
it_reclist-express = 'X'.
it_reclist-rec_type = 'U'.
APPEND it_reclist.
CLEAR it_doc_att.
it_doc_att-obj_descr = 'DETAIL REPORT FOR DELIVERIES '.
LOOP AT text_mail INTO ls_text.
it_mailtxt-line = ls_text."-table_line.
APPEND it_mailtxt.
CLEAR: ls_text.
ENDLOOP.
* Describe the body of the message
CLEAR it_mailpack.
it_mailpack-transf_bin = space.
it_mailpack-head_start = 1.
it_mailpack-head_num = 0.
it_mailpack-body_start = 1.
DESCRIBE TABLE text_mail LINES it_mailpack-body_num.
it_mailpack-obj_descr = it_doc_att-obj_descr.
it_mailpack-doc_type = 'RAW'.
INSERT it_mailpack INTO gt_objpack INDEX 1.
l_sender = sy-uname.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
sender_address = l_sender
document_data = it_doc_att
commit_work = 'X'
TABLES
packing_list = gt_objpack " The first row is for the document, the following rows are each for one attachment
contents_bin = gt_objtxt " Attachments
contents_txt = it_mailtxt " Message Body
receivers = it_reclist " Receiver
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.
ENDIF.
ENDIF.
CLEAR: text_mail.
REFRESH:it_mailtxt.
REFRESH:it_reclist.
endif.
ENDLOOP.
ENDFORM. "send_mail
*&---------------------------------------------------------------------*
*& Form send_FAX
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form send_FAX.
DATA: l_qty(17).
DATA: l_sender TYPE soextreci1-receiver,
text_mail TYPE catsxt_longtext_itab,
ls_text like line of text_mail.
DATA: it_mailpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE, " Dist details
it_mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE," Header data
it_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE, " Rec List
it_mailtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE, " Mail Text
it_att_data LIKE solisti1 OCCURS 0 WITH HEADER LINE, " Attachment data
it_doc_att LIKE sodocchgi1. " Attri of new doc
data: gt_objpack type table of sopcklsti1, " SAPoffice: Description of Imported Object Components
gs_objpack type sopcklsti1,
gt_objtxt like solisti1 occurs 10.
DATA: att_size TYPE i, " att Size
mailtxt_size TYPE i. " Text in mail size
LOOP AT outtab.
CLEAR: gv_new, l_qty.
AT END OF CARRIER .
gv_new = c_x.
ENDAT.
APPEND INITIAL LINE TO text_mail.
CLEAR: ls_text.
l_qty = outtab-qty.
CONCATENATE
'ORDER :' outtab-order# INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'MATERIAL :' outtab-material INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'MATERIAL DES : ' outtab-mat_desc INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'QTY :' l_qty outtab-uom INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'CUSTOMER NAME :' outtab-cust_name INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'CUSTOMER ADDRESS :' outtab-cust_address
outtab-cust_city
outtab-cust_state
outtab-cust_zip INTO ls_text SEPARATED BY space.
append ls_text to text_mail.
CONCATENATE
'CUSTOMER PO :' outtab-cust_po INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'DELV DATE :' outtab-del_create INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'ETA :' outtab-eta INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'DRV TIME :' outtab-drvtm INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'LOAD TIME :' outtab-load_time INTO ls_text.
append ls_text to text_mail.
CONCATENATE
'TRAILER :' outtab-trailer INTO ls_text.
append ls_text to text_mail.
IF gv_new = c_x.
READ TABLE LT_TAB into Ls_TAB with key lifnr = outtab-carrier.
IF sy-subrc is INITIAL.
IF Ls_TAB-FAX_NUMBER is not INITIAL.
clear: l_sender, it_mailpack, it_mailhead,
it_reclist, it_mailtxt, it_att_data, it_doc_att,
gt_objpack, gs_objpack, gt_objtxt .
it_reclist-receiver = Ls_TAB-FAX_NUMBER . "pt_adsmtp-smtp_addr.
it_reclist-express = 'X'.
it_reclist-rec_type = 'U'.
APPEND it_reclist.
CLEAR it_doc_att.
it_doc_att-obj_descr = 'DETAIL REPORT FOR DELIVERIES '.
LOOP AT text_mail INTO ls_text.
it_mailtxt-line = ls_text."-table_line.
APPEND it_mailtxt.
CLEAR: ls_text.
ENDLOOP.
* Describe the body of the message
CLEAR it_mailpack.
it_mailpack-transf_bin = space.
it_mailpack-head_start = 1.
it_mailpack-head_num = 0.
it_mailpack-body_start = 1.
DESCRIBE TABLE text_mail LINES it_mailpack-body_num.
it_mailpack-obj_descr = it_doc_att-obj_descr.
it_mailpack-doc_type = 'RAW'.
INSERT it_mailpack INTO gt_objpack INDEX 1.
l_sender = sy-uname.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
sender_address = l_sender
document_data = it_doc_att
commit_work = 'X'
TABLES
packing_list = gt_objpack " The first row is for the document, the following rows are each for one attachment
contents_bin = gt_objtxt " Attachments
contents_txt = it_mailtxt " Message Body
receivers = it_reclist " Receiver
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.
ENDIF.
ENDIF.
CLEAR: text_mail.
REFRESH:it_mailtxt.
REFRESH:it_reclist.
endif.
ENDLOOP.
endform. "send_FAX
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.