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: 

i need a smart form which was developed in se38

Former Member
0 Kudos
650

hi gurus

i am new to smartforms

plz send one smartform which was developed in se38

i am developing in smamrtforms itself

i dont know how to use se38

thank you

regards

kals.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
169

Hi,

Activate ur smartform and press F8(execution),save the functional module name.

Open se38 editor,press "Ctrl+F6" select the "Function

Module" radiobutton and place the function module name of smartform which u saved alrready,press enter.

Pass the parameters if any(if u hv used any parameters in the smartform of "Form Interface").

Save and activate SE38.Then execute.

reward points,if it is useful.

Thanks,

chandu.

3 REPLIES 3

Former Member
0 Kudos
169

Hi,

Check the below logic:

CONSTANTS : g_c_form TYPE tdsfname VALUE 'Z90xxxxx', (smartform name)

DATA: g_t_print TYPE TABLE OF z90cj_a070_01. (Internal table that is passed to the smartform).

DATA : l_f_fname TYPE tdsfname,

l_t_control LIKE ssfctrlop,

l_t_out TYPE ssfcompop.

g_f_grand = g_f_grandtot.

CONDENSE g_f_grand.

l_t_control-no_dialog = 'X'.

l_t_control-device = 'PRINTER'.

l_t_out-tdnewid = 'X'.

l_t_out-tddelete = ' '.

l_t_out-tdnoprev = 'X'.

l_t_out-tdimmed = 'X'.

l_t_out-tddest = p_prtid .

l_t_out-tddataset = 'SMART'.

l_t_out-tdcopies = '001'.

*--Call smartform

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = g_c_form

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = l_f_fname

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3

.

IF sy-subrc = 0.

CALL FUNCTION l_f_fname

EXPORTING

control_parameters = l_t_control

output_options = l_t_out

user_settings = space

i_language = sy-langu

i_totlines = g_f_totlines

i_grandtot = g_f_grand

TABLES

g_t_print = g_t_print

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc = 0.

MESSAGE s301(z90sj_general) WITH sy-repid.

ELSE.

CASE sy-subrc.

WHEN 1.

MESSAGE i604(z90vj_msg) WITH g_c_ferror.

WHEN 2.

MESSAGE i604(z90vj_msg) WITH g_c_ierror.

WHEN 3.

MESSAGE i604(z90vj_msg) WITH g_c_serror.

WHEN 4.

MESSAGE i604(z90vj_msg) WITH g_c_uerror.

WHEN 5.

MESSAGE i604(z90vj_msg) WITH g_c_oerror.

ENDCASE.

ENDIF.

ENDIF.

Former Member
0 Kudos
169

Kalyan

Below is simple smart form for beginners.Step by step....

A Simple Smartform Tutorial

SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).

According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).

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.

Don't forget to reward if useful....

Former Member
0 Kudos
170

Hi,

Activate ur smartform and press F8(execution),save the functional module name.

Open se38 editor,press "Ctrl+F6" select the "Function

Module" radiobutton and place the function module name of smartform which u saved alrready,press enter.

Pass the parameters if any(if u hv used any parameters in the smartform of "Form Interface").

Save and activate SE38.Then execute.

reward points,if it is useful.

Thanks,

chandu.