cancel
Showing results for 
Search instead for 
Did you mean: 

doubt smart form

Former Member
0 Kudos

hi experts i am new in smart form i know script

could u guide plz

in scripts we have predefined forms and corresponding driver programs like MEDRUCK, RVORDER01 using this we can modify our layout according to client requirement.

1. can u please provide predefined forms and print programs in smart forms and plz tell me 2. wht modifications we will do real time in smart forms

3. how to create table in smart forms

4. how to debug and how to transport smart forms

5. can u please provide some FAQ's in smart forms

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Sayeed,

3. You can right click and create both template or table.

The difference between them is :

Template is fixed columns and fixed rows and for each every row we have to assign variables or internal table fields.

Whereas Table we can have any number of rows once we assign internal table fields to the columns of the table. we generally use Table in Main window unlike template which can be used in any window coz main window extends the data to the next page but other windows don’t.

hope this info is clear.

Sample code is not possible as these are added as the nodes in the main window and then designed.

Check this link to know about them.

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf

4. DEBUG Smartform:

1) One way to debug smartform is to debug the Function Module of that smartforms.

If you want to debug particular smartform node that the solution would be,

insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint.

So whenever you call the smartforms, it will stop at this breakpoint and you can debug onwards.

2) SFTRACE can be used for debugging SMARTFORMS.

Read More here.

http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm

5 .For faq's in SF, check these links.

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf

http://www.sap-basis-abap.com/sapsf001.htm

http://www.sap-press.com/downloads/h955_preview.pdf

http://www.ossincorp.com/Black_Box/Black_Box_2.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://www.sap-img.com/smartforms/smartform-tutorial.htm

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

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

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm

http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm

http://www.sap-img.com/smartforms/smart-001.htm

http://www.sap-img.com/smartforms/smartform-tutorial.htm

http://www.sap-img.com/smartforms/smart-002.htm

Hope this resolves your query.

Reward all the helpful answers.

Regards

Former Member
0 Kudos

Hi Sayeed,

Go through this important URL:

http://www.sap-basis-abap.com/sapsf001.htm

http://www.sap-press.com/downloads/h955_preview.pdf

http://www.ossincorp.com/Black_Box/Black_Box_2.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://www.sap-img.com/smartforms/smartform-tutorial.htm

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

How to trace smartform

http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm

http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF

http://www.sap-img.com/smartforms/smart-006.htm

http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm

check most imp link

http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html

step by step good ex link is....

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

This is the program:

Converting SMART FORMS output to PDF format

REPORT zsuresh_test.

  • Variable declarations

DATA:

w_form_name TYPE tdsfname VALUE 'ZSURESH_TEST',

w_fmodule TYPE rs38l_fnam,

w_cparam TYPE ssfctrlop,

w_outoptions TYPE ssfcompop,

W_bin_filesize TYPE i, " Binary File Size

w_FILE_NAME type string,

w_File_path type string,

w_FULL_PATH type string.

  • Internal tables declaration

  • Internal table to hold the OTF data

DATA:

t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,

  • Internal table to hold OTF data recd from the SMARTFORM

t_otf_from_fm TYPE ssfcrescl,

  • Internal table to hold the data from the FM CONVERT_OTF

T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.

  • This function module call is used to retrieve the name of the Function

  • module generated when the SMARTFORM is activated

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_form_name

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = w_fmodule

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.

  • Calling the SMARTFORM using the function module retrieved above

  • GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF

  • format of the output

w_cparam-no_dialog = 'X'.

w_cparam-preview = space. " Suppressing the dialog box

" for print preview

w_cparam-getotf = 'X'.

  • Printer name to be used is provided in the export parameter

  • OUTPUT_OPTIONS

w_outoptions-tddest = 'LP01'.

CALL FUNCTION w_fmodule

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = w_cparam

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = w_outoptions

  • USER_SETTINGS = 'X'

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

