my sal calc smart forms
TRANSCRIPT
-
8/8/2019 My Sal Calc Smart Forms
1/22
http://www.doc2pdf.net/
This smart form can be used to calculate salary with range of employee numbers.
Step 1:
In se11 create a table just like mentioned below.
Create a table like this..
21/12/2010
http://www.doc2pdf.net/mailto:[email protected]://www.doc2pdf.net/mailto:[email protected] -
8/8/2019 My Sal Calc Smart Forms
2/22
Step 2:
Click on currency quantity fields and mention reference table and reference fields.
Step 3: this is the contents of the table after entries.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
3/22
Make sure entries are like this
Step 4: In se11 create the structure selecting datatypes radiobutton just like
below.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
4/22
Step 5: goto transaction smartforms:
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
5/22
Create smartforms and insert in page logo of your choice.
Then create table and divide the line according to how many fields you are calling in
the output screen.
Here we have divided the first line in to 3 colums.
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.
Just right clicl on the line1 and insert line underneth.
Left sub tree structure in smartforms shd look like this.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
6/22
Step 6: Double click on table and give the looping condition
Loop at itab into wa
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
7/22
Ctrl+shift+f4 you will get the list of fields available after the declaration.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
8/22
Just drag and drop each field you want from workarea declared in global interface.
Step 7: Double click on form interface and in tables tab mention the following.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
9/22
Note: ZSELOPT is the structure created for select options in data dictionary.
In form interface enter this.
Step 8: double click on global definitions.
In global data specify internal table and work area refering to the structure.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
10/22
In global interface goto global data and enter this.
Step 9: In the types tab create types_table as mentioned below.
Note: we are referring the fields of the table.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
11/22
Enter this in types tab.
Step 10: In initialization write a select query and give input output parameters like
this.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
12/22
Initialize the smartform.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
13/22
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.
Now Specify the following calculation in the code.
Code for calculation.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
14/22
Step 12: Now create a text after the code and drag and drop the fields to be
displayed after calculation.
Text to get the total.
Now we are done with the smartform which genertates salary slip. Save and
activate. And execute the smart form.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
15/22
You get a function madule generated for smartform note the function module and
again click on execute button.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
16/22
In this screen double click on the button 0entries corresponding to PID.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
17/22
You get this screen where you have to specify the range .
I = INTEGER.
BT = BETWEEN.
LOW =LEFT VALUE.
HIGH = RIGHT VALUE.
Note: the values you give should be the same order of the contents in the table.
(not 100, 00000000100)
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
18/22
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.
The complete code for salary:
WA-EARNINGS = WA-BASIC + WA-LA + WA-TA + WA-DA + WA-HRA .
WA-DEDUCTION = WA-PT + WA-LOP + WA-IT +WA-TDS.
WA-NET = WA-EARNINGS WA-DEDUCTION.
LA = LUNCH ALLOWANCE.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
19/22
TA = TRAVEL ALLOWANCE.
DA = DEARNESS ALLOWANCE.
HRA = HOUSE RENT ALLOWANCE.
PT = PROFESSIONAL TAX.
LOP = LOSS OF PAY.
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.
Driver program to run smartform
*&---------------------------------------------------------------------*
*& Report ZSMART
*&
*&---------------------------------------------------------------------*
*&
*&*&---------------------------------------------------------------------*
REPORT ZSMART.
tables: ZEMP_EXP_DETAILS.
select-options: PID for ZEMP_EXP_DETAILS-empid.
data: fm_name type rs38l_fnam.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
20/22
start-of-selection.
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-MSGTYNUMBER SY-MSGNO
* WITHSY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Entries should match the order of the data entered in the database.
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
21/22
21/12/2010
mailto:[email protected]:[email protected] -
8/8/2019 My Sal Calc Smart Forms
22/22
Output from the driver program.
mailto:[email protected]:[email protected]