cancel
Showing results for 
Search instead for 
Did you mean: 

displaying a smartform in pdf format using webdynpro

Former Member
0 Kudos

Hi,

I have created a smartform using t.code smartforms. I have created a function module within which i used the function mocule convert_otf which will convert the smartform into binary format. Now how do i proceed in displaying the form using web dynpro.

Plz give me your suggestions.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi Harini,

Please refer this doc: [How to Display a Smartform as PDF document in Web Dynpro for ABAP|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785].

I hope it helps.

Regards

Arjun

Answers (3)

Answers (3)

Former Member
0 Kudos

Check the link below

[]

Regards,

Radhika.

Former Member
0 Kudos
abhimanyu_lagishetti7
Active Contributor
0 Kudos

CALL FUNCTION LV_FUNC_MOD_NAME

EXPORTING

CONTROL_PARAMETERS = LS_SSFCTRLOP

OUTPUT_OPTIONS = LS_OUTPUT_OPTIONS

USER_SETTINGS = ' '

RRNUM = IM_RRNUM

IMPORTING

JOB_OUTPUT_INFO = LT_RETURN

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

ENDIF.

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.

ENDIF.

LV_FUNC_MOD_NAME is your smartform function module name.

LV_XSTRING contains the stream of the pdf , send this to the browser using the following code.

LV_FILENAME = 'RebateRequest.pdf'.

LV_CTYPE = 'pdf'.

CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(

EXPORTING I_FILENAME = LV_FILENAME

I_CONTENT = LV_XSTRING

I_MIME_TYPE = LV_CTYPE

I_INPLACE = ABAP_TRUE

I_IN_NEW_WINDOW = ABAP_TRUE ).

Abhi