cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with send receive Email ( Adobe Interactive)

Former Member
0 Kudos

I have heard the E-Learning(Send, Receive, and Process Interactive Forms via Email in SAP NetWeaver Application Server ABAP (RIG session 4A)

) about this topic on this webpage but i still have to many problems. Can somebody give me a source code, that i know how this works. Or is there a source code anywhere in the sap?

I hope anybody can help me, Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

May be, if you can list out the problems, i can help you..

I believe jeff gebo's webinar available in SDN should surely help you.

Thanks and Regards,

- anto.

Former Member
0 Kudos

okay, sorry but i don`t know where to find "jeff gebo's webinar"???

Former Member
0 Kudos

A quick search in that name results in <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/advancedsearch?query=jeff+gebo&cat=sdn_all">- (check the secon and third results)</a>..

Hope this helps.

- anto.

Former Member
0 Kudos

Thanks. I have written Programm, but it does not work as i want it to do. I will send an Email with attached Adobe Interactive Firm to KevinGrimm9@gmx.de. I tried it with "*lo_recipient = cl_sapuser_bcs=>create( sy-uname )" at the marked(bold, fat) position. It worked but the Email was send to my SAP-Account, but i want to send to KevinGRimm9@gmx.de, so I tried this (see at code in bold, fat):

lo_rec TYPE adr6-smtp_addr VALUE 'KevinGrimm9@gmx.de'. " Empfänger Receiver

lo_recipient = cl_cam_address_bcs=>create_internet_address( lo_rec ).

But it doens`t send the email.

Can anybody help me please???

Kevin

Here my Code:

*----


*

  • Report FP_EXAMPLE_01

*----


*

  • Printing of documents using PDF based forms

*----


*

REPORT z_example_02.

  • Data declaration

DATA: carr_id TYPE sbook-carrid,

customer TYPE scustom,

bookings TYPE ty_bookings,

connections TYPE ty_connections,

fm_name TYPE rs38l_fnam,

fp_docparams TYPE sfpdocparams,

fp_outputparams TYPE sfpoutputparams,

error_string TYPE string,

l_booking TYPE sbook,

t_sums TYPE TABLE OF sbook,

l_sums LIKE LINE OF t_sums,

fp_formoutput TYPE fpformoutput.

PARAMETER: p_custid TYPE scustom-id DEFAULT 38.

SELECT-OPTIONS: s_carrid FOR carr_id DEFAULT 'AA' TO 'ZZ'.

PARAMETER: p_form TYPE tdsfname DEFAULT 'FP_EXAMPLE_01'.

PARAMETER: language TYPE sfpdocparams-langu DEFAULT 'E'.

PARAMETER: country TYPE sfpdocparams-country DEFAULT 'US'.

  • Get data from the following tables: scustom(Flight customer)

  • sbook (Single flight reservation)

  • spfli (Flight plan)

SELECT SINGLE * FROM scustom INTO customer WHERE id = p_custid.

CHECK sy-subrc = 0.

SELECT * FROM sbook INTO TABLE bookings

WHERE customid = p_custid

AND carrid IN s_carrid

ORDER BY PRIMARY KEY.

SELECT * FROM spfli INTO TABLE connections

FOR ALL ENTRIES IN bookings

WHERE carrid = bookings-carrid

AND connid = bookings-connid

ORDER BY PRIMARY KEY.

  • Print data:

  • First get name of the generated function module

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

i_name = p_form

IMPORTING

e_funcname = fm_name.

IF sy-subrc <> 0.

MESSAGE e001(fp_example).

ENDIF.

  • Set output parameters and open spool job

fp_outputparams-nodialog = 'X'. " suppress printer dialog popup

fp_outputparams-getpdf = 'X'. " launch print preview

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

ie_outputparams = fp_outputparams

EXCEPTIONS

cancel = 1

usage_error = 2

system_error = 3

internal_error = 4

OTHERS = 5.

  • Set form language and country (->form locale)

fp_docparams-langu = language.

fp_docparams-country = country.

*fp_docparams-fillable = 'X'.

