cancel
Showing results for 
Search instead for 
Did you mean: 

smart form

Former Member
0 Kudos

can sombody tell me how to make table in smart form.

i want to basicaly sagrigate the wage types in 2 diffrent group ie earning and deductions. the two group of wage types are already know for a person and they are to be shown on the smart form in 2 diffrent places. then after that there total is to be shown at the end. how to do it?

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

Hi Madhvi,

Here is the sample example with steps for creting table in smartforms.

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

Regards,

Sairam

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Madhvi

to my understanding u need to show this way.

<b>Earnings</b> <b>Deductions</b>

Basic salary Absences

Travel Allowances Tax

Bonus

Total XXXX Total XXXX

If this is so then take two templates,and place them side by side .

and in each template define a line of 2 cells and give line form 1 to 5 depending upon the no of allowances u have.

Hope this helps you solve ur query.

Regards

Zarina

Former Member
0 Kudos

hi

are u asking about internal table in smartform? Then this material can help

http://help.sap.com/saphelp_47x200/helpdata/en/fa/0c1453d30111d3b568006094192fe3/content.htm

http://help.sap.com/saphelp_47x200/helpdata/en/fa/0c1444d30111d3b568006094192fe3/frameset.htm

for populating data.. check this sample code....

REPORT ZSMART_PROG1 .

TABLES: KNA1,KNB1.

DATA: BEGIN OF IT_KNA1 OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

BUKRS LIKE KNB1-BUKRS,

NAME1 LIKE KNA1-NAME1,

REGIO LIKE KNA1-REGIO,

LAND1 LIKE KNA1-LAND1,

END OF IT_KNA1.

DATA: V_FNAME TYPE RS38L_FNAM.

selection-screen:begin of block blk1 with frame title text-001.

select-options:s_KUNNR for KNA1-KUNNR.

selection-screen:end of block blk1.

SELECT A~kunNR

B~BUKRS

A~NAME1

A~REGIO

A~LAND1

FROM KNA1 AS A

INNER JOIN KNB1 AS B ON AKUNNR = BKUNNR

INTO TABLE IT_KNA1

WHERE A~KUNNR IN S_KUNNR.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZP_SMARTFORM1'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = V_FNAME

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

CALL FUNCTION '/1BCDWB/SF00000778'

  • 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

T_KNA1 = IT_KNA1

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

regards

dinesh