‎2010 Jan 08 10:36 AM
Hello,
I dont even know if its right place to ask but I will give it a try , I do apologise if this is not right place to ask ...When I am opening pdf document attached to the mail sent through sap I am getting an error saying
THE ROOT OBJECT IS MISSING OR INVALID. I dont understand if its programming error or file error ..plz advise..
regards...
Edited by: BrightSide on Jan 8, 2010 10:36 AM
Edited by: BrightSide on Jan 8, 2010 10:36 AM
‎2010 Jan 08 10:42 AM
Hello Brightside,
I think this issue is not an SAP related matter. You might check and work around Acrobat Versions. Or Google it you must get good discussions on this topic in Acrobat forums.
Cheers
‎2010 Jan 08 10:45 AM
hey..
Thanks for your reply ..it was ok , when I used 'SO_NEW_DOCUMENT_ATT_SEND_API1' but now I am using classes and now I am getting this error. any ideas?
‎2010 Jan 08 10:51 AM
Well then it could be a SAP issue. Could you please paste your code, so that we can review.
Thanks,
Best regards,
Prashant
‎2010 Jan 08 11:08 AM
Hello,
Thanks for your reply.
Code:
*Get Function module name for given smartform
{
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST_SMARTFORM'
IMPORTING
fm_name = fm_name.
}
{
CALL FUNCTION fm_name
EXPORTING
control_parameters = ssfctrlop
output_options = ssfcompop
IMPORTING
job_output_info = it_otf_data
TABLES
it_kna1 = it_kna1.
}
{
it_otf_final[] = it_otf_data-otfdata[].
}
{
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = bin_filesize
bin_file =
TABLES
otf = it_otf_final
lines = it_pdfdata[]
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
}
{
DATA binary_content TYPE TABLE OF solix.
DATA:it_pdfdata TYPE TABLE OF tline WITH HEADER LINE.
DATA:it_pdf TYPE TABLE OF solisti1 WITH HEADER LINE.
}
{
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_dst = '255'
TABLES
content_in = it_pdfdata[]
content_out = it_pdf[]
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
}
{
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_dst = '255'
TABLES
content_in = it_pdfdata[]
content_out = it_pdf[]
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
}
*convert string to raw.
{
CLASS cl_bcs DEFINITION LOAD.
DATA:
lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
lo_send_request = cl_bcs=>create_persistent( ).
Message body and subject
DATA:
lt_message_body TYPE bcsy_text VALUE IS INITIAL,
lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
DATA: gt_stxftxt TYPE TABLE OF stxftxt,
gs_stxftxt TYPE stxftxt.
*-Email body
REFRESH: gt_stxftxt.
SELECT *
FROM stxftxt
INTO TABLE gt_stxftxt
WHERE formname = 'ZINVEMAILTXT'.
IF sy-subrc = 0.
SORT gt_stxftxt BY linenr ASCENDING.
LOOP AT gt_stxftxt
INTO gs_stxftxt.
APPEND gs_stxftxt-tdline TO lt_message_body.
ENDLOOP.
ENDIF.
}
{
lo_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lt_message_body
i_subject = 'Order Shipment Notification' ).
}
Add attachment
{
CALL METHOD lo_document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'health'
i_att_content_hex = conhex.
}
Pass the document to send request
{
lo_send_request->set_document( lo_document ).
}
Create sender
Create recipient
{
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.
}
‎2010 Jan 08 11:22 AM
Hi Brightside,
after 962 posts you should be able to post
code formatted as code.Regards,
Clemens
‎2010 Jan 08 11:36 AM
Hi Brightside,
after 962 posts you should be able to post
code formatted as code.Regards,
Clemens
‎2010 Jan 08 10:52 AM
Hi,
Recently I also faced similar issue wherein i was
sending one pdf document in mail and that was not
getting opened , for that i used one different method
to send mail . Please find the wiki link created by me
in the mail below:
https://wiki.sdn.sap.com/wiki/display/sandbox/ConversionofSpoolRequestDataintoPDFandExcelFormatandSenditintoMail
Hope it helps
Regards
Mansi
‎2010 Jan 08 11:20 AM
Hi Mansi
Sorry if i was wrong in that link u gave me I cant see method ADD_ATTACHMENT, is it something you missed or we dnt need it?
Thanks
‎2010 Jan 08 3:10 PM
‎2010 Jan 08 3:46 PM