Application Development 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: 

Smart forms

Former Member
0 Kudos

Hi all,

Can any tell me about sending Fax from smart forms.

and also usage of XSF output and

XSF output + HTML

Thanks in Advance,

~Teena.

4 REPLIES 4

Simha_
Employee
Employee
0 Kudos

Hi,

check this prog BCS_EXAMPLE_2

REPORT bcs_example_2.

  • This example shows how to send

  • - a simple text provided in an internal table of text lines

  • - and an attached PC document (in form of text lines itab)

  • - to a fax number.

*

  • All activities done via facade CL_BCS!

DATA: send_request TYPE REF TO cl_bcs.

DATA: text TYPE bcsy_text.

DATA: att_text TYPE bcsy_text.

DATA: document TYPE REF TO cl_document_bcs.

DATA: sender TYPE REF TO cl_sapuser_bcs.

DATA: recipient TYPE REF TO if_recipient_bcs.

DATA: bcs_exception type ref to cx_bcs.

data: sent_to_all type os_boolean.

START-OF-SELECTION.

PERFORM main.

----


  • FORM main *

----


FORM main.

try.

  • -------- create persistent send request ------------------------

send_request = cl_bcs=>create_persistent( ).

  • -------- create and set document with attachment ---------------

  • create document from internal table with text

APPEND 'Hello world!' TO text.

document = cl_document_bcs=>create_document(

i_type = 'RAW'

i_text = text

i_length = '12'

i_subject = 'test created by BCS_EXAMPLE_2' ).

  • add attachment to document

REFRESH text.

APPEND 'This is an attachment' TO text.

CALL METHOD document->add_attachment

EXPORTING i_attachment_type = 'RAW'

i_attachment_subject = 'My attachment'

i_attachment_size = '21'

i_att_content_text = text.

  • add document to send request

CALL METHOD send_request->set_document( document ).

  • --------- set sender -------------------------------------------

  • note: this is necessary only if you want to set the sender

  • different from actual user (SY-UNAME). Otherwise sender is

  • set automatically with actual user.

sender = cl_sapuser_bcs=>create( sy-uname ).

CALL METHOD send_request->set_sender

EXPORTING i_sender = sender.

  • --------- add recipient (fax) -----------------------

  • create recipient - please replace fax number !!!

recipient = cl_cam_address_bcs=>create_fax_address(

i_country = 'DE'

i_number = '09999-123456' ).

  • add recipient with its respective attributes to send request

CALL METHOD send_request->add_recipient

EXPORTING

i_recipient = recipient

i_express = 'X'.

  • ---------- send document ---------------------------------------

CALL METHOD send_request->send(

exporting

i_with_error_screen = 'X'

receiving

result = sent_to_all ).

if sent_to_all = 'X'.

write text-003.

endif.

COMMIT WORK.

  • -----------------------------------------------------------

  • * exception handling

  • -----------------------------------------------------------

  • * replace this very rudimentary exception handling

  • * with your own one !!!

  • -----------------------------------------------------------

catch cx_bcs into bcs_exception.

write: 'Fehler aufgetreten.'(001).

write: 'Fehlertyp:'(002), bcs_exception->error_type.

exit.

endtry.

ENDFORM.

Cheers,

Simha.

Reward all the helpful answers..

Former Member
0 Kudos

Hi teena,

To FAX smartform first you need to download the smarform.

In smartforms initial screen, in the menu bar,

<b>GOTO -


> utilities --->Download form.</b>

You will get the .xml file at ur desired destination.

Now you can FAX that .xml. At the same time you can upload this file

at your destination system.

Regards,

V.Raghavender.

navin_khedikar2
Contributor
0 Kudos

Hai Teena

Please check standard smartform SF_SFX_DEMO1.And Program SF_XSF_DEMO.

**Please reward suitable points***

With Regards

Navin Khedikar

Former Member
0 Kudos

Yes I got the solution

Thanks for all your help

~Teena