Professional Documents
Culture Documents
My Sal Calc Smart Forms
My Sal Calc Smart Forms
net/
This smart form can be used to calculate salary with range of employee numbers.
Step 1:
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 2:
Click on currency quantity fields and mention reference table and reference fields.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 3: this is the contents of the table after entries.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 4: In se11 create the structure selecting datatypes radiobutton just like below.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 5: goto transaction smartforms:
Then create table and divide the line according to how many fields you are calling in the output screen.
Step 6: right click on the header and create table line and specify the line type1.
For the main also create table line and give line type which is given to the header.
Hence we get 3 colums for header as well as for the main area.
For each cell in the header give the heading of the fields.
Now create line type 2 with single cell which will be used to display the calculations.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Left sub tree structure in smartforms shd look like this.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Loop at itab into wa
Amrutha_prabhu2000@yahoo.com 21/12/2010
Ctrl+shift+f4 you will get the list of fields available after the declaration.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Just drag and drop each field you want from workarea declared in global interface.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 7: Double click on form interface and in tables tab mention the following.
Note: ZSELOPT is the structure created for select options in data dictionary.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 8: double click on global definitions.
In global data specify internal table and work area refering to the structure.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 9: In the types tab create types_table as mentioned below.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 10: In initialization write a select query and give input output parameters like this.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 11: In the main area create one more table line and assingn it to line type line2. As a result you will
get a single cell, here create a program line by right clicking on the cell.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Step 12: Now create a text after the code and drag and drop the fields to be displayed after calculation.
Now we are done with the smartform which genertates salary slip. Save and activate. And execute the
smart form.
Amrutha_prabhu2000@yahoo.com 21/12/2010
You get a function madule generated for smartform note the function module and again click on
execute button.
Amrutha_prabhu2000@yahoo.com 21/12/2010
In this screen double click on the button 0entries corresponding to PID.
Amrutha_prabhu2000@yahoo.com 21/12/2010
You get this screen where you have to specify the range .
I = INTEGER.
BT = BETWEEN.
Note: the values you give should be the same order of the contents in the table. (not 100, 00000000100)
Amrutha_prabhu2000@yahoo.com 21/12/2010
Smartforms output.
Other calculations for salary include so many other fields in the table, this
was just an example.Here you can say wa-earnings,wa-deduction and wa-net as
output fields and the rest as input firlds.
LA = LUNCH ALLOWANCE.
TA = TRAVEL ALLOWANCE.
Amrutha_prabhu2000@yahoo.com 21/12/2010
DA = DEARNESS ALLOWANCE.
PT = PROFESSIONAL TAX.
IT = INCOME TAX.
ALL THE WORK AREA FIELDS MENTIONED SHOULD BE CREATED UNDER CURRENCY FIELD IN
THE SAME WAY AS OTHER FIELDS IN THE TABLE.
*&---------------------------------------------------------------------*
*& Report ZSMART
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSMART.
tables: ZEMP_EXP_DETAILS.
select-options: PID for ZEMP_EXP_DETAILS-empid.
data: fm_name type rs38l_fnam.
start-of-selection.
Amrutha_prabhu2000@yahoo.com 21/12/2010
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSMART_CALCULATIONS'
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2.
CALL FUNCTION '/1BCDWB/SF00000428'
* 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
PID = PID
* 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.
Entries should match the order of the data entered in the database.
Amrutha_prabhu2000@yahoo.com 21/12/2010
Amrutha_prabhu2000@yahoo.com 21/12/2010
Output from the driver program.
Amrutha_prabhu2000@yahoo.com 21/12/2010