SMARTFORMS INVOICE PROCEDURE 1. Create 5 windows main window (default) --> items 4 secondary windows a) window 1 --> customer b) window 2 --> header c) window 3 --> logo d) window 4 --> footer
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 1/16
SMARTFORMS INVOICE PROCEDURE
1. Create 5 windows
main window (default) --> items
4 secondary windows
a) window 1 --> customer
b) window 2 --> header
c) window 3 --> logo
d) window 4 --> footer
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 2/16
2. eclare the re!uired "arameters for smartform
form interface #-
im"ort #-
i$%na1 ty"e &my%na1
i$'ba% ty"e &my'ba%
tables #-
t$'ba" li%e &my'ba" (structure)
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 3/16
3. dust the windows accordingly in the form "ainter
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 4/16
4. *"load the logo using se+, and create gra"hics obect as "art oflogo window.
ro'ide the name of the logo
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 5/16
5. s "art of customer window create te/t element and "ro'ide thefollowing
customer no # 0i$%na1-%unnr0
country # 0i$%na1-land10
name # 0i$%na1-name10
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 6/16
. s "art of header window create te/t element and "ro'ide thefollowing
sales doc # 0i$'ba%-'beln0
date # 0i$'ba%-erdat0
time # 0i$'ba%-er&et0
"erson # 0i$'ba%-ernam0
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 7/16
+. s "art of footer window create te/t element and "ro'ide thefollowing
"age 0sfsy-"age0 of 0sfsy-form"ages0
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 8/16
,. s "art of items window (main window) create table obect
ote#- able obect creates header main areafooter sections
a) dene 2 table lines (67 tab)
t table le'el by default sa" "ro'ides line ty"e(8lty"e1) rename thisto meaningful name(linety"e1)
draw 4 cells as "art of linety"e1
9ight clic% on linety"e1 create em"tyline underneath sa" "ro'ides line ty"erename it to linety"e2
linety"e1 --> 4 cells linety"e2 --> 1 cell
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 9/16
b) "ro'ide the internal table for the table obect
note # declare a wor% area as "art of global denitions :global data:tab
gs$'ba" ty"e &my'ba"
:: tab in tables obect#-
internal table
gt$'ba" into gs$'ba"
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 10/16
c) t the table le'el create the table line as "art of header
table line --> linety"e1
; creates 4 cells based on linety"e1
Create te/t element as "art of each cell and "ro'ide some staticte/t
cell 1 --> te/t element --> sales doc
cell 2 --> te/t element --> item no
cell 3 --> te/t element --> material
cell 4 --> te/t element --> net 'alue
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 11/16
d) t the table le'el create the table line as "art of main area
table line --> linety"e1
; creates 4 cells based on linety"e1
Create te/t element as "art of each cell and "ro'ide the symbolelds a""ro"riately
cell 5 --> te/t element --> 0ls$'ba"-'beln0
cell --> te/t element --> 0ls$'ba"-"osnr0
cell + --> te/t element --> 0ls$'ba"-matnr0
cell , --> te/t element --> 0ls$'ba"-netwr0
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 12/16
e) eclare a 'ariable :l'$total: ty"e 'ba"-netwr as "art of globaldeclarations :global data: tab
ote# ;"ecify 'ariable :g'$total: as "art of initiali&ation in the out"ut"arameter so that :warning: :g'$total has no dened 'alue: is
su""ressed.
f) s"ecify the calcuation as "art of table le'el
calculation tab at table obect le'el#-
o"eration eldname target eldname time
total ls$'ba"-netwr l'$total after loo"
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 13/16
g) t the table le'el create the table line as "art of footerarea
table line --> linety"e2
; creates 1 cell based on linety"e2
Create te/t element as "art of the cell and "ro'ide the symbolelds a""ro"riately
cell < --> te/t element -->otal 'alue is # 0l'$total0
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 14/16
ote#- s "art of the wor% area :ls$'ba": we are referring to the eld:netwr: which is a currency eld. ecause of this eld whenwe e/ecute the smartform from dri'er "rogram it leads to abort error. =e
can a'oid this by declaring a 'ariable of ty"e :'ba"-waer%:which is currency %ey eld (cu%y). s "art of currency!uantity elds tabrefer the eld :ls$'ba"-netwr: to the additional 'ariable.
global denitions :global data: tab#
l'$waer% ty"e 'ba"-waer%
currency!uantity elds#
eldname reference eld
ls$'ba"-netwr l'$waer%
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 15/16
<. Create the dri'er "rogram for calling the smartform(?<@;AB9@+$C66)
REPORT Z9AMSFORM7_CALL.
types : begin of ty_kna. in!"#$e type %&ykna.types en$ of ty_kna.
$ata "s_kna type ty_kna.
types : begin of ty_'bak. in!"#$e type %&y'bak.types en$ of ty_'bak.
$ata "s_'bak type ty_'bak.
types : begin of ty_'bap. in!"#$e type %&y'bap.types en$ of ty_'bap.
$ata "t_'bap type tab"e of ty_'bap.
pa(a&ete(s p_k#nn( type kna)k#nn(.
sta(t)of)se"e!tion.
pe(fo(& get!#sto&e($ata.
fo(& *ETC+STOMER,ATA .se"e!t sing"e k#nn( "an$ na&e f(o& kna into "s_kna
-e(e k#nn( / p_k#nn(. if sy)s#b(! e0 1. pe(fo(& getigest'a"#esa"eso($e(. -(ite 2i2. e"se. &essage 23o !#sto&e( $ata2 type 242.
en$if.en$fo(&. " GETCUSTOMERDATA
fo(& *ET54*5EST6AL+ESALESOR,ER . se"e!t sing"e 'be"n e($at e(%et e(na& f(o& 'bak into "s_'bak -e(e net-( / se"e!t &a8 net-( f(o& 'bak -e(e k#nn( / p_k#nn( an$ k#nn( / p_k#nn(. if sy)s#b(! e0 1.
7/25/2019 Smartforms Invoice Procedure
http://slidepdf.com/reader/full/smartforms-invoice-procedure 16/16
pe(fo(& getsa"esite&s. e"se. &essage 23o Sa"es $ata2 type 242. en$if.en$fo(&. " GETHIGHESTVALUESALESORDER
fo(& *ETSALES4TEMS . se"e!t 'be"n posn( &atn( net-( f(o& 'bap into tab"e "t_'bap -e(e 'be"n / "s_'bak)'be"n. if sy)s#b(! e0 1. pe(fo(& !a""s&a(tfo(&. e"se. &essage 23o sa"es ite&s2 type 242. en$if.en$fo(&. " GETSALESITEMS
fo(& CALLSMARTFORM .* get the smartform F.M
$ata "'_fna&e type (s;"_fna&. CALL F+3CT4O3 2SSF_F+3CT4O3_MO,+LE_3AME2 E<PORT43* fo(&na&e / 2Z9AMSFORM72 4MPORT43* FM_3AME / "'_fna&e.
* prepare o!tro parameters to s#$p pr$!t %$aog &o'
$ata "s_!t(" type SSFCTRLOP."s_!t(")no_$ia"og / 2<2.
"s_!t(")p(e'ie- / 2<2.
* a smartform F.M
!a"" f#n!tion "'_fna&ee8po(ting CO3TROL_PARAMETERS / "s_!t(" i_kna / "s_kna i_'bak / "s_'baktab"es t_'bap / "t_'bap=>.en$fo(&. " CALLSMARTFORM