on 12-15-2007 6:56 AM
Hi,
Kindly send the smart forms example step by step with screen shots.
Thanks in Advance,
Regards,
Satyanarayan
Hi,
hi
i am giving the following procedure to create smart form and print program.
please check it.
Go with smartforms tcode->provide form name->go for create
Provide a description for a form->under global settings
(Form interface->declarations will be maintained for print program & form)
So go with form interface->go with tables option->maintain internal table based on KNA1
ITAB LIKE KNA1
After that ,
Go with Pages &windows option.
Select page and provide the details.
Then select page ->go for create->window
Provide window name as LOGO.
Repeat Same procedure for address and footer window also
Go with form painter in application tool bar
Adjust all the windows in proper manner.
Then close form painter.
Now select logo window
Go for create->graphic
Give the details there
Name (for name search by F4 for predefine logo names or else give u r logo name)
Object graphics
Id bmap
After that,
Select address window ->go for create->flowlogic->loop
Provide loop name &description
Provide internal table ITAB INTO ITAB.
SELECT LOOP ->go for create->text elements->provide the name and description
Then GOTO->CHANGE EDITOR
Keep variables in address window
cust no &ITAB-KUNNR&
cust name &ITAB-NAME1&
cust country &ITAB-LAND1&
F3
Now select main window
Create->loop
Provide the details
Provide internal table ITAB INTO ITAB
Select LOOP-> go for crate->elements
Provide TEXT name and description
GOTO->CHANGE EDITOR
provide variables in main window
F3
select footer window
go for CREATE->ELEMENTS
PROVIDE DETAILS
GO WITH CHANGE EDITOR OPTION
PH NO:23424234
F3
SAVE AND ACTIVATE
F8
Then u can get function module which is system generated automatically
Copy this function module name
Then create the executable program
TABLES:KNA1.
PARAMETERS:P_KUNNR LIKE KNA1-KUNNR.
DATA:ITAB LIKE KNA1 OCCURS 0 WITH HEADER LINE.
SELECT * FROM KNA1 INTO TABLE ITAB WHERE KUNNR = P_KUNNR.
Call that function module and pass the parameter
TABLES
ITAB = ITAB
Save and activate
execute.
it will work.
Another example:
SMART fORM
USING TABLE IN Smart Form
1) Tcode --> SmartForms
2) Form name --> Z_SF_TEST Create
3) Under Global settings
a) Form Interface
Table Tab
ITAB LIKE EKPO
b) GLOBAL Definitions
WA_NETPR LIKE EKPO-NETPR
In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
For that we have to create an extra variable in global definitions
Ex: netpr FIELD of EKPO
CREATE program lines and specify WA_NETWR = itab-netpr.
4) RT CLick on main Window
CREATE --> TABLE
Click Table painter
DEFAULT %LTYPE will be Created
a) If you want more like Header footer etc add by rt click on %LTYPE1
Table (Tab)
%LTYPE Radio(SELECT) 5 CM 5 CM 6 CM
CLICK on DATA (Tab)
INTERNAL TABLE ITAB LIKE ITAB
5)RT click on table control and create --> program lines
General attribute (Tab)
INPUT PARAMETER OUTPUT PARAMETER
itab WA_NETPR
Code Area
WA_NETWR = ITAB-NETPR.
6) RT CLcick on table ctl and create 3 text to display the fields
a) % text1 +button(insert field)
FIELD name &itab-ebeln&
Output options (tab)
Check New line LINETYPE %Ltype1
check new cell
b) % text2
& itab-ebelp&
output options
check new cell
c) % text2
& wa_netpr&
output options
check new cell
Report ac
Tables ekpo.
Data: itab1 like ekpo occurs 0 with header line.
select * into table itab1 from ekpo.
Call function module
go through this link
Sample
Check these links
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
Reward points if found helpful .
Cheers,
Chandra Sekhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hii
reward points if useful
regards
Jaipal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Here is the step by step procedure
http://sap.niraj.tripod.com/id67.html
Procedure:
1. Create a new smartform
Transaction code SMARTFORMS
Create new smartforms call ZTEST
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. To define the 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.
Collect all the table data in your program, and pass once to SMARTFORMS
In 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
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 = 'ZTEST'
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.
for Smartforms material
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.