job_output_info = t_otf_from_fm

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

t_otf[] = t_otf_from_fm-otfdata[].

  • Function Module CONVERT_OTF is used to convert the OTF format to PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

IMPORTING

BIN_FILESIZE = W_bin_filesize

  • BIN_FILE =

TABLES

otf = T_OTF

lines = T_pdf_tab

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

ERR_BAD_OTF = 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.

To display File SAVE dialog window

CALL METHOD cl_gui_frontend_services=>file_save_dialog

  • EXPORTING

  • WINDOW_TITLE =

  • DEFAULT_EXTENSION =

  • DEFAULT_FILE_NAME =

  • FILE_FILTER =

  • INITIAL_DIRECTORY =

  • WITH_ENCODING =

  • PROMPT_ON_OVERWRITE = 'X'

CHANGING

filename = w_FILE_NAME

path = w_FILE_PATH

fullpath = w_FULL_PATH

  • USER_ACTION =

  • FILE_ENCODING =

EXCEPTIONS

CNTL_ERROR = 1

ERROR_NO_GUI = 2

NOT_SUPPORTED_BY_GUI = 3

others = 4

.

IF sy-subrc <> 0.

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

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

ENDIF.

  • Use the FM GUI_DOWNLOAD to download the generated PDF file onto the

  • presentation server

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = W_bin_filesize

filename = w_FULL_PATH

FILETYPE = 'BIN'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = T_pdf_tab

  • FIELDNAMES =

  • EXCEPTIONS

  • FILE_WRITE_ERROR = 1

  • NO_BATCH = 2

  • GUI_REFUSE_FILETRANSFER = 3

  • INVALID_TYPE = 4

  • NO_AUTHORITY = 5

  • UNKNOWN_ERROR = 6

  • HEADER_NOT_ALLOWED = 7

  • SEPARATOR_NOT_ALLOWED = 8

  • FILESIZE_NOT_ALLOWED = 9

  • HEADER_TOO_LONG = 10

  • DP_ERROR_CREATE = 11

  • DP_ERROR_SEND = 12

  • DP_ERROR_WRITE = 13

  • UNKNOWN_DP_ERROR = 14

  • ACCESS_DENIED = 15

  • DP_OUT_OF_MEMORY = 16

  • DISK_FULL = 17

  • DP_TIMEOUT = 18

  • FILE_NOT_FOUND = 19

  • DATAPROVIDER_EXCEPTION = 20

  • CONTROL_FLUSH_ERROR = 21

  • OTHERS = 22

.

IF sy-subrc <> 0.

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

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

ENDIF.

Find userexits with transaction code:

Selection Text: P_TCODE: Transaction Code to Search

Text Symbols: 001 - Enter the Transaction Code that you want to search through for a User Exit

REPORT z_find_userexit NO STANDARD PAGE HEADING.

*&----


*

*& Enter the transaction code that you want to search through in order

*& to find which Standard SAP® User Exits exists.

*&----


*

*&----


*

*& Tables

*&----


*

TABLES : tstc, "SAP® Transaction Codes

tadir, "Directory of Repository Objects

modsapt, "SAP® Enhancements - Short Texts

modact, "Modifications

trdir, "System table TRDIR

tfdir, "Function Module

enlfdir, "Additional Attributes for Function Modules

tstct. "Transaction Code Texts

*&----


*

*& Variables

*&----


*

DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.

DATA : field1(30).

DATA : v_devclass LIKE tadir-devclass.

*&----


*

*& Selection Screen Parameters

*&----


*

SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.

SELECTION-SCREEN SKIP.

PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN END OF BLOCK a01.

*&----


*

*& Start of main program

*&----


*

START-OF-SELECTION.

  • Validate Transaction Code

SELECT SINGLE * FROM tstc

WHERE tcode EQ p_tcode.

  • Find Repository Objects for transaction code

IF sy-subrc EQ 0.

