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: 

Problem with ADOBE document and class method CL_BCS

Former Member
0 Kudos

Hi All,

I am mailing a ADOBE document using the Class method CL_BCS.(Pls ref the blog /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface).

I am also getting the required output but with my attachment i am also getting a attachment that is blank (i.e completly white page) in pdf format.I have also done the settings as mentioned in the blog in T-Code SCOT.

Can you please specify where i need to change my approach so that i can correct this defect.

Thanks & Regards,

Vivek Agarwal

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 10:29 AM

4 REPLIES 4

Sm1tje
Active Contributor
0 Kudos

Debug your coding thouroughly. You are probably sending two attachments at once. Maybe parameter for add_attachment method is not filled correctly.

Just a suggestion, since you haven't provided us with any code, so all we can do is guess.

Former Member
0 Kudos

i am using ADOBE form and not sap script or smart form.

My code is as follows.....

CLASS cl_bcs DEFINITION LOAD.

DATA: lv_send_request TYPE REF TO cl_bcs VALUE IS INITIAL,

lt_message_body TYPE bcsy_text VALUE IS INITIAL,

lv_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.

DATA: lv_xdocument_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.

DATA: lv_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,

lv_send TYPE adr6-smtp_addr VALUE 'vivek'.

DATA: lv_recipient TYPE REF TO if_recipient_bcs.

lv_send_request = cl_bcs=>create_persistent( ).

lv_document = cl_document_bcs=>create_document(

i_type = 'RAW'

i_text = lt_message_body

i_subject = 'Invoice Remittance' ).

TRY.

lv_document->add_attachment(

EXPORTING

i_attachment_type = 'PDF'

i_attachment_subject = 'Invoice Remittance Form'

  • I_ATTACHMENT_SIZE =

  • I_ATTACHMENT_LANGUAGE = SPACE

  • I_ATT_CONTENT_TEXT =

  • I_ATTACHMENT_HEADER =

i_att_content_hex = gt_att_content_hex ).

CATCH cx_document_bcs INTO lv_xdocument_bcs.

ENDTRY.

  • Add attachment

  • Pass the document to send request

lv_send_request->set_document( lv_document ).

  • Create sender

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

  • Set sender

lv_send_request->set_sender(

EXPORTING

i_sender = lv_sender ).

  • create recipient - please replace e-mail address !!!

lv_recipient = cl_cam_address_bcs=>create_internet_address(

'email id' ).

    • Set recipient

lv_send_request->add_recipient(

EXPORTING

i_recipient = lv_recipient

i_express = 'X' ).

lv_send_request->add_recipient(

EXPORTING

i_recipient = lv_recipient

i_express = 'X' ).

  • Send email

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

lv_send_request->send(

EXPORTING

i_with_error_screen = 'X'

RECEIVING

result = lv_sent_to_all ).

COMMIT WORK.

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

Thanks & Regards,

Vivek Agarwal

Former Member
0 Kudos

Hi Vivek,

i use it like this:

DESCRIBE TABLE IT_BIN LINES N10.

*N10 = ( N10 - 1 ) * 255 + STRLEN( WA_BIN ).*

IT_LENGHT = N10.

CALL METHOD DOCUMENT->ADD_ATTACHMENT

EXPORTING

I_ATTACHMENT_TYPE = ATT_TYPE

I_ATT_CONTENT_HEX = IT_BIN

I_ATTACHMENT_SIZE = IT_LENGHT

I_ATTACHMENT_SUBJECT = SUBJECT.

I think you have to set the ..SIZE.

fill it like i do.

Regards, Dieter

Former Member
0 Kudos

Hi,

There can be a problem in ur SAP-Script or SMARTFORM....

Just check the output first...

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 10:31 AM