Application Development and Automation 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: 
Read only

Send Smart-Forms to Folder

Former Member
0 Likes
432

Dear all.

Dear all

When the document is Printed 2 Messages will be created:

- First, will send the document to the Printer

- Second, we need to convert the message to PDF and to send this message to a specified Folder that is located in a different server.

At this point, understand that it is possible to send the message to folder using ZPDF device.

Now I have 2 more questions:

1 – It’s possible to send the message to an web service? Example, message to Purchase order.

2 – I need to include some metadata in the PDF Files example:

- Title, Subject, Keyword and summary fields

Thanks in advanced

Best Regards

Pedro Miguel Rodrigues

Mail.: pedromrodrigues@gmail.com

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
392

Hi Pedro,

We are using the following technique. May be you can try this :

Step1: Call the SSF function with

*Calling of Form in PDF Format

CALL FUNCTION LF_FM_NAME

EXPORTING

ARCHIVE_INDEX = TOA_DARA

ARCHIVE_PARAMETERS = ARC_PARAMS

CONTROL_PARAMETERS = LS_CONTROL_PARAM

MAIL_RECIPIENT = LS_RECIPIENT

MAIL_SENDER = LS_SENDER

OUTPUT_OPTIONS = LS_COMPOSER_PARAM

USER_SETTINGS = 'X'

I_HEADER = I_HEADER

NAST = NAST

REPEAT = REPEAT

TITLE = V_TITLE

V_GEWEI_X = V_GEWEI_X

IMPORTING

JOB_OUTPUT_INFO = JOB_OUTPUT_INFO

JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS

TABLES

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

Step2: convert into PDF :

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

IMPORTING

BIN_FILESIZE = G_FILESIZE

TABLES

OTF = JOB_OUTPUT_INFO-OTFDATA

LINES = I_PDF_TAB

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

ERR_BAD_OTF = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

MESSAGE S000(ZV) WITH 'Unable to download PDF file'.

ELSE.

MESSAGE S000(ZV) WITH 'PDF file downloaded Successfully'.

ENDIF.

Step3:Get the file name and use data sets:

CALL FUNCTION 'FILE_GET_NAME_USING_PATH'

EXPORTING

LOGICAL_PATH = L_LOGICALPATH

FILE_NAME = L_INFILE

IMPORTING

FILE_NAME_WITH_PATH = L_FILE

EXCEPTIONS

PATH_NOT_FOUND = 1

MISSING_PARAMETER = 2

OPERATING_SYSTEM_NOT_FOUND = 3

FILE_SYSTEM_NOT_FOUND = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

MESSAGE S000(ZV) WITH 'Unable to download PDF file'.

ELSE.

MESSAGE S000(ZV) WITH 'PDF file downloaded Successfully'.

ENDIF.

IF NOT I_PDF_TAB[] IS INITIAL.

*---opens application server file

OPEN DATASET L_FILE FOR OUTPUT IN BINARY MODE.

"encoding default.

IF SY-SUBRC = 0.

LOOP AT I_PDF_TAB.

TRANSFER I_PDF_TAB TO L_FILE.

ENDLOOP.

*--- closes error file

CLOSE DATASET L_FILE.

ELSE.

  • message i000 with 'Unable to download PDF file'.

ENDIF.

ENDIF.

Hope this may help you.

Please reward for all useful answers.

Regards,

Lanka

1 REPLY 1
Read only

Former Member
0 Likes
393

Hi Pedro,

We are using the following technique. May be you can try this :

Step1: Call the SSF function with

*Calling of Form in PDF Format

CALL FUNCTION LF_FM_NAME

EXPORTING

ARCHIVE_INDEX = TOA_DARA

ARCHIVE_PARAMETERS = ARC_PARAMS

CONTROL_PARAMETERS = LS_CONTROL_PARAM

MAIL_RECIPIENT = LS_RECIPIENT

MAIL_SENDER = LS_SENDER

OUTPUT_OPTIONS = LS_COMPOSER_PARAM

USER_SETTINGS = 'X'

I_HEADER = I_HEADER

NAST = NAST

REPEAT = REPEAT

TITLE = V_TITLE

V_GEWEI_X = V_GEWEI_X

IMPORTING

JOB_OUTPUT_INFO = JOB_OUTPUT_INFO

JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS

TABLES

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

Step2: convert into PDF :

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

IMPORTING

BIN_FILESIZE = G_FILESIZE

TABLES

OTF = JOB_OUTPUT_INFO-OTFDATA

LINES = I_PDF_TAB

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

ERR_BAD_OTF = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

MESSAGE S000(ZV) WITH 'Unable to download PDF file'.

ELSE.

MESSAGE S000(ZV) WITH 'PDF file downloaded Successfully'.

ENDIF.

Step3:Get the file name and use data sets:

CALL FUNCTION 'FILE_GET_NAME_USING_PATH'

EXPORTING

LOGICAL_PATH = L_LOGICALPATH

FILE_NAME = L_INFILE

IMPORTING

FILE_NAME_WITH_PATH = L_FILE

EXCEPTIONS

PATH_NOT_FOUND = 1

MISSING_PARAMETER = 2

OPERATING_SYSTEM_NOT_FOUND = 3

FILE_SYSTEM_NOT_FOUND = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

MESSAGE S000(ZV) WITH 'Unable to download PDF file'.

ELSE.

MESSAGE S000(ZV) WITH 'PDF file downloaded Successfully'.

ENDIF.

IF NOT I_PDF_TAB[] IS INITIAL.

*---opens application server file

OPEN DATASET L_FILE FOR OUTPUT IN BINARY MODE.

"encoding default.

IF SY-SUBRC = 0.

LOOP AT I_PDF_TAB.

TRANSFER I_PDF_TAB TO L_FILE.

ENDLOOP.

*--- closes error file

CLOSE DATASET L_FILE.

ELSE.

  • message i000 with 'Unable to download PDF file'.

ENDIF.

ENDIF.

Hope this may help you.

Please reward for all useful answers.

Regards,

Lanka