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

smart forms

Former Member
0 Likes
780

I have created one smartform and I want to call that form through Zprogram. How I will call that form. Anybody can give me code for that.

Thanks....

7 REPLIES 7
Read only

Former Member
0 Likes
763

use the FM SSF_FUNCTION_MODULE_NAME in ur program

and pass on the value of ur smartform in lf_formname.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING formname = lf_formname

IMPORTING fm_name = lf_fm_name

EXCEPTIONS no_form = 1

no_function_module = 2

OTHERS = 3.

Read only

Former Member
0 Likes
763

Hi,

It is simple.

after activation then Smartform, u will get a FM name ,

in ur pprogram simply run that FM like.

call function 'SF_FM_NAME'.

parameters...

like normal funciton...

Reward if it helps....

Read only

0 Likes
763

Hi,

using Kartavya Kaushik 's method u can get FM name in program and then call function.

Jogdand M B

Read only

Former Member
0 Likes
763

Hi Abhay,

When you create a smartform a function module will be generated. You can call this function module using CALL FUNCTION.

But you could use the SSF_FUNCTION_MODULE_NAME where you can pass the smartform name and get the function module name generated.

Refer https://wiki.sdn.sap.com/wiki/display/ABAP/Smartforms for more details.

Regards

Wenceslaus

Read only

Former Member
0 Likes
763

hi,

chk this.

p_control_parameters TYPE ssfctrlop. "occurs 0 with header line

p_output_options-TDCOPIES = 3. "number of copies.

p_output_options-tddest = 'LP01'. "def

p_control_parameters-no_dialog = 'X'. "no dilog box

p_control_parameters-preview = 'X'. "no preview

DATA : v_form_name TYPE rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'Z_PETS_CIL_DOCUMENT_DETAILS'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = v_form_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3

CALL FUNCTION v_form_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMETERS =

control_parameters = p_control_parameters

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = p_output_options

user_settings = ' '

  • ARCHIVE_INDEX_TAB =

in_cashinlieu = int_cil-cashinlieu

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

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.

Regards

Reshma

Read only

Former Member
0 Likes
763

Hi Abahay,

call the fisrt FM written below.pass the smart form name and get the smartform function name.then call that smartformsFM that u got from first function.

use this piece of code in ur program

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = P_FORM

IMPORTING

FM_NAME = P_FUNCTION

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION P_FUNCTION

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

D_VBRK = IT_VBRK

D_VBRP = IT_VBRP

D_LIKP = IT_LIKP

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.

rewards points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
763

Hi,

First u need to call the function module SSF_FUNCTION_MODULE_NAME

By exporting formname and u have to import the name of the func. Module.

Next u have to call this func. Module by passing the internal tables, variables

Which has values.

Regards,

Karthick