2016 Feb 03 3:59 AM
Hi All,
Help required on two scenarios:
-Navin Khedikar
2016 Feb 03 11:24 AM
Hi navin,
Execute SF after that you can enter TCODE: PDF! in Command prompt. it will be convert PDF Format.
if you need more information you can go thourgh below link
http://scn.sap.com/thread/830969
Regards,
Kumar
2016 Feb 03 12:18 PM
Which step were you unable to find, there are already some samples at scn on how-to do this.
Try to search for attach document FB03 or send mail with gos attachment
Regards,
Raymond
2016 Feb 05 5:05 AM
Thanks Raymond,
please check below code, and let me know what is wrong:
data : it_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE,
DATA : lv_buffer TYPE string,
lv_buffer2 TYPE string,
lv_buffer1 TYPE xstring,
i_content TYPE sbdst_content.
l_hstring(1022) TYPE x.
l_cstring(255) TYPE c.
DATA: i_component TYPE sbdst_components
DATA: objkey TYPE sbdst_object_key..
DATA: i_signature TYPE sbdst_signature.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = lv_bin_filesize
TABLES
otf = ls_job_output_info-otfdata
doctab_archive = it_docs
lines = it_lines
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
LOOP AT it_lines.
TRANSLATE it_lines USING '~'.
CONCATENATE lv_buffer it_lines INTO lv_buffer.
ENDLOOP.
TRANSLATE lv_buffer USING '~'.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = lv_buffer
IMPORTING
buffer = lv_buffer1
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
lv_buffer2 = lv_buffer1.
DO.
l_hstring = lv_buffer2.
MOVE l_hstring TO w_content-line.
APPEND w_content TO i_content.
SHIFT lv_buffer2 LEFT BY 255 PLACES.
IF lv_buffer2 IS INITIAL.
EXIT.
ENDIF.
ENDDO.
l_classname = 'BKPF'.
CONCATENATE i_bukrs i_belnr i_gjahr INTO objkey.
w_component-doc_count = 1.
w_component-comp_count = 1.
w_component-comp_id = objkey.
w_component-comp_size = lt_objpack-doc_size.
SELECT SINGLE mimetype
FROM toadd
INTO w_component-mimetype
WHERE doc_type = 'PDF'.
APPEND w_component TO i_component.
w_signature-doc_count = 1.
w_signature-doc_id = 'MESSAGE' .
w_signature-doc_ver_no = 2.
w_signature-comp_count = 1.
w_signature-prop_name = 'DESCRIPTION'.
w_signature-prop_value = objkey.
APPEND w_signature TO i_signature.
CALL METHOD cl_bds_document_set=>create_with_table
EXPORTING
classname = l_classname
classtype = 'BO'
client = sy-mandt
components = i_component
content = i_content
CHANGING
object_key = objkey
signature = i_signature
EXCEPTIONS
internal_error = 1
error_kpro = 2
parameter_error = 3
not_authorized = 4
not_allowed = 5
nothing_found = 6
OTHERS = 7.
IF sy-subrc = 0.
COMMIT WORK AND WAIT.
ENDIF.
The issue is that , after this code i am able to find the attachment in FB03 as a pdf, but the attachment not open in PDF.
I've tried with CALL FUNCTION 'SO_ATTACHMENT_INSERT' and FM 'BINARY_RELATION_CREATE_COMMIT' but didn't get the attachment.
Please help ...
-Navin
2021 Nov 29 8:30 AM
Hi Navin , have u done this ??/ I need process how u convert OTF to Binary to attach to FB02/FB03 ????
please suggest the conversions of OTF !!!!!
2021 Nov 29 9:08 AM