Application Development 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: 

smort forms FM

Former Member
0 Kudos

may i know some impotrant function modules in smort forms

could u plz explain clearly

and functionality of each function module clearly with comments

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

good

go through this link

http://www.erpgenie.com/abap/smartforms.htm

thanks

mrutyun^

5 REPLIES 5

Former Member
0 Kudos

Hi

How to create a New smartfrom, it is having step by step procedure

http://sap.niraj.tripod.com/id67.html

Here is the procedure

1. Create a new smartforms

Transaction code SMARTFORMS

Create new smartforms call ZSMART

2. Define looping process for internal table

Pages and windows

First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)

Here, you can specify your title and page numbering

&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)

Main windows -> TABLE -> DATA

In the Loop section, tick Internal table and fill in

ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2

3. Define table in smartforms

Global settings :

Form interface

Variable name Type assignment Reference type

ITAB1 TYPE Table Structure

Global definitions

Variable name Type assignment Reference type

ITAB2 TYPE Table Structure

4. To display the data in the form

Make used of the Table Painter and declare the Line Type in Tabstrips Table

e.g. HD_GEN for printing header details,

IT_GEN for printing data details.

You have to specify the Line Type in your Text elements in the Tabstrips Output options.

Tick the New Line and specify the Line Type for outputting the data.

Declare your output fields in Text elements

Tabstrips - Output Options

For different fonts use this Style : IDWTCERTSTYLE

For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&

5. Calling SMARTFORMS from your ABAP program

REPORT ZSMARTFORM.

  • Calling SMARTFORMS from your ABAP program.

  • Collecting all the table data in your program, and pass once to SMARTFORMS

  • SMARTFORMS

  • Declare your table type in :-

  • Global Settings -> Form Interface

  • Global Definintions -> Global Data

  • Main Window -> Table -> DATA

  • Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming

  • http://sapr3.tripod.com

TABLES: MKPF.

DATA: FM_NAME TYPE RS38L_FNAM.

DATA: BEGIN OF INT_MKPF OCCURS 0.

INCLUDE STRUCTURE MKPF.

DATA: END OF INT_MKPF.

SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.

SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.

MOVE-CORRESPONDING MKPF TO INT_MKPF.

APPEND INT_MKPF.

ENDSELECT.

  • At the end of your program.

  • Passing data to SMARTFORMS

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMARTFORM'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

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

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

endif.

call function FM_NAME

  • 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

GS_MKPF = INT_MKPF

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.

Reward points if useful

Regards

Anji

Former Member
0 Kudos

hi,

DATA: p_output_options TYPE ssfcompop, "occurs 0 with header line

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.

<b>*---- Function to get the function module name of the -


*---- specified Smart form. </b> -


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'GIVE YOUR SMART FORM NAME'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = v_form_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3 .

<b>*---- Function Module to call the Smart Form -


</b>

*step 1 - go to ur smart form

*step2 - take environment

*step3-take function module name

*copy that unique number.

*step4 -come back to ur driver program.

*step5 - place ur cursur here. take patter,.give that unique number.

*at that time u will get the below code.

*step6 - rename that unique number with 'v_form_name' in the code generated by pattern.

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 =

  • 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.

for any clarifiaction pls revert.

regards,

Reshma

Former Member
0 Kudos

Hi Rajesh,

FM 'SSF_FUNCTION_MODULE_NAME' : for getting smartform function name by pasing smartform name.smartform generates a FM dynamically when we execute it.we call that FM in driver program to call smartform.

reward points if helpful.

Regards,

Hemant

Former Member
0 Kudos

hi

good

go through this link

http://www.erpgenie.com/abap/smartforms.htm

thanks

mrutyun^