Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sending Smartforms through Fax

Former Member
0 Likes
1,102

Hi,

Can anybody suggest me, how to send the smartform through FAX? The output need not be printed instead it should be sent as FAX.

Thanks and Regards,

Lakshmi

Hi,

Can anybody suggest me, how to send the smartform through FAX? The output need not be printed instead it should be sent as FAX.

Thanks and Regards,

Lakshmi

5 REPLIES 5
Read only

FredericGirod
Active Contributor
0 Likes
904

Hi,

in the customizing, you need to define that this form will be send to a fax.

You need also to define a fax number to the people you would like to send the document.

And most important, you need to manage the transaction SCOT. To define where is the Fax server, ...

Rgd

Frédéric

Read only

Former Member
0 Likes
904

Hi Lakshmi,

you can do by setting Fax media at Output determination provided that your fax procedure been defined .

Path> T/code NACE> Select application-> O/P types> O/P type--> Medium.

Please check For PO(Application "EF") O/P NEU --> Medium "FAX".

Lanka

Message was edited by: Lanka Murthy

Read only

Former Member
0 Likes
904

Hi Santhanalashmi,

Please use this FM SO_OBJECT_SEND

CALL FUNCTION 'SO_OBJECT_SEND'

EXPORTING

  • EXTERN_ADDRESS = ' '

  • FOLDER_ID = ' '

  • FORWARDER = ' '

  • OBJECT_FL_CHANGE = ' '

OBJECT_HD_CHANGE = OBJ_HD_CHANGE

  • OBJECT_ID = ' '

OBJECT_TYPE = OBJ_TYPE

OUTBOX_FLAG = 'X' "fax into outbox

  • STORE_FLAG = ' '

  • DELETE_FLAG = ' '

  • CHECK_ALREADY_SENT = ' '

  • GIVE_OBJECT_BACK =

ORIGINATOR = ORIGINATOR "B20K062716

ORIGINATOR_TYPE = 'B' "

IMPORTING

OBJECT_ID_NEW = OBJ_ID_NEW

SENT_TO_ALL = sent_to_all

  • OFFICE_OBJECT_KEY =

TABLES

OBJCONT = OFF_TAB

OBJHEAD = HEAD_TAB

  • OBJPARA =

  • OBJPARB =

RECEIVERS = REC_TAB

  • PACKING_LIST =

  • ATT_CONT =

  • ATT_HEAD =

  • NOTE_TEXT =

  • LINK_LIST =

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

X_ERROR = 20

OTHERS = 21.

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
904

Ad Hoc Fax Kung Fu.

There are a few ways to go about this depending on how the form is being faxed.

If you are faxing from a frontend process, not background, consider the following:

Every windows 2003 server is delivered with a basic fax server. We enabled the fax server on one server 2003 machine on our LAN. The fax server sits as a printer on the network. The server 2003 fax printer is set up on the user's machine.

We then created a printer in SAP, defined as a frontend printer that maps to the local server 2003 fax printer.

When a user prints any output to the SAP frontend printer, data is then spooled to the server 2003 fax printer via SAPLPD, and the windows fax wizard launches.

A user then completes the wizard, or uses Outlook fax contacts to define recipients and send.

This approach meets 80% of our SAP fax requirements.

For bulk data distirbution we use email.

Note: This approach is not designed as a background process or for bulk. Address info is derived from Outlook contacts or manually entered by the user at runtime.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
904

Hi,

Check this sample code helps your purpose.If so,kindly reward points by clicking the star on the elft of reply,if it helps.

The following program shows you how to send a fax from within ABAP/4. The report is delivered

in the standard system and is used in Transaction SCOM for the function "Send test fax".

Only the method via the call of SAPscript with DEVICE='TELEFAX', described below, ensures the

generation of a correct transmission request, independent of the R/3 release and of the used

fax server solution and its configuration.

The regular printing (for example, with NEW-PAGE PRINT ON...) on an output device created in

the spool administration of the device class 'Telefax' does generally not work!

REPORT RSKSENDF MESSAGE-ID SK.

**********************************************************************

  • Test report to send a test fax

  • sends a fax to the number <TO_CNTRY>-<TO_NMBER>

  • containing an automatically generated message text.

**********************************************************************

TABLES: USR03.

PARAMETERS: TO_CNTRY LIKE T005-LAND1 OBLIGATORY,

TO_NMBER LIKE TSP01-RQTELENUM OBLIGATORY,

FROM_USR(30) TYPE C DEFAULT SY-UNAME,