SELECT SINGLE * FROM tadir

WHERE pgmid = 'R3TR'

AND object = 'PROG'

AND obj_name = tstc-pgmna.

MOVE : tadir-devclass TO v_devclass.

IF sy-subrc NE 0.

SELECT SINGLE * FROM trdir

WHERE name = tstc-pgmna.

IF trdir-subc EQ 'F'.

SELECT SINGLE * FROM tfdir

WHERE pname = tstc-pgmna.

SELECT SINGLE * FROM enlfdir

WHERE funcname = tfdir-funcname.

SELECT SINGLE * FROM tadir

WHERE pgmid = 'R3TR'

AND object = 'FUGR'

AND obj_name = enlfdir-area.

MOVE : tadir-devclass TO v_devclass.

ENDIF.

ENDIF.

  • Find SAP® Modifications

SELECT * FROM tadir

INTO TABLE jtab

WHERE pgmid = 'R3TR'

AND object = 'SMOD'

AND devclass = v_devclass.

SELECT SINGLE * FROM tstct

WHERE sprsl EQ sy-langu

AND tcode EQ p_tcode.

FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.

WRITE:/(19) 'Transaction Code - ',

20(20) p_tcode,

45(50) tstct-ttext.

SKIP.

IF NOT jtab[] IS INITIAL.

WRITE:/(95) sy-uline.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

WRITE:/1 sy-vline,

2 'Exit Name',

21 sy-vline ,

22 'Description',

95 sy-vline.

WRITE:/(95) sy-uline.

LOOP AT jtab.

SELECT SINGLE * FROM modsapt

WHERE sprsl = sy-langu AND

name = jtab-obj_name.

FORMAT COLOR COL_NORMAL INTENSIFIED OFF.

WRITE:/1 sy-vline,

2 jtab-obj_name HOTSPOT ON,

21 sy-vline ,

22 modsapt-modtext,

95 sy-vline.

ENDLOOP.

WRITE:/(95) sy-uline.

DESCRIBE TABLE jtab.

SKIP.

FORMAT COLOR COL_TOTAL INTENSIFIED ON.

WRITE:/ 'No of Exits:' , sy-tfill.

ELSE.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

WRITE:/(95) 'No User Exit exists'.

ENDIF.

ELSE.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

WRITE:/(95) 'Transaction Code Does Not Exist'.

ENDIF.

  • Take the user to SMOD for the Exit that was selected.

AT LINE-SELECTION.

GET CURSOR FIELD field1.

CHECK field1(4) EQ 'JTAB'.

SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).

CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

Rewords some points.

Rgds,

P.Naganjana Reddy

Former Member
0 Kudos

1. most of the smartforms start with /smb40/.

so u can navigate in the smartforms window by giving this.

Also u can find some standard scripts and smartforms in the table tnapr.

4. u can save a smartform like any report and transport it from se09,se10.

to debug smartform u can write break-point in the commandlines when u right click.

path is create-> flowlogic->Command lines.

3. To create table path is

right clik create--->table

again right click Create----> table line (this is to split into rows and columns )

Former Member
0 Kudos

Hi!

3. how to create table in smart forms

- its very easy, just right click on the main window and choose in the popup - Create -> Table

4. how to debug and how to transport smart forms

- to debug, just simply insert an ABAP code (right click on a window -> Create -> Flow logic -> Command line) into the Smartform, and write a "BREAK username." command into it.

5. Check out these links...

for Smartforms material

http://www.sap-basis-abap.com/sapsf001.htm

http://www.sap-press.com/downloads/h955_preview.pdf

http://www.ossincorp.com/Black_Box/Black_Box_2.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://www.sap-img.com/smartforms/smartform-tutorial.htm

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

How to trace smartform

http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm

http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF

http://www.sap-img.com/smartforms/smart-006.htm

http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm

check most imp link

http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html

step by step good ex link is....

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

Regards

Tamá