
You may refer to the help file within the trial version of VeryPDF for comprehensive guidance and information. The assistance provided in the help file will offer insights into the features and functionalities of the trial version of VeryPDF
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = pdf_xstring
TABLES
binary_tab = it_lines[].
CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
IMPORTING
uuid = unique_name.
CONCATENATE 'D:\usr\sap\pdfencrypt\' unique_name '.pdf' INTO l_file .
OPEN DATASET l_file FOR OUTPUT IN BINARY MODE.
IF sy-subrc = 0 .
CLEAR : wa_lines.
LOOP AT it_lines INTO wa_lines.
TRANSFER wa_lines TO l_file .
ENDLOOP.
CLOSE DATASET l_file.
PERFORM encryptpdf.
ENDIF.
PERFORM send_mail.
FORM encryptpdf .
l_cmd = 'Z_PDF_ENCRYPT'.
CLEAR wa_params.
// We can set the password after | -u | expression, in this example the ID No is used.
wa_params = |{ |-i | && l_file && | -o | && l_file && | -u | && gs_sf01-wausw }|.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
operatingsystem = sy-opsys
commandname = l_cmd
additional_parameters = wa_params
targetsystem = VALUE rfcdisplay( rfchost = sy-host )
stdout = 'X'
stderr = 'X'
terminationwait = 'X'
IMPORTING
status = w_status
exitcode = w_exit
TABLES
exec_protocol = it_log
EXCEPTIONS
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
wrong_asynchronous_parameters = 12
cant_enq_tbtco_entry = 13
jobcount_generation_error = 14
OTHERS = 15.
IF sy-subrc = 0.
CLOSE DATASET l_file.
OPEN DATASET l_file FOR INPUT IN BINARY MODE.
IF sy-subrc EQ 0.
REFRESH it_lines.
DO.
CLEAR wa_lines.
READ DATASET l_file INTO wa_lines.
IF sy-subrc = 0.
APPEND wa_lines TO it_lines.
ELSE.
IF wa_lines IS NOT INITIAL.
APPEND wa_lines TO it_lines.
ENDIF.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET l_file.
DELETE DATASET l_file.
ENDIF.
ENDIF.
ENDFORM.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = a_subject
i_att_content_hex = it_lines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |