Smartforms: Faxing
Hi All,
I have a form (Delivery Note) that is failing to fax.
With our configuration, the standard SAP form and print program succesfully produces a faxed output.
With the project form however, a perfectly correct image is produced and visible in SOST, however, the fax server receives a blank image and therefore does not process the message.
Based on the above, logically the problem would appear to be the smartform itself (or print program). This produces a printed output correctly and I cannot see any differences in the export parameters when it is called.
Can someone point me in the right direction please?
Thanks
JohnP
Andres, thanks.
It turned out to be a smartstyle. I took out all references to this smartstyle and it worked. The fax server runs windows, so fax images are different to the corresponding print through SAP.
Regards
John
Similar Messages
-
Smartform faxing problem - No delivery to FAX
Hi gurus,
I'm sending a smartform by fax in a company that has never used smartforms before (using ECC6). The output goes to sost but upon releasing it it fails with the error messages "No delivery to FAX" and "Document Conversion failed". On checking with our basis team it appears that the format of the file sent is not right and fails at the point of sending. Existing sapscripts and standard output types are faxed correctly. Both emailed and printed versions of the output are working correctly.
The smartform is called from a custom output type on the purchase order. I've checked OSS and apart from an older note nothing seems to exist there. This is the code I am using to send it. I have been searching for a solution to this without any success for some time. What am I doing wrong here?
If this is a fax output
IF nast-nacha = 2.
ls_cont_par-device = 'TELEFAX'.
ls_cont_par-no_dialog = 'X'.
ls_cont_par-getotf = 'X'.
ls_cont_par-no_open = ' '.
ls_cont_par-no_close = ' '.
ls_cont_par-langu = 'E'.
ls_cont_par-preview = ' '.
ls_options-tdtitle = gv_con_subject.
ls_options-tdteleland = nast-tland.
ls_options-tdtelenum = nast-telfx.
ls_options-tdtelenume = nast-telfx.
ls_options-tdschedule = 'IMM'.
ls_options-tdsenddate = sy-datum.
ls_options-tdsendtime = sy-timlo.
ls_options-faxformat = 'PDF'.
ls_options-tdnoprev = 'X'.
Call the smartform output
CALL FUNCTION lv_function_call
EXPORTING
control_parameters = ls_cont_par
output_options = ls_options
user_settings = ''
i_language = sy-langu
i_values = gs_values
IMPORTING
job_output_info = ls_job
TABLES
it_po_items = gt_po_items
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.
lt_otf_data[] = ls_job-otfdata[].
ls_faxoptions-tdotftype = 'ASC'.
ls_faxoptions-faxformat = 'ASC'.
ls_faxoptions-tddevice = 'TELEFAX'.
ls_faxoptions-tdteleland = nast-tland.
ls_faxoptions-tdtelenum = nast-telfx.
ls_faxoptions-tdsenddate = sy-datum.
ls_faxoptions-tdsendtime = sy-uzeit.
ls_faxoptions-tdcover = ' '.
ls_faxoptions-tdtitle = nast-objky.
ls_faxoptions-tdcopies = 1.
ls_faxoptions-tdnewid = 'X'.
ls_faxoptions-tddataset = 'ZP01 PO Output'.
ls_faxoptions-tdsuffix1 = 'FAX'.
ls_faxoptions-tdsuffix2 = sy-uname.
ls_faxoptions-tdimmed = 'X'.
ls_faxoptions-tdlifetime = 8.
ls_faxoptions-tdcover = 'ZP01'.
ls_faxoptions-tdcovtitle = 'ZP01'.
ls_faxoptions-tdfaxuser = sy-uname.
CALL FUNCTION 'CONVERT_OTF_AND_FAX'
EXPORTING
faxoptions = ls_faxoptions
user = ls_faxoptions-tdfaxuser
IMPORTING
fax_ok = ok
office_objid = off_obj
msgno = msgno
msgid = msgid
msgv1 = msgv1
msgv2 = msgv2
msgv3 = msgv3
msgv4 = msgv4
TABLES
otf = lt_otf_data.
IF ok = 'X'.
MESSAGE s459(td) WITH off_obj-objno. "fax request was succ. created AS
ELSE.l
MESSAGE ID msgid TYPE 'E' NUMBER msgno
WITH msgv1 msgv2 msgv3 msgv4
RAISING send_error.
ENDIF.
ENDIF.Hi,
if you check via the debugger, are the parameters lt_otf_data and ls_job-otfdata[ ] filled with valid OTF data before the call to function 'CONVERT_OTF_AND_FAX'?
regards,
Aidan -
Add Text to outbound mail in action processing / form as PDF
Hi Experts!
We want to add some (static) text into outbound mails, that are sent during action processing of our smartforms. Here´s what where were standing so far:
- We are using actions within transaction processing to send a service report to customers
- We have created a smartform and defined action profiles for our transaction type
- We have configured the output format for SAPScript and Smartforms to PDF in SMTP node of SCOT
- We can successfully send e-mails from our activity containing the smartform as a .pdf attachment
However, the body of the mail message is empty, which is not what we need. We would like to add some (static) text, like "Dear Customer! This is your service report, etc..." to the body of the message.
Has anybody ever done anything similiar within or at least close to the standard? We want to avoid having to code everything by ourselves, i.e. using SO_NEW_DOCUMENT_ATT_SEND_API1 or similar FM´s.
Points will be rewarded for useful answers!!
Thanks a lot & Regards
ChristophHi all!
We fixed the issue ourselves- just in case somebody wondered how we did it:
We have implemented the suggestions given in OSS 935670 in our processing class/method for SmartForm Mail and SmartForm Fax.
Regards
Chris -
Need to sent the SRM PO's via Email
Hi,
Current Process:Business creates the shopping cart which in turn will be converted into SRM Purchase orders. These PO's are sent to the vendors as Printouts.
Requirement:Business wants to sent the SRM Purchase Orders via email.
Please guide me on what are the activities that needs to be performed to achieve this.
Should we activate any BADI?
With regards
KrishnaBBP_PO_ACTION_DEF
check seetings here w.r.t
bbp_pd_po
there options print /fax /email.
PROCESSING TYPE - IN THE LEFT HANE PANE
INTHE RIGHT HAND SIDE YOU CAN SEE many options
smartform fax/email/print . select any one . which you want.
br
muthu -
Error in sending smartform as fax
Hi everyone,
I am trying to send a smartform through Fax, and i am getting the following error;
Cannot process message in node, parameters cannot be converted
Message no. XS821
Diagnosis
The message cannot be processed in the node as parameters such as 'Send
time' or 'Priority' cannot be converted. It is possible that entire
parameters such as 'Recipient list' or 'Packet list' are missing.
System Response
Processing was terminated.
SAP system additional information (error number, if available):
MRSUM
Additional information of the node used (in the system language of the
node)
Can you guys please help me solving this problem?
Thanking you,
Kind regards,
I have changed my code several times, using different functions to send the fax and i am getting the same error message each time.
Please find below the piece of code i am using to send the fax.
DATA:GT_MAIL_LINES TYPE STANDARD TABLE OF soli.
data: gs_mail_lines TYPE soli.
DATA: ls_object_hd TYPE sood1,
ls_receivers TYPE soos1,
lt_receivers TYPE STANDARD TABLE OF soos1,
l_lines TYPE i,
ls_sadrfd TYPE sadrfd.
CLEAR: ls_object_hd, ls_receivers.
REFRESH lt_receivers.
ls_object_hd-objla = sy-langu.
ls_object_hd-objnam = 'NOTE'.
ls_object_hd-objdes = 'Fax subject line in here'.
"Calculate size of table
DESCRIBE TABLE gt_mail_lines LINES l_lines.
READ TABLE gt_mail_lines INDEX l_lines INTO gs_mail_lines.
ls_object_hd-objlen = ( l_lines - 1 ) * 255 + STRLEN( gs_mail_lines ).
"Set Fax control structure
"Fax number in structure must have no leading zero
"as this is added by SAPOffice from the country code
ls_sadrfd-rec_fax = '4421844
ls_sadrfd-rec_street = 'Addr'.
ls_sadrfd-rec_town = 'Addr'.
ls_sadrfd-rec_name1 = 'Name'.
ls_sadrfd-rec_state = 'MU'.
ls_sadrfd-form_langu = 'EN'.
ls_sadrfd-fax_form = 'Z_FAX_COVER'.
ls_sadrfd-send_comp = 'USER'
ls_sadrfd-send_immi = 'X'.
ls_sadrfd-send_nam = sy-uname.
ls_sadrfd-send_date = sy-datum.
ls_sadrfd-send_time = sy-uzeit.
"Convert Receiver information to char field
CALL FUNCTION 'C147_WORKAREA_TO_CHARFIELD'
EXPORTING
I_WORKAREA = ls_sadrfd
IMPORTING
E_CHARFIELD = ls_receivers-recextnam.
ls_receivers-recesc = 'F'.
ls_receivers-mailstatus = 'E'.
ls_receivers-sndart = 'FAX'.
ls_receivers-sndpri = '1'.
APPEND ls_receivers TO lt_receivers.
"Send fax
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = ls_object_hd
object_type = 'RAW'
owner = sy-uname
originator_type = 'B'
TABLES
objcont = gt_mail_lines
receivers = lt_receivers
EXCEPTIONS
OTHERS = 01.
break buantoch.
"The function doesn't commit so we must
"do it if successful.
IF sy-subrc = 0.
COMMIT WORK AND WAIT.
ELSE.
WRITE: / 'Fax failed RAISE ERROR '(012).
ENDIF.Hi,
Then, you can test the FAX fuctionality like:
go to System->Short Message->give a test message,give recipient as the FAX number,type as FAX->Shift+F8 the see if it works... else only SCOT errors will be there...
See:
http://help.sap.com/saphelp_nw2004s/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm
Also see:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4b4fa090-0201-0010-d3b7-b233296d95ff
Regards,
Renjith Michael. -
Problems when trying to send a smartform through fax
Hi,
Im currently confronting a problem when sending smartforms through fax to multiple recipients.
This is the scenario Im working on:
The client needs to be able to send a document, could be a PO or invoices, to diferent recipients at the same time. So far in case of purchase orders, we have been able to find the respective faxes and emails for each of the partner functions.
Functionality for email is working as desired but when sending faxes I have problems.
Reviewing the output through SOST I get all my receipients which are email and faxes. Emails are fine since it creates a PDF attachment with the order and all of its details.
For fax I get the same even though the paramenters are set for fax.
Here is my code if you could please help me here on this one.
SELECT lifn2 FROM EkPA into l_ekpa-lifn2
WHERE EBELN = a_EBELN.
APPEND l_EKPA.
ENDSELECT.
SELECT adrnr
FROM lfa1
INTO itab-q_adrnr
FOR ALL ENTRIES IN l_ekpa WHERE lifnr = l_ekpa-lifn2.
APPEND itab.
ENDSELECT.
*& End of partner address
*& Selection of Address or Fax number from ADR3 & ADR6 according to ADRNR
*& Nato
IF sy-subrc EQ 0.
loop at itab.
SELECT SINGLE smtp_addr INTO (itab-q_mail)
from adr6 where addrnumber = itab-q_adrnr and flg_nouse eq space.
IF itab-q_mail ne Space.
Move 'U' to itab-q_typ2(1).
Move 'X' to itab-q_express(1).
Move 'EXT' to itab-XOBJT.
ENdIF.
SELECT SINGLE FAXNR_LONG INTO (itab-q_fax)
SELECT SINGLE country FAX_NUMBER INTO (itab-q_cty, itab-q_fax )
from adr3 where addrnumber = itab-q_adrnr and flg_nouse eq space.
If itab-q_fax ne space.
Move 'F' to itab-q_typ(1).
Move 'TELEFAX' to itab-q_com.
Endif.
Modify itab.
endloop.
*& END of ITAB
CLEAR : DOC_CHNG.
REFRESH LINES.
IF NAST-NACHA eq '7'.
* Fill both the fax & email Receiver lists
clear: reclist, reclist2.
refresh: reclist, reclist2.
*& loop table itab to update receipient list in table Reclist
*& Nato
loop at itab.
IF not itab-q_typ is initial.
concatenate itab-q_cty itab-q_fax into reclist2-RECNAM separated by space. "FAX NUMBER
move itab-q_fax to reclist2-receiver. "FAX NUMBER
*&>>>>>>>>>>>>>>>>>>>new entry for testing nato 080206<<<<<<<<<<<&
move itab-q_cty to RECLIST2-COUNTRY. "Country Code
move itab-q_fax to Reclist2-FAX. "Fax number
*&>>>>>>>>>>>>>>ENd of entry<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<&
move itab-q_typ to REClist2-REC_TYPE. "Communication type for fax
move itab-q_EXPRESS to Express. "comment for testing
move itab-q_com to REClist2-COM_TYPE.
Move 'X' to reclist2-NOTIF_DEL.
Move 'TELEFAX' to reclist2-SNDART. "TYPE OF DEVICE
Move a_ebeln to sood-OBJDES. "new addition for testing nato
append Reclist2.
endif.
IF not itab-q_typ2 is initial.
move itab-q_mail to REclist-receiver. "SMT ADDRESS
move itab-q_typ2 to REClist-REC_TYPE.
move itab-q_EXPRESS to REClist-express.
move 'X' to reclist-TO_ANSWER.
Move a_ebeln to sood-OBJDES. "new addition for testing nato
move itab-q_com to REClist-COM_TYPE. "comment for testing only
append Reclist.
Endif.
move reclist-receiver to address.
endLoop.
*& END OF RECipient
ENDIF.
DOC_CHNG-OBJ_DESCR = nast-objky.
ELSE.
IF RECLIST IS INITIAL.
LOOP AT reclist INTO RECIPIENT . " This logic might get commented or deleted. Nato 08/01/06
ENDLOOP.
ENDIF.
DOC_CHNG-OBJ_DESCR = L_TITLE.
ENDIF.
IF RECLIST[] IS INITIAL.
MESSAGE E573(VE) RAISING RECEIVER_NOT_FOUND.
ENDIF.
*& New entry to determine path according to communication
*& type
*& If comm type eq U follow convert_otf
*& then Read text, finaly send API
*& If comm type eq F follow path to "Convert OTF & FAX
*& Nato 080106
REFRESH : HOTFDATA, LT_SOLIX, OBJBIN.
LOOP AT JOB_OUTPUT_INFO-OTFDATA INTO HOTFDATA.
APPEND HOTFDATA.
ENDLOOP.
*& Prepare content to be converted to PDF format
*& nato
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = DOC_SIZE
BIN_FILE = LD_BINFILE
TABLES
OTF = HOTFDATA
LINES = HTLINE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
*& new entry just for test today 080306
*&nato
*endif.
*&--end of entry--
I = 0.
N = XSTRLEN( LD_BINFILE ).
WHILE I < N.
LT_SOLIX-LINE = LD_BINFILE+I.
APPEND LT_SOLIX.
I = I + 255.
ENDWHILE.
*& end of convertion pdf
LOOP AT LT_SOLIX INTO WA_SOLIX.
CLEAR WA_SOLI.
ASSIGN WA_SOLI TO <PTR_HEX> CASTING.
MOVE WA_SOLIX TO <PTR_HEX>.
APPEND WA_SOLI TO OBJBIN.
ENDLOOP.
*& Prepare send mail
CLEAR : NAME, DOCNAME.
REFRESH : OBJTXT, OBJPACK.
CONCATENATE NAST-KAPPL NAST-KSCHL INTO NAME.
CONDENSE NAME.
IF NAST-NACHA NE '7'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'STAM'
LANGUAGE = SY-LANGU
NAME = NAME
OBJECT = 'OCS'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 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.
CONCATENATE NAST-OBJKY '.PDF' INTO DOCNAME .
CONDENSE DOCNAME.
*endif. "temp nato -080406
if reclist-rec_type eq 'U'.
DOC_CHNG-OBJ_NAME = 'Delivery'.
LOOP AT LINES.
OBJTXT = LINES-TDLINE.
APPEND OBJTXT.
ENDLOOP.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
IF TAB_LINES > 0.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
ENDIF.
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = DOCNAME.
APPEND OBJHEAD.
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'Delivery'.
OBJPACK-OBJ_DESCR = NAST-OBJKY.
OBJPACK-OBJ_DESCR = A_EBELN.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
break nhernandez.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = ' '
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
CONTENTS_HEX =
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 E081(ZGLO) WITH SY-SUBRC RAISING MAIL_SENDING_ERROR.
ENDIF.
endif.
AM I missing something?Hi Nat,
You can check this link which shows how to use the PRINT_TEXT for sending fax.
http://www.sap-img.com/abap/sending-fax-from-abap.htm
Also you can check these
Smartforms
Sending Smartforms through Fax
Sending SMARTFORM output to FAX gateway
How to fax a smartform?
/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
ftp
Cheers
VJ -
Print program for the smartform for selecting the output type (email/fax)
Hi All,
Requirement :I have to create a print program for the smartform where the output type may be print out,email or fax ,so i need to put the condition for selecting the output type (like printout,email,fax).
can any body please let me know how to put the condition for selecting the desired output type ?
Thanks in advance
RahulHi
It is not the output type that has to be changed
it is the MEDIUM which you have to change and configure
for printout medium is 1
for FAX medium is 2
for MAIL it is 7.
so instead of printout change the medium to 2 or 7 for the same output type and attach to the same driver program and smartform/form.
Reward points for useful Answers
Regards
Anji -
Problem while sending Smartform through Fax
Hi Folks,
I am sending a Smartform through fax by setting the essential Control Parameters and Output Options while calling the function module of the Smartform.
In SOST I get the status message 710(Message transferred to node FAX(...) ) and later in around 20 minutes the message 812(No delivery to FAX(.......fax no) ) occurs for some requests.
Only few requests are sent successfully by the same program and same O/P Type and shows the status message 701(Delivered to FAX (................)).
There is no much time difference between those requests while creating.
Do you know what could be the problem?
Can you help me in solving the issue?may it be that in those cases where it doesnt work, that you got no fax number?
Since it works soemtimes, it seems there are no errors, but rather in some cases some important info is missing, fax number may be one of thsoe important info in a FAX scenario. -
Hello All,
I have a requirement where i need to send the PO reminder smartform output to the user as Fax.
Same is sent using the Program SAPFM06P using the form routine ENTRY_MAHN, which uses 2 FM's, but for SAP Scripts.
Can anybody guide me over same requirement using smartforms.
Waiting for useful pointers.
Thanks in advance...
Regards,
TarunHi Tarun,
I am also having the same requirement, to send a PO Reminder Smartform through Fax.
Could you please let me know whether you were able to send it?
Hi Folks,
Could you please tell me what are all the settings and parameters to be passed while calling the smartform to send it through fax? -
Sending smartform output as FAX
Hi Gurus,
I am sending a smartform output as Fax..
I have written this this code
READ TABLE lt_adr3
INTO lwa_adr3
INDEX 1.
IF sy-subrc = 0.
CONCATENATE lwa_adr3-fax_number text-002 INTO lwa_receivers-receiver.
lwa_receivers-rec_type = gc_u.
lwa_receivers-com_type = gc_int.
lwa_receivers-notif_del = gc_x.
lwa_receivers-notif_ndel = gc_x.
APPEND lwa_receivers TO lt_receivers.
i have +9102267557100 as the fax number and i am sending it to the function module.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = lwa_document_data
commit_work = 'X'
TABLES
packing_list = lt_packing_list
contents_bin = lt_mess_att
receivers = lt_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.
But i am not getting the pdf document at the FAX machine.
Kindly replySolved
-
Account clerk,Tele & Fax Number in Smartform
Hi Gurus
I am trying to print Account clerk,Tele phone number and Fax Number in Smartform but its not printing .I am using Structer FSABE .Fields are SALUT,TELF1 and TELFX.i am using the TC:VF02.please can anyone help me where i can get the details and which its pulling from.please can anyone tell me the solution please
Thanks in advance
Edited by: Reddy on May 19, 2010 8:25 AMCheck table T001S to get user name of A/c clerk. Then you can read the details using BAPI_USER_GET_DETAIL.
-
hi experts
how to send smartform output to fax, where i write the code.
thanks
sitaramBelieve me i searched with exactly with your subject line(smartform output to fax) i got my answer.
can you able to do same?
Cheers -
Smartform convert to WORD - e-mail/fax
Hi All,
Quickly can we convert Smartform output to Word output. Currently I am doing Smartform converted to PDF and sending that as e-mail/fax. New requirement is to send in word format. Can we convert Samrtform to WORD and send as e-mal/fax?
Thanks in advance.
Regards,
TimCheck this code below ....
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSD_SFM_ATTACH'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
CALL FUNCTION FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = wa_control
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = wa_prnctrl
USER_SETTINGS = 'X'
CUST_LINE = gl_cust_line
IMPORTING
DOCUMENT_OUTPUT_INFO = wa_doc_info
JOB_OUTPUT_INFO = wa_outinfo
JOB_OUTPUT_OPTIONS = wa_job_opt
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
t_otf[] = wa_outinfo-otfdata[].
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
USE_OTF_MC_CMD = 'X'
ARCHIVE_INDEX =
IMPORTING
BIN_FILESIZE = g_filesize
TABLES
OTF = t_otf
DOCTAB_ARCHIVE = t_docs
LINES = i_tline
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3
convert PDF 132 to 255
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
No translation
loop at i_tline.
i_objbin-line = i_tline-tdline.
append i_objbin.
endloop.
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[].
loop at i_record.
i_objbin-line = i_record-line.
append i_objbin.
endloop.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
glt_objpack-head_start = 1.
Number of lines of an object header in object packet
glt_objpack-head_num = 0.
Start line of object contents in an object packet
glt_objpack-body_start = 1.
Number of lines of the object contents in an object packet
glt_objpack-body_num = v_lines_txt.
Code for document class
glt_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
glt_objpack-transf_bin = 'X'.
glt_objpack-head_start = 1.
glt_objpack-head_num = 1.
glt_objpack-body_start = 1.
glt_objpack-body_num = v_lines_bin.
glt_objpack-doc_type = 'PDF'.
glt_objpack-obj_name = 'ReturnForm'.
CONCATENATE 'ReturnForm_output' '.pdf'
INTO glt_objpack-obj_descr.
glt_objpack-doc_size = v_lines_bin * 255.
APPEND glt_objpack.
glt_objhead = 'Return_form.PDF'. append glt_objhead.
Document information.
CLEAR i_reclist.
Fill the receiver list
clear gs_reclist.
condense gl_fax_num.
gs_reclist-receiver = P_Z_MFR_MAIL.
gs_reclist-rec_type = co_u.
append gs_reclist to i_reclist.
Sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gl_doc_chng
put_in_outbox = 'X'
COMMIT_WORK = 'X'
TABLES
packing_list = glt_objpack
object_header = glt_objhead
CONTENTS_BIN = i_objbin
contents_hex = i_objbin
contents_txt = gt_objcont
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. -
Send smartforms as fax and email
Hi SAP gurus,
Can you please tell me on how to send smartforms as fax and email?
I would really appreciate your help.
Thanks in advance.Hi,
Check the below link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/a5/28d3b9d26211d4b646006094192fe3/content.htm
Thanks,
Sankar M -
Hi,
Actually my requirement is to send the smartform through email using medium external send..If the email Id of the recipient is not present then the smarform has to be sent through fax using medium external send.So I have changed the value of nast-nacha from 5 to 2 and added the following code to my program.
ls_control_param-device = 'TELEFAX'.
ls_control_param-preview = 'X'.
ls_control_param-no_dialog = 'X'.
ls_control_param-getotf = 'X'.
ls_composer_param-tdtitle = 'Advance shipment notification'.
ls_composer_param-tdtelenum = lv_telfx.
ls_composer_param-tdteleland = lv_land1.
ls_composer_param-tdschedule = 'IMM'.
ls_composer_param-tdsenddate = sy-datum.
ls_composer_param-tdsendtime = sy-timlo.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_appl_obj =
mail_recipient = lv_recipient
mail_sender = lv_sender
output_options = ls_composer_param
user_settings = ' '
vttkvb = vttkvb
IS_DLV_DELNOTE = LS_DLV_DELNOTE
is_nast = nast
IMPORTING
document_output_info = document_output_info
job_output_info = ls_return
job_output_options = job_output_options
TABLES xvttp = xvttp
xvtts = xvtts
xvtsp = xvtsp
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.
While debugging i am not finding any error in the program.But in SOST transaction,it is not showing any entry for the smartform o/p which is sent through fax.
Could anyone give me a proper solution for this?Hi,
All the configuration is done in SCOT transaction to send the smartform through fax.The issue is I am able to send the smartform through fax.I am able to see that in SOST transaction.But the output is coming in abap list format.It should come in OTF format.What can be done for this?
Regards,
Hema
Maybe you are looking for
-
Can I control two Macs with one keyboard & mouse simultaneously?
I'm presently the operator and head audio tech for a major Off-Broadway show. I'm running the show on Ableton Live 6 through a Mac Mini, using a MOTU 828mkIII as the Firewire audio interface to the console. "Show control" is basically straight music
-
How to debug using RSNAST00 and jdbg for multiple invoice number
Hi everyone, I want to debug multiple invoice's print preview. could anybody tell me the step by step process how to do this using RSNAST00 and JDBG. Thanks Lisa
-
BDC Program for Uploading Data for Property Tree in cg02
Hi, How to upload data for property tree ( standard Properties ) of CG02. I checked for BAPI or Function Module but most them supports for specification header and sub item. Please Let me know if any function module or BAPI available for this pr
-
Need a little help here. My imac G5,20" (wireless keyboard and mouse) will not start up properly. No chime and no image on monitor but I can hear the hard drive and after 30 seconds or so the fan gets very loud. Any help would be appreciated!
-
Java Mail Demo - msgsend.java
I have placed the 2 files into the following directories and updated the classpath as follows c:\j2sdk1.4.0_02\jre\lib\ext\mail.jar c:\j2sdk1.4.0_02\jre\lib\ext\activation.jar CLASSPATH = C:\j2sdk1.4.0_02\jre\lib\extmail.jar; C:\j2sdk1.4.0_02\jre\lib