cancel
Showing results for 
Search instead for 
Did you mean: 

Help in Calling Smartform in wd?

Former Member
0 Kudos

Hi All,

I am calling SF from WD, i created IF ui element and in wddoinit method use some coding to call SF..

using CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' and

CALL FUNCTION 'CONVERT_OTF' .

Now my doubt is... Original smartform contains some selection screen for inputing values.

In wd i have to create this input screen or any other way is there to pass input values? Please help.

Thanks,

venkat.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all,

I am using below code getting error..Incorrect parameter with CALL FUNCTION.

error is coming at.. CALL FUNCTION fm_name

My code is:

DATA: node_pdf_data TYPE REF TO if_wd_context_node,

fm_name TYPE rs38l_fnam,

outop TYPE ssfcompop,

cparam TYPE ssfctrlop,

tab_otf_data TYPE ssfcrescl,

tab_otf_final TYPE TABLE OF itcoo,

bin_filesize TYPE i,

bin_file TYPE xstring,

pdf_tab TYPE TABLE OF tline.

" Get function module name for smart form

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZFSD_WTY_PICKLIST'

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

" Get Report Format With Data From Smart Form

outop-tdprinter = 'LP01'.

outop-tddest = 'LP01'.

cparam-no_dialog = 'X' .

cparam-preview = 'X'.

cparam-getotf = 'X'.

CALL FUNCTION fm_name

EXPORTING

control_parameters = cparam

output_options = outop

user_settings = space

IMPORTING

job_output_info = tab_otf_data

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

" Get all data of Smartform

tab_otf_final[] = tab_otf_data-otfdata[].

" Convert OTF data into PDF data

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = bin_filesize

bin_file = bin_file

TABLES

otf = tab_otf_final

lines = pdf_tab

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5.

" Set PDF Data to context attribute

node_pdf_data = wd_context->get_child_node( name = 'PDF_SOURCE' ).

CALL METHOD node_pdf_data->set_attribute

EXPORTING

value = bin_file

name = 'SOURCE'.

Thanks,

Venkat.

Former Member
0 Kudos

Hi Pass below parameter to outop

outop-tdnoprev = 'X'.

outop-tdnoprint = 'X'.

and

cparam-preview = ' '.

and if your smarform has any interface parameter , then pass them too

Former Member
0 Kudos

Hi Akash,

I pass attributes what u told, still getting same error.

what is smartform interface parameters? to execute smartform we give some inputs, but here where should i provide?

shall i create UI elements in webdynpro? please help.

Thanks,

Venkat.

marcin_cholewczuk
Active Contributor
0 Kudos

Hi,

My proposition would be to use generated by smartform function module instead of this general approach. So delete calling SSF_FUNCTION_MODULE_NAME along with this dynamic CALL FUNCTION fm_name and then call generated function module directly. You can find its name under Environment->Function Module Name. Here you can pass all parameters for your smartforms.

[http://pokazywarka.pl/29t6nz/]

Best regards

Marcin Cholewczuk

gill367
Active Contributor
0 Kudos

Yeah as suggested inthe above post

use the direct FM

which is executed when you are executing the smartform driectly.

pass all the required paramater to it.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi Marcin

thanks for your reply, can u give any available example the same.

Thanks,

Venkat.

marcin_cholewczuk
Active Contributor
0 Kudos

Hi venkat,

it's hard to give good example because function module will have different parameters depending on interface of smartform. Just use PATTERN button in SE80/SE38, paste your function module name and pass all not optional parameters.

BR

Marcin Cholewczuk

marcin_cholewczuk
Active Contributor
0 Kudos

Hi venkat,

What do you mean by "Original smartform contains some selection screen for inputing values"? I'm not smartform expert, but I don't recall any selection screens for smartforms or do you mean Form interface in Global settings (for which you input data directly when you call smartform function module)?

Best regards

Marcin Cholewczuk