cancel
Showing results for 
Search instead for 
Did you mean: 

smartform pdf generated with error

Former Member
0 Kudos

Hi Gurus,

Need your help.

I had converted smartform to PDF and sent it as attachment to mail ( 3 PDF's) the loop is running fine and I got all the three

PDF's as mail attachment but only one I am able to open rest to file damaged.

the process goes like :

1.select upto 3 rows

2. loop the three rows one by one.

3. within first loop entry.

3.1 CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

3.2 CALL FUNCTION 'SSF_GET_DEVICE_TYPE'

3.3 CALL FUNCTION V_FM " ( calling generated func module )

3.4 CALL FUNCTION 'CONVERT_OTF'

3.5 CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

then back to second loop entry and third , But when I check my inbox only 1 PDF is generated properly rest are file damaged.

I am working on - EHP4 ERP 2005 ECC 6.0 - Retail can I use cl_bcs in above?

Edited by: DeepakNandikanti on May 24, 2010 7:02 AM

Accepted Solutions (1)

Accepted Solutions (1)

aidan_black
Active Contributor
0 Kudos

Hi,

I guess you do not use the BIN_FILE parameter when calling CONVERT_OTF so therefore the PDF data is returned via table LINES. There can be problems with this in a Unicode system.

It is not absolutely necessary to use parameter BIN_FILE in a Unicode system. But if you don't do this, you must see to it that the PDF data which are returned via table LINES are put into the PDF file without any codepage conversion.

Can you try using parameter BIN_FILE when calling CONVERT_OTF so the PDF data is returned as type XSTRING and use the the example BCS_EXAMPLE_8 of Note 1324547 to handle the PDF data returned.

Regards,

Aidan

Former Member
0 Kudos

Hi,

Thank you for your reply.

As you have told I did not use the BIN_FILE parameter when calling CONVERT_OTF. I have used below code

CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = V_LEN_IN
TABLES
OTF = I_OTF
LINES = I_TLINE "Used this
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
ENDIF.

I'l do what you have told and update you

Former Member
0 Kudos

I want to use function SO_NEW_DOCUMENT_ATT_SEND_API1 for mailinf smartform output in PDF as mail attachment or any other similar or simple function module which wouls serve my purpose.

Answers (1)

Answers (1)

aidan_black
Active Contributor
0 Kudos

Hi Deepak,

For a simpler solution, you do not need to do the PDF conversion at all if you send via email attachment. If you put the OTF data into the email and select the output format PDF in SAPCONNECT, then SAPCONNECT will do the PDF conversion itself and this should work fine.You need to make the setting below in transaction SCOT:

SCOT -> Double click on SMTP node -> In the pop-up, click on button 'SET' for Internet under Support Address types -> Under 'Output Formats for SAP Documents', select 'PDF' for SAPscript/Smartforms.

Regards,

Aidan

Former Member
0 Kudos

Hi Aidan,

Thank you for your reply,

I have done the SCOT setting,

could you tell me how to pass OTF data obtained from Function module below to send as mail:

CALL FUNCTION V_FM
          EXPORTING
          CONTROL_PARAMETERS = W_CTRLOP
          OUTPUT_OPTIONS = W_COMPOP
          USER_SETTINGS = 'X'
          WA_LFA1            = WA_LFA1
          IMPORTING
          JOB_OUTPUT_INFO    = W_RETURN
          TABLES
          IT_POTAB           = IT_POTAB
          EXCEPTIONS
          FORMATTING_ERROR = 1
          INTERNAL_ERROR = 2
          SEND_ERROR = 3
          USER_CANCELED = 4
          OTHERS = 5.
          IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
*          End of: Call Generated Function Module

I_OTF[] = W_RETURN-OTFDATA[].

Using which parameter of function SO_NEW_DOCUMENT_ATT_SEND_API1 should I send the OTF data.

Regards,

Deepak

Former Member
0 Kudos

Hi Aidan,

Resolved the issue by implementing Sap Note : 1324547.

I am closing thread,

Cheers,

Dep