cancel
Showing results for 
Search instead for 
Did you mean: 

Call Smartforms in WD

Former Member
0 Kudos

Hi all,

i want to print the data that i have in Portal (WD) in a PDF via Smartforms,

can somebody tell me how can i do this?

Best Regards

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

get the Smartform function module

  • call smartform

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = '<Smartform name>'

IMPORTING

FM_NAME = LV_FUNC_MOD_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

IF SY-SUBRC <> 0 .

RETURN.

ENDIF.

call LV_FUNC_MOD_NAME with Control parameter NO_DIALOG,GET_OTF marking X

*convert the OTF to PDF using

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

IMPORTING

BIN_FILESIZE = LV_LENGTH

BIN_FILE = LV_XSTRING

TABLES

OTF = LT_RETURN-OTFDATA

LINES = LT_TLINE

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

ERR_BAD_OTF = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

RETURN.

ENDIF.

now use use runtime service method to push the PDF to browser client

CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE

Former Member
0 Kudos

Hi All,

first, i still want know , how can i send the data from WD to SMARTFROMS to fill it?

Kind Regards

Former Member
0 Kudos

in Smartforms look in Form interface, you can add there your attributes, you fill then in the view where are you calling the PRINT action.

BR

Former Member
0 Kudos

Solved, thank you all

Former Member
0 Kudos

Hi

I am also facing the same problem can u plz post the code .

Thanks in advance.

Answers (1)

Answers (1)

Former Member
0 Kudos

Steps are like this:

Portal Data (WD) to ZCLASS -> Call Function Module of your SF ZFORM -> output to pdf -> pdf to portal -> print

hope it helps a little bit.