TO_RECIP(30) TYPE C DEFAULT SY-UNAME.

  • SAPscript content ITAB

DATA: BEGIN OF TEST_DOC OCCURS 10.

INCLUDE STRUCTURE TLINE.

DATA: END OF TEST_DOC.

  • SAPscript header struct

DATA BEGIN OF HEADER.

INCLUDE STRUCTURE THEAD.

DATA END OF HEADER.

**********************************************************************

INITIALIZATION.

**********************************************************************

  • get county from user addres in usr03

  • system->user profile->user address

  • check if not empty

SELECT SINGLE * FROM USR03 WHERE BNAME = SY-UNAME.

IF SY-SUBRC = 0 AND USR03-LAND1 <> SPACE.

TO_CNTRY = USR03-LAND1.

ENDIF.

**********************************************************************

START-OF-SELECTION.

**********************************************************************

PERFORM FILL_UP_TEST_DOC.

PERFORM SHOW_TEST_DOC.

**********************************************************************

AT PF08.

**********************************************************************

PERFORM SEND_FAX TABLES TEST_DOC USING TO_CNTRY

TO_NMBER.

**********************************************************************

AT SELECTION-SCREEN ON TO_NMBER.

**********************************************************************

PERFORM CHECK_NUMBER USING TO_CNTRY TO_NMBER.

&----


*& Form CHECK_NUMBER

&----


FORM CHECK_NUMBER USING

COUNTRY

NUMBER.

DATA: SERVICE LIKE TSKPA-SERVICE VALUE 'TELEFAX',

LEN LIKE SY-FDPOS.

FIELD-SYMBOLS <P>.

  • windows GUI push the ? from mandatory input instead

of overwriting it

LEN = STRLEN( TO_NMBER ).

IF LEN > 1.

SUBTRACT 1 FROM LEN.

ASSIGN TO_NMBER+LEN(1) TO <P>.

IF <P> = '?'.

<P> = SPACE.

ENDIF.

ENDIF.

  • official check FM

CALL FUNCTION 'TELECOMMUNICATION_NUMBER_CHECK'

EXPORTING

COUNTRY = COUNTRY

NUMBER = NUMBER

SERVICE = SERVICE.

  • on old 21?/22? release you may have to handle the

exception

  • because the Function uses RAISE instead of

MESSAGE... RAISING....

ENDFORM. " CHECK_NUMBER

&----


*& Form FILL_UP_TEST_DOC

&----


  • fills test text in itab TEST_DOC *

  • real life example needs to get real life data *

----


FORM FILL_UP_TEST_DOC.

DATA: DATUM(12) TYPE C,

UZEIT(10) TYPE C.

  • SAPscript initialization

  • of course, you may want to set a few parameter

(FORM,LAYOUT,....)

CALL FUNCTION 'INIT_TEXT'

EXPORTING

ID = 'ST '

LANGUAGE = SY-LANGU

NAME = 'FOO-BAR'

OBJECT = 'TEXT'

IMPORTING

HEADER = HEADER

TABLES

LINES = TEST_DOC

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

MESSAGE A400 WITH 'INIT_TEXT'.

ENDIF.

PERFORM ADD_EMPTY_LINE.

WRITE: SY-DATUM TO DATUM.

WRITE: SY-UZEIT TO UZEIT.

PERFORM ADD_LINES USING 'This is test Telefax'(001)

DATUM UZEIT.

PERFORM ADD_EMPTY_LINE.

PERFORM ADD_LINES USING 'From: &'(002) FROM_USR SPACE.

PERFORM ADD_LINES USING 'To: &'(003) TO_RECIP SPACE.

PERFORM ADD_LINES USING 'Fax number: & &'(004)

TO_CNTRY TO_NMBER.

PERFORM ADD_EMPTY_LINE.

PERFORM ADD_LINES USING

'This is a test fax send by Report RSKSENDF'(005)

SPACE SPACE.

PERFORM ADD_LINES USING 'on SAP system & '(006)

SY-SYSID SPACE.

PERFORM ADD_EMPTY_LINE.

PERFORM ADD_LINES USING

'the quick brown fox jumps over the lazy dog.'(101)

SPACE SAPCE.

PERFORM ADD_LINES USING

'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.'(102)

SPACE SAPCE.

PERFORM ADD_EMPTY_LINE.

PERFORM ADD_LINES USING 'End of test'(007) SPACE

SPACE.

ENDFORM. " FILL_UP_TEST_DOC

&----


*& Form ADD_LINES

&----


  • printf a line an appends it in test_doc *