*fp_docparams-langu = 'E'. "wird jetzt automatisch gesetzt, bzw. kann dynamisch verändert werden

*fp_docparams-country = 'GB'. "wird jetzt automatisch gesetzt, bzw. kann dynamisch verändert werden

  • currency key dependant summing

LOOP AT bookings INTO l_booking.

l_sums-forcuram = l_booking-forcuram.

l_sums-forcurkey = l_booking-forcurkey.

COLLECT l_sums INTO t_sums.

ENDLOOP.

  • Now call the generated function module

CALL FUNCTION fm_name

EXPORTING

/1bcdwb/docparams = fp_docparams

customer = customer

bookings = bookings

connections = connections

t_sums = t_sums

IMPORTING

/1bcdwb/formoutput = fp_formoutput

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

IF sy-subrc <> 0.

CALL FUNCTION 'FP_GET_LAST_ADS_ERRSTR'

IMPORTING

e_adserrstr = error_string.

IF NOT error_string IS INITIAL.

  • we received a detailed error description

WRITE:/ error_string.

EXIT.

ELSE.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

  • Close spool job

CALL FUNCTION 'FP_JOB_CLOSE'

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

*********************Send the form*******************

*********************to the Customer*****************

*********************via Email***********************

*IF i_down = abap_true.

  • DATA: filename TYPE string,

  • path TYPE string,

  • fullpath TYPE string,

  • default_extension TYPE string VALUE 'PDF'.

Data:

lt_att_content_hex TYPE solix_tab.

*DATA: data_tab TYPE TABLE OF x255.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

EXPORTING

buffer = fp_formoutput-pdf

TABLES

binary_tab = lt_att_content_hex.

CLASS cl_bcs DEFINITION LOAD.

DATA:

lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.

lo_send_request = cl_bcs=>create_persistent( ).

DATA:

lt_message_body TYPE bcsy_text VALUE IS INITIAL.

DATA: lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.

APPEND 'Dear Vendor,' TO lt_message_body.

APPEND ' ' TO lt_message_body.

APPEND 'Please fill the attached form and send it back to us.'

TO lt_message_body.

APPEND ' ' TO lt_message_body.

APPEND 'Thank You,' TO lt_message_body.

lo_document = cl_document_bcs=>create_document(

i_type = 'RAW'

i_text = lt_message_body

i_subject = 'Vendor Payment Form' ).

DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.

TRY.

lo_document->add_attachment(

EXPORTING

i_attachment_type = 'PDF'

i_attachment_subject = 'Vendor Payment Form'

i_att_content_hex = lt_att_content_hex ).

CATCH cx_document_bcs INTO lx_document_bcs.

ENDTRY.

lo_send_request->set_document( lo_document ).

DATA:

lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,

lo_send TYPE adr6-smtp_addr VALUE 'altehuette@gmx.de'. "Absender SENDER

lo_sender = cl_cam_address_bcs=>create_internet_address( lo_send ).

  • Set sender

lo_send_request->set_sender(

EXPORTING

i_sender = lo_sender ).

  • Create recipient

DATA:

lo_recipient type ref to if_recipient_bcs value is initial.

Data:
lo_rec TYPE adr6-smtp_addr VALUE 'KevinGrimm9@gmx.de'. " Empfänger Receiver
lo_recipient = cl_cam_address_bcs=>create_internet_address( lo_rec ).

*lo_recipient = cl_sapuser_bcs=>create( sy-uname ).

    • Set recipient

lo_send_request->add_recipient(

EXPORTING

i_recipient = lo_recipient

i_express = 'X' ).

*lo_send_request->add_recipient(

*EXPORTING

*i_recipient = lo_recipient

*i_express = 'X' ).

  • Send email

DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.

lo_send_request->send(

EXPORTING

i_with_error_screen = 'X'

RECEIVING

result = lv_sent_to_all ).

COMMIT WORK.

MESSAGE 'The payment form has been emailed to the Vendor' TYPE 'I'.

Former Member
0 Kudos

do the required configuration for SMTP at the R/3 end, so that mails are send to external mail ids. Do refer the same webinar or have a search in SDN.

Hope this helps.

- anto.