----


  • --> cformat format.

  • --> p1 param1

  • --> p2 param2

----


FORM ADD_LINES USING CFORMAT P1 P2.

TEST_DOC-TDFORMAT = '/'.

TEST_DOC-TDLINE = CFORMAT.

IF TEST_DOC-TDLINE CA '&'.

REPLACE '&' WITH P1 INTO TEST_DOC-TDLINE.

IF TEST_DOC-TDLINE CA '&'.

REPLACE '&' WITH P2 INTO TEST_DOC-TDLINE.

ENDIF.

ENDIF.

APPEND TEST_DOC.

ENDFORM. " ADD_LINES

&----


*& Form ADD_EMPTY_LINE

&----


  • appends an empty line to test_doc *

----


FORM ADD_EMPTY_LINE.

TEST_DOC-TDFORMAT = '/'.

CLEAR TEST_DOC-TDLINE.

APPEND TEST_DOC.

ENDFORM. " ADD_EMPTY_LINE

&----


*& Form SHOW_TEST_DOC

&----


  • lists the test doc for aproval *

  • *

*>>>> this is for fun only because PRINT_TEXT also

offers a preview *

----


FORM SHOW_TEST_DOC.

FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.

WRITE: / 'Test fax would look like this:'(020).

ULINE.

SKIP.

LOOP AT TEST_DOC.

IF TEST_DOC-TDLINE <> SPACE.

WRITE:/ TEST_DOC-TDLINE.

ELSE.

SKIP.

ENDIF.

ENDLOOP.

SKIP.

ULINE.

FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.

WRITE: 'Press PF8 to send it'(021).

ENDFORM. " SHOW_TEST_DOC

&----


*& Form SEND_FAX

&----


  • send fax by calling SAPscript *

----


  • Note: Instead of using PRINT_TEXT you may also *

  • call OPEN_FORM / WRITE_FORM_LINES / CLOSE_FORM, *

  • this allows you to use a similar program structure *

  • as with NEW-PAGE PRINT ON / WRITE / NEW-PAGE PRINT

OFF *

----


FORM SEND_FAX

TABLES DOC2FAX STRUCTURE TEST_DOC

USING COUNTRY

NUMBER.

DATA: SID(5) TYPE N.

DATA BEGIN OF POPT.

INCLUDE STRUCTURE ITCPO.

DATA END OF POPT.

DATA BEGIN OF PRES.

INCLUDE STRUCTURE ITCPP.

DATA END OF PRES.

CLEAR POPT.

POPT-TDCOPIES = 1. " one copy

  • POPT-TDDEST = " done internaly by script,

  • POPT-TDPRINTER = " do not fill !!!

POPT-TDNEWID = 'X'. " do not reuse old spool request

POPT-TDDATASET = 'TEST'(022). " fill as you want

POPT-TDSUFFIX1 = 'FAX'(023). " fill as you want

POPT-TDSUFFIX2 = SY-UNAME. " fill as you want

POPT-TDIMMED = 'X'. " send now

POPT-TDLIFETIME = 8. " keep 8 days in spool

POPT-TDTELENUM = NUMBER. " number without country code

POPT-TDTELELAND = COUNTRY. " country of recipient

POPT-TDCOVER = 'test fax'(024).

POPT-TDCOVTITLE = 'test fax'(024).

  • POPT-TDIEXIT = 'X'.

CALL FUNCTION 'PRINT_TEXT'

EXPORTING

APPLICATION = 'TX'

ARCHIVE_INDEX = ' '

ARCHIVE_PARAMS = ' '

DEVICE = 'TELEFAX' "<<< here we say: fax it !

DIALOG = 'X'

HEADER = HEADER

OPTIONS = POPT

IMPORTING

RESULT = PRES

TABLES

LINES = DOC2FAX

EXCEPTIONS

OTHERS = 01.

  • do not bother with exception in sample code

  • CANCELED = 01

  • DEVICE = 02

  • FORM = 03

  • OPTIONS = 04

  • UNCLOSED = 05

  • UNKNOWN = 06

  • FORMAT = 07

  • TEXTFORMAT = 08

  • EXTERNAL = 09.

IF SY-SUBRC = 0.

  • arriving here means we could send:

SID = PRES-TDSPOOLID.

IF SID > '00000'.

MESSAGE S433 WITH SID.

ENDIF.

LEAVE .

ELSE.

  • do not bother with exception in sample code

MESSAGE A400 WITH 'PRIN_TEXT'.

ENDIF.

ENDFORM. " SEND_FAX