You are on page 1of 512

Tutorials on SAP-ABAP Dictionary

Creating a Transparent Table Creating a structure in ABAP Dictionary Creating Search helps (Elementary and collective Creating a secondary index !or"ing #ith table maintenance generator Creation o$ a %ogical Database Creation o$ a &ie# cluster 'o# level loc"ing o$ database tables Creation o$ a table pool and pooled table

Reports
PD( &ie#er Convert internal table data into )T*% #ith out using (unction *odules Convert internal table data into )T*% using (unction *odules Adding custom context menu in classical list Dynamic Selection Screen (Drop do#ns+ pushbuttons+ radio buttons+ icons Creating Dynamic variant using table T&A'& Display images (li"e company logo on the selection,screen Custom Parameter,id Creation Creating Dynamic Patterns Scheduling a bac"ground -ob by triggering an event Per$ormance Tuning using Parallel Cursor Creating a Transaction &ariant E,mailing the bac"ground -obs ABAP Programming standards ABAP Per$ormance Tuning Chec"list .nderstanding S/% Trace Changing the text 0Sales 1rder0 to 0Billing 'e2uest0 in the transactions &A34+ &A35 and &A36 Creation o$ a #eb service in SAP Calling a #eb service in ABAP that validates an email id )andling $avorites in ABAP !or"bench 7mplementing events in Table *aintenance .sing Sorted table and 7ndex #hile processing internal tables Displaying 8raphics using ABAP Program The (eatures o$ ABAPT* 9e# Editor , Part 5 The (eatures o$ ABAPT* 9e# Editor , Part 4 !or"ing #ith *enu Painter Dynamic &ariant in a report Creating (4 helps #ith ease 1b-ect oriented programming (11P explained #ith an example Calling an '(C $unction module $rom one system to another .pdating *aterial *aster long text (BAS7C DATA TE:T+ 79SPECT719 TE:T and 79TE'9A% C1**E9T System debugging , Explained in detail *ESSA8E :::: 'A7S798 ::::; !hat is this<

Di$$erences bet#een %S*! and BDC ABAP Per$ormance Standards Create = *odi$y = Delete records in any table $rom CS& $ile Do#nload data $rom tables #ith user de$ined delimiters Creation o$ a 9umber 'ange 1b-ect Creation o$ a Dynamic 7nternal table )' 7n$otype Creation A real,time example on sending PD( $ile as an email (Complete program Developing a simple interactive report Demo on 7nteractive reporting (1ne more example Do#nloading $ile on to the application server Creating a (unction *odule Creating a dynamic selection screen on a report Displaying 6D 8raphs in ABAP Creating a Tabstrip on the selection screen Dynamic SE%ECT statement Do#nloading report output into Excel using 1%E .nderstanding ABAP .nit .nderstanding 0Chec"point 8roup0 .nderstanding 0Coverage Analy>er0 (TP $ile trans$er in Bac"ground Converting an :*% $ile #ith many hierarchy levels to ABAP $ormat Table Control using #i>ard Splitter Controls and 8raphs Text Edit Control .sage and Example Displaying images on the screen !or"ing #ith Screen Painter Demo on Tabstrips !or"ing #ith Chec"box Demo using Table Control Display %ogo on Screen

Dialog Programming

BDC Programming

)o# to do BDC #ithout #riting BDC Program Creating a simple database table using BDC BDC recording $rom testing client to development client

Creation of Transparent Table

4; Enter the table name and press Create

5; Enter the description, Delivery class and check on table maintenance allowed. Then click on the tab
Fields.

6; Enter the ZCHAR in ields tab and ZCHAR!DE in ield type tab.

?; Do"ble click on ZCHAR!DE. Then it will ask or #ave. $ress %&E#'.

@; #ave it as a local ob(ect on pressin) *ocal ob(ect b"tton

+. ,ow it will ask or the creation o the data element. $ress &es.

-. Click on the Field label tab and enter the len)ths and descriptions accordin)ly.

.. Then press De inition tab and enter the domain.

/. Do"ble click on that 0char!d to create domain, then it will ask or save be ore )oin) ne1t screen. $ress &es.

43; #ave it as a local ob(ect.

22. ,ow it will ask or domain creation. $ress &es.

23. 4ive short description or that domain which yo" are creatin). And mention the data type in data type ield and len)th in no. characters ield an press E,TER.

25. Then press Ctrl6F5. 7t will ask or save be ore activation. #ave it as a local 8b(ect.

4?; $ress Enter.

4@; Then the ollowin) screen appears. $ress on back b"tton.

4A; $ress Ctrl6F5. &o" will )et the ollowin) screen. $ress 9ack b"tton.

2-. &o" will )et the ollowin) screen.

2.. Create one more ield Z,:; and )ive data element name as Z,:;!DE. And do"ble click on %Z,:;!DE<

2/. #ave it by pressin) &es.

53; ,ow it will ask or the data element creation. $ress &es.

32. 4ive short description o the data element. And )ive the len)ths and ield labels accordin)ly in Field label tab.

33. $ress on De inition tab and )ive the domain name in Domain ield. Do"ble click on Z,:;!D.

56; 7t will ask or save. $ress &es.

3=. #ave it as a local 8b(ect.

5@; ,ow it asks or Domain creation. $ress &es.

3+. 4ive short description in short te1t ield. Enter the data type and no. characters, $ress Enter. Then $ress on Activate b"tton or $ress Ctrl6F5.

3-. #ave this as a local ob(ect.

3.. $ress enter.

5B; ,ow yo" will )et the ollowin) screen. $ress 9ack b"tton.

63; Activate the data element 9y pressin) Activate b"tton or $ressin) Ctrl6F5.

52. $ress enter.

65; $ress 9ack b"tton.

55. ,ow we created two ields. And Data elements and Domain or these two ields. ,ow we have to maintain the technical settin)s. $ress on Technical settin)s b"tton.

5=. 4ive the data class and si0e cate)ory o the table as per the re>"irement. And press the back b"tton.

6@; ,ow

activate

the

table

by

pressin)

the

activate

b"tton

or

CTR*6F5.

5+. $ress enter.

5-. ,ow yo" will )et the ollowin) screen.

6C; ,ow enter the data into table. 4o to :tilities Table contents Create Entries.

5/. ,ow enter the data in the ields and #ave it.

?3; &o" will )et the ollowin) screen a ter clickin) the Reset 9"tton.

=2. Enter the data or the second entry into the table. =3. #ave it and press reset.

=5. &o" will )et the ollowin) screen.

==. =?.

A)ain enter the data or the third entry. $ress save, Reset @8ptionalA and 9ack b"tton.

=+.

,ow yo" will )et the ollowin) screen.

?D; To see the table contents )o to :tilities Table contents Display. 8r press Ctrl6#hi t6F2B.

=.. &o" will )et the ollowin) screen.

=/. $ress on r"n b"tton or press F.. ,ow it will display the table contents.

,ow en(oy by creatin) tables on yo"r own.

Creating a Structure in ABAP Dictionary

4o to transaction #E22 and select the radio b"tton CData type'. Enter a str"ct"re name startin) with & or Z.

$ress create b"tton. A popD"p screen appears with 5 di erent options. #elect the radio b"tton str"ct"re.

The screen will be displayed like this.

$rovide the description and also components.

Then press #AEE, CHECF and ACT7EATE. #tr"ct"re Created #"ccess "lly.

Creating Search Helps (Elementary and Secondary)


9y Eikram Chellappa, ;o"ri Tech #ol"tions

4o To #E22 TDcode.

#elect the radio b"tton o search help.

$rovide the search help name. #elect the create b"tton.

#elect E*E;E,TAR& search help.

$ress Enter. $rovide the short description, the selection method. $rovide the ields.

#ave it, Check 7t G Activate it. Then e1ec"te it.

He can see the screen like this, and then press F= in this pa)e.

Then press F= Eiew the o"tp"t like this.

This is the o"tp"t or elementary search help.

The Collective #earch Help is like this.

4oto TDCode #e22. $rovide name. #elect collective search help b"tton. $ress enter.

$rovide the Eal"es

#elect incl"de search help. Then provide search help name, which is already de ine by the same ields.

Then save it, activate it G e1ec"te it.

$ress F= we can see the o"tp"t like this.

Di 9etween Elementary search helps G Collective search helps 2A Elementary search helps describe a search path. The elementary search help m"st de ine where the data o the hit list sho"ld be read rom @selection methodA, how the e1chan)e o

val"es between the screen template and selection method is implemented @inter ace o the search helpA and how the online inp"t help sho"ld be de ined @online behavior o the search helpA. 3A Collective search helps combine several elementary search helps. Collective search help th"s can o er several alternative search paths. 5A An elementary search help de ines the standard low o an inp"t help. =A A collective search help combines several elementary search helps. The "ser can th"s choose one o several alternative search paths with collective search help. ?A A collective search help comprises several elementary search helps. 7t combines all the search paths that are meanin) "l or a ield. +A 9oth elementary search helps and other search helps can be incl"ded in a collective search help. 7 other collective search helps are contained in collective search help, they are e1panded to the level o the elementary search helps when the inp"t help is called.

Creating a secondary inde

There are two types o inde1esI $rimary inde1 and secondary inde1. $rimary inde1 is a"tomatically created "sin) the primary keys de ined.

#econdary inde1 co"ld be created as per the "ser re>"irement. This article disc"sses abo"t creatin) a secondary inde1. 4o to transaction #E22.

For o"r demo p"rpose, we have considered the table ZA:TH8R. To know i there are any secondary inde1es available, click on 4oto 7nde1es

Followin) pop"p appearsI

From the above screenshot, it is evident that there are no secondary inde1es already created. Click on Create Create 7nde1

Enter the name o the inde1.

Fill in the details J #hort description and the ields in the inde1.

#ave and activate. ,ow yo" can observe the inde1 created above in the list nowI

;a1im"m n"mber o secondary inde1es we can have are /. How to make #E*ECT statement to make "se o any partic"lar secondary inde1K

Secondary Indexes
Consider the ollowin) e1ampleI #E*ECT L FR8; #$F*7 M!H7,T# 8RAC*E N7,DEO@P#$F*7P P#$F*7QBB2PAN ....... E,D#E*ECT. 7n the above e1ample, BB2 is the secondary inde1 o the table #$F*7. 7tNs a wellDknown act that the e icient way o retrievin) data rom the database tables is by "sin) secondary inde1es. ;any database vendors provide the optimi0er hints or the same. From #A$R v=.?, optimi0er hints can be provided by the M!H7,T# parameter. This is dependent on the database systems that s"pport optimi0er hints. The point to be noted here is these optimi0er hints are not standardi0ed by the #S* standards. Each database vendor is ree to provide the optimi0er hints. ,ow to know which inde1 to "se or o"r tableI 2. 4o to #E22 and there speci y the table name 3. ,ow rom the men", )oto DDT inde1es 5. select the re>"ired inde1. ,ow s"ppose that the identi ier BB2 represents a nonD"ni>"e secondary inde1 comprisin) o the col"mns C7T&FR8; and C7T&T8. The inde1 name sho"ld be de ined asI UtablenameTQU7nde1 7denti ierT like #$F*7QBB2 in the above e1ample. The se>"ence o ields in the HHERE condition is o no relevance in "sin) this optimi0ers inde1. 7 yo" speci y hints incorrectly, A9A$T; i)nores them b"t doesnNt ret"rn a synta1 error or r"ntime error. The code was written in RV5 =.+C. Code Consider the ollowin) e1ampleI RE$8RT #"resh!test. TA9*E#I sp li. DATA I t!sp li *7FE sp li 8CC:R# B H7TH HEADER *7,E. #E*ECT L FR8; sp li 7,T8 TA9*E t!sp li M!H7,T# 8RAC*E N7,DEO@P#$F*7P P#$F*7QBB2PAN. *88$ AT t!sp li. HR7TE IV t!sp li. E,D*88$.

!or"ing #ith Table $aintenance %enerator

4o to #E22 and enter the Z table name or which the table maintenance )enerator has to be )enerated. Click on Chan)e.

Click on :tilities Table ;aintenance 4enerator

Enter A"thori0ation )ro"p @For e.). G,CGA F"nction )ro"p @)o to #E.B or creatin) "nction )ro"pA &o" can select either one step or two step. Assi)n #creen n"mbers @To assi)n #creen n"mbers click on the b"tton NFind #cr noN. 7t will propose screen noNsA Then Create. #ave #in)le stepI 8nly overview screen is created i.e. the Table ;aintenance $ro)ram will have only one screen where yo" can add, delete or edit records. Two stepI Two screens namely the overview screen and #in)le screen are created. The "ser can see the key ields in the irst screen and can "rther )o on to edit "rther details. &o" can now create TCode or the table maintenance )enerator. Enter the TCode to be created and click on Create.

Creation of a &ogical Database

4o to transaction N#E36' or N#*D9N.

Enter the lo)ical database name as shown above .

7 we are "sin) *o)ical Database or HR p"rpose, we sho"ld check the check 9o1 C7n o types @HR onlyA. $ress CREATE 9"tton as shown above. 7t wo"ld prompt or packa)e name and workbench re>"est .

8n pressin) #ave b"tton, ollowin) screen appears, promptin) or the details o the root node.

Click on create b"tton. Followin) screen appearsI

,ow enter the details o all the tables "nder *FA2 @as shown belowA.

Click on create 9"tton.

Click on create 9"tton.

,ow create a ,ode with hierarchically "nder *F92.

The above screen displays the *D9 str"ct"re as per o"r re>"irements. He can maintain search help or the ields or the tables de ined in str"ct"re.

#elect CTransaction with parameters @$arameter transactionA'

Click on save. ,ow yo" can create the table entries thro")h the transaction created above. For o"r demo p"rposes, let "s provide search help or ;AT,R and HERF#.

*et "s "se the standard search help available or ;AT,R and HERF#.

The c"rrency and >"antity ields are a"tomatically maintained here.

4o back to the main screen

Here we can desi)n o"r own selection screen as per the re>"irements.

A"tomatically created incl"de with namin) convention.

Here by "sin) above marked statement we can create Dynamic selection screen or di erent tables as per the re>"irements.

Creation of a &ogical Database


...Previous

Database pro)ram @with some incl"desA are a"tomatically created "pon the creation o lo)ical databaseI

4o back to the main screen.

Here we can maintain te1ts or selectDoptions and parameters.

,avi)ate to the main screenI

Here we can maintain doc"mentation or o"r created Z lo)ical database.

Click on Display.

Creation of a 'ie# cluster


9y T.,.#wapna

View Cluster A view cl"ster is the set o ob(ects, s"ch as views, reports or tables, which belon) to one b"siness "nction. The data can be arran)ed either hierarchically or nonDhierarchically in view cl"ster. A viewDcl"ster transaction edits the comple1 crossDtable data in a view cl"ster. The transaction navi)ation bo1 shows the comple1 b"siness ob(ect with its components or s"b ob(ects. Example: *et "s create a Eiew Cl"ster on ;aterial Details. The view cl"ster wo"ld incl"de three tables namely, ;ARA, ;ARC and ;ARD. He need to create maintenance views or each o these tables. Maintenance view for a!le M"#" To create maintenance view or the table ;ARA ollow the proced"re below. 4o to transaction #E22. 4ive a view name say Z;;!E!;ARA and click on %Create<. 4ive a short description, enter the table name as ;ARA and click on the tab Eiew ields.

9y de a"lt all the key ields wo"ld be added. He can add more ields by clickin) on the b"tton Table ields.

,ow #ave and activate the view. Maintenance view for a!le M"#C Follow the same proced"re as above. 7n the Tab Eiew ields, )ive %#< in the col"mn %$< or the ields ;A,DT and ;AT,R as shown in the screen shot belowI

This is beca"se the ields ;A,DT and ;AT,R wo"ld be illed in the view or ;ARA and th"s they act as s"bsets and appear as header data when we create entries in view cl"ster. Maintenance view for a!le M"#$ Follow the same proced"re as above. 7n the Tab Eiew ields, )ive %#< in the col"mn %$< or the ields ;A,DT, ;AT,R and HERF# as shown in the screen shot belowI

This is beca"se the ields ;A,DT, ;AT,R and HERF# wo"ld be illed in the view or ;ARC and th"s they act as s"bsets and appear as header data when we create entries in view cl"ster. a!le Maintenance %enerator for &MM'V'M"#" ,ow, or each view we need to create a table maintenance )enerator, which has to be done as ollowsI

The table maintenance screen appears. Here )ive the details as in the screen shot below. This table maintenance is or the view Z;;!E! ;ARA.

9e ore creatin) a table maintenance )enerator, create a "nction )ro"p say ZF4!;ATER7A* rom the transaction #E.B. A ter the "nction )ro"p is s"ccess "lly created, enter the "nction )ro"p name as shown

in the screen shot. Also select ;aintenance type as %8ne #tep< and )ive the ;aintenance #creen no. as %2< in the 8verview screen and click on the b"tton %Create<. #imilarly, create the Table maintenance 4enerators or the views Z;;!E!;ARC and Z;;!E!;ARD. The screen shots or these views wo"ld be as ollowsI a!le Maintenance %enerators for &MM'V'M"#C and &MM'V'M"#$

,ote that the 8verview screen n"mbers wo"ld chan)e or each view. 7t wo"ld be %3< or the view Z;;!E!;ARC and it wo"ld be %5< or the view Z;;!E!;ARD. Creatin( view cluster The preDre>"isites or creatin) the Eiew Cl"ster are now ready. 4o to transaction #E?= and select the b"tton %Edit Eiew Cl"ster<. Enter the view cl"ster name as say %Z;;!EC!;ATER7A*< and click on %Create<.

An in ormation messa)e wo"ld pop "p sayin)

Contin"e by pressin) %Enter<. The ollowin) screen appears. 4ive a short description and click on %8b(ect #tr"ct"re< as shown in the screen shot belowI

8n Clickin) the %8b(ect #tr"ct"re< the ollowin) screen appears. #elect the %,ew Entries< b"tton to enter the maintenance views created to orm a cl"ster.

Enter the val"es as shown belowI

The entries wo"ld be entered in a hierarchical manner. The short te1t is the description o the view. The %$redecess< col"mn speci ies the predecessor o that view. #o in this case, the predecessor o Z;;!E!;ARA is Z;;!E!;ARA itsel . The predecessor o Z;;!E!;ARC is Z;;!E!;ARA and the predecessor o Z;;!E!;ARD is Z;;!E!;ARC. The %DE$< col"mn e1plains whether the entry is a Header entry or a Dependent entry. 7t is %R< or the view Z;;!E!;ARA, beca"se it is a header entry and does not depend on any other view. Hhereas, it is %#< or Z;;!E!;ARC and Z;;!E!;ARD, beca"se Z;;!E!;ARC is dependent on Z;;!E!;ARA and Z;;!E!;ARD is dependent on Z;;!E!;ARC. The col"mn %$8#< speci ies the se>"ence o the views. 7n the col"mn %#tart< select the radio b"tton a)ainst the entry or Z;;!E!;ARA as it comes irst in the hierarchy. A ter enterin) the above entries, press %Enter<. Three popD"ps or each view wo"ld appear as shown below. $roceed "rther by clickin) on %Enter< key.

,ow select each line and click on %FieldDdependence< b"tton. A popD"p appears sayin) %Field dependencies s"ccess "lly )enerated<.

4enerate the ield dependence or the views Z;;!E!;ARC and Z;;!E!;ARD in the same way. ,ow, save the entries and )o back to %Header Entry< older. Activate the view cl"ster. A popD"p appears as shown below. Click on %&es<.

The view cl"ster is now created s"ccess "lly. )ote: 2. The view cl"ster can be created on the tables whose data has to be stored in a hierarchical manner. 8ne has to check whether proper orei)n key relationships are maintained between the tables appearin) in the cl"ster. #ometimes while )eneratin) the FieldDdependencies, errors may occ"r i the orei)n keys are not maintained properly.

3.

estin( the View Cluster From the initial screen o the transaction %#E?=< )ive the view cl"ster name and click on %Test<.

#ince we have created the view cl"ster on standard tables ;ARA, ;ARC and ;ARD we observe that all the e1istin) entries wo"ld appear. The screen shot below shows all the e1istin) entries o the table ;ARA. 7n order to see the correspondin) $lant details or the material, ("st select an entry and do"ble click on $lant details as shown below.

The plant details wo"ld appear. 7n the same way or the correspondin) stora)e location details, select an entry and do"ble click on #tora)e details as shown below.

7n the above screen shot the material selected in the ;aterial details view wo"ld appear as a header entry. The stora)e location details are as ollowsI

7n the above screen shot the material selected in the ;aterial details view and the plant selected in the $lant details view wo"ld appear as header entry.

(o# le)el loc"ing of database table


9y #wetabh #h"kla, 7n osys Technolo)ies ,ormally i a person opens table maintenance )enerator and tries to maintain the table, no one else can maintain the same table at the same time. This is beca"se o table level lock by de a"lt in #A$. 8nly one "ser can maintain any table at a time thro")h #;5B or any transaction that calls table maintenance )enerator. 7n the t"torial below we will see how to remove table level lock and apply row level lock. This way any n"mber o "sers can modi y the table at same time. 9"t any partic"lar row can be modi ied by only one "ser at a time. He will create a transaction or this p"rpose. The transaction will call o"r c"stom report. This c"stom report will call the table maintenance )enerator o the table a ter deletin) table level lock.

7n c"rrent e1ample let<s create ollowin)I ReportI ZRE$!#H:F#5 TransactionI ZTE#T!#H:F#5 TableI ZTE#T!#H:F#5 with table maintenance )enerator. :sin) transaction ZTE#T!#H:F#5 we will delete the table level lock and p"t row level lock so that m"ltiple "sers can maintain table at same time. Rows locked by one "ser will not be editable by other "ser. 2. Create table ZTE#T!#H:F#5.

3.

Create table maintenance )enerator or the table.

He will make sin)le screen maintenance or this table. #ave it. #o inally we have table maintenance code a"tomatically )enerated in "nction )ro"p ZTE#T!#H:F#5. 5. Create lock ob(ect E&T##!E=55#H in #E22. 4ive it name as EZTE#T!#H:F#5.

,ow save and activate the *ock ob(ect. #A$ creates two "nction mod"les correspondin) to lock ob(ect or en>"e"e and de>"e"e o the table.

=.

,ow create a report ZRE$!#H:F#5 and transaction code ZTE#T!#H:F#5 to call this report. This tcode will call table maintenance )enerator o table ZTE#T!#H:F#5 .

?.

,ormally i a person opens table maintenance )enerator and tries to maintain the table, no one else can maintain table at the same time. This is beca"se o table level lock by de a"lt in #A$. 8nly one "ser can maintain any table at a time. 7n report ZRE$!#H:F#5 we will delete the table level lock and p"t row level lock so that m"ltiple "sers can maintain table at same time. Rows locked by one "ser will not be editable by other "ser. Check the report and comments )iven below.

LGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL LG Report ZRE$!#H:F#5 LG LGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD LG A"thor I #wetabh #h"kla LG Date I B?V33V3BB/ LG Description I To delete table level lock rom table. LGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL RE$8RT 0rep!sh"ks5. LL#election ran)e or view maintenance DATAI 9E47, 8F selekttab 8CC:R# 2. P#elektionsbereich 7,C*:DE #TR:CT:RE vimsellist. DATAI E,D 8F selekttab, LLTable o inactive C:A "nctions or view maintenance 9E47, 8F e1cl!c"a! "nct 8CC:R# 2. Pinaktive C:ADFkt bei EiewD$ le)e 7,C*:DE #TR:CT:RE vime1cl "n. DATAI E,D 8F e1cl!c"a! "nct. DATAI lt!en>!del T&$E #TA,DARD TA9*E 8F se>)5, lt!en>!read T&$E #TA,DARD TA9*E 8F se>)-, lw!en>!read T&$E se>)-, lw!en>!del T&$E se>)5, lv!s"brc T&$E syDs"brc. LRead all the lock details in system CA** F:,CT78, NE,S:E!READ3N EO$8RT7,4 )client W syDmandt )name W N N )"name W NLN TA9*E# en> W lt!en>!read. LHe will search entry or table level lock or o"r table *88$ AT lt!en>!read 7,T8 lw!en>!read HHERE )name ES NR#TA9*EN A,D )ar) C# NZTE#T!#H:F#5N. ;8EEDC8RRE#$8,D7,4 lw!en>!read T8 lw!en>!del. A$$E,D lw!en>!del T8 lt!en>!del. E,D*88$. LDelete table level lock entry or o"r table CA** F:,CT78, NE,S:E!DE*ETEN EO$8RT7,4 check!"pd!re>"ests W 2 7;$8RT7,4 s"brc W lv!s"brc

TA9*E# en>

W lt!en>!del.

L,ow call the table maintenace )enerator. CA** F:,CT78, NE7EH!;A7,TE,A,CE!CA**N EO$8RT7,4 action W N:N view!name W NZTE#T!#H:F#5N show!selection!pop"p W NON TA9*E# dba!sellist W selekttab e1cl!c"a! "nct W e1cl!c"a! "nct. +. X"st one more chan)e in table maintenance screen. ,ow open table maintenance "nction )ro"p@ZTE#T!#H:F#5A in #E.B.He know or table maintenance #A$ a"tomatically creates code in the "nction )ro"p. ,ow we will make some modi ication in that e1istin) code to chan)e the behavior. 8pen the screen yo" created thro")h table maintenance and add one mod"le.

8pen the screen BBB2 and add one mod"le in $98 o the screen as shown in i)"re below.

Check the code below to be added in the mod"le m!chan)e!lockin). ;8D:*E m!chan)e!lockin) 8:T$:T. LCall the "nction mod"le correspondin) to the lock ob(ect we created CA** F:,CT78, NE,S:E:E!EZTE#T!#H:F#5N EO$8RT7,4 matnr W 0test!sh"ks5Dmatnr werks W 0test!sh"ks5Dwerks EOCE$T78,# orei)n!lock W 2 system! ail"re W 3 8THER# W 5. 7F syDs"brc ,E B. L row is locked..hence )ray.. *88$ AT #CREE,. screenDinp"t W B. ;8D7F& #CREE,. E,D*88$. E,D7F. E,D;8D:*E. P m!chan)e!lockin) 8:T$:T -. ,ow we are ready or testin). Call the transaction once and make some entries in table. 7n below screenshot 7 have entered some random val"es. #ince we have not maintained any check tables etc, so val"es may be invalid. That can be taken care in real scenario.

#ave data. *et<s call two sessions o the transaction ZTE#T!#H:F#5.

Session 1
7n irst session we will call the transaction ZTE#T!#H:F#5 and try to open some e1istin) val"es or table maintenance.

*et<s open an e1istin) val"e material W ;AT2 and $lant W B+-..

#o the entry opens in chan)e mode. ,ow open a second session o the transaction and see. ,ow the same material and plant combination can not be chan)ed by any other "ser or session.

Session 2
8pen transaction ZTE#T!#H:F#5

#o we can see that o"r transaction is able to achieve a row level lockin) and has removed table level lockin).

Creation of a table pool and pool table


9y Firan F"mar Fandakatla, 7ntelli)ro"p

7n this T"torial, we create a Table pool irst and then createV @add a table to Table poolA a $ooled Table. #tep 2I 4o to transaction #E22. 4o to :tilities 8ther Dictionary 8b(ects

#tep 3I #elect Radio b"tton Table poolVCl"ster 4ive table $ool ,ameI ZT9*!$88*. Then press F? or choose Create.

#tep 5I Then #elect Radio b"tton Table $ool. $ress Enter.

#tep =I

Then yo" )o to maintain $oll #creen there )ive #hort Description.

#tep ?I Then )o to Technical settin)s.

#tep +I 7n the C;aintain technical #ettin)s' screen $rovide #i0e cate)ory.

#ave and activate the table $ool. 4o back to #E22. #tep -I

4o to #E22 A9A$ DictionaryI 7nitial #creen. Create a Z table.

#tep .I ;aintain Delivery and ;aintenance attrib"tes or the Z table.

Add ields to the Z table. ;aintain Technical settin)s and Enhancement Cate)ory.

#tep /I Then 4o to E1tras Chan)e table cate)ory

#tep 2BI Choose Table type. 7n o"r E1ample it is $ooled table.

#tep 22I 4o back to Delivery and ;aintenance tab and provide $oolVCl"ster val"e.

He have s"ccess "lly created Table pool and $ooled table.

PD* 'ie#er
9y #ai F"mar 9, Ente)

This $ro)ram helps yo" to view any o"tp"t in $DF viewer as shown below. 7t<s very simple to "nderstand. X"st convert 8FT data into $DF as below. *&---------------------------------------------------------------------* *& Report ZSAP_PDF_VIEWER_DEMO_2 *& *&---------------------------------------------------------------------* REPORT ZSAP_PDF_VIEWER.

DATA: LT_PDF TYPE TABLE OF TLINE LS_PDF LI!E LINE OF LT_PDF LV_"RL TYPE #$AR2%% PDF_FSIZE TYPE I LV_#ONTENT TYPE &STRIN' LT_DATA TYPE STANDARD TABLE OF &2%%. DATA : L_(OB_O"TP"T_INFO TYPE SSF#RES#L. DATA : LS_#ONTROL_PARAM TYPE SSF#TRLOP. DATA : '_$TML_#ONTAINER TYPE REF TO #L_'"I_#"STOM_#ONTAINER '_$TML_#ONTROL TYPE REF TO #L_'"I_$TML_VIEWER. DATA : P_VBELN TYPE VBELN_VL.

FIELD-SYMBOLS )FS_&* TYPE &.

INITIALIZATION. LS_#ONTROL_PARAM-'ETOTF + ,&,. LS_#ONTROL_PARAM-NO_DIALO' + ,&,. START-OF-SELE#TION. #ALL F"N#TION ,-.B#DWB-SF//////01, E&PORTIN' * AR#$IVE_INDE& + * AR#$IVE_INDE&_TAB + * AR#$IVE_PARAMETERS + #ONTROL_PARAMETERS + LS_#ONTROL_PARAM P_VBELN + P_VBELN * MAIL_APPL_OB( + * MAIL_RE#IPIENT + * MAIL_SENDER + * O"TP"T_OPTIONS + * "SER_SETTIN'S + ,&, IMPORTIN' * DO#"MENT_O"TP"T_INFO + L_DO#"MENT_O"TP"T_INFO (OB_O"TP"T_INFO + L_(OB_O"TP"T_INFO * (OB_O"TP"T_OPTIONS + L_(OB_ O"TP"T_OPTIONS E&#EPTIONS FORMATTIN'_ERROR + . INTERNAL_ERROR + 2 SEND_ERROR + 0 "SER_#AN#ELED + 1 OT$ERS + % . IF SY-S"BR# )* /. * MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO * WIT$ SY-MS'V. SY-MS'V2 SY-MS'V0 SY-MS'V1. ENDIF. #ALL F"N#TION ,#ONVERT_OTF, E&PORTIN' FORMAT + IMPORTIN' BIN_FILESIZE + TABLES OTF + LINES + E&#EPTIONS ERR_MA&_LINEWIDT$ + ERR_FORMAT + ERR_#ONV_NOT_POSSIBLE + OT$ERS +

,PDF, PDF_FSIZE L_(OB_O"TP"T_INFO-OTFDATA LT_PDF . 2 0 1.

* 2o34ert p56 to 78tr93: 8tr93: LOOP AT LT_PDF INTO LS_PDF. ASSI'N LS_PDF TO )FS_&* #ASTIN'. #ON#ATENATE LV_#ONTENT )FS_&* INTO LV_#ONTENT IN BYTE MODE. ENDLOOP. #ALL S#REEN .//.

*&---------------------------------------------------------------------* *& Mo5;<e STAT"S_/.// O"TP"T *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* MOD"LE STAT"S_/.// O"TP"T. * SET PF-STAT"S ,77777777,. * SET TITLEBAR ,777,. #REATE OB(E#T '_$TML_#ONTAINER E&PORTIN' #ONTAINER_NAME + ,PDF,. #REATE OB(E#T '_$TML_#ONTROL E&PORTIN' PARENT + '_$TML_#ONTAINER. * #o34ert 78tr93: to =93>r? t>=<e to p>88 to t@e LOAD_DATA Aet@o5 #ALL F"N#TION ,S#MS_&STRIN'_TO_BINARY, E&PORTIN' B"FFER + LV_#ONTENT TABLES BINARY_TAB + LT_DATA. * Lo>5 t@e $TML #ALL MET$OD '_$TML_#ONTROL-*LOAD_DATAB E&PORTIN' TYPE + ,>pp<92>t9o3, S"BTYPE + ,p56, IMPORTIN' ASSI'NED_"RL + LV_"RL #$AN'IN' DATA_TABLE + LT_DATA E&#EPTIONS DP_INVALID_PARAMETER + . DP_ERROR_'ENERAL + 2 #NTL_ERROR + 0 OT$ERS + 1 C. * S@oD 9t #ALL MET$OD '_$TML_#ONTROL-*S$OW_"RLB "RL + LV_"RL IN_PLA#E + ,&, C. ENDMOD"LE. E STAT"S_/.// O"TP"T *&---------------------------------------------------------------------* *& Mo5;<e "SER_#OMMAND_/.// INP"T *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* MOD"LE "SER_#OMMAND_/.// INP"T. ENDMOD"LE. E "SER_#OMMAND_/.// INP"T

Con)ert internal table data into HT$& format #ithout using *unction $odules
9y #"man F"mar Chinnam

The o"tp"t o this T"torial is same as previous one b"t in this we are not "sin) any "nction mod"les to convert internal table data to HT;* table. *&----------------------------------------------------------------* *& Report YTEST_TABLE_$TML. *&

*&----------------------------------------------------------------* REPORT ?te8t_t>=<e_@tA<.. *----------------------------------------------------------------* * D A T A D E # L A R A T I O N *----------------------------------------------------------------* *-$TML T>=<e DATA: t_@tA< TYPE STANDARD TABLE OF D0@tA< WIT$ $EADER LINE E $tA< T>=<e *- De2<>re I3ter3>< t>=<e >35 F9e<52>t><o: 9t_6<9:@t TYPE STANDARD TABLE OF 86<9:@t WIT$ $EADER LINE E F<9:@t8 Det>9<8 9t_62>t TYPE <42_t_62>t WIT$ $EADER LINE. E F9e<52>t><o: *-V>r9>=<e8 DATA: 4_<93e8 TYPE 9 4_69e<5B1/C. *-F9e<58?A=o<8 FIELD-SYMBOLS: )68* TYPE ANY. *----------------------------------------------------------------* * S T A R T - O F - S E L E # T I O N *----------------------------------------------------------------* START-OF-SELE#TION. SELE#T * FROM 86<9:@t INTO TABLE 9t_6<9:@t "P TO 2/ ROWS. *----------------------------------------------------------------* * E N D - O F - S E L E # T I O N *----------------------------------------------------------------* END-OF-SELE#TION. *-F9<< t@e #o<;A3 @e>593:8 >35 Propert9e8 * F9e<5 2>t><o: 98 ;8e5 to pop;<>te t@e $e>593:8 >35 V><;e8 o6 * T@e t>=<e 2e<<8 5?3>A92><<? #ALL F"N#TION ,LV#_FIELD#ATALO'_MER'E, E&PORTIN' 9_8tr;2t;re_3>Ae + ,SFLI'$T, #$AN'IN' 2t_69e<52>t + 9t_62>tFG E&#EPTIONS 932o3898te3t_93ter6>2e + . pro:r>A_error + 2. DELETE 9t_62>t W$ERE 69e<53>Ae + ,MANDT,. t_@tA<-<93e + ,)@tA<*,. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)t@e>5*,. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)tr*,. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)t5*)@.*F<9:@t8 Det>9<8)-@.*)-t5*,. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)-tr*,.

APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)-t@e>5*,. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)t>=<e =or5er + E.E*,. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)tr*,. APPEND t_@tA<. #LEAR t_@tA<. *-Pop;<>te $TML 2o<;A38 6roA F9<e52>t><o: LOOP AT 9t_62>t. #ON#ATENATE ,)t@ =:2o<or + E:ree3E 6:2o<or + E=<>2HE*, 9t_62>t-82rte7t_< ,)-t@*, INTO t_@tA<-<93e. APPEND t_@tA<. #LEAR t_@tA<. ENDLOOP. t_@tA<-<93e + ,)-tr*,. APPEND t_@tA<. #LEAR t_@tA<. DES#RIBE TABLE 9t_62>t LINES 4_<93e8. *-Pop;<>te $TML t>=<e 6roA I3ter3>< t>=<e 5>t> LOOP AT 9t_6<9:@t. t_@tA<-<93e + ,)tr*,. APPEND t_@tA<. #LEAR t_@tA<. *-Pop;<>te e3t9re roD o6 $TML t>=<e D?3>A92><<? *-W9t@ t@e $e<p o6 F9e<52>t><o:. DO 4_<93e8 TIMES. READ TABLE 9t_62>t INDE& 8?-935e7. #ON#ATENATE ,IT_FLI'$T-, 9t_62>t-69e<53>Ae INTO 4_69e<5. ASSI'N B4_69e<5C TO )68*. t_@tA<-<93e + ,)t5*,. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + )68*. APPEND t_@tA<. #LEAR t_@tA<. t_@tA<-<93e + ,)-t5*,. APPEND t_@tA<. #LEAR t_@tA<. #LEAR 4_69e<5. "NASSI'N )68*. ENDDO. t_@tA<-<93e + ,)-tr*,. APPEND t_@tA<. #LEAR t_@tA<. ENDLOOP. t_@tA<-<93e + ,)-t>=<e*,. APPEND t_@tA<. #LEAR t_@tA<. *-DoD3<o>5 t@e $TML 93to 6ro3te35 #ALL F"N#TION ,'"I_DOWNLOAD, E&PORTIN' 69<e3>Ae + ,#:IF<9:@t8.@tA,

TABLES 5>t>_t>= + t_@tA< E&#EPTIONS 69<e_Dr9te_error + . 3o_=>t2@ + 2 :;9_re6;8e_69<etr>386er + 0 934><95_t?pe + 1 3o_>;t@or9t? + % ;3H3oD3_error + J @e>5er_3ot_><<oDe5 + K 8ep>r>tor_3ot_><<oDe5 + L 69<e89Me_3ot_><<oDe5 + N @e>5er_too_<o3: + ./ 5p_error_2re>te + .. 5p_error_8e35 + .2 5p_error_Dr9te + .0 ;3H3oD3_5p_error + .1 >22e88_5e39e5 + .% 5p_o;t_o6_AeAor? + .J 598H_6;<< + .K 5p_t9Aeo;t + .L 69<e_3ot_6o;35 + .N 5>t>pro495er_e72ept9o3 + 2/ 2o3tro<_6<;8@_error + 2. OT$ERS + 22. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF. *-D98p<>? t@e $TML 69<e #ALL MET$OD 2<_:;9_6ro3te35_8er492e8+*e7e2;te E&PORTIN' 5o2;Ae3t + ,#:IF<9:@t8.@tA, oper>t9o3 + ,OPEN, E&#EPTIONS 23t<_error + . error_3o_:;9 + 2 =>5_p>r>Aeter + 0 69<e_3ot_6o;35 + 1 p>t@_3ot_6o;35 + % 69<e_e7te389o3_;3H3oD3 + J error_e7e2;te_6>9<e5 + K 8?32@ro3o;8_6>9<e5 + L 3ot_8;pporte5_=?_:;9 + N OT$ERS + ./. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF.

Result:

Con)ert internal table data into HT$& format using *unction $odules
9y #"man F"mar Chinnam

Followin) F"nction ;od"les are "sed to convert internal table data to HT;* Table. 2. HHH!7TA9!T8!HT;*!HEADER# is "sed to pop"late col"mn headin)s. 5; HHH!7TA9!T8!HT;*!*A&8:T is "sed to pop"late col"mn cell properties. 6; HHH!7TA9!T8!HT;* is "sed to convert internal table data to HT;*. *&---------------------------------------------------------------------* *& Report YTEST_TABLE_$TML

*& *&---------------------------------------------------------------------* REPORT ?te8t_t>=<e_@tA<. *---------------------------------------------------------------------* * T Y P E S D E # L A R A T I O N *---------------------------------------------------------------------* TYPES:BE'IN OF t?_86<9:@t 2>rr95 TYPE 8_2>rr_95 E A9r<93e #o5e 2o3395 TYPE 8_2o33_95 E #o33e2t9o3 N;A=er 6<5>te TYPE 8_5>te E F<9:@t D>te pr92e TYPE 8_pr92e E A9rF>re 2;rre32? TYPE 8_2;rr2o5e E #;rre32? END OF t?_86<9:@t. *-ALL re<>te5 De2<>r>t9o38 DATA: t_@e>5er TYPE STANDARD TABLE OF D0@e>5 WIT$ $EADER LINE E$e>5er t_69e<58 TYPE STANDARD TABLE OF D069e<58 WIT$ $EADER LINE EF9e<58 t_@tA< TYPE STANDARD TABLE OF D0@tA< E$tA< D>_@e>5er TYPE D0@e>5 D_@e>5 TYPE D0@e>5. DATA: 9t_86<9:@t TYPE TABLE OF t?_86<9:@t E F<9:@t8 Det>9<8 9t_62>t TYPE <42_t_62>t WIT$ $EADER LINE. E F9e<52>t><o: *---------------------------------------------------------------------* * S T A R T - O F - S E L E # T I O N *---------------------------------------------------------------------* START-OF-SELE#TION. SELE#T * FROM 86<9:@t INTO #ORRESPONDIN' FIELDS OF TABLE 9t_86<9:@t "P TO 2/ ROWS. *---------------------------------------------------------------------* * E N D - O F - S E L E # T I O N *---------------------------------------------------------------------* END-OF-SELE#TION. *-Pop;<>te F9e<52>t><o: 9t_62>t-2o<te7t + ,A9r<93e #o5e,. APPEND 9t_62>t. 9t_62>t-2o<te7t + ,#o33e2t9o3 N;A=er,. APPEND 9t_62>t. 9t_62>t-2o<te7t + ,F<9:@t 5>te,. APPEND 9t_62>t. 9t_62>t-2o<te7t + ,A9r6>re,. APPEND 9t_62>t. 9t_62>t-2o<te7t + ,#;rre32?,. APPEND 9t_62>t. *-F9<< t@e #o<;A3 @e>593:8 >35 Propert9e8 LOOP AT 9t_62>t. D_@e>5-te7t + 9t_62>t-2o<te7t. *-Pop;<>te t@e #o<;A3 $e>593:8 #ALL F"N#TION ,WWW_ITAB_TO_$TML_$EADERS, E&PORTIN' 69e<5_3r + 8?-t>=97 te7t + D_@e>5-te7t 6:2o<or + ,=<>2H, =:2o<or + ,:ree3, TABLES

@e>5er + t_@e>5er. *-Pop;<>te #o<;A3 Propert9e8 #ALL F"N#TION ,WWW_ITAB_TO_$TML_LAYO"T, E&PORTIN' 69e<5_3r + 8?-t>=97 6:2o<or + ,=<>2H, 89Me + ,0, TABLES 69e<58 + t_69e<58. ENDLOOP. *-T9t<e o6 t@e D98p<>? D>_@e>5er-te7t + ,F<9:@t8 Det>9<8, . D>_@e>5er-6o3t + ,Ar9><,. D>_@e>5er-89Me + ,2,. *-Prep>r93: t@e $TML 6roA I3te3>< T>=<e REFRES$ t_@tA<. #ALL F"N#TION ,WWW_ITAB_TO_$TML, E&PORTIN' t>=<e_@e>5er + D>_@e>5er TABLES @tA< + t_@tA< 69e<58 + t_69e<58 roD_@e>5er + t_@e>5er 9t>=<e + 9t_86<9:@t. *-DoD3<o>5 t@e $TML 93to 6ro3te35 #ALL F"N#TION ,'"I_DOWNLOAD, E&PORTIN' 69<e3>Ae + ,#:IF<9:@t8.@tA, TABLES 5>t>_t>= + t_@tA< E&#EPTIONS 69<e_Dr9te_error + . 3o_=>t2@ + 2 :;9_re6;8e_69<etr>386er + 0 934><95_t?pe + 1 3o_>;t@or9t? + % ;3H3oD3_error + J @e>5er_3ot_><<oDe5 + K 8ep>r>tor_3ot_><<oDe5 + L 69<e89Me_3ot_><<oDe5 + N @e>5er_too_<o3: + ./ 5p_error_2re>te + .. 5p_error_8e35 + .2 5p_error_Dr9te + .0 ;3H3oD3_5p_error + .1 >22e88_5e39e5 + .% 5p_o;t_o6_AeAor? + .J 598H_6;<< + .K 5p_t9Aeo;t + .L 69<e_3ot_6o;35 + .N 5>t>pro495er_e72ept9o3 + 2/ 2o3tro<_6<;8@_error + 2. OT$ERS + 22. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF.

*-D98p<>? t@e $TML 69<e #ALL MET$OD 2<_:;9_6ro3te35_8er492e8+*e7e2;te E&PORTIN' 5o2;Ae3t + ,#:IF<9:@t8.@tA, oper>t9o3 + ,OPEN, E&#EPTIONS 23t<_error + . error_3o_:;9 + 2 =>5_p>r>Aeter + 0 69<e_3ot_6o;35 + 1 p>t@_3ot_6o;35 + % 69<e_e7te389o3_;3H3oD3 + J error_e7e2;te_6>9<e5 + K 8?32@ro3o;8_6>9<e5 + L 3ot_8;pporte5_=?_:;9 + N OT$ERS + ./. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF.

Result:

Adding custom conte t menu in classical list


*y +oy,it %hosh- .*M .ndia

*&---------------------------------------------------------------* *& Report Z_#ONTE&T_MEN"_DEMO *& *&---------------------------------------------------------------* *& p;=<98@e5 >t SAPTe2@392><.#OM *& *&---------------------------------------------------------------* REPORT M_2o3te7t_Ae3;_5eAo. * T>=<e 5e2<>r>t9o3 DATA: 9_4=>H TYPE STANDARD TABLE OF 4=>H INITIAL SIZE / 9_4=>p TYPE STANDARD TABLE OF 4=>p INITIAL SIZE /. * WorH>re> 5e2<>r>t9o3 DATA: D_4=>H TYPE 4=>H D_4=>p TYPE 4=>p. START-OF-SELE#TION. * Set 2;8toA 8t>t;8 SET PF-STAT"S ,BASI#,. * Fet2@ @e>5er 5>t> SELE#T * FROM 4=>H INTO TABLE 9_4=>H "P TO %/ ROWS. IF 8?-8;=r2 + /. * Fet2@ <93e 9teA 5>t> SELE#T * FROM 4=>p INTO TABLE 9_4=>p FOR ALL ENTRIES IN 9_4=>p W$ERE 4=e<3 + 9_4=>p-4=e<3. #$E#! 8?-8;=r2 + /. * D98p<>? =>892 <98t LOOP AT 9_4=>H INTO D_4=>H. FORMAT #OLOR #OL_$EADIN'. WRITE : -./ D_4=>H-4=e<3 2/ D_4=>H-er5>t 0% D_4=>H-erMet %% D_4=>H-er3>A. $IDE: D_4=>H-4=e<3. ENDLOOP. ENDIF. AT "SER-#OMMAND. * $>35<e ;8er 2oAA>35 #ASE 8?-;2oAA. W$EN ,DETAIL,. #$E#! NOT D_4=>H IS INITIAL. * D98p<>? 5et>9< <98t LOOP AT 9_4=>p INTO D_4=>p W$ERE 4=e<3 + D_4=>H-4=e<3. FORMAT #OLOR #OL_$EADIN'. WRITE : -./ D_4=>p-4=e<3 2% D_4=>p-po83r 0% D_4=>p-A>t3r %% D_4=>p-A>tD>. ENDLOOP.

WINDOW STARTIN' AT 2/ 2/ ENDIN' AT .2/ ../. END#ASE. *&---------------------------------------------------------------* *& ForA o3_2tAe3;_reO;e8t *&---------------------------------------------------------------* * #re>t9o3 o6 2;8toA 2o3te7t Ae3;- It 98 2><<e5 5?3>A92><<? * =? ABAP r;3t9Ae *----------------------------------------------------------------* * --*L_MEN" $>35<e 6or 2o3te7t Ae3; *----------------------------------------------------------------* FORM o3_2tAe3;_reO;e8t "SIN' <_Ae3; TYPE REF TO 2<_2tAe3;. DATA <93 TYPE 9. 'ET #"RSOR LINE <93. IF <93 * 2 AND 8?-<8935 + /. * A55 Ae3; #ALL MET$OD <_Ae3;-*>55_6;32t9o3 E&PORTIN' 62o5e + ,DETAIL, te7t + te7t-//.. ENDIF. * A55 Ae3; #ALL MET$OD <_Ae3;-*>55_6;32t9o3 E&PORTIN' 62o5e + ,BA#!, te7t + te7t-//2. ENDFORM. Eo3_2tAe3;_reO;e8t /ow 0"P calls the routine 1)'C ME)2'#E32E0 : Hhenever "ser presses ri)ht mo"se b"tton or shi t 6 F2B key combinations sap tri))ers system event and calls the method D7#$ATCH!#&#TE;!EEE,T# o class C*!4:7!CFH. Hithin it, it calls the method D7#$ATCH o class *C*!D&,$R8!$R8O& @de ined within the class pool o C*!4:7!CFHA.

From this method @D7#$ATCHA it calls the ro"tine 8,!CT;E,:!RES:E#T which is de ined in o"r pro)ram.

1utput: *asic list:

$etail list:

Dynamic Selection Screen (Drop do#ns+ pushbuttons+ radio buttons+ icons)


9y #warna #, Tata Cons"ltancy #ervices Followin) is the code in which the selection screen chan)es based on the "serNs click on the radio b"ttons. The entire selection screen is chan)ed. The F. b"tton is disabled and selection screen p"shDb"tton which chan)es dynamically based on radio b"tton and does the "nctionality o the F. b"tton.

*&----------------------------------------------------------------* *& Report Z_882r * * P;=<98@e5 >t SAPTe2@392><.#OM *& * *&----------------------------------------------------------------* *&DYNAMI# Se<e2t9o3 82ree3 =>8e5 o3 ;8er 2<92H8 o3 t@e r>59o=;tto3* *& * *&----------------------------------------------------------------* REPORT M882r. *TYPE POOLS DE#LARATIONS FOR VAL"E REP"EST MANA'ER AND I#ONS TYPE-POOLS : 4rA 92o3. *SELE#TION S#REEN FIELDS TABLES : 882r69e<58. *'LOBAL DE#LARATIONS DATA : 6<>: TYPE 2 t>=<e3>AeB./C AAt>=<e LI!E 55/2<-t>=3>Ae 85t>=<e LI!E 55/2<-t>=3>Ae @rt>=<e LI!E 55/2<-t>=3>Ae. *DE#LARATIONS FOR SELE#TION S#REEN STAT"S DATA 9t_;2oAA TYPE TABLE OF 8?-;2oAA. ***********SELE#TION-S#REENS********************** SELE#TION-S#REEN BE'IN OF BLO#! =<H. WIT$ FRAME. *FOR DYNAMI# DISPLAY OF MOD"LES PARAMETERS : p> RADIOB"TTON 'RO"P r>5 "SER-#OMMAND 2oA MODIF ID Ao5 p= RADIOB"TTON 'RO"P r>5 MODIF ID r>5 p2 RADIOB"TTON 'RO"P r>5 MODIF ID 2>5. SELE#TION-S#REEN S!IP. **TO IN#L"DE DYNAMI# I#ONS

SELE#TION-S#REEN #OMMENT 2BJC te7t_//.. *DYNAMI# LIST BO& BASED ON "SER SELE#TIONS PARAMETERS o3e AS LISTBO& VISIBLE LEN'T$ 2/ MODIF ID Ao5. PARAMETERS tDo AS LISTBO& VISIBLE LEN'T$ 2/ MODIF ID r>5. PARAMETERS t@ree AS LISTBO& VISIBLE LEN'T$ 2/ MODIF ID 2>5. SELE#TION-S#REEN END OF BLO#! =<H.. *DISPLAY DYNAMI# P"S$B"TTON ON APP TOOLBAR ON "SER #LI#!S SELE#TION-S#REEN: F"N#TION !EY . F"N#TION !EY 2 F"N#TION !EY 0. **EVENT ON SELE#TION S#REEN FOR O"TP"T DISPLAY AT SELE#TION-S#REEN O"TP"T. *#LI#! OF FIRST RADIO B"TTON IF p> + ,&,. 882r69e<58-6;32t7t_/. + ,M>ter9><8 M>3>:eAe3t,. WRITE 92o3_p<>3t AS I#ON TO te7t_//.. *#ODE TO 'ET DYNAMI#S BASED ON T$E SELE#TED RADIO LOOP AT S#REEN. IF 82ree3-:ro;p. + ,MOD,. 82ree3-93te38969e5 + ,.,. 82ree3->2t94e + .. 82ree3-598p<>?_05 + ,.,. MODIFY S#REEN. ENDIF. IF 82ree3-:ro;p. + ,RAD,. 82ree3-93te38969e5 + ,/,. 82ree3->2t94e + /. 82ree3-598p<>?_05 + ,/,. MODIFY S#REEN. ENDIF. IF 82ree3-:ro;p. + ,#AD,. 82ree3-93te38969e5 + ,/,. 82ree3->2t94e + /. 82ree3-598p<>?_05 + ,/,. MODIFY S#REEN. ENDIF. ENDLOOP. ENDIF. *#LI#! OF SE#OND RADIO IF p= + ,&,. 882r69e<58-6;32t7t_/2 + ,S><e8 A35 D98tr9=;t9o3,. WRITE 92o3_D8_8@9p AS I#ON TO te7t_//.. LOOP AT S#REEN. IF 82ree3-:ro;p. + ,RAD,. 82ree3-93te38969e5 + ,.,. 82ree3->2t94e + .. 82ree3-598p<>?_05 + ,.,. MODIFY S#REEN. ENDIF. IF 82ree3-:ro;p. + ,MOD,. 82ree3-93te38969e5 + ,/,. 82ree3->2t94e + /. 82ree3-598p<>?_05 + ,/,. MODIFY S#REEN. ENDIF. IF 82ree3-:ro;p. + ,#AD,. 82ree3-93te38969e5 + ,/,.

82ree3->2t94e + /. 82ree3-598p<>?_05 + ,/,. MODIFY S#REEN. ENDIF. ENDLOOP. ENDIF. *#LI#! OF T$IRD RADIO IF p2 + ,&,. 882r69e<58-6;32t7t_/0 + ,$;A>3 Re8o;r2e8,. WRITE 92o3_3eD_eAp<o?ee AS I#ON TO te7t_//.. LOOP AT S#REEN. IF 82ree3-:ro;p. + ,RAD,. 82ree3-93te38969e5 + ,/,. 82ree3->2t94e + /. 82ree3-598p<>?_05 + ,/,. MODIFY S#REEN. ENDIF. IF 82ree3-:ro;p. + ,MOD,. 82ree3-93te38969e5 + ,/,. 82ree3->2t94e + /. 82ree3-598p<>?_05 + ,/,. MODIFY S#REEN. ENDIF. IF 82ree3-:ro;p. + ,#AD,. 82ree3-93te38969e5 + ,.,. 82ree3->2t94e + .. 82ree3-598p<>?_05 + ,.,. MODIFY S#REEN. ENDIF. ENDLOOP. ENDIF. *#"STOMISIN' T$E TOOLBARS OF T$E SELE#TION S#REEN *WIT$ FL B"TTON DISABLED APPEND : ,PRIN, TO 9t_;2oAA ,SPOS, TO 9t_;2oAA ,ONLI, TO 9t_;2oAA. #ALL F"N#TION ,RS_SET_SELS#REEN_STAT"S, E&PORTIN' p_8t>t;8 + 8?-p6He? TABLES p_e72<;5e + 9t_;2oAA. **EVENT ON T$E SELE#TION AT SELE#TION-S#REEN. * LIST BO& ONE VAL"ES #ASE o3e. W$EN ,.,. AAt>=<e + ,MAR#,. W$EN ,2,. AAt>=<e + ,MARA,. W$EN ,0,. AAt>=<e + ,MARD,. W$EN ,1,. AAt>=<e + ,MARM,. END#ASE. * LIST BO& TWO VAL"ES #ASE tDo. W$EN ,.,.

85t>=<e + ,VBA!,. W$EN ,2,. 85t>=<e + ,VBAP,. W$EN ,0,. 85t>=<e + ,VB"!,. W$EN ,1,. 85t>=<e + ,VB"P,. END#ASE. * LIST BO& T$REE VAL"ES #ASE t@ree. W$EN ,.,. @rt>=<e + ,PA///.,. W$EN ,2,. @rt>=<e + ,PA///J,. W$EN ,0,. @rt>=<e + ,PA//22,. W$EN ,1,. @rt>=<e + ,PA///L,. END#ASE. *VAL"ES FOR #LI#! OF T$E P"S$B"TTON ON APP TOOLBAR *AND ENABLIN' T$E B"TTONS TO PERFORM FL #ASE 882r69e<58-;2oAA. W$EN ,F#/.,. t>=<e3>Ae + AAt>=<e. 882r69e<58-;2oAA + ,ONLI,. W$EN ,F#/2,. t>=<e3>Ae + 85t>=<e. 882r69e<58-;2oAA + ,ONLI,. W$EN ,F#/0,. t>=<e3>Ae + @rt>=<e. 882r69e<58-;2oAA + ,ONLI,. END#ASE. *INITIALIZATION EVENT INITIALIZATION. *VAL"ES ASSI'NED TO DROPDOWNLISTS IN T$E S"BRO"TINES PERFORM 61_4><;e_reO;e8t_p>. PERFORM 61_4><;e_reO;e8t_p=. PERFORM 61_4><;e_reO;e8t_p2. *START OF SELE#TION EVENT START-OF-SELE#TION. *S"BRO"TINE FOR O"TP"T PERFORM o;tp;t. *&----------------------------------------------------------------* *& ForA 61_4><;e_reO;e8t_PA *&----------------------------------------------------------------* * te7t *-----------------------------------------------------------------* *S"BRO"TINE TO PROVIDE DROPDOWN VAL"ES TO LIST. FORM 61_4><;e_reO;e8t_p>. DATA: <_3>Ae TYPE 4rA_95 <9_<98t TYPE 4rA_4><;e8 <_4><;e LI!E LINE OF <9_<98t. <_4><;e-He? + ,.,. <_4><;e-te7t + ,P<>3t D>t> 6or M>ter9><,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,2,.

<_4><;e-te7t + ,'e3er>< M>ter9>< D>t>,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,0,. <_4><;e-te7t + ,Stor>:e Lo2>t9o3 D>t> 6or M>ter9><,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,1,. <_4><;e-te7t + ,"39t8 o6 Me>8;re 6or M>ter9><,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_3>Ae + ,ONE,. #ALL F"N#TION ,VRM_SET_VAL"ES, E&PORTIN' 95 + <_3>Ae 4><;e8 + <9_<98t E&#EPTIONS 95_9<<e:><_3>Ae + . OT$ERS + 2. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF. ENDFORM. E 61_4><;e_reO;e8t_t>=3>Ae *&----------------------------------------------------------------* *& ForA 61_4><;e_reO;e8t_PB *&----------------------------------------------------------------* * te7t *-----------------------------------------------------------------* *S"BRO"TINE TO PROVIDE DROPDOWN VAL"ES TO LIST2 FORM 61_4><;e_reO;e8t_p=. DATA: <_3>Ae TYPE 4rA_95 <9_<98t TYPE 4rA_4><;e8 <_4><;e LI!E LINE OF <9_<98t. <_4><;e-He? + ,.,. <_4><;e-te7t + ,S><e8 Do2;Ae3t: $e>5er D>t>,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,2,. <_4><;e-te7t + ,S><e8 Do2;Ae3t: IteA D>t>,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,0,. <_4><;e-te7t + ,S><e8 Do2;Ae3t:$e>5er St>t;8,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,1,. <_4><;e-te7t + ,S><e8 Do2;Ae3t: IteA St>t;8,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_3>Ae + ,TWO,. #ALL F"N#TION ,VRM_SET_VAL"ES, E&PORTIN' 95 + <_3>Ae 4><;e8 + <9_<98t E&#EPTIONS 95_9<<e:><_3>Ae + .

OT$ERS + 2. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF. ENDFORM. E 61_4><;e_reO;e8t_PB *&----------------------------------------------------------------* *& ForA 61_4><;e_reO;e8t_P# *&----------------------------------------------------------------* * te7t *-----------------------------------------------------------------* *S"BRO"TINE TO PROVIDE DROPDOWN VAL"ES TO LIST0 FORM 61_4><;e_reO;e8t_p2. DATA: <_3>Ae TYPE 4rA_95 <9_<98t TYPE 4rA_4><;e8 <_4><;e LI!E LINE OF <9_<98t. <_4><;e-He? + ,.,. <_4><;e-te7t + ,$R M>8ter :I36ot?pe ///. BOr:. A889:3Ae3tC,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,2,. <_4><;e-te7t + ,A55re88 I36ot?pe ///J,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,0,. <_4><;e-te7t + ,E5;2>t9o3 I36ot?pe //22,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_4><;e-He? + ,1,. <_4><;e-te7t + ,B>892 P>? I36ot?pe ///L,. APPEND <_4><;e TO <9_<98t. #LEAR <_4><;e. <_3>Ae + ,T$REE,. #ALL F"N#TION ,VRM_SET_VAL"ES, E&PORTIN' 95 + <_3>Ae 4><;e8 + <9_<98t E&#EPTIONS 95_9<<e:><_3>Ae + . OT$ERS + 2. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF. ENDFORM. E 61_4><;e_reO;e8t_P# *&----------------------------------------------------------------* *& ForA O"TP"T *&----------------------------------------------------------------* * te7t *-----------------------------------------------------------------* * --*P_TABLENAME te7t *-----------------------------------------------------------------* *6INAL O"TP"T FORM o;tp;t. DATA p_t>=<eB./C. p_t>=<e + t>=<e3>Ae. *pop;p to 598p<>? te@ 8e<e2te5 t>=<e >35

*#o3t93;e =;tto3 98 2<92He5 #ALL F"N#TION ,POP"P_TO_DISPLAY_TE&T, E&PORTIN' t9te< + ,"8er Se<e2t9o38 , te7t<93e. + p_t>=<e te7t<93e2 + ,98 t@e Se<e2te5 t>=<e, 8t>rt_2o<;A3 + 2% 8t>rt_roD + J. *>889:393: t@e t>=<e 4><;e 93 p_t>=<e to t@e * T>=<e 93 SE.J tr>38>2t9o3 =? e7p<929t<? 2><<93: SET PARAMETER ID ,DTB, FIELD p_t>=<e. #ALL TRANSA#TION ,SE.J,. ENDFORM. EO"TP"T .nitial screen

Dynamic selection screens based on selection o the radio b"ttons

8n click o the 9"tton in the Application toolbar, here %#ales and Distrib"tion<, we )et

8n clickin) Contin"e, it proceeds to #E2+.

Dynamic 'ariant using the table T'A('


9y Xoy(it 4hosh, 79; 7ndia

*et "s say or the )iven selection screen we need to create a dynamic variant.

0tep 4. First maintain a variable with val"es in table TEARE. This can be done rom transaction #TEARE. *ater this variable needs to be assi)ned to the variant.

0tep 5. ,e1t create the dynamic variant by pressin) the #AEE b"tton on the selection screen.

7n the ne1t screen @A9A$I #ave as EariantA enter Eariant name, description, set the %#election variable< @*A radio b"tton and press %#election variable< p"sh b"tton.

7n the ne1t screen check that )reen tra ic li)ht is on "nder col"mn T @TI Table variable rom TEAREA. Then click on the b"tton.

,ow rom the pop"p select the variable name created in #tep2 and save the variant.

0tep 3. #elect the variant rom Eariant catalo).

7t will pop"late %Airline< selectDoption with the val"es maintained in TEARE table a)ainst variable ZA7R*7,E!C8DE.

Display images (li"e company logo) on the selection,screen


*y %aura! *aner,i- Cap(emini .ndia

4o to #;HB and or "ploadin) the ima)e.

#elect 9inary Data

#elect the Find 9"tton

$ress $ress the Create b"tton

Enter name and description

#elect the ima)e to "pload

Assi)n a packa)e @m"stA

$ress #ave and 8F

Hrite the ollowin) report CodeI REPORT M:=_pro:/J. * START OF DO NOT #$AN'E*********************************** DATA: 5o2H93: TYPE REF TO 2<_:;9_5o2H93:_2o3t>93er p92t;re_2o3tro<_. TYPE REF TO 2<_:;9_p92t;re ;r<B2%JC TYPE 2 . DATA: O;er?_t>=<e LI!E D0O;er? O##"RS . WIT$ $EADER LINE @tA<_t>=<e LI!E D0@tA< O##"RS . ret;r3_2o5e LI!E D0p>r>A-ret_2o5e 2o3te3t_t?pe LI!E D0p>r>A-2o3t_t?pe 2o3te3t_<e3:t@ LI!E D0p>r>A-2o3t_<e3 p92_5>t> LI!E D0A9Ae O##"RS / p92_89Me TYPE 9. * END OF DO NOT #$AN'E************************************* DATA : 8;AB1C 3;A.B1C 3;A2B1C. PARAMETERS: p_5;AA?B1C DEFA"LT ,1, . PARAMETERS: p_5;AA?.B1C DEFA"LT ,%, . AT SELE#TION-S#REEN O"TP"T. PERFORM 8@oD_p92. START-OF-SELE#TION. *&------------------------------------------------------------------*& ForA 8@oD_p92 *&------------------------------------------------------------------FORM 8@oD_p92. DATA: rep95 LI!E 8?-rep95. rep95 + 8?-rep95. #REATE OB(E#T p92t;re_2o3tro<_. E&PORTIN' p>re3t + 5o2H93:. #$E#! 8?-8;=r2 + /. #ALL MET$OD p92t;re_2o3tro<_.-*8et_05_=or5er E&PORTIN' =or5er + %. #ALL MET$OD p92t;re_2o3tro<_.-*8et_598p<>?_Ao5e E&PORTIN' 598p<>?_Ao5e + 2<_:;9_p92t;re+*598p<>?_Ao5e_8tret2@. #ALL MET$OD p92t;re_2o3tro<_.-*8et_po89t9o3 E&PORTIN' @e9:@t + 2// <e6t + .// top + 2/ D95t@ + 1//. *#$AN'E POSITION AND SIZE ABOVE*************************** IF ;r< IS INITIAL.

REFRES$ O;er?_t>=<e. O;er?_t>=<e-3>Ae + ,_OB(E#T_ID,. *#$AN'E IMA'E NAME BELOW "PLOADED IN SWO/****************** O;er?_t>=<e-4><;e + ,BI!ER,. APPEND O;er?_t>=<e. #ALL F"N#TION ,WWW_'ET_MIME_OB(E#T, TABLES O;er?_8tr93: + O;er?_t>=<e @tA< + @tA<_t>=<e A9Ae + p92_5>t> #$AN'IN' ret;r3_2o5e + ret;r3_2o5e 2o3te3t_t?pe + 2o3te3t_t?pe 2o3te3t_<e3:t@ + 2o3te3t_<e3:t@ E&#EPTIONS o=Qe2t_3ot_6o;35 + . p>r>Aeter_3ot_6o;35 + 2 OT$ERS + 0. IF 8?-8;=r2 )* /. * MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o * WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41. ENDIF. #ALL F"N#TION ,DP_#REATE_"RL, E&PORTIN' t?pe + ,9A>:e, 8;=t?pe + 235p_8>p_t>=_;3H3oD3 89Me + p92_89Me <96et9Ae + 235p_<96et9Ae_tr>38>2t9o3 TABLES 5>t> + p92_5>t> #$AN'IN' ;r< + ;r< E&#EPTIONS OT$ERS + .. ENDIF. #ALL MET$OD p92t;re_2o3tro<_.-*<o>5_p92t;re_6roA_;r< E&PORTIN' ;r< + ;r<. *S?3t>7 6or "RL *;r< + ,69<e:--D:I2orp-:=>3erQ9Ip92H;tI2>rtoo3_.L1.:96,. *;r< + ,@ttp:--<.?9A:.2oA->-9-DD-=et>-?0.:96,. ENDFORM. E8@oD_p92 ;ake chan)es in the report accordin)ly.

4iven below is the desired o"tp"t

Custom Parameter,id Creation


9y Abhi(it Daptary, Cap)emini 7ndia

0tep4I Creation o parameter 7D. $arameter 7D can be created in the table T$ARA. X"st enter the name o the parameter id in the table and that parameter 7D will be created.

4o to the table maintenance )enerator o the table T$ARA and )o to the Maintain b"tton thro")h the transaction #;5B. Enter the table view name T$ARA.

Click on the maintain b"tton. The ollowin) in ormation will appear. Click on the Tick b"tton or the E,TER b"tton to )o to the ne1t screen.

Enter the #etV4et parameter id as the parameter 7D yo" want to create. Here, 7 will be creatin) the parameter 7d as Z,A;E!DATA2. Click on E) E# b"tton.

7t will ask or the te1t o the parameter 7d. Enter the te1t o the parameter 7D and click on the 0ave b"tton.

Enter the $acka)e and the transport n"mber. The parameter id can be seen in the table P"#".

#tep3I :sin) the parameter 7d that yo" have created. ,ow )o to the 0E44 transaction or creatin) a data element and enter the parameter id at the 6urther Characteristics tab at the parameter 7d section.

Activate the data element and "se it with the pro)ram. 7t will act the same )ood as a standard one.

Create Dynamic Patterns


9y Xoy(it 4hosh, 79; 7ndia

0tep4. Create a pattern with only one line that contains 7898E:. .

$"t this above e1pression and press save b"tton.

0tep5. ,ow rom C;8D create a pro(ect and incl"de enhancement #E:EDBB2 in it.

,ow select the "ser e1it EO7T!#A$**8CA*!EDT2!BB2 and create the incl"de pro)ram in it.

,ow insert the ollowin) code block in the incl"de pro)ram and activate it. *&---------------------------------------------------------------------* *& I32<;5e Z&SE""2J * *&---------------------------------------------------------------------* DATA: D_=;66er TYPE 8tr93:. #ASE He?Dor5. W$EN ,DYNAMI#_PATTERN,. D_=;66er + ,*********************************************************************,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& Pro:r>A :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& Mo5;<e :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& S;=-Mo5;<e :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& F;32t9o3>< #o3t>2t:,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& F;32t. Spe2. Re6. :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& De4e<operB#oAp>3?C:,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& #re>te D>te :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& Pro:r>A T?pe :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& ProQe2t P@>8e :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*& De82r9pt9o3 :,. APPEND D_=;66er TO =;66er. D_=;66er + ,*********************************************************************,.

APPEND D_=;66er TO =;66er. W$EN OT$ERS. * Do 3ot@93: END#ASE. *astly activate the pro(ect

Scheduling bac"ground -obs by triggering e)ents

Step1: Create event from transaction SM62.

Give event name and description and press save button

Step2: Create a program that triggers this event by calling the FM BP_

! "T_RAIS # .

*&---------------------------------------------------------------------*

*& Report Z_TRI''ER_EVENT * *& * *&---------------------------------------------------------------------* *& * *& * *&---------------------------------------------------------------------* REPORT Z_TRI''ER_EVENT . #ALL F"N#TION ,BP_EVENT_RAISE, E&PORTIN' e4e3t95 + ,Z_TRI''ER_(OB, E&#EPTIONS BAD_EVENTID + . EVENTID_DOES_NOT_E&IST + 2 EVENTID_MISSIN' + 0 RAISE_FAILED + 1 OT$ERS + % . IF 8?-8;=r2 )* /. Wr9te: ,E4e3t 6>9<e5 to tr9::er,. e<8e. Wr9te: ,E4e3t tr9::ere5,. ENDIF.

Step3: Configure the bac ground !ob from transaction SM"6. #n the initial screen give !ob name and !ob class and press $Start condition button.

#n the popup screen press $After event button and give the event name and then press save button.

,ow )o back to the initial screen and press C0tep; b"tton

$rovide pro)ram and variant name and a ter providin) all the val"es press save b"tton.

7n the initial screen press save b"tton.

0tep<I ,ow e1ec"te the pro)ram to tri))er the event and as well check the back)ro"nd (ob.

R"n transaction #;5-

Check the stat"s o (ob de ined above

,ow check the spool to see the )enerated list

Performance Tuning using Parallel Cursor


9y #"resh F"mar $arvathaneni, &A#H Technolo)ies

)ested =oops J This is one o the ear actors or all the A9A$ developers as this cons"mes lot o pro)ram e1ec"tion time. 7 the n"mber o entries in the internal tables is h")e, then the sit"ation wo"ld be too worse. The sol"tion or this is to "se parallel c"rsor method whenever there is a need or ,ested *oop. Pro(ram usin( )ormal )ested =oopI REPORT TABLES: <9Hp ZNORMAL_NESTEDLOOP.

<9p8. D>t>: t_<9Hp t_<9p8 t?pe t>=<e o6 <9Hp t?pe TABLE OF <9p8.

5>t>: W_R"NTIME. TYPE I W_R"NTIME2 TYPE I. START-OF-SELE#TION. 8e<e2t * 6roA <9Hp 93to t>=<e t_<9Hp. 8e<e2t * 6roA <9p8 93to t>=<e t_<9p8. :et R"N TIME FIELD D_r;3t9Ae.. <oop >t t_<9Hp 93to <9Hp. <oop >t t_<9p8 93to <9p8 D@ere 4=e<3 eO <9Hp-4=e<3. e35<oop. e35<oop. :et R"N TIME FIELD D_r;3t9Ae2. D_r;3t9Ae2 + D_r;3t9Ae2 - D_r;3t9Ae.. Dr9te D_r;3t9Ae2. Nested Loop using Parallel Cursor: REPORT TABLES: <9Hp <9p8. DATA: t_<9Hp t_<9p8 TYPE TABLE OF <9Hp TYPE TABLE OF <9p8. Mp>r><<e<_2;r8or2.

DATA: D_r;3t9Ae. TYPE 9 D_r;3t9Ae2 TYPE 9 D_935e7 LI!E 8?-935e7. START-OF-SELE#TION. SELE#T * FROM <9Hp INTO TABLE t_<9Hp. SELE#T * FROM <9p8

INTO TABLE t_<9p8. 'ET R"N TIME FIELD D_r;3t9Ae.. SORT t_<9Hp BY 4=e<3. SORT t_<9p8 BY 4=e<3. LOOP AT t_<9Hp INTO <9Hp. LOOP AT t_<9p8 INTO <9p8 FROM D_935e7. IF <9Hp-4=e<3 NE <9p8-4=e<3. D_935e7 + 8?-t>=97. E&IT. ENDIF. ENDLOOP. ENDLOOP. 'ET R"N TIME FIELD D_r;3t9Ae2. D_r;3t9Ae2 + D_r;3t9Ae2 - D_r;3t9Ae.. WRITE D_r;3t9Ae2. "nalysis reportI R"ntime in microsecondsI .teration )o 2 3 5 )ormal )ested =oop 5=,-/+,2=5.,?5=,?.5 5=,2B5,=3+ 2sin( Parallel Cursor +5,.3/ ?+,./= ?B,?2B

Creating a Transaction 'ariant


9y #mita #in)h

7n this t"torial, we wo"ld disc"ss abo"t creatin) a transaction variant or the transaction ;;B2. 8"r transaction variant sho"ld de a"lt to a val"e or 7nd"stry sector and material type and sho"ld not allow the end "ser to chan)e those val"es @o"tp"t onlyA. 4o to transaction #HDB.

Enter the transaction code ;;B2. ,ow click on b"tton CREATE. Followin) in ormation messa)e wo"ld appearI

Click Enter to proceed. ,ow the ;;B2 transaction wo"ld appear.

#elect the re>"ired 7nd"stry sector and ;aterial Type and press E,TER. Followin) pop"p wo"ld appearI

,ow make the modi ications as shown belowI

Click on CE1it and #ave'. Followin) pop"p wo"ld appearI

Click Enter to proceed. Followin) screen wo"ld appearI

#ave yo"r entries and )o back to the main screen. ,ow enter the transaction variant name and click on Chan)e b"tton as shown belowI

,ow click on 7nsert Row. Enter the name o the screen variant created earlier or "se F= help to select the val"eI

,ow click on 4oto Create Eariant Transaction

Enter the val"es as shown above. Click on Enter. The ollowin) #E/5 transaction wo"ld appearI

The name o the Transaction Eariant is a"tomatically proposed. #ave yo"r entries. ,ow )o to Transaction Z;;B2 and check yo"r transaction variantI

&o" can observe that the ield 7nd"stry sector and ;aterial type de a"lt to the val"e we have )iven earlier and are o"tp"t enabled only.

E,$ailing the bac"ground -obs


*y /arini

This t"torial deals abo"t the proced"re in a"tomatic eDmailin) o the back)ro"nd (obs. The o"tp"t o the back)ro"nd (ob is sent to the recipient as an email.

Consider the ollowin) simple pro)ramI


'EP1'T >bac"groundEtest; !'7TEF Ghello SAPTechnical;com teamG;

He wo"ld sched"le the above pro)ram as a back)ro"nd (ob and send the o"tp"t o the same as an email. 4o to Transaction #;5+. Enter the (ob name.

$ress Enter. Followin) pop"p screen appearsI

Enter yo"r pro)ram name as shown above and click on #AEE.

Click on 9ack b"tton to navi)ate to the main screen.

Click on the b"tton C#pool list recipient' as shown above.

Enter the name o the recipient to which the o"tp"t to be sent. ,ow come back to the main screen and click on C#tart Condition'.

#elect 7mmediate and click on save.

#ave yo"r (ob. 8nly a ter yo" save, the (ob wo"ld be set to stat"s Released.

&o" can )o to transaction #;5- to monitor the back)ro"nd (ob. ,ow )o to #A$ inbo1 @transaction #9H$V#8B2A to check the stat"s o the back)ro"nd (obI

7n the above screenshot, yo" can observe an email related to the (ob we created earlier. 8pen the attachment to see the o"tp"t o the back)ro"nd (obI

ABAP Programming . /aming Standards


9y #"priya Xoshi Followin) are the per ormance standards need to be ollowin) in writin) A9A$ pro)ramsI

6or all "*"P Pro(rams > ransaction Codes

"dd the !elow header at the !e(innin( of Every "*"P pro(ram ************************************************************************ * OB(E#T ID : * PRO'RAM TITLE : * MOD"LE : * PRO'RAM TYPE : * INP"T : * O"TP"T : * #REATED BY : * #REATION DATE : *---------------------------------------------------------------------------------------------------------* DES#RIPTION : * * * ************************************************************************

* Mo59692>t9o3 @98tor?: * --------------------------------------------------------------------------------------------------------* DATE R"8er ID RTS Ver R Tr>38port ReO;e8t R De82r9pt9o3 * --------------------------------------------------------------------------------------------------------* ************************************************************************ Naming conventions to be followed:

Other Objects

%pplication area corresponds to the application area you are &or ing li e ' ( 'asis C ( C) F( F# * ( +M

S , S- . S%M

M , MM.Supply

ABAP Performance Standards


9y Aveek 4hose, 79; 7ndia

$escription R"n E1tended synta1 checks with character literals checkbo1 switched on G Code 7nspector to recti y all relevant errors and warnin) @e.). :se the res"lts o the above checks to remove all variablesVconstants etc that are declared b"t are not "sedA Transaction #E5B @A9A$ R"ntime AnalysisA m"st be checked to

#esult ?@- ) or )>"A

Comments

meas"reVcompare pro)ram per ormanceVr"ntime i pro)ram has m"ltiple ine icient databases selects or complicated internal table operations :se transaction #TB? @#S* TraceA to see what indices yo"r database accesses are "sin). Check these indices a)ainst yo"r Cwhere' cla"se to ass"re they are si)ni icant. Check other indices or this table and where yo" have to chan)e yo"r Cwhere' cla"se to "se it. Create new indices i necessary, b"t do not or)et to check the impact by cons"ltin) onsite coordinator. T&$E @data elementA command is "sed while declarin) the ields whenever easible instead o *7FE. Remember not always the data element name matches with the table ield name 7nternal Table is de ined with CT&$E #TA,DARD TA9*E 8F' G HorkDAreas is "sed instead o header lines 4lobal variables are minimi0ed by declarin) local variables or by passin) variables thro")h parameters G ar)"ments while creatin) internal s"bro"tine@sA 7n #E*ECT statement, only the re>"ired ields are selected in the same order as they reside on the database tableVstr"ct"reVview For selectin) sin)le row rom a database table, C#E*ECT :$ to 2 Rows' is "sed. C#elect #in)le' is "sed only when "ll primary key combination is known ,o #E*ECT L is "sed :se C#E*ECT 7,T8 TA9*E' rather than C#E*ECT 7,T8 C8RRE#$8,D7,4 F7E*D# 8F TA9*E' Always speci y as many primary keys as possible in HHERE cla"se to make the #elect e icient Always select into an internal table, e1cept when the table will be very lar)e @i.e., when the internal table will be )reater than ?BB,BBB recordsA. :se C:p to , Rows' when the n"mber o records needed is known #elect statement within a 4ET event is not "sed Hild cards like %AM< is avoided as m"ch as possible ,ested #elect is not "sed instead C7nner Xoin' andVor CFor all Entries' is "sed. CFor all Entries' is to be "sed over C*oop at 7TA9 V #elect V E,D*88$' @F8R A** E,TR7E# retrieves a "ni>"e res"lt set so ens"re yo" retrieve the "ll key rom the databaseA Hhen creatin) (oins over database tables there sho"ld be an inde1 at least on the inner table or the ields in the (oin condition else "se C F8R A** E,TR7E#' select statement :sa)e o X87, is limited to a ma1im"m o 3 i.e. not more than 5 database tables are (oined at one time CHECF that the internal table "sed in F8R A** E,TR7E# is ,8T empty as this will retrieve all entries rom the table Delete ad(acent d"plicate entries rom internal table be ore selection rom database table "sin) C F8R A** E,TR7E#' statement For copyin) internal tables "se %W< operator instead o *oopin) G Appendin) #8RT inside a *88$ is not "sed #ort internal table by ields in the correct order, which are "sed in a READ TA9*E statement "sin) 97,AR& #EARCH. 7 the order o

sortin) is invalid the 97,AR& #EARCH will never work For lar)e internal tables where only some rows are to be processed, "se #8RT and then the READ TA9*E command is "sed to set inde1 to irst relevant row be ore loopin) rom that inde1. :se CHECF or 7FYEO7TYE,D7F as appropriate to e1it rom the loop #ort ields and #ort 8rder on the #8RT statement sho"ld be mentioned e1plicitly @e.). #8RT 7TA9 9& F*D2 F*D3 A#CE,D7,4A Hashed table is "sed or processin) lar)e amo"nt o data @provided that yo" access sin)le records only, and all with a "lly speci ied keyA DE*ETE or #8RT is not "sed on a hashed table since it increases memory cons"mption #orted table is "sed or ran)e accesses involvin) table key or inde1 accesses Fields speci ied in the HHERE condition with the critical operators ,8T and UT @ne)ative #S* statementsA cannot be "sed or a search "sin) database inde1es. Hhenever possible orm"late #S* statements positively Hhen codin) 7F or CA#E, testin) conditions are nested so that the most re>"ently tr"e conditions are processed irst. Also CA#E is "sed instead o 7F when testin) m"ltiple ields Ce>"al to' somethin) *88$ AT 7TA9 7,T8 H8RFAREA HHERE F W %OOO< sho"ld be "sed instead o *88$ AT 7TA9 7,T8 H8RFAREA V CHECF 7TA9D F W %OOO<. Also READ TA9*E 7,T8 H8RFAREA sho"ld be "sed instead o only READ TA9*E. A ter the A$$E,D statement inside a loop, the work area that has been appended is cleared 7nternal tables, Hork areas G 4lobal Eariables are reed when no lon)er needed @e.). "sin) the FREE V REFRE#H commandA, especially when the tables are lar)e or the pro)ram is a batch pro)ram Do not delete the records o internal table inside the *oop J End loop. $o not use: *88$ AT 7TA9 HHERE ES:,R W %BBBB2B22<. DE*ETE 7TA9. E,D*88$. 2se: DE*ETE 7TA9 HHERE ES:,R W %BBBB2B22<. :se the ;8D7F& 7TA9 ... TRA,#$8RT7,4 2 3 ... or sin)le line, and ;8D7F& 7TA9 ... TRA,#$8RT7,4 2 3 ... HHERE condition or a set o line, to accelerate the "pdatin) o internal table 7 possible, :pdateV7nsert statement is "sed instead o ;odi y 7s the ollowin) steps ens"red d"rin) database "pdatesK *ock data to be edited Read c"rrent data rom the database

$rocess data and write it to the database

Release the locks set at the be)innin) Try to avoid lo)ical databases. 7 yo"r pro)ram "ses a lo)ical database, b"t does not re>"ire all ields belon)in) to a certain 4ET event, always "se the F7E*D# addition to red"ce the amo"nt o data selected by the lo)ical database Avoid the a))re)ate @Co"nt, ;a1, ;inA "nctions in the database selection :se $arallel C"rsor methods or nested loop into the internal tables i second internal table contains considerable n"mber o records 7n #mart ormV #apscript do not make red"ndant data retrieval where data is available in inter ace

0nderstanding S1& Trace


9y Aveek 4hose, 79; 7ndia

Performing an S ! "race:

4; %ccess transaction S/01. From the initial screen2 clic the chec bo3 for S45 trace2 under

the trace re6uests2 clic "race on# 2. 7un the program containing the S45 6uery that needs to be analy8ed in the S9": editor. 6; Come bac to S"$% screen2 under /race re6uests2 clic "race off.
?; Click =ist trace to view the trace o the c"rrent statement.
Screen shot of the initial S"$% screen

After clic&ing list trace

'asic !ist "race

The basic list trace shows the se>"ence o database operations that are takin) place while a >"ery is processed, it incl"des prepare, etch, open, reopen, e1ec"te. 7n addition the basic list trace also )ives the d"ration e1ec"tion or each o the operations with color le)end. Summari(ing the basic trace list )menu path: *oto + Summar,-

A basic trace list can be s"mmari0ed to see the s"mmation o e1ec"tion times o similar database operations. :se men" pathI 4oto#"mmary. The above screen shot depicts the s"mmed "p e1ec"tion time. The s"mmary option lists the s"mmed "p e1ec"tion time o all the >"eries that the #S* trace has capt"red at its r"ntime, b"t the identi ication o a partic"lar >"ery can be done "sin) the P.$ B Process .$ which is displayed as the irst col"mn o the above screen shot. For e1ample, CD6 is the process 7D or one o the #S* statements. Summar, of a particular trace

To )et the total e1ec"tion time, speci ically or a partic"lar #S* #tatement, select all the P.$ correspondin) to it and click s"mmari0e in the application toolbar. This leads to a compressed data o #S* trace as above. .olor legends indicating the processes in a trace 1

:se the men" pathI 4oto DT #how color le)end to know abo"t the color speci ication in the trace. Color legends indicating the processes in a trace 2

The above screen shot indicates that the >"ery e1ec"tion time has e1ceeded its threshold with the link pink color. A chan)e in ob(ect name is indicated with the chan)e in color to yellow. These colors thereby indicate whether the >"ery is well written and also the c"rrent stat"s o the database server. Extended list

@From basic trace listI click e1tended list b"tton in application toolbar to view the e1tended listA. The e1tended list shows the c"rsor id declared or the #S* statement, the connection type also. Cursors: A c"rsor is a handle or name or an area in memory in which a parsed statement and other in ormation or processin) the statement are keptZ s"ch an area is also called a private #S* area. Altho")h most 8racle "sers rely on the a"tomatic c"rsor handlin) o the 8racle "tilities, the pro)rammatic inter aces o er application desi)ners more control over c"rsors. 7n application development, a c"rsor is a named

reso"rce available to a pro)ram and can be "sed speci ically or the parsin) o #S* statements embedded within the application. Identical select statements

:se the men" pathI 4oto 7dentical #elects to view a comprehensive list o identical select statements e1ec"ted d"rin) the trace and the n"mber o times they were e1ec"ted. 7dentical select statements are )ro"ped based on the where clause. ,ote that identical select statements have similar execution plan "sed or their processin) thereby savin) time o e1ec"tion and provide increased per ormance, too. Identical select statements displayed

The above screen shot shows the list o identical select statements and the n"mber o time they )ot e1ec"ted. Database Operations Measured by SQL Trace The #S* Trace analysis helps in meas"rin) the e1ec"tion time o the ollowin) data base operations that are per ormed when e1ec"tin) an #S* statement. 4A $EC="#E: This operation declares a new c"rsor and assi)ns the #S* statement to that c"rsor created. 5A P#EP"#E: This operation converts the #S* statement into native #S* and rames o"t an e1ec"tion plan or that statement. 3A 1PE): This operation opens the declared c"rsor and passes the parameters or database access. <A 6E C/: This operation passes one or more data records etched to the database inter ace o the RV5 system. EA #E1PE): 8nce a new select statement is bro")ht in then this operation opens the c"rsor previo"sly declared or previo"s select statement and per orms new parameter passin) to the database. 6A E:EC: $asses the parameters or the database statement, and e1ec"tes the statements that chan)e data in the database @s"ch as :$DATE, DE*ETE, or 7,#ERTA.

Changing the te t 2Sales 3rder2 to 2Billing (e4uest2 in the transactions 'A56+ 'A57 and 'A58
9y Eikram Chellappa, ;o"ri Tech #ol"tions

0cenarioI The below steps to be ollowed or Chan)in) the te1t #ales 8rder to 9illin) Re>"est in EAB2, EAB3, EAB5 Transactions. 4o to transaction EAB2

7n ;en" bar 4o to #ystem T #tat"s

Do"ble click on the #creen n"mber 2B2

Do"ble click on ;8D:*E C:A!#ETZE,

Do"ble Click on $ERF8R; C:A!#ETZE,.

Click on Enhance

@#hi t6F=A

Click on Edit T Enhancement 8perations T #how 7mplicit Enhancement 8ptions

#croll down "p to the line 2=3?. Here we need to create an Enhancement.

Ri)ht Click on the pa)e 4o to Enhancement 7mplementation T Create

The below screen will appear ;ark the check bo1

Click on create enhancement 7mplementation @F.A

Enter the Enhancement 7mplementation, #hort te1t and Click on Create Composite 7mplementation.

The 9elow screen will appear

Enter the name or Composite enhancement implementation and #hort Te1t. Then Click on Creation o Enhancement @EnterA

Click on #ave and Assi)n it in correspondin) $acka)e.

9y scrollin) down select the already created Enhancement 7mplementation, Click on contin"e.

4o to #E.B create a new 0pro)ram named 0title.

Click on &es.

Enter the $ro)ram name and contin"e.

Enter the Title o the created pro)ram and Assi)n Type as ;od"le $ool. Click on #ave.

#ave it in $acka)e.

Ri)ht Click on 0title T Create T4:7 Titles

Enter the Title Code And Title.

Click on Trans er or @EnterA

Create another Title code.

Assi)n the Title code and title.

Repeat the above same proced"re.

Ri)ht Click on Ztitle and Click on Activate.

The created 4:7 title will display "nder 4:7 Title.

Type #A$;E=?A in $ro)ram T 4o to #"bro"tines.

#croll down in C:A!#ETZE,.

The 9elow screen will display.

Type the 9elow Code IF 8?-t2o5e + ,VA/.,.

SET TITLEBAR ,Z/., OF PRO'RAM ,ZTITLE, WIT$ )TFS*. ELSEIF 8?-t2o5e + ,VA/2,. SET TITLEBAR ,Z/2, OF PRO'RAM ,ZTITLE, WIT$ )TFS*. ELSEIF 8?-t2o5e + ,VA/0,. SET TITLEBAR ,Z/0, OF PRO'RAM ,ZTITLE, WIT$ )TFS*. ENDIF.

Click on save and Click on activate Enhancements @Ctrl6F5A

4o to $ro)ram and Click on 4enerate.

,ow yo" can )o and view the transaction screen. 4o to EAB2.

4o to EAB3.

4o to EAB5.

Creation of a #eb ser)ice in SAP


9y Ra)hava Eakada, ;o"ri Tech #ol"tions

C7n this #cenario, 7 wo"ld like to e1plain abo"t creatin) a Heb #ervice with a simple scenario.' Creatin) a Heb #ervice 7n the "nction library @#E5-A, display the "nction mod"le. 8pen the "nction ;od"le I ME_GET_CURRENT_USER_ID

Choose Utilities DT More Utilities DT Creating a Web Service DT From Function Module

7n the Heb #ervice Creation Hi0ard, choose Continue Enter the name o the Heb #ervice De inition

7n the ollowin) screen, enter the re>"ired data and select the checkbo1 Name Ma!!ing. 7 the checkbo1 Name Ma!!ing is ticked, the wi0ard accepts the e1istin) names or the end point.

Choose Continue. 7n the ollowin) screen, enter the re>"ired data and select the checkbo1 Release Service "or runtime.

Choose Contin"e.

Choose Complete.

#ave as local ob(ect. Testin) a Heb #ervice. Prerequisites 8pen the transaction H#AD;7,.

#elect the Heb service de inition yo" have created "nder S#$% $!!lication "or RFC&Com!liant FMs #elect and e1pand the CZHE9!4ET!C:RRE,T!:#ER' and select the Heb #ervice as shown in screen.

&o" have entered the address o the application server on which the X3EE En)ine is r"nnin) in transaction H#AD;7, "nder Goto DT $dministration Settings.

Check the X3EE #erver and check in yo"r server.

C'oose Web Service (ome!age )E*ecute +utton ,

#elect the CDoc"ment #tyle' "nder #tyle de inition in H#D*.

The !eb service re2uires authentication;

Enter the "ser and password

Click on the CTest'.

#elect the C8perations'.

Fill in val"es or the method parameters "nderneath the headin) Re-uest i" re-uired. Choose Send

The re>"ired val"es are displayed "nder the Res!onse headin). The Heb service has not been tested s"ccess "lly.

Calling a #eb ser)ice in ABAP that )alidates an email id


9y Te(a

#n this tutorial2 &e &ould use a free &eb service in an %'%+ program &hich validates an email(id. For more details regarding this &eb service2 clic& here. Create a program and use the follo&ing code:
REPORT M4><95>te_eA>9<. PARAMETERS: p_A>9<B.//C LOWER #ASE. E E-M>9< 95 to =e 4er969e5 DATA: @ttp_2<9e3t TYPE REF TO 96_@ttp_2<9e3t . DATA: D_8tr93: TYPE 8tr93: D_re8;<t TYPE 8tr93: r_8tr TYPE 8tr93: . DATA: re8;<t_t>= TYPE TABLE OF 8tr93:. START-OF-SELE#TION . #LEAR D_8tr93: . #ON#ATENATE ,@ttp:--DDD.De=8er492e7.3et-V><95>teEA>9<.>8A7-I8V><95EA>9<SEA>9<+, p_A>9< INTO D_8tr93: . #ALL MET$OD 2<_@ttp_2<9e3t+*2re>te_=?_;r< E&PORTIN' ;r< + D_8tr93: IMPORTIN' 2<9e3t + @ttp_2<9e3t

E&#EPTIONS >r:;Ae3t_3ot_6o;35 + . p<;:93_3ot_>2t94e + 2 93ter3><_error + 0 OT$ERS + 1. #ALL MET$OD @ttp_2<9e3t-*8e35 E&#EPTIONS @ttp_2oAA;392>t9o3_6>9<;re + . @ttp_934><95_8t>te + 2. #ALL MET$OD @ttp_2<9e3t-*re2e94e E&#EPTIONS @ttp_2oAA;392>t9o3_6>9<;re + . @ttp_934><95_8t>te + 2 @ttp_pro2e8893:_6>9<e5 + 0. #LEAR D_re8;<t . D_re8;<t + @ttp_2<9e3t-*re8po38e-*:et_25>t>B C. REFRES$ re8;<t_t>= . SPLIT D_re8;<t AT 2<_>=>p_2@>r_;t9<9t9e8+*2r_<6 INTO TABLE re8;<t_t>= . READ TABLE re8;<t_t>= INTO r_8tr INDE& 2. IF r_8trT11B.C + ,t,. WRITE:- ,V><95 eA>9< >55re88,. ELSE. WRITE:- ,I34><95 eA>9< >55re88,. ENDIF.
8"tp"tI

Handling fa)orites in ABAP !or"bench


*y 0unitha

This doc"ment details the proced"re in handlin) the avorites in the A9A$ Horkbench. 7 wo"ld always want to add my re>"ently "sed ob(ects in the avorites. For o"r learnin) p"rpose, let "s add the packa)e #HD$!DE;8!T:T8R7A*# @Demo t"torials or Heb Dynpro A9A$A to the avorite list. 4o to Transaction #E.B and select C$acka)e' #HD$!DE;8!T:T8R7A*# as shown belowI rom the list bo1. Enter the packa)e name

,ow open the list bo1 CFavorites' and click on AddI

The ollowin) messa)e appearsI

,ow veri y the same by openin) the avoritesI

This way, we can add the recently "sed ob(ects in the avorites list. o download>2pload favorites from one system to anotherI 7n the avorites, click on Edit as shown belowI

Followin) screen appearsI

:sin) the DownloadV:pload b"ttons, we can either downloadV"pload the avorites rom one system to another.

E)ents in Table $aintenance


0cenarioI He have a ollowin) c"stom table which contains the ields CDate on which record was created' and C,ame o the person who created the ob(ect'. He wo"ld like to have these to be illed "p with #&D DAT:; and #&D:,A;E respectively.

4o to Table ;aintenance 4eneratorI

Enter the details as shown belowI

,ow click on Environment DT ;odi ication DT Events

Followin) screen is displayed.

Click on F=. Followin) entries are displayedI

Here yo" can observe that there are di erent types o events available like be ore savin) the data, a ter savin) the data, be ore deletin), a ter deletin) and others. *et "s )o with CCreatin) a new entry'.

Click on the b"tton in the Editor col"mn and enter the ollowin) codeI @$lease note that yo" sho"ld also code F8R; and E,DF8R; as wellA.

#ave and activate the table. estin( the scenarioI 4o to #;5B and try creatin) new entries. Do not enter the val"es or CCreated on' and CCreated by'.

Check yo"r entries in the database table. &o" can observe that the date and "ser name are a"tomatically illedDin. #ee the screenshot belowI

0sing Sorted table and 9nde #hile processing 9nternal tables


*y 0uresh Fumar Parvathaneni

There wo"ld have been many instances where we wo"ld have to process lar)e entries in an internal table with a HHERE condition. This article is intended to demonstrate the comparison between three di erent methods in handlin) this sit"ation. 6irst MethodI The normal method "sed by most o "s. #tandard internal table processin) "sin) HHERE condition 0econd MethodI #ame as above, b"t here we wo"ld be "sin) the #orted table hird MethodI #orted table and "sin) the 7nde1 Followin) is the demo pro)ram ill"stratin) the above three methodsI REPORT ZINTERNAL_TABLE_OPERATIONS. * Pro:r>A to 6935 t@e =e8t Aet@o5 93 re>593: t@e 93ter3>< t>=<e8 * A;t@or: S;re8@ !;A>r P>r4>t@>3e39 * T?pe 5e2<>r>t9o3 TYPES: BE'IN OF TY_MARA MATNR LI!E MARA-MATNR MTART LI!E MARA-MTART END OF TY_MARA. * I3ter3>< t>=<e 5e2<>r>t9o3 DATA: T_MARA TYPE STANDARD TABLE OF TY_MARA T_MARA. TYPE SORTED TABLE OF TY_MARA WIT$ NON-"NIP"E !EY MTART. * V>r9>=<e 5e2<>r>t9o3 DATA: W_#O"NTER TYPE I W_R"NTIME. TYPE I W_R"NTIME2 TYPE I W_TABI& LI!E SY-TABI&. * T>=<e DorH>re> 5e6939t9o3 DATA: WA_MARA TYPE TY_MARA. SELE#T MATNR E M>ter9>< N;A=er MTART E M>ter9>< T?pe FROM MARA INTO TABLE T_MARA. T_MARA.FG + T_MARAFG. * #ASE .: Pro2e8893: 93ter3>< t>=<e ;893: LOOP..W$ERE #o359t9o3 'ET R"N TIME FIELD W_R"NTIME..

LOOP AT T_MARA INTO WA_MARA W$ERE MTART EP ,F$MI,. ADD . TO W_#O"NTER. ENDLOOP. 'ET R"N TIME FIELD W_R"NTIME2. * #><2;<>te R;3t9Ae W_R"NTIME2 + W_R"NTIME2 - W_R"NTIME.. WRITE W_R"NTIME2. #LEAR W_#O"NTER. * #ASE 2: "893: > Sorte5 t>=<e 'ET R"N TIME FIELD W_R"NTIME.. LOOP AT T_MARA. INTO WA_MARA W$ERE MTART EP ,F$MI,. ADD . TO W_#O"NTER. ENDLOOP. 'ET R"N TIME FIELD W_R"NTIME2. * #><2;<>te R;3t9Ae W_R"NTIME2 + W_R"NTIME2 - W_R"NTIME.. WRITE W_R"NTIME2. #LEAR W_#O"NTER. * #ASE 0: "893: INDE& o3 > 8orte5 t>=<e 'ET R"N TIME FIELD W_R"NTIME.. READ TABLE T_MARA. INTO WA_MARA WIT$ !EY MTART + ,F$MI,. IF SY-S"BR# EP /. W_TABI& + SY-TABI& T .. ADD . TO W_#O"NTER. LOOP AT T_MARA. INTO WA_MARA FROM W_TABI&. IF WA_MARA-MTART NE ,F$MI,. E&IT. ENDIF. ADD . TO W_#O"NTER. ENDLOOP. ENDIF. 'ET R"N TIME FIELD W_R"NTIME2. * #><2;<>te R;3t9Ae W_R"NTIME2 + W_R"NTIME2 - W_R"NTIME.. WRITE W_R"NTIME2. Followin) is the analysis report in microseconds, as per the data vol"meI #ecordsI 32,5/B .teration 2sin( )ormal =11P 9 2sin( 0orted ta!le =11P )o G/E#E 9 G/E#E 2 ./..3 .5/ .-/ 5 .5/ .-= .5= ..B ? .=3 .5#ecordsI 253,+/5 .teration 2sin( )ormal =11P 9 2sin( 0orted ta!le =11P )o G/E#E 9 G/E#E 2 5=35/ 5?--= 3 5=3-2 5.3?B 2sin( .)$E: on 0orted ta!le 5?+5?/3 2sin( .)$E: on 0orted ta!le 22 2B 2B / 2B

5 =

5==/3 5=2/.

5+?5= 5?+/?

5??= 5?.=

#orted table mi)ht have )iven a better per ormance here i the ield in the HHERE condition is the irst ield in the internal table. However, rom the above statistics, we can say that method 5 is better than the other 3 methods. 7n prod"ction environment, the data wo"ld be h")e and the per ormance co"ld be m"ch improved with this simple techni>"e.

Displaying %raphics using an ABAP Program


9y Ra)hava Eakada, ;o"ri Tech #ol"tions

C7 wo"ld like to e1plain abo"t a simple report pro)ram to display )raphics. The #A$ 4raphics can be "sed or vario"s b"siness p"rposes'. 7n this article 7 am e1plainin) abo"t a simple #ales analysis on a yearly basis. *&---------------------------------------------------------------------* *& Report Z'RAP$_TEST *& *&---------------------------------------------------------------------* REPORT Z'RAP$_TEST. DATA: BE'IN OF TAB O##"RS % #LASSB%C TYPE # VAL.B2C TYPE I VAL2B2C TYPE I VAL0B2C TYPE I END OF TAB. DATA: BE'IN OF OPTTAB O##"RS . #B2/C END OF OPTTAB. MOVE: ,6>3, TO TAB-#LASS .2 TO TAB-VAL. L TO TAB-VAL2 .% TO TAB-VAL0. APPEND TAB. #LEAR TAB. MOVE: ,2oo<, TO TAB-#LASS .% TO TAB-VAL. ./ TO TAB-VAL2 .L TO TAB-VAL0. APPEND TAB. #LEAR TAB. MOVE: ,DA, TO TAB-#LASS .K TO TAB-VAL. .. TO TAB-VAL2 2/ TO TAB-VAL0. APPEND TAB. #LEAR TAB. OPTTAB + ,FIFRST + 0D,. APPEND OPTTAB. E-- 'r>69H-T?p OPTTAB + ,P0TYPE + TO,. APPEND OPTTAB. E-- O=QeHt>rt OPTTAB + ,P0#TYP + RO,. APPEND OPTTAB. E-- F>r=e3 5er O=QeHte OPTTAB + ,TISIZE + 2,. APPEND OPTTAB. E-- $>;ptt9te<:rUVe OPTTAB + ,#LBA#! + &,. APPEND OPTTAB. E-- B>2H:ro;35 #o<or #ALL F"N#TION ,'RAP$_MATRI&_0D, E&PORTIN' #OL. + ,.NNK, #OL2 + ,.NNL, #OL0 + ,.NNN, DIM2 + ,Pro5;2t8,

DIM. TITL TABLES DATA OPTS E&#EPTIONS OT$ERS LEAVE PRO'RAM. #esults :

+ ,Ye>r8, + ,S><e8 I3 R8. #rore8, + TAB + OPTTAB + ..

E1ec"te the report pro)ram or an o"tp"t shown below.

Click on 8verview or detailed view.

To display more detailed view.

T$e ABAP "e& ditor


T%

9y #"resh F"mar $arvathaneni This article, the irst part o a twoDarticle series, takes yo" on a brie to"r o the eat"res available in the new A9A$T; editor @step by step with screenshotsA PreHreIuisites The new A9A$T; editor is available with #A$R 4:7 or windows +.=B patch level 2B or hi)her. However this new editor is s"pported rom the #A$R Eersion #A$R ,etweaver 3BB=s.

0hiftin( to "*"P

)ew Editor

#tart any o the ollowin) transaction codes to access the A9A$T; workbenchI

#E5. #E5#E3= #E5-

He wo"ld "se #E5. or o"r demo p"rposes. $roced"re to shi t between 8ld A9A$T; Editor and ,ew A9A$T; EditorI

4o to :tilities [ #ettin)s Click on FrontDend Editor @,ewA as shown below

Click

or chan)es to e ect.
M

6eatures in "*"P
6irst =ooJ:

)ew Editor

Eiew o the new A9A$T; Editor @ rom #E5.AI

$isplay 6eatures
Followin) are some o the eat"res that co"ld be observed while writin) the codeI

=ine )um!ers As observed in the above screenshot, the new A9A$ T; editor displays the line n"mbers or easy navi)ation thro")h the code. Chan(ed line indicators The chan)ed lines in the c"rrent session are marked with .

These indicators wo"ld vanish once yo" come o"t o the pro)ram.

*ooJmarJs
9ookmarks allow in navi)atin) and code editin). There are / n"mbered bookmarks provided by #A$R and "nlimited "nn"mbered bookmarks. 9ookmarks co"ld be accessed by the ri)ht click o the mo"se in the 7ndicator ;ar)in @The complete le t portion o the A9A$T; editorA.

To set a bookmark, ri)ht click on the 7ndicative ;ar)in, click on 9ookmarks DDT 9ookmark B @9ookmarks are n"mbered B to /A. A 9l"e la) with the bookmark n"mber wo"ld appear on the 7ndicative ;ar)in. To navi)ate to any bookmark marked earlier, ri)ht click on the 7ndicative ;ar)in, 4o to 9ookmark DDT 9ookmark B.

Code /ints
Code hints appear as yo" type in A9A$ T; editor. For e1ample, i yo" start typin) or $arameters, ollowin) occ"rsI

Hhen typed $, nothin) appears. Hhen typed $A, code hint $ACF appears.

Hhen typed $AR, code hint $ARA;ETER# appears.

$ress TA9 to choose the )iven code hint.

Chan(in( the 6ont and Colors of codin( environment


Click on , available at the ri)ht side bottom o the editor. Click on CFonts and Colors' on the le t side o the window that is appeared a ter clickin). From here, we can set di erent colors and onts or di erent elements on the editor.

Gindow 0plitter

The window splitter allows yo" to work on di erent parts o the code sim"ltaneo"sly. The window co"ld be set to splitter mode by do"ble clickin) the splitter line above the vertical scrollbar @shown belowA.

The split screen is seen as belowI

Also visit Feat"res o A9A$ ,ew Editor $art 3

The *eatures of ABAP /e# Editor Part 7


9y #"resh F"mar $arvathaneni

GorJin( with Colors and 6ontsI #witch to the new editor @i the de a"lt editor shown is the old editorA. 7n the ,ew A9A$ editor, click on the b"tton Coptions' available at the bottom o the ri)ht hand side, as shown in the below screen shotI

Followin) popD"p appearsI

,ow select CFonts and Colors' available on the le t side.

:sin) this, yo" can desi)n how the screen sho"ld look like, For e1ample, yo" can dictate how the comments sho"ld appear @like Font, si0e, ore)ro"nd color and back)ro"nd colorA. *et "s take the same Ccomments' section or o"r scenario here. Comments are c"rrently displayed as shown belowI

,ow click on the options b"tton and select CFonts and Colors'. #elect CComments' rom the list bo1I

,ow chan)e the way yo" wo"ld like the options to appear in this sectionI

#ave and check how the way comments appear now.

GorJin( with Code emplatesI To view the Code Templates c"rrently available, Click on C8ptions' as shown earlier. ,ow click on CCode Templates' option available on the le t side.

&o" wo"ld observe the code templates available or "se with the editor. Click on any code template to "nderstand "rther.

Above screenshot is or CD8'. He wo"ld "se this or o"r demo p"rpose to better "nderstand the code template. Hrite some sample code in yo"r editor.

,ow select yo"r pro)ram code and click the ri)ht b"tton o the mo"se. #elect DT Format DT #"rro"nd by template DT Do @A @as shown in the ollowin) screenshotA

,ow observe yo"r codeI

&o"r code is now s"rro"nded by the code template CD8'. Creatin( custom code templateI ,ow we wo"ld work on creatin) o"r own code template or o"r "t"re "se. As observed in the earlier screenshots, there is no code template available or s"bro"tine. *et "s create a code template or the same.

#elect yo"r code and click on ri)ht b"tton. #elect Format DT E1tract template

Enter the name or yo"r code template.

Click on 8F.

,ow we need to de ine the position where the selected te1t @s"rro"nded te1tA to appear. Click on the empty line between C orm' and Cend orm' and click on C7nsert ta)'

#elect #"rro"nded Te1t rom the )iven options.

#ave and e1it. To test o"r code template, write a sample code in o"r pro)ram.

Ri)ht click and select o"r code template.

8"r code template is displayed as belowI

,ow ("st enter the orm name to complete yo"r s"bro"tine de inition. 0ettin( *reaJHpointsI 8pen the new A9A$ editor and write some sample code in it.

Activate yo"r pro)ram. To set the breakDpoint, click on indicator mar)in, available on the le t side o the line n"mbers. @#ee the screenshot belowAI

9reakDpoint in set now.

!or"ing #ith $enu Painter


9y Ra)hava Eakada, ;o"ri Tech #ol"tions For theoretical concepts on ;en" $ainter, please visit 0"P.help.com

Create a program in S9": /( Code.

9nter the /itle of the +rogram %nd Select the /ype as 93ecutable +rogram. %nd clic on save. Save it in a 7elevant +ac age.

Go to /(code S9;< 9nter the +rogram name and Status name.

Clic on create

9nter the Short te3t for Status.

Clic

on

Menu

'ar.

Specify a Menu =ame file

-ouble clic on File.

9nter the Code and te3t >alues.

Clic on save2 chec and %ctivate. +ress 93ecute or F:.

Clic on Continue and 9nter.

Created Menu is displayed here.

"o create a "itle/ .lic& on "itle !ist# Clic on create.

9nter the /itle Code and /itle. Clic on continue.

Clic on enter and Clic on /est.

9nter the created /itle Code in /itle2 Clic on e3ecute.

Clic on Continue.

Created

/itle

-isplayed.

Clic on Save.
*&---------------------------------------------------------------------* *& Report ZMEN"_PAINTER *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZMEN"_PAINTER. TABLES: MARA. DATA: MATNR TYPE MARA-MATNR ERSDA TYPE MARA-ERSDA ERNAM TYPE MARA-ERNAM DISPLAY TYPE # SAVE TYPE # DELETE TYPE # #LEAR TYPE # E&IT TYPE # O!_#ODE LI!E SY-"#OMM. #ALL S#REEN ./.. *&---------------------------------------------------------------------*

*& Mo5;<e STAT"S_/./. O"TP"T *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* MOD"LE STAT"S_/./. O"TP"T. SET PF-STAT"S ,ZMEN",. SET TITLEBAR ,ZMEN"_PAINTER,. #ASE SY-"#OMM. W$EN ,E&IT,. LEAVE PRO'RAM. W$EN ,BA#!,. LEAVE PRO'RAM. W$EN ,DISPLAY,. SELE#T SIN'LE ERSDA ERNAM FROM MARA INTO BMARA-ERSDA MARA-ERNAMC W$ERE MATNR + MARA-MATNR. W$EN ,#LEAR,. #LEAR MARA. END#ASE. ENDMOD"LE. E STAT"S_/./. O"TP"T *&---------------------------------------------------------------------* *& Mo5;<e "SER_#OMMAND_/./. INP"T *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* MOD"LE "SER_#OMMAND_/./. INP"T. ENDMOD"LE. E "SER_#OMMAND_/./. INP"T

Clic on middle #con .

9nter M%7% in the /able.Fieldname /e3t 'o3 /hen clic on Get From -ictionary.

Select the re6uire fields and clic on continue.

#nsert these bo3es on the screen.

?ou can vie& li e this after placing the bo3es.

Create re6uire +ush buttons from toolbo3.

Create re6uire chec bo3 from toolbo3.

Give the re6uired =ame 2 /e3t and Function Code =ame . Clic on Save2 Chec and %ctivate.

Output: 9nter the Material number and +ress -isplay.

Clic on -isplay.

>alues are displayed as sho&n belo&.

Similarly ?ou Can >ie& Clear %nd 93it. Clear , #t &ill clear all the displayed contents.

93it ( #t &ill return to code..

*e can @se the same operation in Function Aeys.



F? Clear F+ Display F- E1it.

9nter the Material and +ress F6 . /he same functionality F1 to Clear and FB to 93it.

Dynamic 'ariant in a report


9y #"ra( F"mar $abbathi, &A#H Technolo)ies

0cenario: This blo) is to e1plain the creation o Dynamic Eariant or report selection screen.
*et "s "nderstand %Hhat is Dynamic EariantK< Dynamic Eariant consists o selection variable or a selection screen item where in a orm"la can be de ined. For e1ampleI 8n the selection screen o a report, take a Date ield, which needs to be dynamic. From Date sho"ld be %C"rrent date J 2?< and To Date sho"ld be %C"rrent Date<. 7n this way the report when r"n with this variant, it wo"ld be possible to retrieve all those records which are past 2? days entries rom now.

$lease ind below the proced"re to de ine D&,A;7C Eariant.

#tep 2I 4o to transaction #E5. to speci y the $ro)ram name and select %Eariant< radio b"tton and %Display<. Then it will lead yo" to ne1t screen %A9A$IEariants J7nitial #creen< as shown belowI #peci y the variant which needs to be created or chan)ed.

#tep3I #peci y all those val"es which are static on the selection screen in this step. Then click %Eariant Attrib"tes< to de ine selection variable or %Date Created< on the selection screen.

#tep 5I 7n this step, provide s"itable meanin) or the variant. As we need to de ine selection variable or %Date created< item on selection screen, check the bo1 "nder * as shown in the selection screen belowI

#tep =I 7n the previo"s step, select %#election Eariables< on the men". 7t leads to the ne1t screen as shown below. As we have decided to create selection variable or %Date created< item only, in this screen yo" )et to see the variable as %Date created<. Here yo" are provided with three options. TI Table variable rom TEARE DI Dynamic Date Calc"lation 9I :ser de ined Eariables. From the provided options as per o"r re>"irement select %D< option. This can be done by clickin) the Tra ic li)hts "nder %D<as shown below to know that the partic"lar option is selected. ,ow click the black arrow as shown in the screenshot below and yo" will be prompted with search help o di erent orm"las or the selection variable.

#tep ?I Find the s"itable orm"la as %C"rrent date J 111, c"rrent date 6 yyy< and select it. This will lead yo" to the ne1t screen to enter the val"es or 111 and yyy. #o, provide val"es as 2? or 111 and B or yyy. #ave the variant and this will concl"de the creation o dynamic variant with the help o selection variable. This variant can also be "sed in the back)ro"nd (obs.

Creating *6 helps in ease


9y 4a"rab 9aner(i

4o to #E+2 and create a )eneral te1t TO like the one shown below. #elect 4eneral Te1t rom Doc"ment Class #elect *an)"a)e Type ,ame and press create

Type in what yo" want to see in o"tp"t :2 is or the *old ext yo" see in the headin) o the F2 Help. 7 yo" don<t want to speci y a bold te1t yo" can ("st type it in the D8FT7T*E in the "nction mod"le called.

#ave the Te1t. ,ow Displayin) the F2 Help. 7 have modi ied an e1istin) pro)ram or showin) F2 help. #ee below CD(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((C CD 7eport EG'F/9S/FS9%7CGFG95+ CD

C C

CD(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((C CD CD CD(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((C REPORT Z'B_TEST_SEAR#$_$ELP . * INTERNAL TABLE FOR STORIN' NAMES IN SELE#TION LIST 5>t>: =e:93 o6 t_9t>= o22;r8 / 3>AeB./C t?pe 2 e35 o6 t_9t>=. *FIELDNAME AND TAB NAME FOR T$E SELE#TION DATA :69e<5_t>= LI!E 569e8 O##"RS / WIT$ $EADER LINE. *T$E TABLE FOR RET"RNIN' T$E NAME OF T$E SELE#TED ITEM DATA : ret;r3_t>= LI!E 558@ret4>< O##"RS / WIT$ $EADER LINE. *START T$E SELE#TION S#REEN BLO#! 8e<e2t9o3-82ree3 =e:93 o6 =<o2H 88. D9t@ 6r>Ae. p>r>Aeter8: p_3>Ae.B./C t?pe 2. 8e<e2t9o3-82ree3 e35 o6 =<o2H 88.. *&---------------------------------------------------------------------* *& * *& F1 $e<p 6or p_3>Ae. * *&---------------------------------------------------------------------* >t 8e<e2t9o3-82ree3 o3 4><;e-reO;e8t 6or p_3>Ae.. *#LEAR ALL E&ISTIN' DATA *TO BE DONE EVERYTIME F1 $ELP IS REP"ESTED REFRES$ t_9t>=. REFRES$ 69e<5_t>=. 69e<5_t>=-69e<53>Ae + ,ERNAM,. 69e<5_t>=-t>=3>Ae + ,VBA!,. APPEND 69e<5_t>=. t_9t>=-3>Ae + ,A35reD8,. >ppe35 t_9t>=. t_9t>=-3>Ae + ,(e339e,. >ppe35 t_9t>=. #ALL F"N#TION ,F1IF_INT_TABLE_VAL"E_REP"EST, E&PORTIN' * DDI#_STR"#T"RE + , , ret69e<5 + 69e<5_t>=-69e<53>Ae * PVAL!EY + , , * DYNPPRO' + , , * DYNPNR + , , * DYNPROFIELD + , , * STEPL + / WINDOW_TITLE + ,Se<e2t 3>Ae, * VAL"E + , , * VAL"E_OR' + ,#, * M"LTIPLE_#$OI#E + , , * DISPLAY + , , * #ALLBA#!_PRO'RAM + , , * #ALLBA#!_FORM + , , * MAR!_TAB + * IMPORTIN' * "SER_RESET + t>=<e8 4><;e_t>= + t_9t>= FIELD_TAB + 69e<5_t>=

C C

RET"RN_TAB + ret;r3_t>= DYNPFLD_MAPPIN' + E&#EPTIONS PARAMETER_ERROR + . NO_VAL"ES_FO"ND + 2 OT$ERS + 0 . IF 8?-8;=r2 )* /. MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO WIT$ SY-MS'V. SY-MS'V2 SY-MS'V0 SY-MS'V1. e<8e. p_3>Ae. + ret;r3_t>=-69e<54><. ENDIF. *&---------------------------------------------------------------------* *& * *& F. $e<p 6or p_3>Ae. * *&---------------------------------------------------------------------* >t 8e<e2t9o3-82ree3 o3 @e<p-reO;e8t 6or p_3>Ae.. #ALL F"N#TION ,DSYS_S$OW_FOR_F.$ELP, E&PORTIN' * APPLI#ATION + ,SOK/, 5oH2<>88 + ,T&, DO!LAN'" + SY-LAN'" 5oH3>Ae + ,Z_'A"RAB_DEMO, * DO!TITLE + ,T@98 >ppe>r8 >8 =o<5 t9t<e, * $OMETE&T + , , * O"TLINE + , , * VIEWNAME + ,STANDARD, * Z_ORI'INAL_O"TLINE + , , * #ALLED_FROM_SOK/ + , , * S$ORT_TE&T + , , * APPENDI& + , , * IMPORTIN' * APPL + * PF/0 + * PF.% + * PF.2 + E&#EPTIONS #LASS_"N!NOWN + . OB(E#T_NOT_FO"ND + 2 OT$ERS + 0 . IF 8?-8;=r2 )* /. * MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO * WIT$ SY-MS'V. SY-MS'V2 SY-MS'V0 SY-MS'V1. ENDIF. *

%part from the FM DSHSES)1!E(1'E(4)E%P+$ollo#ing FMHs can also be used:


4;

5; )E%PE1BIECTES)1!

)E%PE1BIECTES)1!E(1'E(7E%D

Gere is the output

3b-ect oriented programming (33P) e plained #ith an e ample


9y 4a"rab 9aner(i

Create a class that keeps track o a bank acco"nt balance. Then write a pro)ram to "se this class.

Steps in'ol'edI
R"n the class b"ilder "tility @0E5<A. Create a class called ZACC8:,T11, where 11 is the last two di)its o yo"r lo)on 7D. Declare a $R7EATE attrib"te 9A*A,CE o type D;9TR to store the acco"nt balance. Create the ollowin) $:9*7C methodsI o #ET!9A*A,CE @#ets the balance to a new val"eA 7;$8RT7,4 ,EH!9A*A,CE T&$E D;9TR o DE$8#7T @Adds a deposit amo"nt to the balance and ret"rns the new balanceA 7;$8RT7,4 A;8:,T T&$E D;9TR RET:R,7,4 ,EH!9A*A,CE T&$E D;9TR o H7THDRAH @#"btracts a deposit amo"nt rom the balance and ret"rns the new balance.A 7;$8RT7,4 A;8:,T T&$E D;9TR RET:R,7,4 ,EH!9A*A,CE T&$E D;9TR EOCE$T78,# 7,#:FF7C7E,T!F:,D# Activate all elements o yo"r class. Hrite a pro)ram called Z!:#E!ACC8:,T!11, where 11 is the last two di)its o yo"r lo)on 7D. This pro)ram sho"ld do the ollowin)I o 7nstantiate an instance o the Acco"nt class. o #et the acco"nt balance to some initial val"e. o *a"e several deposits and #ithdra#als+ printing the ne#

balance each time; Do not allo# the balance to become less than >ero; (.se the exception to detect this;

Test and deb") yo"r pro)ram.

KExtra CreditK: 7 yo" have e1tra time, try any o the ollowin)I Replace the #ET!9A*A,CE method with a constr"ctor. $ass the openin) balance when yo" instantiate the acco"nt ob(ect. Create a static attrib"te and methods to set and )et the name o the bank that holds the acco"nts. 0tepH!yHstep approach with screenHshots 4o to #E3= @Class b"ilderA Type in ZACC8:,TAA as the name o the class and press Create.

De ine 5 methods DE$8#7T, #ET!9A*A,CE and H7THDRAH.

$lace the mo"se c"rsor in DE$8#7T and hit the $arameters b"tton.

Hrite the parameters imported V e1ported or DE$8#7T method. #imilarly or #ET!9A*A,CE

And H7THDRAH

For withdraw we de ine an e1ception.

He can see the attrib"tes and methods by pressin) CDisplay ob(ect list' b"tton on top.

,ow we 7;$*E;E,T the 5 methods. Do"ble click the method DE$8#7T.

Hrite the re>"ired code. #imilarly or #ET!9A*A,CE

#imilarly or H7THDRAH.

,ow we are almost done creatin) the ob(ect. $ress CTR* 6 F5 to activate or hit the ;atchstick. He will see this in the stat"s ,ow we are done b"ildin) the )lobal class we can test it. $ress F..

Click #ET!9A*A,CE. Hrite the ,EH!9A*A,CE and press E,TER.

He come back to 7nitial #creen. ,ow click DE$8#7T.

He see the ret"rn Eal"es now.

,ow let<s H7THDRAH =BBB

,ow the 9A*A,CE is 3BBB *ets try withdrawin) 5BBB now.

He )et an e1ception.

4iven below is an e1ample code or "sin) the )lobal class we de ined. RE$8RT Z49!88$#!9A,F DATAI acct2 type re to 0acco"ntaa. DATAI bal type i. create ob(ectI acct2. selectionDscreen parametersI selectionDscreen end o block a. startDo Dselection. call method writeIV N#et balance to N, p!amnt. acct2DTset!balance@ p!amnt A. be)in p!amnt p!dpst p!wdrw o type type type block a. dmbtr, dmbtr, dmbtr. .

bal W acct2DTdeposit@ writeIV NDeposited N, p!dpst ,N b"cks makin) balance to N, bal. bal W acct2DTwithdraw@ writeIV NHithdrew N, p!wdrw ,N b"cks makin) balance to N, bal. This is the o"tp"t.

p!dpst

A.

p!wdrw

A.

Calling an (*C function module from one system to another


9y 4a"rab 9aner(i

0ollo1ing are the participant s,stem for our demo purpose: -01 , System &here 7FC function module e3ists -S" , Calling system Ian 7FC call is made from this system to -01J Scenario:

*e &ould develop a small 7FC function module in -01 system2 &hich &ould add t&o variables. *e &ould pass t&o variables from -S" to -01 and get bac the sum of those t&o variables bac to -S". Activities to be performed in the s,stem 2$% Go to S9"B. @nder @tilities K Create Function Group Isay EG'FF@=CJ2 if doesnHt e3ists. =o& create a =e& Function Module EG'FF@=C0<

@nder

#M+)7/

/ab2

define

the

follo&ing

variables

@nder 9L+)7/ /ab

#n

the

Source

Code

=o& set the function module as $7emote(enabled moduleM in the attributes tab.

Activities to be performed in the S,stem 2S3 Create an 7FC destination from -S" to -01. Go to SM1N2 +ress Create. 9nter the 7FC -estination name: -01(201(/9S/ Connection /ype: " #n -escription: /est Connection to -01 #n /he /echnical Settings /ab2 enter the system details

#n /he 5ogon.Security /ab2 enter the logon details. Clic on Save. % +opup &ill imply that connection has been created =o& +ress the /9S/ C)==9C/#)= to chec the connection.

/his means the connection to the remote system &as successful. #f the connection fails &e get an error li e this

However establishin) a connection will not ens"re lo))in) on to the tar)et system. For that we have to test RE;8TE *848,. $ress the RE;8TE *848, b"tton 7 we can see this

And this

Then o"r connection was s"ccess "l. However i we see the screen as shown below then there is an a"thentication ail"re @"serDid or password is wron)A.

The new connection will become visible in the #;?/ list like this.

A ter establishin) the connection, let "s create a pro)ram, which wo"ld tri))er the RFC in DB? system. 4o to #E5. and create a pro)ram Z49!RFC Hrite the ollowin) code

Activate @Ctrl6F5A and E1ec"te @F.A Type any two n"mbers.

$ress @F.A A)ain. He have the desired o"tp"t.

0ploading $aterial $aster &ong Te t (Basic data te t+ 9nspection te t+ 9nternal comment)


9y Te(a This pro)ram co"ld be "sed to "pload the material master lon) te1t @9asic data te1t, inspection te1t, internal commentA. Followin) is the screenshot rom the transaction ;;B3.

He can achieve this "nctionality by "sin) the F"nction ;od"le %C#E" E' E: <. $lease note that i the lon) te1t already e1ists, then it is overwritten in this case. REPORT ZMM_INSERT_LON'TE&T. *I3ter3>< t>=<e to @o<5 <o3: te7t... DATA: BE'IN OF T_"PLOAD O##"RS / MATNR LI!E MARA-MATNR E IDB2C TYPE # E LTE&T LI!E TLINE-TDLINE E END OF T_"PLOAD *I3ter3>< t>=<e to @o<5 <o3: te7t.... T_LINE LI!E TLINE O##"RS / WIT$ $EADER DATA:

M>ter9>< 3;A=er I5e3t9692>t9o3 Lo3: te7t LINE.

W_'R"N LI!E T$EAD-TDID E To @o<5 95 W_OB(E#T LI!E T$EAD-TDOB(E#T VAL"E ,MATERIAL, E To @o<5 o=Qe2t 95 LV_VAL"EBK/C. E V><;e to @o<5 A>ter9>< 3;A=er START-OF-SELE#TION. * T@98 per6orA 98 ;8e5 to ;p<o>5 t@e 69<e PERFORM "PLOAD_FILE. * T@98 per6orA 98 ;8e5 to p<>2e t@e te7t 93 MM/2 tr>38>2t9o3 PERFORM PLA#E_LON'TE&T. *&---------------------------------------------------------------------* *& ForA 2re>te_te7t *&---------------------------------------------------------------------* * T@98 ro;t93e ;8e5 to 2re>te te7t 93 MM/2 tr>38>2t9o3 *----------------------------------------------------------------------* * P>88e5 t@e p>r>Aeter D_:r;3 to P_#_'R"N * >35 <4_4><;e to P_LV_VAL"E *----------------------------------------------------------------------* FORM #REATE_TE&T "SIN' P_#_'R"N P_LV_VAL"E. DATA: L_ID LI!E T$EAD-TDID L_NAMEBK/C. MOVE : P_#_'R"N TO L_ID P_LV_VAL"E TO L_NAME. #ALL F"N#TION ,#REATE_TE&T, E&PORTIN' FID + L_ID FLAN'"A'E + SY-LAN'" FNAME + L_NAME FOB(E#T + W_OB(E#T * SAVE_DIRE#T + ,&, * FFORMAT + ,*, TABLES FLINES + T_LINE E&#EPTIONS NO_INIT + . NO_SAVE + 2 OT$ERS + 0 . IF SY-S"BR# )* /. #LEAR LV_VAL"E. ELSE. DELETE T_LINE INDE& .. ENDIF. ENDFORM. E 2re>te_te7t *&---------------------------------------------------------------------* *& ForA ;p<o>5_69<e *&---------------------------------------------------------------------* * T@98 ro;t93e 98 ;8e5 to ;p<o>5 69<e *----------------------------------------------------------------------* * No 93ter6>2e p>r>Aeter8 >re p>88e5 *----------------------------------------------------------------------* FORM "PLOAD_FILE . #ALL F"N#TION ,"PLOAD, E&PORTIN' * #ODEPA'E + , , * FILENAME + , ,

FILETYPE + ,DAT, ITEM + , , FILEMAS!_MAS! + , , FILEMAS!_TE&T + , , FILETYPE_NO_#$AN'E + , , FILEMAS!_ALL + , , FILETYPE_NO_S$OW + , , LINE_E&IT + , , "SER_FORM + , , "SER_PRO' + , , SILENT + ,S, IMPORTIN' FILESIZE + #AN#EL + A#T_FILENAME + A#T_FILETYPE + TABLES DATA_TAB + T_"PLOAD E&#EPTIONS #ONVERSION_ERROR + . INVALID_TABLE_WIDT$ + 2 INVALID_TYPE + 0 NO_BAT#$ + 1 "N!NOWN_ERROR + % '"I_REF"SE_FILETRANSFER + J OT$ERS + K . IF SY-S"BR# )* /. * MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO * WIT$ SY-MS'V. SY-MS'V2 SY-MS'V0 SY-MS'V1. ENDIF. SORT T_"PLOAD BY MATNR ID. ENDFORM. E ;p<o>5_69<e *&---------------------------------------------------------------------* *& ForA p<>2e_<o3:te7t *&---------------------------------------------------------------------* * T@98 ro;t93e p<>2e8 t@e te7t 93 MM/2 tr>38>2t9o3 *----------------------------------------------------------------------* * No 93ter6>2e p>r>Aeter8 >re p>88e5 *----------------------------------------------------------------------* FORM PLA#E_LON'TE&T . LOOP AT T_"PLOAD. T_LINE-TDFORMAT + ,ST,. T_LINE-TDLINE + T_"PLOAD-LTE&T. APPEND T_LINE. IF T_"PLOAD-ID EP ,BT,. MOVE T_"PLOAD-MATNR TO LV_VAL"E. MOVE ,'R"N, TO W_'R"N. ETe8t ID 6or B>892 5>t> te7t PERFORM #REATE_TE&T "SIN' W_'R"N LV_VAL"E. ENDIF. IF T_"PLOAD-ID EP ,IT,. #LEAR W_'R"N. MOVE T_"PLOAD-MATNR TO LV_VAL"E. MOVE ,PR"E, TO W_'R"N. ETe8t ID 6or I38pe2t9o3 te7t PERFORM #REATE_TE&T "SIN' W_'R"N LV_VAL"E. ENDIF. IF T_"PLOAD-ID EP ,I#,. * * * * * * * * * * * * * * *

#LEAR W_'R"N. MOVE : T_"PLOAD-MATNR TO LV_VAL"E ,IVER, TO W_'R"N. 2oAAe3t PERFORM #REATE_TE&T "SIN' W_'R"N LV_VAL"E. ENDIF. ENDLOOP. ENDFORM. E p<>2e_<o3:te7t

ETe8t ID 6or I3ter3><

System Debugging
9y #elvamani

Consider the follo&ing program2 &hich contains a simple call to the function module #C)=FSG)*.

Set a brea point at the C%55 F@=C/#)= statement and no& e3ecute the program.

9nsure that the system debugging is s&itched off2 by selecting Settings system debugging. )n pressing F12 instead of going into the code of the function module2 the function module is e3ecuted and the follo&ing pop(up is sho&n:

Select a record and press C)=/#=@92 the program is e3ecuted &ithout going into the debug mode of the function module. 7easonO =o& go to the function module #C)=FSG)*. Select Goto Main +rogram.

=o& again select Goto %ttributes

From the above screenshot2 it is understood that the program status is SH ISystem programJ. #n order to debug the system program2 &e need to set the system debugging )=. =o& repeat the above debugging by setting system debugging )=. /his time2 &e should be able to debug the function module.

Can &e set the custom programs as system programsO Go to our program &hich has a call to the function module #C)=FSG)*. Set the debug point at the C%55 F@=C/#)= statement.

Go to program attributes and set the status to System +rogram.

=o& try debugging the program &ith system debugging off. /his time2 the debug point &ill not even reach the C%55 F@=C/#)= statement. )nce you turn the system debugging )=2 both our program and the standard function module could be debugged.

$ESSA%E

(A9S9/%

*y 0uresh Fumar Parvathaneni

7n )eneral, e1ceptions in a "nction mod"le are handled by means o RA7#E EOCE$T78,. This sets a ret"rn code which is passed back to the callin) pro)ram. For e)., let "s consider an e1ample o a "nction mod"le #OOOO, which wo"ld create a p"rchase order with re erence to a $"rchase Re>"isition. The import parameter or this "nction mod"le is $"rchase Re>"isition n"mber and the e1port parameter is the $"rchase 8rder n"mber created here. Ass"me that a ter a $R is created, a material is moved rom one plant to another. ,ow d"rin) the $8 creation, beca"se o this mismatch the $8 wo"ld not be created. 7n a normal case, i there is any mismatch, we )enerally "se RA7#E EOCE$T78, OOOO. This wo"ld stop the "nction mod"le rom "rther processin) and ret"rns to the callin) pro)ram with ("st the ret"rn code. 9"t the callin) pro)ram wo"ld never know the material n"mber that ca"sed this error. ,ow, instead o raisin) the e1ception "sin) RA7#E EOCE$T78,, we wo"ld "se the ollowin) statementI ;E##A4E E5B/@B+A with %111< Raisin) OOOO. :sin) the above statement is similar to the "sa)e o RA7#E EOCE$T78,, e1cept orI 7 the call to the "nction mod"le does not handle EOCE$T78,#, then the messa)e is iss"ed @in this case the error messa)e is iss"edA

7 the callin) pro)ram handles the e1ception, then no messa)e is iss"ed. The callin) pro)ram wo"ld have the messa)e details in the standard messa)e variables #&D ;#47D, #&D;#4E2 and others. #o in o"r case, the callin) pro)ram wo"ld have the in ormation abo"t the material and plant combination that tri))ered the e1ception.

Di((erences )et&een *S%+ and BDC


*atch $ata Communication ?*$CA is the oldest batch inter acin) techni>"e that #A$ provided since the early versions o RV5. 9DC is not a typical inte)ration tool, in the sense that, it can be only be "sed or "ploadin) data into RV5 and so it is not biDdirectional. 9DC works on the principle o sim"latin) "ser inp"t or transactional screen, via an A9A$ pro)ram. Typically the inp"t comes in the orm o a lat ile. The A9A$ pro)ram reads this ile and ormats the inp"t data screen by screen into an internal table @9DCDATAA. The transaction is then started "sin) this internal table as the inp"t and e1ec"ted in the back)ro"nd. 7n Call Transaction, the transactions are tri))ered at the time o processin) itsel and so the A9A$ pro)ram m"st do the error handlin). 7t can also be "sed or realDtime inter aces and c"stom error handlin) G lo))in) eat"res. Hhereas in 9atch 7np"t #essions, the A9A$ pro)ram creates a session with all the transactional data, and this session can be viewed, sched"led and processed @"sin) Transaction #;5?A at a later time. The latter techni>"e has a b"iltDin error processin) mechanism too. +atc' In!ut )+I, !rograms still "se the classical 9DC approach b"t doesnt re>"ire an A9A$ pro)ram to be written to ormat the 9DCDATA. The "ser has to ormat the data "sin) prede ined str"ct"res and store it in a lat ile. The 97 pro)ram then reads this and invokes the transaction mentioned in the header record o the ile. Direct In!ut )DI, !rograms work e1actly similar to 97 pro)rams. 9"t the only di erence is, instead o processin) screens they validate ields and directly load the data into tables "sin) standard "nction mod"les. For this reason, D7 pro)rams are m"ch aster @R;DAT7,D D ;aterial ;aster D7 pro)ram works at least ? times asterA than the 9DC co"nterpart and so ideally s"ited or loadin) lar)e vol"me data. D7 pro)rams are not available or all application areas. =0MG is an encaps"lated data trans er tool. 7t can provide the same "nctionality as 9DC in act m"ch more b"t when comin) to techinical perspective most the parameters are encap"lated. To listo"t some o the di erences I

*#;H is basicaly desi)ned or a "ctional cons"ltant who do not do m"ch codin) b"t need to e1plore the "ctionality while 9DC is desi)ned or a technical cons"ltant. *#;H o ers di erent techin>"e or mi)ratin) dataI Direct inp"t ,9A$7,7doc,9atch inp"t recordin). Hhile bdc basically "ses recordin).

*#;H mappin) is done by #A$ while in 9DC we have to do it e1plicitly . *#;H is basically or standard #A$ application while bdc basically or c"stomi0ed application. Codin) can be done le1ibly in 9DC when compared to *#;H

ABAP Performance Standards

Followin) are the per ormance standards need to be ollowin) in writin) A9A$ pro)ramsI

1,

-nused.Dead code Avoid leaving unused code in the program; Either comment out or delete the unused situation; .se program ,,J chec" ,,J extended program to chec" $or the variables+ #hich are not used statically;

2,

Su)routine -sage (or good modulari>ation+ the decision o$ #hether or not to execute a subroutine should be made be$ore the subroutine is called; (or exampleF
This is better:

7( $4 9E 3; PE'(1'* sub4; E9D7(; (1'* sub4; ;;; E9D(1'*; Than thisF PE'(1'* sub4; (1'* sub4; 7( $4 9E 3; ;;; E9D7(; E9D(1'*; /, -sage o( I0 statements !hen coding 7( tests+ nest the testing conditions so that the outer

conditions are those #hich are most li"ely to $ail; (or logical expressions #ith A9D + place the mostly li"ely $alse $irst and $or the 1'+ place the mostly li"ely true $irst; Example , nested 7(GsF 7( (least li"ely to be true ; 7( (less li"ely to be true ; 7( (most li"ely to be true ; E9D7(; E9D7(; E9D7(; Example , 7(;;;E%SE7(;;;E9D7( F 7( (most li"ely to be true ; E%SE7( (less li"ely to be true ; E%SE7( (least li"ely to be true ; E9D7(; Example , A9DF 7( (least li"ely to be true A9D (most li"ely to be true ; E9D7(; Example , 1'F 7( (most li"ely to be true 1' (least li"ely to be true ; ?; CAS 's, nested I(s
Hhen testin) ields Pe>"al toP somethin), one can "se either the nested 7F or the CA#E statement. The CA#E is better or two reasons. 7t is easier to read and a ter abo"t ive nested 7Fs the per ormance o the CA#E is more e icient.

1,

%2! statements
Hhen records a and b have the e1act same str"ct"re, it is more e icient to ;8EE a T8 b

than to ;8EEDC8RRE#$8,D7,4 a T8 b.

MOVE BSE' TO *BSE'.


is better than

*1&E,C1''ESP19D798 BSE8 T1 KBSE8; A; S * CT and S * CT SI"3*


Hhen "sin) the #E*ECT statement, st"dy the key and always provide as m"ch o the le tD most part o the key as possible. 7 the entire key can be >"ali ied, code a #E*ECT #7,4*E not ("st a #E*ECT. 7 yo" are only interested in the irst row or there is only one row to be ret"rned, "sin) #E*ECT #7,4*E can increase per ormance by "p to three times.

4,

Small internal ta)les 's, complete internal ta)les


7n )eneral it is better to minimi0e the n"mber o ields declared in an internal table. Hhile it may be convenient to declare an internal table "sin) the *7FE command, in most cases, pro)rams will not "se all ields in the #A$ standard table. For e1ampleI 7nstead o thisI dataI t!mara like mara occ"rs B with header line. :se thisI dataI be)in o t!mara occ"rs B, matnr like maraDmatnr, ... end o t!mara.

5,

Ro&-le'el processing and S * CT SI"3*


#imilar to the processin) o a #E*ECTDE,D#E*ECT loop, when callin) m"ltiple #E*ECTD #7,4*E commands on a nonDb" ered table @check Data Dictionary DT Technical 7n oA, yo" sho"ld do the ollowin) to improve per ormanceI o o o :se the #E*ECT into UitabT to b" er the necessary rows in an internal table, then sort the rows by the key ields, then "se a READ TA9*E H7TH FE& ... 97,AR& #EARCH in place o the #E*ECT #7,4*E command. ,ote that this only make sense when the table yo" are b" erin) is not too lar)e @this decision m"st be made on a case by case basisA.

B;

R ADing single records o( internal ta)les


Hhen readin) a sin)le record in an internal table, the READ TA9*E H7TH FE& is not a direct READ. This means that i the data is not sorted accordin) to the key, the system m"st se>"entially read the table. There ore, yo" sho"ldI o #8RT the table

"se READ TA9*E H7TH FE& 97,AR& #EARCH or better per ormance.

43; S2RTing internal ta)les


Hhen #8RTin) internal tables, speci y the ields to #8RTed. #8RT 7TA9 9& F*D2 F*D3. is more e icient than #8RT 7TA9.

11, "um)er o( entries in an internal ta)le


To ind o"t how many entries are in an internal table "se DE#CR79E. DE#CR79E TA9*E 7TA9 *7,E# C,T*,#. is more e icient than *88$ AT 7TA9. C,T*,# W C,T*,# 6 2. E,D*88$.

12, Per(ormance diagnosis


To dia)nose per ormance problems, it is recommended to "se the #A$ transaction #E5B, A9A$V= R"ntime Analysis. The "tility allows statistical analysis o transactions and pro)rams.

1/, "ested S * CTs 'ersus ta)le 'ie&s


#ince releA#E =.B, 8$E, #S* allows both inner and o"ter table (oins. A nested #E*ECT loop may be "sed to accomplish the same concept. However, the per ormance o nested #E*ECT loops is very poor in comparison to a (oin. Hence, to improve per ormance by a actor o 3?1 and red"ce network load, yo" sho"ld either create a view in the data dictionary then "se this view to select data, or code the select "sin) a (oin.

16, I( nested S * CTs must )e used


As mentioned previo"sly, per ormance can be dramatically improved by "sin) views instead o nested #E*ECTs, however, i this is not possible, then the ollowin) e1ample o "sin) an internal table in a nested #E*ECT can also improve per ormance by a actor o ?1I :se thisI orm select!)ood. dataI t!vbak like vbak occ"rs B with header line. dataI t!vbap like vbap occ"rs B with header line. select L rom vbak into table t!vbak "p to 3BB rows. select L rom vbap or all entries in t!vbak where vbeln W t!vbakDvbeln. ... endselect.

end orm. 7nstead o thisI orm select!bad. select L rom vbak "p to 3BB rows. select L rom vbap where vbeln W vbakDvbeln. ... endselect. endselect. end orm. Altho")h "sin) P#E*ECT...F8R A** E,TR7E# 7,...P is )enerally very ast, yo" sho"ld be aware o the three pit alls o "sin) itI Firstly, #A$ a"tomatically removes any d"plicates rom the rest o the retrieved records. There ore, i yo" wish to ens"re that no >"ali yin) records are discarded, the ield list o the inner #E*ECT m"st be desi)ned to ens"re the retrieved records will contain no d"plicates @normally, this wo"ld mean incl"din) in the list o retrieved ields all o those ields that comprise that tableNs primary keyA. #econdly, i yo" were able to code P#E*ECT ... FR8; Udatabase tableT F8R A** E,TR7E# 7, TA9*E UitabTP and the internal table UitabT is empty, then all rows rom Udatabase tableT will be retrieved. Thirdly, i the internal table s"pplyin) the selection criteria @i.e. internal table UitabT in the e1ample P...F8R A** E,TR7E# 7, TA9*E UitabT PA contains a lar)e n"mber o entries, per ormance de)radation may occ"r.

11, S * CT 7 'ersus S * CTing indi'idual (ields


7n )eneral, "se a #E*ECT statement speci yin) a list o ields instead o a #E*ECT L to red"ce network tra ic and improve per ormance. For tables with only a ew ields the improvements may be minor, b"t many #A$ tables contain more than ?B ields when the pro)ram needs only a ew. 7n the latter case, the per ormace )ains can be s"bstantial. For e1ampleI :seI select vbeln a"art vbtyp rom table vbak into @vbakDvbeln, vbakDa"art, vbakDvbtypA where ... 7nstead o "sin)I select L rom vbak where ...

4A; A'oid unnecessary statements


There are a ew cases where one command is better than two. For e1ampleI :seI append Utab!waT to UtabT. 7nstead o I UtabT W Utab!waT. append UtabT @modi y UtabTA.

And also, "seI i not UtabT\] is initial. 7nstead o I describe table UtabT lines Uline!co"nterT. i Uline!co"nterT T B.

4D; Copying or appending internal ta)les


:se thisI Utab3T\] W Utab2T\]. @i Utab3T is emptyA 7nstead o thisI loop at Utab2T. append Utab2T to Utab3T. endloop. However, i Utab3T is not empty and sho"ld not be overwritten, then "seI append lines o Utab2T \ rom inde12] \to inde13] to Utab3T.

Create.$odify.Delete records in any table from CS' file


*y Pavan Allows to create, modi y or delete records based on data comin) rom a C#E ile. ,o other ormat than C#E is allowed. A check is done on ield names to be s"re every key ield is present in so"rce ile. This ile m"st contain header with ields names correspondin) to the DD7C @ ields names m"st be comma separated tooA. #ome system ields can be "pdated too. Test r"n "ses a tr"e ;8D7F& V DE*ETE statement b"t is ollowed by a Rollback. RE$8RT csv!"pload *7,ED#7ZE 3??. L Data DATAI it!ddB5p T&$E TA9*E 8F ddB5p, is!ddB5p T&$E ddB5p. DATAI it!rdata T&$E TA9*E 8F te1t2B3=, is!rdata T&$E te1t2B3=. DATAI it! ields T&$E TA9*E 8F ieldname. DATAI it! ile T&$E REF T8 data, is! ile T&$E REF T8 data. DATAI w!error T&$E te1t253. L ;acros DEF7,E write!error. concatenate NErrorI tableN p!table G2

G3 into w!error separated by space. condense w!error. writeI V w!error. stop. E,DD8FDDEF7,7T78,. L Field symbols F7E*DD#&;98*#I UtableT T&$E #TA,DARD TA9*E, UdataT T&$E A,&, U sT T&$E A,&. L #election screen #E*ECT78,D#CREE,I 9E47, 8F 9*8CF bB2 H7TH FRA;E T7T*E te1tDbB2. $ARA;ETER#I p! ile T&$E local ile DEFA:*T NCI^temp^N 89*74AT8R&, p!separ T&$E c DEFA:*T NZN 89*74AT8R&. #E*ECT78,D#CREE,I E,D 8F 9*8CF bB2. #E*ECT78,D#CREE,I 9E47, 8F 9*8CF bB3 H7TH FRA;E T7T*E te1tDbB3. $ARA;ETER#I p!table T&$E tabname 89*74AT8R& ;E;8R& 7D dtb ;ATCHC8DE 89XECT dd!dbtb!2+. #E*ECT78,D#CREE,I E,D 8F 9*8CF bB3. #E*ECT78,D#CREE,I 9E47, 8F 9*8CF bB5 H7TH FRA;E T7T*E te1tDbB5. $ARA;ETER#I p!create T&$E c A# CHECF98O. #E*ECT78,D#CREE,I E,D 8F 9*8CF bB5, #F7$. #E*ECT78,D#CREE,I 9E47, 8F 9*8CF bB= H7TH FRA;E T7T*E te1tDbB=. $ARA;ETER#I p!nodb RAD789:TT8, 4R8:$ )2 DEFA:*T NON :#ERDC8;;A,D r)2, p!save RAD789:TT8, 4R8:$ )2, p!dele RAD789:TT8, 4R8:$ )2. #E*ECT78,D#CREE,I #F7$. $ARA;ETER#I p!test T&$E c A# CHECF98O, p!list T&$E c A# CHECF98O DEFA:*T NON. #E*ECT78,D#CREE,I E,D 8F 9*8CF bB=. L At selection screen AT #E*ECT78,D#CREE,. 7F syD"comm W NR42N. 7F p!nodb 7# 7,7T7A*. p!test W NON. E,D7F. E,D7F. L At selection screen AT #E*ECT78,D#CREE, 8, EA*:EDRES:E#T F8R p! ile. CA** F:,CT78, NF=!F7*E,A;EN EO$8RT7,4 ield!name W N$!F7*EN

7;$8RT7,4 ile!name W p! ile. L #tart o selection #TARTD8FD#E*ECT78,. $ERF8R; !table!de inition :#7,4 p!table. $ERF8R; !"pload!data :#7,4 p! ile. $ERF8R; !prepare!table :#7,4 p!table. $ERF8R; !process!data. 7F p!nodb 7# 7,7T7A*. $ERF8R; !modi y!table. E,D7F. 7F p!list W NON. $ERF8R; !list!records. E,D7F. L End o selection E,DD8FD#E*ECT78,. LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L F8R; !table!de inition L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L DDT EA*:E@7,!TA9*EA L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL F8R; !table!de inition :#7,4 val"e@in!tableA. DATAI l!tname T&$E tabname, l!state T&$E dd)otstate, l!ddB3v T&$E ddB3v. l!tname W in!table. CA** F:,CT78, NDD7F!TA9*!4ETN EO$8RT7,4 name W l!tname 7;$8RT7,4 )otstate W l!state ddB3v!wa W l!ddB3v TA9*E# ddB5p!tab W it!ddB5p EOCE$T78,# ille)al!inp"t W 2 8THER# W 3. 7F l!state ,E NAN. write!error Ndoes not e1ist or is not activeN space. E,D7F. 7F l!ddB3vDtabclass ,E NTRA,#$N A,D l!ddB3vDtabclass ,E NC*:#TERN. write!error Nis typeN l!ddB3vDtabclass. E,D7F.

E,DF8R;. LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L F8R; !prepare!table L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L DDT EA*:E@7,!TA9*EA L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL F8R; !prepare!table :#7,4 val"e@in!tableA. DATAI l!tname T&$E tabname, lt! tab T&$E lvc!t! cat. l!tname W in!table. CA** F:,CT78, N*EC!F7E*DCATA*84!;ER4EN EO$8RT7,4 i!str"ct"re!name W l!tname CHA,47,4 ct! ieldcat W lt! tab EOCE$T78,# 8THER# W 2. 7F syDs"brc ,E B. HR7TEI V NError while b"ildin) ield catalo)N. #T8$. E,D7F. CA** ;ETH8D cl!alv!table!createWTcreate!dynamic!table EO$8RT7,4 it! ieldcatalo) W lt! tab 7;$8RT7,4 ep!table W it! ile. A##74, it! ileDTL T8 UtableT. CREATE DATA is! ile *7FE *7,E 8F UtableT. A##74, is! ileDTL T8 UdataT. E,DF8R;. LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L F8R; !"pload!data L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L DDT EA*:E@7,!F7*EA L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL F8R; !"pload!data :#7,4 val"e@in! ileA. DATAI l! ile T&$E strin), l!lte1t T&$E strin). DATAI l!len)t T&$E i, l! ield T&$E ieldname. DATAI l!missk T&$E c. l! ile W in! ile. l!len)t W strlen@ in! ile A. F8R;AT 7,TE,#7F7ED 8,.

HR7TEI V NReadin) ileN, in! ile@l!len)tA. CA** F:,CT78, N4:7!:$*8ADN EO$8RT7,4 ilename W l! ile iletype W NA#CN TA9*E# data!tab W it!rdata EOCE$T78,# 8THER# W 2. 7F syDs"brc UT B. HR7TEI V5 NError "ploadin)N, l! ile. #T8$. E,D7F. L File not empty DE#CR79E TA9*E it!rdata *7,E# syDtma1l. 7F syDtma1l W B. HR7TEI V5 NFileN, l! ile, Nis emptyN. #T8$. E*#E. HR7TEI NDN, syDtma1l, Nrows readN. E,D7F. L File header on irst row READ TA9*E it!rdata 7,T8 is!rdata 7,DEO 2. l!lte1t W is!rdata. HH7*E l!lte1t C# p!separ. #$*7T l!lte1t AT p!separ 7,T8 l! ield l!lte1t. A$$E,D l! ield T8 it! ields. E,DHH7*E. 7F syDs"brc W B. l! ield W l!lte1t. A$$E,D l! ield T8 it! ields. E,D7F. L Check all key ields are present #F7$. F8R;AT RE#ET. F8R;AT C8*8R C8*!HEAD7,4. HR7TEI V5 NFey ieldsN. F8R;AT RE#ET. *88$ AT it!ddB5p 7,T8 is!ddB5p HHERE ,8T key la) 7# initial. HR7TEI V5 is!ddB5pD ieldname. READ TA9*E it! ields H7TH FE& table!line W is!ddB5pD ieldname TRA,#$8RT7,4 ,8 F7E*D#. 7F syDs"brc W B. F8R;AT C8*8R C8*!$8#7T7EE. HR7TEI NokN. F8R;AT RE#ET. E*#E7F is!ddB5pDdatatype ,E NC*,TN. F8R;AT C8*8R C8*!,E4AT7EE. HR7TEI NerrorN. F8R;AT RE#ET. l!missk W NON. E,D7F. E,D*88$.

L *o) other ields #F7$. F8R;AT C8*8R C8*!HEAD7,4. HR7TEI V5 N8ther ieldsN. F8R;AT RE#ET. *88$ AT it!ddB5p 7,T8 is!ddB5p HHERE key la) 7# initial. HR7TEI V5 is!ddB5pD ieldname. READ TA9*E it! ields H7TH FE& table!line W is!ddB5pD ieldname TRA,#$8RT7,4 ,8 F7E*D#. 7F syDs"brc W B. HR7TEI NON. E,D7F. E,D*88$. L ;issin) key ield 7F l!missk W NON. #F7$. HR7TEI V5 N;issin) key ields D no "rther processin)N. #T8$. E,D7F. E,DF8R;. LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L F8R; !process!data L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL F8R; !process!data. DATAI l!lte1t T&$E strin), l!ste1t T&$E te1t=B, l! ield T&$E ieldname, l!datat T&$E c. *88$ AT it!rdata 7,T8 is!rdata FR8; 3. l!lte1t W is!rdata. *88$ AT it! ields 7,T8 l! ield. A##74, C8;$8,E,T l! ield 8F #TR:CT:RE UdataT T8 U sT. 7F syDs"brc W B. L Field val"e comes rom ile, determine conversion DE#CR79E F7E*D U sT T&$E l!datat. CA#E l!datat. HHE, N,N. #$*7T l!lte1t AT p!separ 7,T8 l!ste1t l!lte1t. HR7TE l!ste1t T8 U sT R74HTDX:#T7F7ED. 8EER*A& U sT H7TH NBBBBBBBBBBBBBBBBN. Pma1 2+ HHE, N$N. #$*7T l!lte1t AT p!separ 7,T8 l!ste1t l!lte1t. TRA,#*ATE l!ste1t :#7,4 N,.N. U sT W l!ste1t. HHE, NFN. #$*7T l!lte1t AT p!separ 7,T8 l!ste1t l!lte1t. TRA,#*ATE l!ste1t :#7,4 N,.N. U sT W l!ste1t. HHE, NDN. #$*7T l!lte1t AT p!separ 7,T8 l!ste1t l!lte1t.

TRA,#*ATE l!ste1t :#7,4 NV.D.N. CA** F:,CT78, NC8,EERT!DATE!T8!7,TER,A*N EO$8RT7,4 date!e1ternal W l!ste1t 7;$8RT7,4 date!internal W U sT EOCE$T78,# 8THER# W 2. HHE, NTN. CA** F:,CT78, NC8,EERT!T7;E!7,$:TN EO$8RT7,4 inp"t W l!ste1t 7;$8RT7,4 o"tp"t W U sT EOCE$T78,# 8THER# W 2. HHE, 8THER#. #$*7T l!lte1t AT p!separ 7,T8 U sT l!lte1t. E,DCA#E. E*#E. #H7FT l!lte1t :$ T8 p!separ. #H7FT l!lte1t. E,D7F. E,D*88$. 7F ,8T UdataT 7# 7,7T7A*. *88$ AT it!ddB5p 7,T8 is!ddB5p HHERE datatype W NC*,TN. L This ield is mandant A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT. U sT W syDmandt. E,D*88$. 7F p!create W NON. 7F is!ddB5pDrollname W NERDATN. A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT. U sT W syDdat"m. E,D7F. 7F is!ddB5pDrollname W NERZETN. A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT. U sT W syD"0eit. E,D7F. 7F is!ddB5pDrollname W NER,A;N. A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT. U sT W syD"name. E,D7F. E,D7F. 7F is!ddB5pDrollname W NAEDATN. A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT. U sT W syDdat"m. E,D7F. 7F is!ddB5pDrollname W NAET7;N. A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT.

U sT W syD"0eit. E,D7F. 7F is!ddB5pDrollname W NAE,A;N. A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT. U sT W syD"name. E,D7F. A$$E,D UdataT T8 UtableT. E,D7F. E,D*88$. E,DF8R;. LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L F8R; !modi y!table L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL F8R; !modi y!table. #F7$. 7F p!save W NON. ;8D7F& @p!tableA FR8; TA9*E UtableT. E*#E7F p!dele W NON. DE*ETE @p!tableA FR8; TA9*E UtableT. E*#E. EO7T. E,D7F. 7F syDs"brc ES B. F8R;AT C8*8R C8*!$8#7T7EE. 7F p!save W NON. HR7TEI V5 N;odi y table 8FN. E*#E. HR7TEI V5 NDelete table 8FN. E,D7F. F8R;AT RE#ET. 7F p!test 7# 7,7T7A*. C8;;7T H8RF. E*#E. R8**9ACF H8RF. HR7TEI ND test only, no "pdateN. E,D7F. E*#E. F8R;AT C8*8R C8*!,E4AT7EE. HR7TEI V5 NError while modi yin) tableN. F8R;AT RE#ET. E,D7F. E,DF8R;. LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L F8R; !list!records L LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL F8R; !list!records. DATAI l!tlen) T&$E i, l!lasti T&$E i, l!o st T&$E i.

L 8"tp"t width l!tlen) W 2. *88$ AT it!ddB5p 7,T8 is!ddB5p. l!tlen) W l!tlen) 6 is!ddB5pDo"tp"tlen. 7F l!tlen) *T syDlins0. l!lasti W syDtabi1. l!tlen) W l!tlen) 6 2. E*#E. l!tlen) W l!tlen) D is!ddB5pDo"tp"tlen. EO7T. E,D7F. E,D*88$. L 8"tp"t header #F7$. F8R;AT C8*8R C8*!HEAD7,4. HR7TEI V5 NContentsN. F8R;AT RE#ET. :*7,E AT V5@l!tlen)A. L 8"tp"t records *88$ AT UtableT A##74,7,4 UdataT. *88$ AT it!ddB5p 7,T8 is!ddB5p FR8; 2 T8 l!lasti. 7F is!ddB5pDposition W 2. HR7TEI V5 syDvline. l!o st W 5. E,D7F. A##74, C8;$8,E,T is!ddB5pD ieldname 8F #TR:CT:RE UdataT T8 U sT. l!o st W l!o st 6 2. 7F is!ddB5pDdecimals *E 3. HR7TEI AT l!o st U sT. E*#E. HR7TEI AT l!o st U sT DEC7;A*# 5. E,D7F. l!o st W l!o st 6 is!ddB5pDo"tp"tlen. HR7TEI AT l!o st syDvline. E,D*88$. E,D*88$. L 8"tp"t end :*7,E AT V5@l!tlen)A. E,DF8R;.

"um)er Range 2)8ect


*y 0uresh Fumar Parvathaneni

Creation o a ,"mber ran)e ob(ectI 2. 4o to transaction #,R8 @#imple way to remember is

0ap)"mber#an)e1b(ectA.

3. 5.

Enter the n"mber ran)e ob(ect name and press CREATE. Enter the description, *on) te1t and ,"mber *en)th domain andHarnin) M as shown belowI

Harnin)M Ass"me that an interval is de ined rom 2 to 2BBB. 7 yo" want to iss"e a warnin) at the n"mber /BB, enter 2B @MA here.

=.

$ress #AEE. &o" wo"ld )et a prompt as shown belowI

?. +.

$ress &E# and assi)n the ob(ect to a local class. ,ow click on C,"mber Ran)es' b"tton on the application toolbar.

-.

Click on CChan)e 7ntervals'.

.. /.

Click on C7nsert 7nterval'. Enter the val"es as shown belowI

2B. Click C7nsert' and then #AEE. The n"mber ran)e ob(ect is )enerated. estin( the )um!er #an(e 1!,ect I He can "se the "nction mod"le, ,:;9ER!4ET!,EOT, to )et the ne1t n"mber o any n"mber ran)e ob(ect. Followin) is a test pro)ram to )et the ne1t available n"mber o the ob(ect created aboveI 'EP1'T >snroEtest; DATAF 9.*BE' THPE 7; CA%% (.9CT719 G9.*BE'E8ETE9E:TG E:P1'T798 nrErangeEnr L G34G ob-ect L GMDE*1G 7*P1'T798 9.*BE' L 9.*BE' E:CEPT719S 79TE'&A%E91TE(1.9D L 4 9.*BE'E'A98EE91TE79TE'9 L 5 1BIECTE91TE(1.9D L 6 /.A9T7THE7SE3 L ? /.A9T7THE7SE91TE4 L @ 79TE'&A%E1&E'(%1! L A B.((E'E1&E'(%1! L D 1T)E'S L C ; 7( sy,subrc NJ 3; *ESSA8E 7D SH,*S87D THPE SH,*S8TH 9.*BE' SH,*S891

!7T) SH,*S8&4 SH,*S8&5 SH,*S8&6 SH,*S8&?; E9D7(; !rite F= G9ext available number isF G+ 9umber;

Dynamic Internal Ta)le


9y Ei(ayanand $oreddy This T"torial details abo"t creation o dynamic internal table with di erent scenarios .nternal a!les are local tables within a pro)ram containin) a series o lines havin) same data type. A9A$T; 8pen #S* allows sin)le ield, ran)e o ields, entire database table or view into an internal table.

7n technical terms 7nternal table is a dynamic se>"ential dataset in which all records have the same data str"ct"re and a key. A static internal ta)le can be declared in an A9A$ T; pro)ram initially, when the str"ct"re o the internal table is i1ed and known to the "ser. Dynamic internal ta)le is an e1tension to internal table concept, "sed when the n"mber o ields is not known at the desi)n time or "ntil the compile time. 0cenario 4: Display the table o contents in )rid ormat "sin) the dynamic internal table. Creatin( $ynamic internal ta!le $ARA;ETER# I p!table@2BA T&$E C. DATAI w!tabname T&$E w!tabname, w!dre T&$E REF T8 data, w!)rid T&$E REF T8 cl!)"i!alv!)rid. F7E*DD#&;98*#I Ut!itabT T&$E A,& TA9*E. w!tabname W p!table. CREATE DATA w!dre T&$E TA9*E 8F @w!tabnameA. A##74, w!dre DTL T8 Ut!itabT.

$op"latin) Dynamic internal table #E*ECT L FR8; @w!tabnameA :$ T8 3B R8H# 7,T8 TA9*E Ut!itabT. Displayin) dynamic internal table "sin) 4rid. CREATE 89XECT w!)rid EO$8RT7,4 i!parent W cl!)"i!containerWTscreenB. CA** ;ETH8D w!)ridDTset!table! or! irst!display EO$8RT7,4 i!str"ct"re!name W w!tabname CHA,47,4 it!o"ttab W Ut!itabT.

CA** #CREE, 2BB. 0cenario 5: Create a dynamic internal table with the speci ied n"mber o col"mns. Creatin( $ynamic internal ta!le T&$ED$88*#I slis. F7E*DD#&;98*#I Ut!dyntableT T&$E #TA,DARD TA9*E, C Dynamic internal table name U s!dyntableT, U s! ldvalT type any. $ARA;ETER#I p!cols@?A T&$E c. DATAI t!newtable T&$E REF T8 data, C Field symbol to create work area C Field symbol to assi)n val"es C 7np"t n"mber o col"mns

t!newline T&$E REF T8 data, t! ldcat T&$E slis!t! ldcat!alv, t! ldcat T&$E lvc!t! cat, wa!it! ldcat T&$E lvc!s! cat, wa!colno@3A T&$E n, wa! lname@?A T&$E c. L Create ields . D8 p!cols T7;E#. C*EAR wa!it! ldcat. move syDinde1 to wa!colno. concatenate NC8*N wa!colno into wa! lname. wa!it! ldcatD ieldname W wa! lname. wa!it! ldcatDdatatype W NCHARN. wa!it! ldcatDintlen W 2B. A$$E,D wa!it! ldcat T8 t! ldcat. E,DD8. L Create dynamic internal table and assi)n to F# CA** ;ETH8D cl!alv!table!createWTcreate!dynamic!table EO$8RT7,4 it! ieldcatalo) W t! ldcat 7;$8RT7,4

ep!table

W t!newtable.

A##74, t!newtableDTL T8 Ut!dyntableT. L Create dynamic work area and assi)n to F# CREATE DATA t!newline *7FE *7,E 8F Ut!dyntableT. A##74, t!newlineDTL T8 U s!dyntableT. Populatin( $ynamic internal ta!le DATAI ieldname@3BA T&$E c. DATAI ieldval"e@2BA T&$E c. DATAI inde1@5A T&$E c. D8 p!cols T7;E#. inde1 W syDinde1. ;8EE syDinde1 T8 wa!colno. C8,CATE,ATE NC8*N wa!colno 7,T8 wa! lname. L #et "p ieldval"e C8,CATE,ATE NEA*:EN inde1 7,T8 ieldval"e. C8,DE,#E ieldval"e ,8D4A$#.

A##74, C8;$8,E,T wa! lname 8F #TR:CT:RE U s!dyntableT T8 U s! ldvalT. U s! ldvalT W ieldval"e. E,DD8.

L Append to the dynamic internal table A$$E,D U s!dyntableT T8 Ut!dyntableT. $isplayin( dynamic internal ta!le usin( %rid. DATAI wa!cat *7FE *7,E 8F s! ldcat. D8 p!cols T7;E#. C*EAR wa!cat. ;8EE syDinde1 T8 wa!colno. C8,CATE,ATE NC8*N wa!colno 7,T8 wa! lname. wa!catD ieldname W wa! lname. wa!catDselte1t!s W wa! lname. wa!catDo"tp"tlen W N2BN. A$$E,D wa!cat T8 s! ldcat. E,DD8. L Call A9A$ *ist Eiewer @A*EA CA** F:,CT78, NRE:#E!A*E!4R7D!D7#$*A&N EO$8RT7,4 it! ieldcat W s! ldcat TA9*E# t!o"ttab W Ut!dyntableT.

In(otype creation

Custom 7n$otype can be created by $ollo#ing these stepsF 4; 8o to transaction P*34;

5; Provide the 7n$otype number; The number should be $rom B333 to BBBB; Avoid providing the 7n$otype number that already exists; 6; See to it that the Employee 7n$otype and PS structure radio buttons have been selected; All Push button ?; Select the OAllP Push button as sho#n in above $igure; The $ollo#ing belo# sho#n screen is displayed; @; *aintain the structure (Provide $ields #hich #ill be included in our current custom 7n$otype; The PAQEH=PBQEH and PS)D4 structures are not re2uired to be provided #hile creating the custom 7n$otype; They are included in the custom 7n$otype by de$ault; A; Save and activate the structure; 8o to the initial screen o$ P*34 transaction; 7n$otype characteristics Push button Technical Attributes Push button D; Select the O7n$otype characteristicsP push button sho#n in the above $igure; The belo# screen is displayed; 9e# Entries Push button C; Select the O9e# EntriesP push button sho#n in the above $igure; The belo# sho#n screen is displayed; B; Provide the Current custom 7n$otype number (B335 and description $or the 7n$otype; Also provide the Time constraint based on the re2uirement+ 5333 as the single screen and 6333 as the list screen; 43; The OSubtype 1bligatoryP chec" box needs to be selected i$ #e intend to ma"e the subtype as mandatory $ield; This step is use$ul #hen #e come through the step 44 (Subtype maintenance ;This step can be s"ipped i$ #e donPt #ant the subtype $or an 7n$otype; 44; Save the 7n$otype details and go bac" to the initial screen o$ P*34 transaction; Additional steps 7$ a subtype needs to be maintained $or the 7n$otype then some additional steps also needs to be per$ormed be$ore providing 7n$otype characteristics (step number D ; 45; Select the Technical attributes ((igure sho#n in step A $rom the initial screen o$ P*34 transaction ;The belo# sho#n $igure is displayed; 46; Select the change button on application tool bar; The dialog module in the above screen then becomes

editable; 4?; Select the 7n$otype B335 and select the details button as sho#n in the above $igure (7n change mode ; The belo# sho#n $igure is displayed; Display=Change button Details 4@; Provide the Subtype $ield o$ the 7n$otype+ Subtype table as T@B4A and Subty;text table as T@B4S; 4A; Save and go bac" to the initial P*34 screen; 4D; The subtypes $or an 7n$otype can be entered via the maintenance vie# &ET@B4A; 4C; Continue #ith step D as re2uired;

Automatic 'endor Debit Posting


#"bmitted by Eikram $lease note that there are some c"stom ields added in the E9A$ table, c"stom messa)e class and c"stom incl"de pro)ram "sed in this pro)ram. :n ort"nately, the contrib"tor co"ldnNt provide "s with the "nctionalVtechnical speci ications or this pro)ram.

REPORT ZA"TO_DEBIT_VENDOR NO STANDARD PA'E $EADIN' LINE-SIZE 2%/ LINE-#O"NT J%B2C MESSA'E-ID ZS#M. ************************************************************************ * Pro:r>A 3>Ae : ZA"TO_DEBIT_VENDOR * T?pe : Report * De82r9pt9o3 : A;toA>t92 Ve35or De59t Po8t93:8 ************************************************************************ *---------------------------------------------------------------------* * TABLES *---------------------------------------------------------------------* TABLES: VBA! ADRJ TRDYSE/.#M. *---------------------------------------------------------------------* * IN#L"DE *---------------------------------------------------------------------* IN#L"DE ZZ"TI_STD_$EADER_FOOTER. ESt>35>r5 @e>5er >35 6ooter *----------------------------------------------------------------------* * TYPES DE#LARATION *----------------------------------------------------------------------* TYPES: BE'IN OF T_#RMEMO VBELN TYPE VBA!-VBELN

POSNR TYPE VBAP-POSNR ERDAT TYPE VBA!-ERDAT A"ART TYPE VBA!-A"ART A"'R" TYPE VBA!-A"'R" WAER! TYPE VBA!-WAER! V!OR' TYPE VBA!-V!OR' VTWE' TYPE VBA!-VTWE' SPART TYPE VBA!-SPART VDAT" TYPE VBA!-VDAT" BSTN! TYPE VBA!-BSTN! BSAR! TYPE VBA!-BSAR! BSTD! TYPE VBA!-BSTD! AEDAT TYPE VBA!-AEDAT B"!RS_VF TYPE VBA!-B"!RS_VF MATNR TYPE VBAP-MATNR ZMEN' TYPE VBAP-ZMEN' ZIEME TYPE VBAP-ZIEME END OF T_#RMEMO BE'IN OF T_#RMEMO_#$AN'E VBELNBN/C TYPE # POSNR TYPE VBAP-POSNR ERDAT TYPE VBA!-ERDAT A"ART TYPE VBA!-A"ART A"'R" TYPE VBA!-A"'R" WAER! TYPE VBA!-WAER! V!OR' TYPE VBA!-V!OR' VTWE' TYPE VBA!-VTWE' SPART TYPE VBA!-SPART VDAT" TYPE VBA!-VDAT" BSTN! TYPE VBA!-BSTN! BSAR! TYPE VBA!-BSAR! BSTD! TYPE VBA!-BSTD! AEDAT TYPE VBA!-AEDAT B"!RS_VF TYPE VBA!-B"!RS_VF MATNR TYPE VBAP-MATNR ZMEN' TYPE VBAP-ZMEN' ZIEME TYPE VBAP-ZIEME END OF T_#RMEMO_#$AN'E BE'IN OF T_MV!E MATNR TYPE MV!E-MATNR V!OR' TYPE MV!E-V!OR' VTWE' TYPE MV!E-VTWE' MTPOS TYPE MV!E-MTPOS END OF T_MV!E BE'IN OF T_ORDERS VBELV TYPE VBFA-VBELV POSNV TYPE VBFA-POSNV VBELN TYPE VBFA-VBELN POSNN TYPE VBFA-POSNN VBTYP_N TYPE VBFA-VBTYP_N END OF T_ORDERS BE'IN OF T_E!PO EBELN TYPE E!!O-EBELN

EBELP TYPE WAERS TYPE MEN'E TYPE MEINS TYPE NETPR TYPE PEIN$ TYPE AD8HM TYPE T&(#D TYPE END OF T_E!PO

E!PO-EBELP E!!O-WAERS E!PO-MEN'E E!PO-MEINS E!PO-NETPR E!PO-PEIN$ E!PO-AD8HM E!PO-T&(#D

BE'IN OF T_E!BE EBELN TYPE E!BE-EBELN EBELP TYPE E!BE-EBELP ZE!!N TYPE E!BE-ZE!!N V'ABE TYPE E!BE-V'ABE '(A$R TYPE E!BE-'(A$R BELNR TYPE E!BE-BELNR B"ZEI TYPE E!BE-B"ZEI END OF T_E!BE BE'IN OF T_RB!P BELNR TYPE RB!P-BELNR '(A$R TYPE RB!P-'(A$R BLDAT TYPE RB!P-BLDAT B"DAT TYPE RB!P-B"DAT &BLNR TYPE RB!P-&BLNR LIFNR TYPE RB!P-LIFNR RMWWR TYPE RB!P-RMWWR WMWST. TYPE RB!P-WMWST. &RE#$ TYPE RB!P-&RE#$ STBL' TYPE RB!P-STBL' END OF T_RB!P BE'IN OF T_#D$DR OB(E#T#LAS TYPE OB(E#TID TYPE #$AN'ENR TYPE "DATE TYPE "TIME TYPE END OF T_#D$DR BE'IN OF T_#DPOS OB(E#T#LAS TYPE OB(E#TID TYPE #$AN'ENR TYPE TABNAME TYPE TAB!EY TYPE FNAME TYPE #$N'IND TYPE VAL"E_NEW TYPE VAL"E_OLD TYPE END OF T_#DPOS #D$DR-OB(E#T#LAS #D$DR-OB(E#TID #D$DR-#$AN'ENR #D$DR-"DATE #D$DR-"TIME

#D$DR-OB(E#T#LAS #D$DR-OB(E#TID #D$DR-#$AN'ENR #DPOS-TABNAME #DPOS-TAB!EY #DPOS-FNAME #DPOS-#$N'IND #DPOS-VAL"E_NEW #DPOS-VAL"E_OLD

BE'IN OF T_#$AN'E_DO#S OB(E#T#LAS TYPE #D$DR-OB(E#T#LAS OB(E#TID TYPE #D$DR-OB(E#TID #$AN'ENR TYPE #D$DR-#$AN'ENR

"DATE TYPE #D$DR-"DATE "TIME TYPE #D$DR-"TIME TABNAME TYPE #DPOS-TABNAME TAB!EY TYPE #DPOS-TAB!EY FNAME TYPE #DPOS-FNAME #$N'IND TYPE #DPOS-#$N'IND VAL"E_NEW TYPE #DPOS-VAL"E_NEW VAL"E_OLD TYPE #DPOS-VAL"E_OLD END OF T_#$AN'E_DO#S BE'IN OF T_S"##ESS 2rAeAo TYPE VBA!-4=e<3 2AeAo TYPE VBA!-4=e<3 or5er8 TYPE VBA!-4=e<3 po TYPE VBA!-4=e<3 A9ro_3o TYPE VBA!-4=e<3 te7tB2/C TYPE # END OF T_S"##ESS BE'IN OF T_ERROR 2rAeAo TYPE VBA!-4=e<3 2AeAo TYPE VBA!-4=e<3 or5er8 TYPE VBA!-4=e<3 po TYPE VBA!-4=e<3 A9ro_3o TYPE VBA!-4=e<3 te7tB.//C TYPE # END OF T_ERROR. *----------------------------------------------------------------------* * WOR!AREA DE#LARATION *----------------------------------------------------------------------* DATA: WA_#RMEMO TYPE T_#RMEMO WA_#RMEMO_#$AN'E TYPE T_#RMEMO_#$AN'E WA_MV!E TYPE T_MV!E WA_ORDERS TYPE T_ORDERS WA_#MEMO TYPE T_ORDERS WA_PO TYPE T_ORDERS WA_E!PO TYPE T_E!PO WA_E!BE TYPE T_E!BE WA_E!BE_TEMP TYPE T_E!BE WA_RB!P TYPE T_RB!P WA_RB!P_TMP TYPE T_RB!P WA_#D$DR TYPE T_#D$DR WA_#DPOS TYPE T_#DPOS WA_#$AN'E_DO#S TYPE T_#$AN'E_DO#S WA_#RMEMO_MRLM TYPE T_#RMEMO WA_S"##ESS TYPE T_S"##ESS WA_ERROR TYPE T_ERROR WA_S"##ESS_MRLM TYPE T_S"##ESS WA_ERROR_MRLM TYPE T_ERROR. *--WorH >re> for ><< t@e 93ter3>< t>=<e8 ;8e5 for Se3593: M>9< DATA : WA_OB(PA#! TYPE SOP#!LSTI. WA_OB($EAD TYPE SOLISTI. WA_OB(BIN TYPE SOLISTI.

WA_OB(T&T TYPE SOLISTI. WA_RE#LIST TYPE SOMLRE#I. . DATA: *-- Str;2t;re to @o<5 I34o92e $e>5er D>t> 7_5o2@e>5er LI!E =>p9_932934_2re>te_@e>5er *-- Str;2t;re to @o<5 Re4er8>< Po8t93: D>t> 7_re4_po8t LI!E BAPI_IN#INV_FLD. *----------------------------------------------------------------------* * INTERNAL TAABLE DE#LARATION *----------------------------------------------------------------------* DATA: IT_#RMEMO TYPE STANDARD TABLE OF T_#RMEMO WIT$ $EADER LINE IT_#RMEMO_#$AN'E TYPE STANDARD TABLE OF T_#RMEMO_#$AN'E WIT$ $EADER LINE IT_MV!E TYPE STANDARD TABLE OF T_MV!E WIT$ $EADER LINE IT_#RMEMO_MIRO TYPE STANDARD TABLE OF T_#RMEMO WIT$ $EADER LINE IT_#RMEMO_MRLM TYPE STANDARD TABLE OF T_#RMEMO WIT$ $EADER LINE IT_ORDERS TYPE STANDARD TABLE OF T_ORDERS WIT$ $EADER LINE IT_#MEMO TYPE STANDARD TABLE OF T_ORDERS WIT$ $EADER LINE IT_PO TYPE STANDARD TABLE OF T_ORDERS WIT$ $EADER LINE IT_E!PO TYPE STANDARD TABLE OF T_E!PO WIT$ $EADER LINE IT_E!BE TYPE STANDARD TABLE OF T_E!BE WIT$ $EADER LINE IT_E!BE_TEMP TYPE STANDARD TABLE OF T_E!BE WIT$ $EADER LINE IT_RB!P TYPE STANDARD TABLE OF T_RB!P WIT$ $EADER LINE IT_#D$DR TYPE STANDARD TABLE OF T_#D$DR WIT$ $EADER LINE IT_#DPOS TYPE STANDARD TABLE OF T_#DPOS WIT$ $EADER LINE IT_#$AN'E_DO#S TYPE STANDARD TABLE OF T_#$AN'E_DO#S WIT$ $EADER LINE IT_S"##ESS TYPE STANDARD TABLE OF T_S"##ESS WIT$ $EADER LINE IT_ERROR TYPE STANDARD TABLE OF T_ERROR WIT$ $EADER LINE IT_S"##ESS_MRLM TYPE STANDARD TABLE OF T_S"##ESS WIT$ $EADER LINE IT_ERROR_MRLM TYPE STANDARD TABLE OF T_ERROR WIT$ $EADER LINE. *-- I3ter3>< t>=<e to @o<5 I34o92e IteA D>t> DATA:BE'IN OF 9t_9teA5>t> O##"RS /. IN#L"DE STR"#T"RE =>p9_932934_2re>te_9teA. DATA:END OF 9t_9teA5>t>. *-- I3ter3>< t>=<e to @o<5 I34o92e A22t A889:3Ae3t D>t> DATA:BE'IN OF 9t_A##O"NT93:5>t> O##"RS /. IN#L"DE STR"#T"RE BAPI_IN#INV_#REATE_A##O"NT. DATA:END OF 9t_>22o;3t93:5>t>. *-- I3ter3>< t>=<e to @o<5 BAPI return 5>t> DATA: BE'IN OF 9t_ret;r3 O##"RS /. IN#L"DE STR"#T"RE =>p9ret2. ERet;r3 P>r>Aeter. DATA: END OF 9t_ret;r3. *-- I3ter3>< t>=<e to @o<5 BAPI return 5>t> DATA: BE'IN OF 9t_ret;r3_ArLA O##"RS /. IN#L"DE STR"#T"RE =>p9ret2. ERet;r3 P>r>Aeter. DATA: END OF 9t_ret;r3_ArLA. *--MAIL re<>te5 I3ter3>< t>=<e8 DATA: &_DO#_#$N' TYPE SODO##$'I. IT_OB(PA#! TYPE STANDARD TABLE OF SOP#!LSTI. E 5o2;Ae3t >ttr9=;te8 E >tt>2@Ae3t t>=<e

IT_OB($EAD TYPE STANDARD TABLE OF SOLISTI. E o=Qe2t @e>5er t>=<e IT_OB(BIN TYPE STANDARD TABLE OF SOLISTI. E =93>r? t>=<e IT_OB(T&T TYPE STANDARD TABLE OF SOLISTI. E o=Qe2t te7t IT_RE#LIST TYPE STANDARD TABLE OF SOMLRE#I. E A>9< re29p9e3t8 9t_2oApre88e5_<98t TYPE STANDARD TABLE OF SOLI 9t_p56_<98t TYPE STANDARD TABLE OF TLINE 9t_p56 TYPE t<93e O##"RS ./ WIT$ $EADER LINE 9t_@tA< TYPE 8o<98t9. O##"RS ./ WIT$ $EADER LINE *-- I3ter3>< t>=<e for MIME 5>t> B93 #$AR 6orA>tC 9t_teAp TYPE =>p9O2A9Ae O##"RS ./ WIT$ $EADER LINE *-- I3ter3>< t>=<e for 8tor93: 5>t> 9t_A9AeB2%%C TYPE 2 O##"RS ./ WIT$ $EADER LINE. *----------------------------------------------------------------------* * 'LOBAL VARIABLES * *----------------------------------------------------------------------* DATA: V_P'M_ID TYPE SY-REPID E Pro:r>A 95 4_MterA TYPE <6=.-MterA E P>?Ae3t TerA8 4_te7tBK%C TYPE 2 E To 8tore error or 8;22e88 te7t 4_9teA3oBJC TYPE 3 E To I32reAe3t IteA No. 6or BAPI 4_5o23r LI!E =>p9_932934_6<5-934_5o2_3o E For MIRO 5o2;Ae3t 3;A=er 4_?e>r. LI!E =>p9_932934_6<5-6982_?e>r E For MIRO F982>< ?e>r 4_8po3o t?pe TSP/.-RPIDENT E For Spoo< No. 4_t?pe t?pe SOOD!-OB(TP E For Spoo< T?pe V_#RMEMO_PTY TYPE VBAP-ZMEN' E For #R MeAo Pt?. V_LINE_AMO"NT TYPE E!PO-NETPR E For #R MeAo IteA Pt?. V_'ROSSAMT TYPE E!PO-NETPR E For #R MeAo 'r>35 Pt?. 4_t>7_perB0C t?pe 3 E For #R MeAo T>7 >Ao;3t W 4_t>7_>At TYPE E!PO-NETPR E For #R MeAo T>7 >Ao;3t 4_6<>:B.C t?pe 2 E F<>: to pro2e88 6r;t@er 4_tot_8_ArLA TYPE 9 E For MRLM S;22e88 Re2or58 4_tot_e_ArLA TYPE 9 E For MRLM Error Re2or58 V_DATE TYPE SY-DAT"M E For Se<. S2ree3 D>te V_DATE2B./C TYPE # E For EM>9< D>te V_TIMEB./C TYPE # E For EM>9< T9Ae V_TIME2B./C TYPE # E For EM>9< T9Ae V_INFOB.//C TYPE # E For EM>9< Bo5? Te7t V_TABLE_LINES TYPE SY-TABI& E To I32reAe3t EA>9< #o;3t V_TE&T2 TYPE STRIN' E For EM>9< I5 te7t 4_<93e8 TYPE 9 E To Store PDF L93e8 4_teApB%//C TYPE 2 E To #o34ert to 2%% 2@>r 6orA>t 4_o668et TYPE p E To #o34ert to 2%% 2@>r 6orA>t 4_<93e8<e3 TYPE 9 E To #o34ert to 2%% 2@>r 6orA>t 4_A9Ae<e3 TYPE 9 E To #o34ert to 2%% 2@>r 6orA>t 4_t>=97 t?pe 8?-t>=97. E To #o34ert to 2%% 2@>r 6orA>t

*----------------------------------------------------------------------* * #ONSTANTS * *----------------------------------------------------------------------* #ONSTANTS: #_&B.C TYPE # VAL"E ,&, E #o38t>3t & or F<>: #_EB.C TYPE # VAL"E ,E, E For Error 2@e2H 2_4B.C TYPE # VAL"E ,V, E For PO Do28 2_oB.C TYPE # VAL"E ,O, E For Or5er Do28 2_2B.C TYPE # VAL"E ,#, E For #re59t MeAo Do28 2_HB.C TYPE # VAL"E ,!, E For #R MeAo Do28 2_;B.C TYPE # VAL"E ,", E For #@>3:e t>=<e8 "p5>te 2_><9B0C TYPE # VAL"E ,ALI, E For ALI ForA>t 2_4=>HB1C TYPE # VAL"E ,VBA!, E For #@>3:e 5o28 t>=<e #_/.B2C TYPE # VAL"E ,/., E For Ser9>< No. & Re4er8>< Re>8o3 #_/2B2C TYPE # VAL"E ,/2, E For Re4er8>< Re>8o3 2_=<>rt TYPE =Hp6-=<>rt VAL"E ,RE, E Do2;Ae3t t?pe #_MTPOS TYPE MV!E-MTPOS VAL"E ,BANS, E IteA #>te:or? :ro;p #_A"'R"B%C TYPE # VAL"E ,A"'R", E Re>8o3 #o5e #_////%//2/%B./C TYPE # VAL"E ,////%//2/%, E 'L A22o;3t X #_VER!BELE'BNC TYPE # VAL"E ,VER!BELE',. E For O=Qe2t #<>88 *-- $or9Mo3t>< t>= & <93e 6ee5 2o38t>3t8 #LASS #L_ABAP_#$AR_"TILITIES DEFINITION LOAD. #ONSTANTS: #_TAB TYPE # VAL"E #L_ABAP_#$AR_"TILITIES+*$ORIZONTAL_TAB #_#R_LF TYPE # VAL"E #L_ABAP_#$AR_"TILITIES+*#R_LF . *----------------------------------------------------------------------* * SELE#TION S#REEN *----------------------------------------------------------------------* *-- Se<e2t Opto38 SELE#TION-S#REEN: BE'IN OF BLO#! B/. WIT$ FRAME TITLE TE&T-//.. SELE#T-OPTIONS: S_A"ART FOR VBA!-A"ART OBLI'ATORY NO INTERVALS E S><e8 Do2;Ae3t T?pe S_A"'R" FOR VBA!-A"'R" OBLI'ATORY NO INTERVALS E Or5er re>8o3 S_ERDAT FOR VBA!-ERDAT OBLI'ATORY. E D>te o3 D@92@ t@e re2or5 D>8 2re>te5 SELE#TION-S#REEN: END OF BLO#! B/.. *-- M>9< Se3593: Opt9o38 SELE#TION-S#REEN BE'IN OF BLO#! B2 WIT$ FRAME TITLE TE&T-//1. PARAMETERS:P_EMAIL AS #$E#!BO& DEFA"LT SPA#E "SER-#OMMAND V_#OM . PARAMETERS : P_MODE TYPE SO_ES#APE default ,", MODIF ID "S.. SELE#T-OPTIONS: S_EMAIL FOR ADRJ-SMTP_ADDR NO INTERVALS MODIF ID "S2. * SELE#T-OPTIONS: S_EMAIL FOR TRDYSE/.#M-"SERNAME * NO INTERVALS MODIF ID "S2. SELE#TION-S#REEN: BE'IN OF LINE. SELE#TION-S#REEN: #OMMENT %%B1/C TE&T-/.N MODIF ID "S2. SELE#TION-S#REEN: END OF LINE. SELE#TION-S#REEN END OF BLO#! B2.

*----------------------------------------------------------------------* * WOR! AREA for SELE#T-OPTIONS *----------------------------------------------------------------------* DATA : &_EMAIL LI!E S_EMAIL. EWorH >re> 6or EMAIL 8e<e2t-opt9o38 *----------------------------------------------------------------------* * INITIALIZATION *----------------------------------------------------------------------* INITIALIZATION. *-- De6>;<t 4><;e8 for S><e8 Do2;Ae3t T?pe #LEAR S_A"ARTFG. S_A"ART-SI'N + ,I,. S_A"ART-OPTION + ,EP,. S_A"ART-LOW + ,#R,. APPEND S_A"ART. #LEAR S_A"ART. *-- De6>;<t 4><;e8 for D>te o3 D@92@ t@e re2or5 D>8 2re>te5 V_DATE + B SY-DAT"M - . C. #LEAR S_ERDATFG. S_ERDAT-SI'N + ,I,. S_ERDAT-OPTION + ,EP,. S_ERDAT-LOW + SY-DAT"M. S_ERDAT-$I'$ + SY-DAT"M. APPEND S_ERDAT. #LEAR S_ERDAT. *----------------------------------------------------------------------* * TOP OF PA'E * *----------------------------------------------------------------------* TOP-OF-PA'E. *-- D98p<>?93: 8t>35>r5 @e>5er. PERFORM 8t5_top_o6_p>:e "SIN' 8?-t9t<e. *----------------------------------------------------------------------* * A T S E L E # T I O N S # R E E N O " T P " T *----------------------------------------------------------------------* *-- For Ao596?93: t@e 8e<e2t9o3 82ree3 <>?o;t AT SELE#TION-S#REEN O"TP"T. PERFORM F_MODIFY_S#REEN. *----------------------------------------------------------------------* * AT SELE#TION S#REEN. * *----------------------------------------------------------------------* AT SELE#TION-S#REEN. *-- S;=ro;t93e to V><95>te 8e<e2t9o3 82ree3 69e<58 PERFORM 6_4><95>te. *----------------------------------------------------------------------* * START-OF-SELE#TION * *----------------------------------------------------------------------* START-OF-SELE#TION. *-- Fet2@ t@e #re59t MeAo ReO;e8t8 5o2;Ae3t8 PERFORM F_'ET_#REDIT_MEMO_REP"EST. IF NOT IT_#RMEMOFG IS INITIAL.

*-- Fet2@ IteA #>te:or? 'ro;p PERFORM F_'ET_MV!E_DO#S. *-- Fet2@ S><e8 Or5er 5o2;Ae3t8 PERFORM F_'ET_SO_PO_DO#S. ENDIF. PO Do2;Ae3t8 >35 #re59t MeAo8

*-- I6 #re59t AeAo reO;e8t 93ter3>< t>=<e @>4e >3 2@>3:e re2or58 t@e3 * 6et2@ t@e 2@>3:e 5o2;Ae3t8 6roA #D$DR >35 #DPOS IF NOT IT_#RMEMO_#$AN'EFG IS INITIAL. *-- Fet2@ #@>3:e Do2;Ae3t8 for #R MeAo8 6roA #D$DR >35 #DPOS t>=<e8 PERFORM F_'ET_#$AN'ED_DO#S. ENDIF. *-- Fet2@ P;r2@>893: Do2;Ae3t IteA Det>9<8 IF NOT IT_POFG IS INITIAL. PERFORM F_'ET_E!PO. ENDIF. *-- Fet2@ MIRO Ve35or =>8e5 o3 t@e PO Det>9<8 IF NOT IT_E!POFG IS INITIAL. PERFORM F_'ET_VENDOR. ENDIF. *----------------------------------------------------------------------* * END-OF-SELE#TION * *----------------------------------------------------------------------* if 4_6<>: 98 939t9><. *-- Pro2e88 Ve35or De=9t Po8t93:8 PERFORM F_PRO#ESS_MIRO. *-- Pro2e88 Re4er8>< Po8t93:8 o6 Ve35or A;toA>t92 De=9t8 ;893: T#ODE MRLM PERFORM F_PRO#ESS_MRLM. *-- Se35 A>9< if ;8er e3ter8 EA>9< 95,8 >35 EA>9< Mo5e 98 3ot 939t9>< IF P_EMAIL + #_& AND P_MODE IS NOT INITIAL AND S_EMAILFG IS NOT INITIAL. *-- 'et 8poo< 95 per6orA 6_8poo<_95. *-- EM>9< Lo:92 PERFORM F_MAIL_LO'I#. ENDIF. *-- 598p<>? t@e EM>9< RS#ONN/. >35 S;88e88 >35 Error re2or58 o6 MIRO >35 MRLM per6orA 6_598p<>?_report. e<8e. *-- E<8e e79t t@e pro2e88 e79t. e3596. *&---------------------------------------------------------------------* *& ForA F_MODIFY_S#REEN *&---------------------------------------------------------------------* * A ForA ro;t93e to Ao596? t@e 82ree3 *----------------------------------------------------------------------*

FORM F_MODIFY_S#REEN . *-- To Mo596? M>9< Se3593: Opt9o38 LOOP AT S#REEN. IF P_EMAIL + #_&. IF S#REEN-'RO"P. + ,"S., . S#REEN-INVISIBLE + /. S#REEN-A#TIVE + .. S#REEN-INP"T + /. MODIFY S#REEN. ENDIF. IF S#REEN-'RO"P2 + ,"S2, . S#REEN-INVISIBLE + /. S#REEN-A#TIVE + .. MODIFY S#REEN. ENDIF. ELSEIF P_EMAIL + SPA#E. IF S#REEN-'RO"P. + ,"S., . S#REEN-INVISIBLE + .. S#REEN-A#TIVE + /. MODIFY S#REEN. ENDIF. IF S#REEN-'RO"P. + ,"S2, . S#REEN-INVISIBLE + .. S#REEN-A#TIVE + /. MODIFY S#REEN. ENDIF. ENDIF. ENDLOOP. ENDFORM. E F_MODIFY_S#REEN

*&---------------------------------------------------------------------* *& ForA 6_4><95>te *&---------------------------------------------------------------------* * V><95>t9o3 o6 Se<e2t9o3-S2ree3 I3p;t8 *----------------------------------------------------------------------* FORM 6_4><95>te . *-- V><95>te S><e8 Do2;Ae3t T?pe if 3ot 8_A"ARTFG 98 939t9><. 8e<e2t A"ART 93to 8_A"ART-<oD 6roA TVA! ;p to . roD8 D@ere A"ART 93 8_A"ART. e358e<e2t. if 8?-8;=r2 )* /. Ae88>:e E/// D9t@ ,I34><95 S><e8 Do2;Ae3t T?pe,Be/.C . e3596. ENDIF. *-- V><95>te Or5er re>8o3 Bre>8o3 for t@e =;893e88 tr>38>2t9o3C if 3ot 8_A"'R"FG 98 939t9><. 8e<e2t A"'R" 93to 8_A"'R"-<oD 6roA TVA" ;p to . roD8 D@ere A"'R" 93 8_A"'R".

e358e<e2t. if 8?-8;=r2 )* /. Ae88>:e E/// D9t@ ,I34><95 Or5er re>8o3,Be/2C . e3596. e3596. ENDFORM. E 6_4><95>te *&---------------------------------------------------------------------* *& ForA F_'ET_#REDIT_MEMO_REP"EST *&---------------------------------------------------------------------* * Fet2@ #re59t AeAo reO;e8t8 6roA VBA! & VBAP *----------------------------------------------------------------------* FORM F_'ET_#REDIT_MEMO_REP"EST . SELE#T AYVBELN BYPOSNR AYERDAT AYA"ART AYA"'R" AYWAER! AYV!OR' AYVTWE' AYSPART AYVDAT" AYBSTN! AYBSAR! AYBSTD! AYAEDAT AYB"!RS_VF BYMATNR BYZMEN' BYZIEME INTO TABLE IT_#RMEMO FROM B VBA! AS A INNER (OIN VBAP AS B ON AYVBELN + BYVBELN C W$ERE B AYERDAT IN S_ERDAT OR AYAEDAT IN S_ERDAT C AND AYA"ART IN S_A"ART. IF SY-S"BR# + /. SORT IT_#RMEMO BY VBELN POSNR. ELSE. MESSA'E I/// WIT$ ,No #re59t MeAo ReO;e8t 8e<e2te5,B//2C. 4_6<>: + #_&. 8top. ENDIF. ENDFORM. E F_'ET_#REDIT_MEMO_REP"EST

*&---------------------------------------------------------------------* *& ForA F_'ET_MV!E_DO#S *&---------------------------------------------------------------------* * Fet2@ S><e8 D>t> for M>ter9>< *----------------------------------------------------------------------* FORM F_'ET_MV!E_DO#S . DATA: LV_TABI& TYPE SY-TABI&.

*-- Fet2@ S><e8 D>t> for M>ter9>< SELE#T MATNR E M>ter9>< N;A=er V!OR' E S><e8 Or:>39M>t9o3 VTWE' E D98tr9=;t9o3 #@>33e< MTPOS E IteA 2>te:or? :ro;p 6roA A>ter9>< A>8ter FROM MV!E E S><e8 D>t> 6or M>ter9>< INTO TABLE IT_MV!E FOR ALL ENTRIES IN IT_#RMEMO W$ERE MATNR + IT_#RMEMO-MATNR AND V!OR' + IT_#RMEMO-V!OR' AND VTWE' + IT_#RMEMO-VTWE'. IF SY-S"BR# + /. SORT IT_MV!E BY MATNR V!OR' VTWE' MTPOS. ENDIF. *-- V><95>te IteA 2>te:or? :ro;p if MV!E-MTOPS )* ,BANS, t@e3 9:3ore #M ReO;e8t <93e 9teA LOOP AT IT_#RMEMO INTO WA_#RMEMO. LV_TABI& + SY-TABI&. READ TABLE IT_MV!E INTO WA_MV!E WIT$ !EY MATNR + WA_#RMEMO-MATNR V!OR' + WA_#RMEMO-V!OR' VTWE' + WA_#RMEMO-VTWE' MTPOS + #_MTPOS BINARY SEAR#$. IF SY-S"BR# )* /. DELETE IT_#RMEMO INDE& LV_TABI&. E De<ete #R AeAo re2or58 ELSE. *-- E<8e 2@e2H for 2re59t AeAo reO;e8t 2@>3:e 5>te 98 3ot 939t9>< >35 * >ppe35 t@o8e re2or58 to IT_#RMEMO_#$AN'E 93ter3>< t>=<e to retr94e * 2@>3:e 5o2;Ae3t8 IF NOT WA_#RMEMO-AEDAT IS INITIAL. WA_#RMEMO_#$AN'E-VBELN + WA_#RMEMO-VBELN. WA_#RMEMO_#$AN'E-POSNR + WA_#RMEMO-POSNR. WA_#RMEMO_#$AN'E-ERDAT + WA_#RMEMO-ERDAT. WA_#RMEMO_#$AN'E-A"ART + WA_#RMEMO-A"ART. WA_#RMEMO_#$AN'E-A"'R" + WA_#RMEMO-A"'R". WA_#RMEMO_#$AN'E-WAER! + WA_#RMEMO-WAER!. WA_#RMEMO_#$AN'E-V!OR' + WA_#RMEMO-V!OR'. WA_#RMEMO_#$AN'E-VTWE' + WA_#RMEMO-VTWE'. WA_#RMEMO_#$AN'E-SPART + WA_#RMEMO-SPART. WA_#RMEMO_#$AN'E-VDAT" + WA_#RMEMO-VDAT". WA_#RMEMO_#$AN'E-BSTN! + WA_#RMEMO-BSTN!. WA_#RMEMO_#$AN'E-BSAR! + WA_#RMEMO-BSAR!. WA_#RMEMO_#$AN'E-BSTD! + WA_#RMEMO-BSTD!. WA_#RMEMO_#$AN'E-AEDAT + WA_#RMEMO-AEDAT. WA_#RMEMO_#$AN'E-B"!RS_VF + WA_#RMEMO-B"!RS_VF. WA_#RMEMO_#$AN'E-MATNR + WA_#RMEMO-MATNR. WA_#RMEMO_#$AN'E-ZMEN' + WA_#RMEMO-ZMEN'. WA_#RMEMO_#$AN'E-ZIEME + WA_#RMEMO-ZIEME. APPEND WA_#RMEMO_#$AN'E TO IT_#RMEMO_#$AN'E. #LEAR WA_#RMEMO_#$AN'E. ENDIF. ENDIF. ENDLOOP. ENDFORM. E F_'ET_MV!E_DO#S

*&---------------------------------------------------------------------* *& ForA F_'ET_SO_PO_DO#S *&---------------------------------------------------------------------* * Fet2@ t@e S><e8 Or5er 5o2;Ae3t8 PO 5o2;Ae3t8 & #re59t MeAo *----------------------------------------------------------------------* FORM F_'ET_SO_PO_DO#S. *-- Fet2@ Pre2e593: 8><e8 or5er8 =>8e5 o3 t@e 2re59t AeAo reO;e8t SELE#T VBELV POSNV VBELN POSNN VBTYP_N FROM VBFA INTO TABLE IT_ORDERS FOR ALL ENTRIES IN IT_#RMEMO W$ERE VBELN + IT_#RMEMO-VBELN AND POSNN + IT_#RMEMO-POSNR AND VBTYP_N + #_! AND VBTYP_V + #_#. IF SY-S"BR# + /. SORT IT_ORDERS BY VBELV POSNV. *-- Fet2@ S;=8eO;e3t PO 5o2;Ae3t8 & #re59t MeAo =>8e5 o3 t@e 8><e8 or5er8 SELE#T VBELV POSNV VBELN POSNN VBTYP_N FROM VBFA INTO TABLE IT_PO FOR ALL ENTRIES IN IT_ORDERS W$ERE VBELV + IT_ORDERS-VBELV AND POSNV + IT_ORDERS-POSNV AND VBTYP_N IN B#_V #_OC AND VBTYP_V + #_#. IF SY-S"BR# + /. SORT IT_PO BY VBTYP_N. *-- #op? t@e IT_PO 93ter3>< t>=<e 2o3te3t8 to IT_#MEMO 93ter3>< t>=<e IT_#MEMOFG + IT_POFG. *-- De<ete PO 5o2;Ae3t8 6roA IT_#MEMO 93ter3>< t>=<e DELETE IT_#MEMO W$ERE VBTYP_N + #_V. SORT IT_#MEMO BY VBELN POSNN. IF IT_#MEMOFG IS INITIAL. MESSA'E I/// WIT$ ,No #re59t MeAo >re >4>9<>=<e 6or #M ReO;e8t,B//0C. * 4_6<>: + 2_7. * 8top. ENDIF. *-- De<ete #re59t MeAo 5o2;Ae3t8 6roA IT_PO 93ter3>< t>=<e DELETE IT_PO W$ERE VBTYP_N + #_O. SORT IT_PO BY VBELN POSNN. ENDIF. ENDIF.

ENDFORM.

E F_'ET_SO_PO_DO#S

*&---------------------------------------------------------------------* *& ForA F_'ET_#$AN'ED_DO#S *&---------------------------------------------------------------------* * Fet2@ #@>3:e Do2;Ae3t8 for #R MeAo8 6roA #D$DR >35 #DPOS t>=<e8 *----------------------------------------------------------------------* FORM F_'ET_#$AN'ED_DO#S . *-- Fet2@ #@>3:e Do2;Ae3t8 for #R MeAo8 6roA #D$DR SELE#T OB(E#T#LAS OB(E#TID #$AN'ENR "DATE "TIME FROM #D$DR INTO TABLE IT_#D$DR FOR ALL ENTRIES IN IT_#RMEMO_#$AN'E W$ERE OB(E#T#LAS + #_VER!BELE' AND OB(E#TID + IT_#RMEMO_#$AN'E-VBELN * AND "DATE + IT_#RMEMO_#$AN'E-AEDAT . IF SY-S"BR# + /. SORT IT_#D$DR BY OB(E#T#LAS OB(E#TID #$AN'ENR. *-- Fet2@ #@>3:e Do2;Ae3t8 for #R MeAo8 6roA #DPOS SELE#T OB(E#T#LAS OB(E#TID #$AN'ENR TABNAME TAB!EY FNAME #$N'IND VAL"E_NEW VAL"E_OLD FROM #DPOS INTO TABLE IT_#DPOS FOR ALL ENTRIES IN IT_#D$DR W$ERE OB(E#T#LAS + #_VER!BELE' AND OB(E#TID + IT_#D$DR-OB(E#TID AND #$AN'ENR + IT_#D$DR-#$AN'ENR AND TABNAME + #_VBA! AND FNAME + #_A"'R" AND #$N'IND + #_". IF SY-S"BR# + /. SORT IT_#DPOS BY OB(E#T#LAS OB(E#TID #$AN'ENR. ENDIF. ENDIF. ENDFORM. E F_'ET_#$AN'ED_DO#S

*&---------------------------------------------------------------------* *& ForA F_'ET_E!PO *&---------------------------------------------------------------------* * Fet2@ P;r2@>893: Do2;Ae3t IteA Det>9<8 *----------------------------------------------------------------------*

FORM F_'ET_E!PO . *-- Fet2@ P;r2@>893: Do2;Ae3t IteA Det>9<8 SELE#T AYEBELN BYEBELP AYWAERS BYMEN'E BYMEINS BYNETPR BYPEIN$ BYAD8HM BYT&(#D INTO TABLE IT_E!PO FROM B E!!O AS A INNER (OIN E!PO AS B ON AYEBELN + BYEBELN C FOR ALL ENTRIES IN IT_PO W$ERE AYEBELN + IT_PO-VBELN AND BYEBELP + IT_PO-POSNNT.B%C. IF SY-S"BR# + /. SORT IT_E!PO BY EBELN EBELP. ENDIF. ENDFORM. E F_'ET_E!PO

*&---------------------------------------------------------------------* *& ForA F_'ET_VENDOR *&---------------------------------------------------------------------* * Fet2@ MIRO Ve35or 5et>9<8 =>8e5 o3 t@e PO Det>9<8 *----------------------------------------------------------------------* FORM F_'ET_VENDOR . DATA: LV_TABI& TYPE SY-TABI&. *-- Fet2@ $98tor? per P;r2@>893: Do2;Ae3t re2or58 for ><< t@e PO re2or58 SELE#T EBELN EBELP ZE!!N V'ABE '(A$R BELNR B"ZEI FROM E!BE INTO TABLE IT_E!BE FOR ALL ENTRIES IN IT_E!PO W$ERE EBELN + IT_E!PO-EBELN AND EBELP + IT_E!PO-EBELP AND V'ABE + ,2,. * >35 STBL' + 8p>2e. IF SY-S"BR# + /. SORT IT_E!BE BY BELNR '(A$R. *-- Fet2@ t@e 4e35or 5et>9<8 =>8e5 o3 t>=<e IT_E!BE 93ter3>< t>=<e SELE#T BELNR '(A$R BLDAT B"DAT &BLNR

LIFNR RMWWR WMWST. &RE#$ STBL' FROM RB!P INTO TABLE IT_RB!P FOR ALL ENTRIES IN IT_E!BE W$ERE BELNR + IT_E!BE-BELNR AND '(A$R + IT_E!BE-'(A$R. IF SY-S"BR# + /. SORT IT_RB!P BY BELNR '(A$R. ENDIF. ENDIF. *-- Sort PO $98tor? 5o2;Ae3t8 =>8e5 o3 PO X >35 PO IteA SORT IT_E!BE BY EBELN EBELP. *-- #op? t@e PO $98tor? 5o2;Ae3t8 93to IT_E!BE_TEMP 93ter3>< t>=<e IT_E!BE_TEMPFG + IT_E!BEFG. *-- De<ete PO $98tor? 5o2;Ae3t8 6roA IT_E!BE_TEMP 93ter3>< t>=<e * 2oAp>r93: D9t@ IT_RB!P D@ere BSTBL'C Re4er8>< 5o2;Ae3t 3;A=er * 98 939t9>< LOOP AT IT_E!BE_TEMP INTO WA_E!BE_TEMP. LV_TABI& + SY-TABI&. READ TABLE IT_RB!P INTO WA_RB!P WIT$ !EY BELNR + WA_E!BE_TEMP-BELNR '(A$R + WA_E!BE_TEMP-'(A$R * &RE#$ + SPA#E STBL' + SPA#E. IF SY-S"BR# )* /. DELETE IT_E!BE_TEMP INDE& LV_TABI&. ENDIF. #LEAR: WA_E!BE_TEMP WA_RB!P. ENDLOOP. ENDFORM. E F_'ET_VENDOR

*&---------------------------------------------------------------------* *& ForA F_PRO#ESS_MIRO *&---------------------------------------------------------------------* * Pro2e88 MIRO *----------------------------------------------------------------------* FORM F_PRO#ESS_MIRO . DATA: <4_9teA3o TYPE 9 <4_t>=97 t?pe 8?-935e7 <2_2@e2HB.C TYPE 2 VAL"E ,&, V_FILL_ITEM <4_r=Hp_=<5>t t?pe 8?-5>t;A. 2<e>r : 9t_9teA5>t> 9t_>22o;3t93:5>t> IT_#RMEMO_MIRO IT_#RMEMO_MRLM. re6re8@ : 9t_9teA5>t> 9t_>22o;3t93:5>t> IT_#RMEMO_MIRO IT_#RMEMO_MRLM. *-- #op? ><< t@e #R MeAo Do28 >35 5e<ete or5er re>8o3 3ot 93 S_A"'R" IT_#RMEMO_MRLMFG + IT_#RMEMOFG.

*-- De<ete Re4er8>< po8t93:8 D@92@ >re 3ot 93 S_A"'R" DELETE IT_#RMEMO_MRLM W$ERE A"'R" IN S_A"'R". *-- De<ete Re4er8>< po8t93:8 D@ere AEDAT 98 939t9>< DELETE IT_#RMEMO_MRLM D@ere >e5>t 98 939t9><. *-- De<ete or5er re>8o3 D@92@ >re 3ot 93 S_A"'R" DELETE IT_#RMEMO W$ERE A"'R" NOT IN S_A"'R". *-- Loop t@ro;:@ t@e 2re59t AeAo reO;e8t re2or58 LOOP AT IT_#RMEMO INTO WA_#RMEMO. <4_t>=97 + 8?-t>=97. *-- I6 2re59t AeAo reO;e8t 2@>3:e 5>te 98 3ot 939t9>< t@e3 * 8e35 2@>3:e 5>te BAEDATC to <4_r=Hp_=<5>t if 3ot WA_#RMEMO->e5>t 98 939t9><. <4_r=Hp_=<5>t + WA_#RMEMO->e5>t. e<8e. *-- I6 2re59t AeAo reO;e8t 2@>3:e 5>te 98 939t9>< t@e3 * 8e35 2re>te 5>te BERDATC to <4_r=Hp_=<5>t <4_r=Hp_=<5>t + WA_#RMEMO-er5>t. e3596. READ TABLE IT_ORDERS INTO WA_ORDERS WIT$ !EY VBELN + WA_#RMEMO-VBELN POSNN + WA_#RMEMO-POSNR. IF SY-S"BR# + /. READ TABLE IT_PO INTO WA_PO WIT$ !EY VBELV + WA_ORDERS-VBELV POSNV + WA_ORDERS-POSNV. IF SY-S"BR# + /. READ TABLE IT_E!PO INTO WA_E!PO WIT$ !EY EBELN + WA_PO-VBELN EBELP + WA_PO-POSNN. IF SY-S"BR# + /. *-- Re>5 IT_E!BE_TEMP 93ter3>< t>=<e D@92@ 2o3t>938 re2or58 D@92@ >re 3ot re4er8e5 READ TABLE IT_E!BE_TEMP INTO WA_E!BE_TEMP WIT$ !EY EBELN + WA_E!POEBELN EBELP + WA_E!POEBELP. IF SY-S"BR# + /. *-- Re>5 IT_RB!P 93ter3>< t>=<e D9t@ &RE#$ BI3592>tor: po8t 934o92eC + ,&, * 2@e2H for 934o92e re2or58 for t@e 2orre8p3593: #R MeAo re2or58 READ TABLE IT_RB!P INTO WA_RB!P WIT$ !EY BELNR + WA_E!BE_TEMPBELNR '(A$R + WA_E!BE_TEMP'(A$R &RE#$ + #_&. IF SY-S"BR# + /. *-- Re>5 IT_RB!P 93ter3>< t>=<e D9t@ &RE#$ BI3592>tor: po8t 934o92eC + SPA#E * >35 5o2;Ae3t 5>te + #R MeAo 2re>t9o3 5>te * >35 re6ere32e 5o2;Ae3t 3;A=er + PO 3;A=er READ TABLE IT_RB!P INTO WA_RB!P_TMP WIT$ !EY BELNR + WA_E!BE_TEMP-BELNR '(A$R + WA_E!BE_TEMP-'(A$R BLDAT + WA_#RMEMOERDAT

&RE#$ + , , &BLNRT/B./C + WA_E!BE_TEMP-e=e<3. * STBL' + SPA#E. IF SY-S"BR# + /. #ONTIN"E. ELSE. *-- P;>3t9t? #o34er89o3 B'et t@e #re59t MeAo P;>3t9t? =? p>8893: #MR ;39t per o3e PO ;39tC per6orA 6_O;>3t9t?_2o34. *-- F9<<93: t@e L93e 9teA8 5>t> *-- I32reAe3t93: t@e 9teA 3o <4_9teA3o + <4_9teA3o T .. 4_9teA3o + <4_9teA3o. 9t_9teA5>t>-934o92e_5o2_9teA 9t_9teA5>t>-po_3;A=er 9t_9teA5>t>-po_9teA 9t_9teA5>t>-t>7_2o5e 9t_9teA5>t>-TA&("R#ODE + + + + + 4_9teA3o. WA_eHPO-e=e<3. WA_E!PO-EBELP. WA_eHpo-AD8HM. WA_eHpo-T&(#D.

*-- #o34ert93: SAP >Ao;3t to BAPI 6orA>t =? p>8893: <93e 9teA >Ao;3t >35 2;rre32? PERFORM 6_2;rre32?_>Ao;3t_8>p_to_=>p9 "SIN' WA_E!PO-D>er8 V_LINE_AMO"NT #$AN'IN' 9t_9teA5>t>9teA_>Ao;3t . V_#RMEMO_PTY C. 9t_9teA5>t>-O;>3t9t? 9t_9teA5>t>-po_;39t APPEND 9t_9teA5>t>. + B WA_#RMEMO-ZMEN' * + WA_E!PO-MEINS.

*-- Pop;<>te A22o;3t A889:3Ae3t 5>t> IT_A##O"NTIN'DATA-INVOI#E_DO#_ITEM + 4_9teA3o. IT_A##O"NTIN'DATA-&"NPL + 8p>2e. IT_A##O"NTIN'DATA-SERIAL_NO + #_/.. IT_A##O"NTIN'DATA-TA&_#ODE + 9t_9teA5>t>-t>7_2o5e. IT_A##O"NTIN'DATA-TA&("R#ODE + 9t_9teA5>t>-TA&("R#ODE. IT_A##O"NTIN'DATA-ITEM_AMO"NT + 9t_9teA5>t>-9teA_>Ao;3t. IT_A##O"NTIN'DATA-P"ANTITY + 9t_9teA5>t>-O;>3t9t?. IT_A##O"NTIN'DATA-PO_"NIT + 9t_9teA5>t>-po_;39t. IT_A##O"NTIN'DATA-'L_A##O"NT + #_////%//2/%. >ppe35 IT_A##O"NTIN'DATA. 2<e>r IT_A##O"NTIN'DATA. #LEAR 9t_9teA5>t>. e3596. e3596. ENDIF. ENDIF. ENDIF. ENDIF. *-- At e35 o6 e>2@ 2re59t AeAo reO;e8t 69<< t@e @e>5er 5et>9<8 o6 BAPI FM >35 *-- po8t t@e BAPI

AT END OF VBELN. re>5 t>=<e 9t_2rAeAo 93to D>_2rAeAo 935e7 <4_t>=97. *-- Pop;<>te t@e 5o2;Ae3t $e>5er *-- 'ett93: t@e @e>5er 5>t> for 934o92e 7_5o2@e>5er-934o92e_935 + 8p>2e. 7_5o2@e>5er-5o2_t?pe + 2_=<>rt. 7_5o2@e>5er-5o2_5>te + <4_r=Hp_=<5>t. 7_5o2@e>5er-p8t3:_5>te + <4_r=Hp_=<5>t. 7_5o2@e>5er-re6_5o2_3o + WA_RB!P-&BLNR. 7_5o2@e>5er-2oAp_2o5e + WA_#RMEMO-B"!RS_VF. 7_5o2@e>5er-#"RREN#Y + WA_#RMEMO-WAER!. 7_5o2@e>5er-2><2_t>7_935 + <2_2@e2H. *-- Lo:92 to 6935 t@e T>7 W 4_t>7_per + B WA_RB!P-WMWST. - B WA_RB!P-RMWWR - WA_RB!P-WMWST. C C * .//. 4_t>7_>At + B V_'ROSSAMT * 4_t>7_per C - .//. V_'ROSSAMT + B V_'ROSSAMT T 4_t>7_>At C. 7_5o2@e>5er-:ro88_>Ao;3t + V_'ROSSAMT. #LEAR:4_5o23r 4_?e>r..

*-- #><<93: BAPI to 2re>te PO 934o92e 5o2;Ae3t #$E#! NOT IT_ITEMDATAFG IS INITIAL. #ALL F"N#TION ,BAPI_IN#OMIN'INVOI#E_#REATE, E&PORTIN' @e>5er5>t> + 7_5o2@e>5er IMPORTIN' 934o92e5o23;A=er + 4_5o23r 6982><?e>r + 4_?e>r. TABLES 9teA5>t> + 9t_9teA5>t>FG A##O"NT93:DATA + 9t_A##O"NT93:DATAFG * 'LA##O"NTDATA + * t>75>t> + return + 9t_ret;r3. *-- #oAA9t DorH IF NOT 4_5o23r IS INITIAL. #ALL F"N#TION ,BAPI_TRANSA#TION_#OMMIT, E&PORTIN' D>9t + ,&,. *-- Mo4e t@e 5>t> to S;22e88 I3ter3>< T>=<e D>_8;22e88-2rAeAo + D>_2rAeAo-4=e<3. D>_8;22e88-2AeAo + D>_2AeAo-4=e<3. D>_8;22e88-or5er8 + D>_or5er8-4=e<4. D>_8;22e88-po + D>_po-4=e<3. D>_8;22e88-A9ro_3o + 4_5o23r. D>_8;22e88-te7t + ,MIRO 98 Po8te5,. >ppe35 D>_8;22e88 TO 9t_8;22e88. 2<e>r D>_8;22e88. *-ENDIF. Re>5 t@e 4><;e8 93 t@e t>=<e IT_RET"RN. #LEAR 9t_ret;r3. READ TABLE 9t_ret;r3 INDE& ..

I6 Ae88>:e t?pe 98 error t@e3 ro<< =>2H t@e DorH IF 9t_ret;r3-t?pe + #_E. *-- Ro<< =>2H #ALL F"N#TION ,BAPI_TRANSA#TION_ROLLBA#!,. *-- Mo4e t@e 5>t> to Error I3ter3>< T>=<e D>_error-2rAeAo + D>_2rAeAo-4=e<3. D>_error-2AeAo + D>_2AeAo-4=e<3. D>_error-or5er8 + D>_or5er8-4=e<4. D>_error-po + D>_po-4=e<3. D>_error-te7t + 9t_ret;r3-MESSA'E. >ppe35 D>_error TO 9t_error. 2<e>r D>_error. ENDIF. re6re8@: 9t_ret;r3 9t_9teA5>t> 9t_>22o;3t93:5>t>. 2<e>r: V_'ROSSAMT 9t_ret;r3 9t_9teA5>t> D>_2rAeAo D>_or5er8 D>_po D>_eHpo WA_E!BE_TEMP D>_r=Hp D>_r=Hp_tAp 4_5o23r 4_?e>r. WA_S"##ESS WA_ERROR 9t_>22o;3t93:5>t> 4_t>7_per 4_t>7_>At V_FILL_ITEM <4_r=Hp_=<5>t. ENDAT. ENDLOOP. ENDFORM. E F_PRO#ESS_MIRO

*&---------------------------------------------------------------------* *& ForA 6_O;>3t9t?_2o34 *&---------------------------------------------------------------------* * P;>3t9t? #o34er89o3 *----------------------------------------------------------------------* FORM 6_O;>3t9t?_2o34 . *-- P;>3t9t? #o34er89o3 B'et t@e #re59t MeAo P;>3t9t? =? p>8893: #MR ;39t per o3e PO ;39tC #LEAR: V_LINE_AMO"NT V_#RMEMO_PTY. 2><< 6;32t9o3 ,M#_"NIT_#ONVERSION, E&PORTIN' MATNR + WA_#RMEMO-MATNR 3>2@_Ae938 + WA_E!PO-MEINS 4o3_Ae938 + WA_#RMEMO-ZIEME IMPORTIN' "MREF + V_#RMEMO_PTY E&#EPTIONS #ONVERSION_NOT_FO"ND + . MATERIAL_NOT_FO"ND + 2 NA#$_MEINS_MISSIN' + 0 OVERFLOW + 1 VON_MEINS_MISSIN' + % OT$ERS + J. if 8?-8;=r2 )* /. MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO WIT$ SY-MS'V. SY-MS'V2 SY-MS'V0 SY-MS'V1. ELSE.

V_LINE_AMO"NT + B V_#RMEMO_PTY * WA_#RMEMO-ZMEN' * WA_E!PO-pe93@ * WA_E!PO-NETPR C. V_'ROSSAMT + V_'ROSSAMT T V_LINE_AMO"NT. ENDIF. ENDFORM. E 6_O;>3t9t?_2o34

*&---------------------------------------------------------------------* *& ForA 6_2;rre32?_>Ao;3t_8>p_to_=>p9 *&---------------------------------------------------------------------* * SAP AAo;3t to BAPI AAo;3t *----------------------------------------------------------------------* FORM 6_2;rre32?_>Ao;3t_8>p_to_=>p9 "SIN' p_D>er8 p_H=etr #$AN'IN' p_>At_5o22;r. DATA : <4_D>er8 LI!E t2;r2-D>er8 <4_8>p>Ao;3t LI!E =>p92;rr-=>p92;rr <4_=>p9_>Ao;3t LI!E =>p92;rr-=>p92;rr. <4_D>er8 + p_D>er8. <4_8>p>Ao;3t + p_H=etr. #ALL F"N#TION ,#"RREN#Y_AMO"NT_SAP_TO_BAPI, E&PORTIN' 2;rre32? + <4_D>er8 8>p_>Ao;3t + <4_8>p>Ao;3t IMPORTIN' =>p9_>Ao;3t + <4_=>p9_>Ao;3t. p_>At_5o22;r + <4_=>p9_>Ao;3t. ENDFORM. E 6_2;rre32?_>Ao;3t_8>p_to_=>p9

*&---------------------------------------------------------------------* *& ForA 6_598p<>?_report *&---------------------------------------------------------------------* * D98p<>? Report *----------------------------------------------------------------------* FORM 6_598p<>?_report . *-- S;22e88 Report IF NOT IT_S"##ESSFG IS INITIAL. "LINE AT -.B.2NC. WRITE:-. 8?-4<93e ,#R MeAo, .N 8?-4<93e ,#re59t MeAo, 0N 8?-4<93e ,S><e8 Or5er, %N 8?-4<93e ,P;r2@>8e Or5er, KN 8?-4<93e ,MIRO N;A=er, NN 8?-4<93e ,Te7t, .2N 8?-4<93e. "LINE AT -.B.2NC. LOOP AT 9t_8;22e88 93to D>_8;22e88. WRITE:-. 8?-4<93e D>_8;22e88-2rAeAo .N 8?-4<93e D>_8;22e88-2AeAo

0N 8?-4<93e D>_8;22e88-or5er8 %N 8?-4<93e D>_8;22e88-po KN 8?-4<93e D>_8;22e88-A9ro_3o NN 8?-4<93e D>_8;22e88-te7t .2N 8?-4<93e. ENDLOOP. "LINE AT -.B.2NC. S!IP 2. ENDIF. *-- Error Report IF NOT IT_ERRORFG IS INITIAL. "LINE AT -.B.KNC. WRITE:-. 8?-4<93e ,#R MeAo, .N 8?-4<93e ,#re59t MeAo, 0N 8?-4<93e ,S><e8 Or5er, %N 8?-4<93e ,P;r2@>8e Or5er, KN 8?-4<93e ,Error Te7t, .KN 8?-4<93e. "LINE AT -.B.KNC. LOOP AT IT_ERROR 93to WA_ERROR. WRITE:-. 8?-4<93e WA_ERROR-2rAeAo .N 8?-4<93e WA_ERROR-2AeAo 0N 8?-4<93e WA_ERROR-or5er8 %N 8?-4<93e WA_ERROR-po KN 8?-4<93e WA_ERROR-te7t .KN 8?-4<93e. ENDLOOP. "LINE AT -.B.KNC. ENDIF. IF NOT IT_S"##ESS_MRLMFG IS INITIAL. "LINE AT -.B.2NC. WRITE:-. 8?-4<93e ,#R MeAo, .N 8?-4<93e ,#re59t MeAo, 0N 8?-4<93e ,S><e8 Or5er, %N 8?-4<93e ,P;r2@>8e Or5er, KN 8?-4<93e ,Re4er8>< Po8t93: No., NN 8?-4<93e ,Te7t, .2N 8?-4<93e. "LINE AT -.B.2NC. LOOP AT 9t_8;22e88_ArLA 93to D>_8;22e88_ArLA. WRITE:-. 8?-4<93e D>_8;22e88_ArLA-2rAeAo .N 8?-4<93e D>_8;22e88_ArLA-2AeAo 0N 8?-4<93e D>_8;22e88_ArLA-or5er8 %N 8?-4<93e D>_8;22e88_ArLA-po KN 8?-4<93e D>_8;22e88_ArLA-A9ro_3o NN 8?-4<93e D>_8;22e88_ArLA-te7t .2N 8?-4<93e.

ENDLOOP. "LINE AT -.B.2NC. S!IP 2. ENDIF. *-- Error Report IF NOT IT_ERROR_MRLMFG IS INITIAL. "LINE AT -.B.KNC. WRITE:-. 8?-4<93e ,#R MeAo, .N 8?-4<93e ,#re59t MeAo, 0N 8?-4<93e ,S><e8 Or5er, %N 8?-4<93e ,P;r2@>8e Or5er, KN 8?-4<93e ,Error Te7t, .KN 8?-4<93e. "LINE AT -.B.KNC. LOOP AT IT_ERROR_MRLM 93to WA_ERROR_MRLM. WRITE:-. 8?-4<93e WA_ERROR_MRLM-2rAeAo .N 8?-4<93e WA_ERROR_MRLM-2AeAo 0N 8?-4<93e WA_ERROR_MRLM-or5er8 %N 8?-4<93e WA_ERROR_MRLM-po KN 8?-4<93e WA_ERROR_MRLM-te7t .KN 8?-4<93e. ENDLOOP. "LINE AT -.B.KNC. ENDIF. ENDFORM. E 6_598p<>?_report

*&---------------------------------------------------------------------* *& ForA F_PRO#ESS_MRLM *&---------------------------------------------------------------------* * Pro2e88 Re4er8>< po8t93:8 *----------------------------------------------------------------------* FORM F_PRO#ESS_MRLM . 2<e>r: D>_#RMEMO_MRLM. LOOP AT IT_#RMEMO_MRLM 93to WA_#RMEMO_MRLM. re>5 t>=<e 9t_25po8 93to D>_25po8 D9t@ He? OB(E#TID + WA_#RMEMO_MRLM-VBELN. if 8?-8;=r2 )* /. #ONTIN"E. ELSE. if D>_25po8-4><;e_o<5 93 8_>;:r;. READ TABLE IT_ORDERS INTO WA_ORDERS WIT$ !EY VBELN + D>_#RMEMO_MRLM-VBELN POSNN + D>_#RMEMO_MRLM-POSNR. IF SY-S"BR# + /. * READ TABLE IT_#MEMO INTO WA_#MEMO WIT$ !EY VBELV + WA_ORDERS-VBELV * POSNV + WA_ORDERS-POSNV. * IF SY-S"BR# + /. READ TABLE IT_PO INTO WA_PO WIT$ !EY VBELV + WA_ORDERS-VBELV POSNV + WA_ORDERS-POSNV. IF SY-S"BR# + /. READ TABLE IT_E!PO INTO WA_E!PO WIT$ !EY EBELN + WA_PO-VBELN

* * *

* AEDAT EBELN

EBELP + WA_PO-POSNN. IF SY-S"BR# + /. READ TABLE IT_E!BE INTO WA_E!BE WIT$ !EY EBELN + WA_E!PO-EBELN EBELP + WA_E!PO-EBELP. IF SY-S"BR# + /. LOOP AT IT_E!BE 93to WA_E!BE W$ERE EBELN + WA_E!PO-EBELN AND EBELP + WA_E!PO-EBELP. READ TABLE IT_RB!P INTO WA_RB!P WIT$ !EY BELNR + WA_E!BE-BELNR '(A$R + WA_E!BE-'(A$R BLDAT + WA_#RMEMO_MRLM&BLNRT/B./C + WA_E!BE&RE#$ + SPA#E STBL' + SPA#E.

*--

*--

*--

*-*--

IF SY-S"BR# + /. Ao4e: WA_RB!P-BELNR TO &_REV_POST-INV_DO#_NO WA_RB!P-'(A$R TO &_REV_POST-FIS#_YEAR WA_RB!P-B"DAT TO &_REV_POST-PSTN'_DATE. IF WA_RB!P-B"DATT1B2C + SY-DAT"MT1B2C. &_REV_POST-REASON_REV + #_/.. ELSE. &_REV_POST-REASON_REV + #_/2. ENDIF. ENDIF. ENDLOOP. #><< t@e FM for MIRO re4er8>< #ALL F"N#TION ,BAPI_IN#OMIN'INVOI#E_#AN#EL, E&PORTIN' INVOI#EDO#N"MBER + &_REV_POST-INV_DO#_NO FIS#ALYEAR + &_REV_POST-FIS#_YEAR REASONREVERSAL + &_REV_POST-REASON_REV POSTIN'DATE + &_REV_POST-PSTN'_DATE IMPORTIN' INVOI#EDO#N"MBER_REVERSAL + &_REV_POST-INV_DO#_NO FIS#ALYEAR_REVERSAL + &_REV_POST-FIS#_YEAR TABLES RET"RN + 9t_ret;r3_ArLA. #oAA9t DorH IF NOT &_REV_POST-INV_DO#_NO IS INITIAL. #ALL F"N#TION ,BAPI_TRANSA#TION_#OMMIT, E&PORTIN' D>9t + ,&,. Mo4e t@e 5>t> to S;22e88 I3ter3>< T>=<e D>_8;22e88_ArLA-2rAeAo + D>_2rAeAo-4=e<3. D>_8;22e88_ArLA-2AeAo + D>_2AeAo-4=e<3. D>_8;22e88_ArLA-or5er8 + D>_or5er8-4=e<4. D>_8;22e88_ArLA-po + D>_po-4=e<3. D>_8;22e88_ArLA-te7t + ,MRLM Do3e,. >ppe35 D>_8;22e88_ArLA TO 9t_8;22e88_ArLA. 2<e>r D>_8;22e88_ArLA. ENDIF. Re>5 t@e 4><;e8 93 t@e t>=<e IT_RET"RN. #LEAR 9t_ret;r3_ArLA. READ TABLE 9t_ret;r3_ArLA INDE& .. I6 Ae88>:e t?pe 98 error t@e3 ro<< =>2H t@e DorH

IF 9t_ret;r3_ArLA-t?pe + ,E, . *-- Ro<< =>2H #ALL F"N#TION ,BAPI_TRANSA#TION_ROLLBA#!,. *-- Mo4e t@e 5>t> to Error I3ter3>< T>=<e D>_error_ArLA-2rAeAo + D>_2rAeAo-4=e<3. D>_error_ArLA-2AeAo + D>_2AeAo-4=e<3. D>_error_ArLA-or5er8 + D>_or5er8-4=e<4. D>_error_ArLA-po + D>_po-4=e<3. D>_error_ArLA-te7t + 9t_ret;r3_ArLA-MESSA'E. >ppe35 D>_error_ArLA TO 9t_error_ArLA. 2<e>r D>_error_ArLA. * * * ENDIF. ENDIF. ENDIF. ENDIF. ENDIF. ENDIF. ENDIF. ENDIF. ENDIF. #LEAR: D>_error_ArLA D>_S"##ESS_ArLA &_REV_POST D>_#RMEMO_MRLM D>_or5er8 D>_po D>_eHpo D>_eH=e D>_r=Hp D>_2AeAo. REFRES$: IT_RET"RN_MRLM. e35<oop. ENDFORM. E F_PRO#ESS_MRLM

*&---------------------------------------------------------------------* *& ForA F_8poo<_95 *&---------------------------------------------------------------------* * #re>te > new 8poo< ID *----------------------------------------------------------------------* FORM F_8poo<_95 . *-- #re>te > new 8poo< 6roA t@e 5>t> 93 5>t>_t>= *-- 3eD-p>:e <93e-89Me 8?-<938M pr93t o3 3eD-p>:e <93e-89Me 2%% pr93t o3 5e8t93>t9o3 ,LO#L,Bp.NC E))++ A? pr93ter *-- re2e94er ,T(OSVOB, 2o4er te7t ,Spoo< t9t<e,Bp2/C E ))++ T9t<e or Spoo< reO. 3>Ae <98t 3>Ae ,L98t 3>Ae,Bp2.C <98t 5>t>8et ,L98t D>t>8et,Bp22C 9AAe59>te<? , , E & Ae>38 pr93t 3oD Heep 93 8poo< 2_7 E & Ae>38 Heep 8poo< new <98t 95e3t9692>t9o3 2_7 3o 59><o: . *-- Wr9t93: Report *-- I3 this per6orA ?o; D9<< Dr9te t@e 2o5e for 598p<>?93: t@e <98t per6orA 6_598p<>?_report. *-- 3eD-p>:e pr93t o66 3eD-p>:e pr93t o66. ENDFORM. E F_8poo<_95

*&---------------------------------------------------------------------* *& ForA F_MAIL_LO'I# *&---------------------------------------------------------------------* * Lo:92 to 8e35 > A>9< for t@e :94e3 EA>9< ID,8 *----------------------------------------------------------------------* FORM F_MAIL_LO'I# . 5>t> : D>_t8p/.8?8 t?pe t8p/.8?8. 2<e>r 4_8po3o. 4_8po3o + 8?-8po3o. * 4_>tt>2@_5e82 + 8?-t9t<e. *-- #o34ert t@e Spoo< ID 93to PDF 6orA>t per6orA 6_p56_2o34er89o3 t>=<e8 9t_2oApre88e5_<98t 9t_p56_<98t ;893: 4_8po3o. *-- Se35 t@e M>9< 93 PDF ForA>t per6orA 6_8e35_A>9<. ENDFORM. E F_MAIL_LO'I#

*&---------------------------------------------------------------------* *& ForA 6_p56_2o34er89o3 *&---------------------------------------------------------------------* * Re>5 t@e 8poo< >35 2o34ert 93to PDF 6orA>t *----------------------------------------------------------------------* * --*P_ITAB_#OMPRESSED_LIST te7t * --*P_ITAB_PDF_LIST te7t * --*P_V_SPONO te7t *----------------------------------------------------------------------* FORM 6_p56_2o34er89o3 TABLES 9t_2oApre88e5_<98t 8tr;2t;re 8o<9 9t_p56_<98t 8tr;2t;re t<93e ;893: <4_8poo<3 t?pe t8p/.-rO95e3t. 2<e>r: 9t_2oApre88e5_<98t 9t_p56_<98t. re6re8@: 9t_2oApre88e5_<98t 9t_p56_<98t. *-- #><< t@e FM ERSPO_RET"RN_SPOOL(OBE to re>5 t@e 8poo< =? p>8893: t@e 8poo< 3;A=er 2><< 6;32t9o3 ,RSPO_RET"RN_SPOOL(OB, e7port93: rO95e3t + <4_8poo<3 5e89re5_t?pe + 4_t?pe 9Aport93: re><_t?pe + 4_t?pe t>=<e8 =;66er + 9t_2oApre88e5_<98t =;66er_p56 + 9t_p56_<98t e72ept9o38 3o_8;2@_Qo= + . Qo=_2o3t>938_3o_5>t> + 2 8e<e2t9o3_eApt? + 0 3o_perA9889o3 + 1 2>3_3ot_>22e88 + % re>5_error + J

t?pe_3o_A>t2@ + K ot@er8 + L. if 8?-8;=r2 )* /. Ae88>:e I/// D9t@ ,Error 93 8poo< re>593:,B/.KC. e3596. *-- I6 t@e L98t t?pe 98 ALI 2><< t@e FM E#ONVERT_ABAPSPOOL(OB_2_PDFE * to 2o34ert <98t 93to PDF ForA>t if 4_t?pe + 2_><9. E 6or L98t 9t 98 ALI 2><< 6;32t9o3 ,#ONVERT_ABAPSPOOL(OB_2_PDF, e7port93: 8r2_8poo<95 + <4_8poo<3 t>=<e8 p56 + 9t_p56 e72ept9o38 err_3o_>=>p_8poo<Qo= + . err_3o_8poo<Qo= + 2 err_3o_perA9889o3 + 0 err_2o34_3ot_po889=<e + 1 err_=>5_5e8t5e492e + % ;8er_2>32e<<e5 + J err_8poo<error + K err_teA8eerror + L err_=t2Qo=_ope3_6>9<e5 + N err_=t2Qo=_8;=A9t_6>9<e5 + ./ err_=t2Qo=_2<o8e_6>9<e5 + .. ot@er8 + .2. if 8?-8;=r2 )* /. Ae88>:e e/// D9t@,Error 93 2o34ert9o3 o6 <98t 93to PDF 6orA>t,B/.LC. e3596. *-- Lo:92 to 2o34ert t@e :94e3 6orA>t 93to 2%% 2@>r>2ter 6orA>t 93 IT_PDF 5e82r9=e t>=<e 9t_p56 <93e8 4_<93e8. 5e82r9=e 69e<5 9t_p56 <e3:t@ 4_<93e8<e3 IN 2@>r>2ter MODE. 5e82r9=e 69e<5 9t_teAp <e3:t@ 4_A9Ae<e3 IN 2@>r>2ter MODE. LOOP AT 9t_p56. 4_t>=97 + 8?-t>=97. MOVE 9t_p56 TO 4_teApT4_o668et. IF 4_t>=97 + 4_<93e8. 4_<93e8<e3 + 8tr<e3B 9t_p56 C. ENDIF. 4_o668et + 4_o668et T 4_<93e8<e3. IF 4_o668et 'E 4_A9Ae<e3. #LEAR 9t_teAp. 9t_teAp + 4_teApB4_A9Ae<e3C. APPEND 9t_teAp. S$IFT 4_teAp BY 4_A9Ae<e3 PLA#ES. 4_o668et + 4_o668et - 4_A9Ae<e3. ENDIF. IF 4_t>=97 + 4_<93e8. IF 4_o668et 'T /. #LEAR 9t_teAp. 9t_teAp + 4_teApB4_o668etC. APPEND 9t_teAp.

ENDIF. ENDIF. ENDLOOP. LOOP AT 9t_teAp. 9t_A9AeB2%%C + 9t_teAp-<93e. APPEND 9t_A9Ae. ENDLOOP. *-- F93>< D>t> to 8e35 to EM>9< 9t_@tA<FG + 9t_A9AeFG. e3596. ENDFORM. E 6_p56_2o34er89o3

*&---------------------------------------------------------------------* *& ForA 6_8e35_A>9< *&---------------------------------------------------------------------* * Se35 EM>9< Lo:92 *----------------------------------------------------------------------* FORM 6_8e35_A>9< . 5>t> : D>_t8p/.8?8 t?pe t8p/.8?8. *-- Pop;<>te M>9< I5,8 WA_RE#LIST-RE#_TYPE + P_MODE. WA_RE#LIST-E&PRESS + #_&. *-- Loop t@ro;:@ t@e EA9>< 8e<e2t opt9o38 LOOP AT S_EMAIL INTO &_EMAIL. WA_RE#LIST-RE#EIVER + &_EMAIL-LOW. *-- >ppe35 re2e94er t>=<e APPEND WA_RE#LIST TO IT_RE#LIST. ENDLOOP. *-- I6 re2e94er t>=<e 98 3ot 939t9>< #$E#! IT_RE#LISTFG IS NOT INITIAL. *--To 2@e2H M>9< ID,8 93ter3>< t>=<e 8@o;<5 3ot =e EApt?. *--pop;<>te 5o2;Ae3t >ttr9=;te8 *-- M>9< 8;=Qe2t <93e #LEAR: &_DO#_#$N'. &_DO#_#$N'-OB(_NAME + ,$EADIN',. #ON#ATENATE ,A;toA>t92 Ve35or De59t Po8t93:8,B//%C SY-DAT"M INTO &_DO#_#$N'-OB(_DES#R SEPARATED BY SPA#E. *-- M>9< =o5? #ON#ATENATE ,A;toA>t92 Ve35or De59t Po8t93:8,B//%C , 98 >tt>2@e5.,B//JC INTO WA_OB(T&T SEPARATED BY SPA#E. APPEND WA_OB(T&T TO IT_OB(T&T. *-- Appe35 D>te >35 T9Ae 93to Bo5? o6 eA>9<. MOVE ,F9<e 98 :e3er>te5 o3,B//KC TO V_INFO.

V_TIME + SY-"ZEIT. #ON#ATENATE V_TIMET/B2C V_TIMET2B2C V_TIMET1B2C INTO V_TIME2 SEPARATED BY ,:,. #ON#ATENATE SY-DAT"MT1B2C ,-, SY-DAT"MTJB2C ,-, SY-DAT"MT/B1C INTO V_DATE2. #ON#ATENATE V_INFO V_DATE2 ,At, V_TIME2 INTO V_INFO SEPARATED BY SPA#E. WA_OB(T&T + V_INFO. APPEND WA_OB(T&T TO IT_OB(T&T. *-- Do2;Ae3t 89Me #LEAR : V_TABLE_LINES. DES#RIBE TABLE IT_OB(T&T LINES V_TABLE_LINES. READ TABLE IT_OB(T&T INTO WA_OB(T&T INDE& V_TABLE_LINES . &_DO#_#$N'-DO#_SIZE + B V_TABLE_LINES - . C * 2%% T STRLENB WA_OB(T&T C. *-- Pop;<>te p>2H93: <98t for =o5? te7t WA_OB(PA#!-$EAD_START + .. WA_OB(PA#!-$EAD_N"M + /. WA_OB(PA#!-BODY_START + .. WA_OB(PA#!-BODY_N"M + V_TABLE_LINES. WA_OB(PA#!-DO#_TYPE + ,RAW,. APPEND WA_OB(PA#! TO IT_OB(PA#!. #LEAR WA_OB(PA#!. if 4_t?pe + 2_><9. <oop >t 9t_@tA<. D>_o=Q=93-<93e + 9t_@tA<-<93e. APPEND WA_OB(BIN TO IT_OB(BIN. #LEAR WA_OB(BIN. e35<oop. 4_t?pe + ,PDF,. e3596. *-- 'et tot>< 3o.o6 <93e8 o6 O=Qe2t t>=<eB>tt>2@Ae3tC #LEAR : V_TABLE_LINES. DES#RIBE TABLE IT_OB(BIN LINES V_TABLE_LINES. *-- Pop;<>te o=Qe2t @e>5erB>tt>2@Ae3t 3>AeC WA_OB($EAD + ,A;toA>t92 Ve35or De59t Po8t93:8 <o:,B/.1C. APPEND WA_OB($EAD TO IT_OB($EAD. #LEAR WA_OB($EAD. *-- P>2H93: <98t for >tt>2@Ae3t WA_OB(PA#!-TRANSF_BIN + #_&.

WA_OB(PA#!-$EAD_START WA_OB(PA#!-$EAD_N"M + WA_OB(PA#!-BODY_START WA_OB(PA#!-BODY_N"M + WA_OB(PA#!-DO#_TYPE +

+ .. .. + .. V_TABLE_LINES . 4_t?pe .

WA_OB(PA#!-OB(_NAME + ,A;to_De=9t,. WA_OB(PA#!-OB(_DES#R + ,>tt>2@Ae3t,. WA_OB(PA#!-DO#_SIZE + V_TABLE_LINES * 2%%. APPEND WA_OB(PA#! TO IT_OB(PA#!. #LEAR WA_OB(PA#!. *-- Se3593: t@e EM>9< 5o2;Ae3t 93 :94e3 6orA>t #ALL F"N#TION ,SO_NEW_DO#"MENT_ATT_SEND_API., E&PORTIN' DO#"MENT_DATA + &_DO#_#$N' P"T_IN_O"TBO& + #_& #OMMIT_WOR! + #_& TABLES PA#!IN'_LIST + IT_OB(PA#! OB(E#T_$EADER + IT_OB($EAD #ONTENTS_BIN + IT_OB(BIN #ONTENTS_T&T + IT_OB(T&T RE#EIVERS + IT_RE#LIST E&#EPTIONS TOO_MANY_RE#EIVERS + . DO#"MENT_NOT_SENT + 2 DO#"MENT_TYPE_NOT_E&IST + 0 OPERATION_NO_A"T$ORIZATION + 1 PARAMETER_ERROR + % &_ERROR + J ENP"E"E_ERROR + K OT$ERS + L. IF SY-S"BR# )* /. MESSA'E E/// WIT$ ,Error o22;rre5 93 8e3593: A>9<,B/.%C. ELSE. *-- W>9t ;pto 2 8e2o;358 D>9t ;p to 2 8e2o358. *-- #><< t@e RS#ONN/. BSAP2o33e2t: St>rt Se35 Pro2e88C S"BMIT RS#ONN/. WIT$ MODE + ,INT, * WIT$ o;tp;t + ,&, AND RET"RN. PERFORM F_DISPLAY_SENT_MAIL_STAT"S. ENDIF. * To 5e<ete t@e 8poo< reO;e8t D>_t8p/.8?8-rO95e3t + 8?-8po3o. 2><< 6;32t9o3 ,RSPO_IDELETE_SPOOLREP, e7port93: 8poo<reO + D>_t8p/.8?8. if 8?-8;=r2 )* /. e3596. ENDFORM. E 6_8e35_A>9<

*&---------------------------------------------------------------------* *& ForA F_DISPLAY_SENT_MAIL_STAT"S *&---------------------------------------------------------------------* * D98p<>? M>9< Se3t 8t>t;8 to t@e ;8er *----------------------------------------------------------------------* FORM F_DISPLAY_SENT_MAIL_STAT"S . "LINE AT -.BJ/C. WRITE :- SY-VLINE ,M>9< 8e3t S;22e886;<<? to,B/.JC #OLOR % INTENSIFIED ON J/ SY-VLINE. LOOP AT S_EMAIL INTO &_EMAIL. V_TABLE_LINES + STRLENB &_EMAIL-LOW C. MOVE &_EMAIL-LOWT/BV_TABLE_LINESC TO V_TE&T2. WRITE :- SY-VLINE 2 SY-TABI& LEFT-("STIFIED % ,C, V_TE&T2 J/ SY-VLINE. ENDLOOP. "LINE AT -.BJ/C. ENDFORM. E F_DISPLAY_SENT_MAIL_STAT"S

De)eloping simple interacti)e report


9y Eakada Ra)hava, ;o"ri Tech #ol"tions

L.n this scenario- we would taJe an example of a material and develop an interactive report. 1nce you clicJ on reIuire Lmaterial no; on the !asic list- the correspondin( material information on the secondary list.; Followin) is a sample interactive report developed or o"r demo p"rposeI 79+)7/ 8intractive .

TYPES : BE'IN OF 8tr_A>r5 A>t3r TYPE A>r5-A>t3r <:ort TYPE A>r5-<:ort DerH8 TYPE A>r5-DerH8 END OF 8tr_A>r5. DATA : D>_A>r5 TYPE 8tr_A>r5 9t_A>r5 TYPE TABLE OF 8tr_A>r5. TYPES : BE'IN OF 8tr_A>Ht A>t3r TYPE A>Ht-A>t3r A>Ht: TYPE A>Ht-A>Ht: END OF 8tr_A>Ht.

DATA : D>_A>Ht TYPE 8tr_A>Ht 9t_A>Ht TYPE TABLE OF 8tr_A>Ht. TYPES : BE'IN OF 8tr_A>r> A>t3r TYPE A>r>-A>t3r er85> TYPE A>r>-er85> er3>A TYPE A>r>-er3>A <>e5> TYPE A>r>-<>e5> At>rt TYPE A>r>-At>rt A>tH< TYPE A>r>-A>tH< Ae938 TYPE A>r>-Ae938 END OF 8tr_A>r>. DATA : D>_A>r> TYPE 8tr_A>r> 9t_A>r> TYPE TABLE OF 8tr_A>r>. TYPES : BE'IN OF 8tr_693>< A>t3r TYPE A>r>-A>t3r er85> TYPE A>r>-er85> er3>A TYPE A>r>-er3>A <>e5> TYPE A>r>-<>e5> At>rt TYPE A>r>-At>rt A>tH< TYPE A>r>-A>tH< Ae938 TYPE A>r>-Ae938 <:ort TYPE A>r5-<:ort DerH8 TYPE A>r5-DerH8 END OF 8tr_693><. DATA: D>_693>< TYPE 8tr_693>< 9t_693>< TYPE TABLE OF 8tr_693><. PARAMETERS : p<>3t TYPE A>r5-DerH8 8tor LI!E A>r5-<:ort. SELE#T A>t3r <:ort DerH8 FROM A>r5 INTO TABLE 9t_A>r5 W$ERE <:ort + 8tor AND DerH8 + p<>3t. . SELE#T A>t3r A>Ht: FROM A>Ht INTO TABLE 9t_A>Ht FOR ALL ENTRIES IN 9t_A>r5 W$ERE A>t3r + 9t_A>r5-A>t3r AND 8pr>8 + ,E,. SELE#T A>t3r er85> er3>A <>e5> At>rt A>tH< Ae938 FROM A>r> INTO TABLE 9t_A>r> FOR ALL ENTRIES IN 9t_A>Ht W$ERE A>t3r + 9t_A>Ht-A>t3r. LOOP AT 9t_A>Ht INTO D>_A>Ht. WRITE : -. D>_A>Ht-A>t3r #OLOR . 1/ D>_A>Ht-A>Ht: #OLOR 2. $IDE D>_A>Ht-A>t3r. ENDLOOP. #LEAR D>_A>r5-A>t3r. AT LINE-SELE#TION. REFRES$ 9t_693><. #LEAR D>_693><. "LINE. IF 8?-<8935 + .. WRITE : -. ,MATERIAL NO, #OLOR 2 2/ ,#REATION DATE, #OLOR 0 02 ,PERSON #REATED, %/ ,DATE OF LIST, J% ,MATERIALTYPE,

L/ ,MAT'RO"P, N/ ,"NITOFMEAS"RE, ../ ,STORLO#ATION, #OLOR 1 .0/ ,PLANT, #OLOR %. "LINE. ENDIF. LOOP AT 9t_A>r> INTO D>_A>r> W$ERE A>t3r + D>_A>Ht-A>t3r. D>_693><-A>t3r + D>_A>r>-A>t3r. D>_693><-er85> + D>_A>r>-er85>. D>_693><-er3>A + D>_A>r>-er3>A. D>_693><-<>e5> + D>_A>r>-<>e5>. D>_693><-At>rt + D>_A>r>-At>rt. D>_693><-A>tH< + D>_A>r>-A>tH<. D>_693><-Ae938 + D>_A>r>-Ae938. READ TABLE 9t_A>r5 INTO D>_A>r5 WIT$ !EY A>t3r + D>_A>Ht-A>t3r. D>_693><-<:ort + D>_A>r5-<:ort. D>_693><-DerH8 + D>_A>r5-DerH8. APPEND D>_693>< TO 9t_693><. ENDLOOP. LOOP AT 9t_693>< INTO D>_693><. WRITE : -. D>_693><-A>t3r #OLOR 2 2/ D>_693><-er85> #OLOR 0 0K D>_693><-er3>A %/ D>_693><-<>e5> K/ D>_693><-At>rt L% D>_693><-A>tH< N% D>_693><-Ae938 ..% D>_693><-<:ort #OLOR 1 .0/ D>_693><-DerH8 #OLOR %. ENDLOOP. TOP-OF-PA'E. WRITE : -. ,MATERIAL NO, #OLOR . 1/ ,DIS#RIPTION, #OLOR 2. "LINE . Res"lt Enter the C$lant' and C#tora)e *ocation'

$ress the E1ec"te 9"tton.

Do"ble Click on re>"ire C;aterial ,o' which displays secondary list to correspondin) material in ormation. The res"lt shown below

De)eloping simple interacti)e report


9y Eikram Chellappa, ;o"ri Tech #ol"tions

#E32.#EME) : H 4et the $lant and stora)e location rom the "ser and to )et the available materials in the partic"lar stora)e location and display in a report. Hhen the material n"mber in the report is selected the material description and other complete details are displayed in a new screen "sin) interactive report. #TE$# F8**8HED T8 ACH7EEE THE 48A*I 4o to #E5. A9A$ Editor create a new pro)ram.

Code the lo)ic in the A9A$ Editor. Check JActivateD and E1ec"te the code.

Type in the Re>"ired $arameters or select a val"e rom F= Help #creen.

E1ec"te the pro(ect

The Report is displayed in the o"tp"t #creen.

#elect a record "sin) the mo"se do"ble click.

A new screen shows the o"tp"t based on the selected record achievin) the interactive reportin).

*&----------------------------------------------------------------* *& Report ZV9Hr>A_93ter>2t94e * *& * *&----------------------------------------------------------------* *& P;=<98@e5 >t SAPTechnical.CO * *& * *&----------------------------------------------------------------* REPORT ZV9Hr>A_93ter>2t94e NO STANDARD PA'E $EADIN' LINE-SIZE 2%%. ********** T$E INITIALIZATION PART #REATIN' STR"#T"RES************* INITIALIZATION. TYPES : BE'IN OF TY_MARD MATNR TYPE MARD-MATNR WER!S TYPE MARD-WER!S

L'ORT TYPE MARD-L'ORT END OF TY_MARD BE'IN OF TY_MARA MATNR TYPE MARA-MATNR ERSDA TYPE MARA-ERSDA ERNAM TYPE MARA-ERNAM MTART TYPE MARA-MTART MAT!L TYPE MARA-MAT!L END OF TY_MARA BE'IN OF TY_MA!T MATNR TYPE MA!T-MATNR SPRAS TYPE MA!T-SPRAS MA!T& TYPE MA!T-MA!T& END OF TY_MA!T BE'IN OF TY_FINAL MATNR TYPE MARA-MATNR ERSDA TYPE MARA-ERSDA ERNAM TYPE MARA-ERNAM MTART TYPE MARA-MTART MAT!L TYPE MARA-MAT!L WER!S TYPE MARD-WER!S L'ORT TYPE MARD-L'ORT SPRAS TYPE MA!T-SPRAS MA!T& TYPE MA!T-MA!T& END OF TY_FINAL. ***** T$E INITIALIZATION PART #REATIN' WOR!AREA AND INTERNAL TABLE***** DATA : W_MARD TYPE TY_MARD I_MARD TYPE TABLE OF TY_MARD W_MARA TYPE TY_MARA I_MARA TYPE TABLE OF TY_MARA W_MA!T TYPE TY_MA!T I_MA!T TYPE TABLE OF TY_MA!T W_FINAL TYPE TY_FINAL I_FINAL TYPE TABLE OF TY_FINAL. **************************START-OF-SELE#TION.************************** START-OF-SELE#TION. *************************'ET INP"T FROM "SER*************************** PARAMETER : PLANT TYPE MARD-WER!S STLO# TYPE MARD-L'ORT. ****SELE#T DATA FROM DATABASE INTO INTERNAL TABLES********************* **SELE#T FROM MARD T$E REP"IRED FIELDS FOR T$E 'IVEN INP"T************* SELE#T MATNR WER!S L'ORT FROM MARD INTO TABLE I_MARD W$ERE WER!S + PLANT AND L'ORT + STLO#. *****#$E#! IF RE#ORDS ARE FET#$ED IF NO E&IT O"T OF T$E PRO'RAM******** IF SY-S"BR# )* /. WRITE ,NO RE#ORDS,. E&IT. ELSE. ***IF RE#ORDS ARE FET#$ED FROM FRIST TABLE***************************** ****FET#$ RELATED RE#ORDS FROM NE&T TABLE****************************** SELE#T MATNR ERSDA ERNAM MTART MAT!L FROM MARA INTO TABLE I_MARA FOR ALL ENTRIES IN I_MARD W$ERE MATNR + I_MARD-MATNR.

IF SY-S"BR# )* /. WRITE ,NO MASTER DATA,. STOP. ELSE. SELE#T MATNR SPRAS MA!T& FROM MA!T INTO TABLE I_MA!T FOR ALL ENTRIES IN I_MARA W$ERE MATNR + I_MARA-MATNR AND SPRAS + ,E,. ENDIF. ENDIF. *****READ FROM INTERNAL TABLE FOR O"TP"T ****************************** LOOP AT I_MARA INTO W_MARA. AT FIRST. WRITE : SY-"LINEB.//C -. SY-VLINE 2% ,E&AMPLE INTERA#TIVE REPORT, .// SY-VLINE - SY-"LINEB.//C -. SY-VLINE 2 ,MATERIAL N"MBER, 2/ SY-VLINE 22 ,#REATION DATE, 1/ SY-VLINE 12 ,"SER NAME, J/ SY-VLINE J2 ,MATERIAL TYPE, L/ SY-VLINE L2 ,MATERIAL 'RO"P, .// SY-VLINE - SY-"LINEB.//C. ENDAT. ON #$AN'E OF W_MARA-MATNR. READ TABLE I_MARD INTO W_MARD WIT$ !EY MATNR + W_MARA-MATNR. ENDON. WRITE :-. SY-VLINE 2 W_MARA-MATNR 2/ SY-VLINE 22 W_MARA-ERSDA 1/ SY-VLINE 12 W_MARA-ERNAM J/ SY-VLINE J2 W_MARA-MTART L/ SY-VLINE L2 W_MARA-MAT!L .// SY-VLINE. $IDE W_MARA-MATNR. #LEAR W_MARA-MATNR. WRITE: - SY-"LINEB.//C. ENDLOOP. *****************END-OF-SELE#TION.************************************* END-OF-SELE#TION. ****MOVIN' VAL"ES IN TO FINAL INTERNAL TABLE ************************** LOOP AT I_MARA INTO W_MARA. ON #$AN'E OF W_MARA-MATNR. READ TABLE I_MA!T INTO W_MA!T WIT$ !EY MATNR + W_MARA-MATNR. READ TABLE I_MARD INTO W_MARD WIT$ !EY MATNR + W_MARA-MATNR.

ENDON.

ENDLOOP. ********AT LINE-SELE#TION EVENT TRI'ERIN' INTERA#TIVE REPORTIN'.******* AT LINE-SELE#TION. #ASE SY-LSIND. W$EN .. **DISPLAY O"TP"T IN NEW S#REEN AT LINE SELE#TION BY "SER MO"SE #LI#! ** WRITE: - W_MARA-MATNR #OLOR 2. READ TABLE I_FINAL INTO W_FINAL WIT$ !EY MATNR + W_MARA-MATNR SPRAS + ,EN,. "LINE .B2//C. WRITE : -. SY-VLINE K% ,E&AMPLE INTERA#TIVE REPORT, 2// SY-VLINE SY-"LINEB2//C -. SY-VLINE 2 ,MATERIAL N"MBER, 2/ SY-VLINE 22 ,#REATION DATE, 1/ SY-VLINE 12 ,"SER NAME, J/ SY-VLINE J2 ,MATERIAL TYPE, L/ SY-VLINE L2 ,MATERIAL 'RO"P, .// SY-VLINE ./2 ,PLANT N"MBER, .2/ SY-VLINE .22 ,STORA' LO#ATION, .1/ SY-VLINE .12 ,LAN'"A'E, .J/ SY-VLINE .J2 ,DES#RIPTION, 2// SY-VLINE - SY-"LINEB2//C. WRITE :-. SY-VLINE 2 W_FINAL-MATNR 2/ SY-VLINE 22 W_FINAL-ERSDA 1/ SY-VLINE 12 W_FINAL-ERNAM J/ SY-VLINE J2 W_FINAL-MTART L/ SY-VLINE L2 W_FINAL-MAT!L .// SY-VLINE ./2 W_FINAL-WER!S .2/ SY-VLINE

W_FINAL-MATNR + W_FINAL-ERSDA + W_FINAL-ERNAM + W_FINAL-MTART + W_FINAL-MAT!L + W_FINAL-WER!S + W_FINAL-L'ORT + W_FINAL-SPRAS + W_FINAL-MA!T& + APPEND W_FINAL

W_MARA-MATNR. W_MARA-ERSDA. W_MARA-ERNAM. W_MARA-MTART. W_MARA-MAT!L. W_MARD-WER!S. W_MARD-L'ORT. W_MA!T-SPRAS. W_MA!T-MA!T&. TO I_FINAL.

.22 W_FINAL-L'ORT .1/ SY-VLINE .12 W_FINAL-SPRAS .J/ SY-VLINE .J2 W_FINAL-MA!T& 2// SY-VLINE - SY-"LINEB2//C. #LEAR W_MARA-MATNR. END#ASE.

Do#nloading files onto the Application Ser)er


9y Eikram Chellappa, ;o"ri Tech #ol"tions

$escription This is a demo application to download the data rom the internal table o the application to a ile in the application server. 0tep !y 0tep %uidance. 4o to transaction #E5. to open A9A$ editor and Type in the pro)ram name click the create b"tton. Here we have "sed CZD8H,*8AD!A$$*!DE;8' as the pro)ram name.

Enter the #hort Description or the pro)ram #elect the $ro)ram type to be CE1ec"table pro)ram'

Click on 0"VE C/ECF and "C .V" E.

4ive the path o the ile which has to be "ploaded Here we have the ile in location C^:#R^#A$^#R7^#&#^#RC^D8H,.TOT' The drive name is taken as the de a"lt #A$ installation drive.

12 P2 =.0 0C#EE) The data rom the internal table is moved in to D8H,.TOT ile in the $resentation server and o"t p"t displayed on the list screen shows the data in the internal table.

1utput 6ile in the "pplication server. 4o to Transaction A*22 to see the #A$ installation directories Find o"r directory do"ble click

Find o"r downloaded ile in the directory and do"ble click it

The Downloaded data is displayed

SO3R.4 .O24

REPORT ZDOWNLOAD_APPL_DEMO. TYPES : BE'IN OF ST_DEMO RE'_NOB./C TYPE # NAMEB2/C TYPE # ADDRB2/C TYPE # END OF ST_DEMO. DATA : WA_DEMO TYPE ST_DEMO IT_DEMO TYPE TABLE OF ST_DEMO L_FNAME TYPE STRIN' . PARAMETERS: P_FNAMEB.2LC TYPE # DEFA"LT OBLI'ATORY. L_FNAME + P_FNAME. WA_DEMO-RE'_NO + ,.////.,. WA_DEMO-NAME + ,ANAND,.

,I;8rI8>pISRIISYSI8r2IDOWN.T&T,

WA_DEMO-ADDR + ,NA'AR!OVIL,. APPEND WA_DEMO TO IT_DEMO. WA_DEMO-RE'_NO + ,.////2,. WA_DEMO-NAME + ,VI!RAM,. WA_DEMO-ADDR + ,#$ENNAI,. APPEND WA_DEMO TO IT_DEMO. OPEN DATASET L_FNAME FOR O"TP"T IN TE&T MODE EN#ODIN' DEFA"LT. WRITE :% ,RE' N"M, .J ,NAME, 0K ,ADDRESS, . LOOP AT IT_DEMO INTO WA_DEMO. IF SY-S"BR# + /. TRANSFER WA_DEMO TO L_FNAME. WRITE :-% WA_DEMO-RE'_NO .J WA_DEMO-NAME 0K WA_DEMO-ADDR. ENDIF. ENDLOOP.

Step,by,Step approach in creating a *unction $odule


9y #asidhar Reddy ;atli, R89ERT 98#CH

2.

8pen #E5- transaction. 4o to 4oto F"nction )ro"ps Create )ro"p.

3.

4ive the "nction )ro"p name and short te1t. And click on #ave.

5.

#ave this "nction )ro"p as local ob(ect.

=.

Then open the transaction se.B and select the %F"nction )ro"p< rom the drop down list. Enter the "nction )ro"p name. $ress Enter.

?.

Ri)ht click on Z##R and press activate.

+.

Then yo" will )et the ollowin) screen. $ress Enter.

-.

4o to the transaction se5- a)ain and click on create.

..

,ow it will ask or the "nction )ro"p. Enter the "nction )ro"p and )ive the short te1t. $ress #ave.

/.

Click on the Attrib"tes tab and )ive the short te1t.

2B. Click on the 7mport tab and enter the $arameter name, Type and Re erence type o variables A and 9.

22. Click on E1port tab and enter the $arameter name, Type and re erence type o RE#.

<2. Click on E1ceptions tab and enter the E1ception and short te1t or that e1ception.

<". ,ow click on the #o"rce code tab and write the ollowin) lines as shown bellow.

<;. $ress synta1 check b"tton or Ctrl6F3.

<1. ,ow press on Activate b"tton or press Ctrl6F5.

<6. $ress Enter.

<B. ,ow $ress on Test b"tton or $ress F..

<:. Enter val"es or A and 9. And press E1ec"te or F..

<N. The ollowin) screen will be displayed with res"lt.

20. 7 yo" enter A val"e as ?. it will throw e1ception.

2<. 8"tp"t with E1ception.

22. ,ow create and en(oy more F"nction ;od"les.

Displaying 8D %raphs in ABAP


9y #warna #, Tata Cons"ltancy #ervices

*S9Ap<e report to 2re>te :r>p@ 93 ABAP *;893: 'RAP$_MATRI&_0D 6;32t9o3 Ao5;<e *T@e :r>p@ 8@oD8 t@e per6orA>32e o6 0 2oAp>39e8 6or t@e Fo;r *O;>rter8 o6 > 893:<e ?e>r *A"T$OR : SD>r3>.S. REPORT Z_0D'RAP$. *8tr;2t;re 5e2<>r>t9o3 6or per6orA>32e Ae>8;reAe3t

TYPES: BE'IN OF t?_per6orA>32e 2oAp>3?B.%C TYPE 2 O. TYPE 9 O2 TYPE 9 O0 t?pe 9 O1 t?pe 9 END OF t?_per6orA>32e. *8tr;2t;re 5e2<>r>t9o3 6or opt9o38 t>=<e t?pe8 : BE'IN OF t?_optt>=<e opt9o38B0/C TYPE 2 END OF t?_optt>=<e. *I3ter3>< t>=<e >35 DorH >re> 5e2<>r>t9o38 DATA: 9t_per6orA>32e TYPE STANDARD TABLE OF t?_per6orA>32e D>_per6orA>32e TYPE t?_per6orA>32e. DATA : 9t_optt>=<e t?pe 8t>35>r5 t>=<e o6 t?_optt>=<e D>_optt>=<e t?pe t?_optt>=<e. *939t9><9M>t9o3 e4e3t INITIALIZATION. *8t>rt o6 8e<e2t9o3 e4e3t START-OF-SELE#TION. *2<e>r93: t@e DorH >re>8 #LEAR WA_PERFORMAN#E. #LEAR D>_optt>=<e. *>ppe3593: 4><;e8 93to t@e per6orA>32e 93ter3>< t>=<e D>_per6orA>32e-2oAp>3? + ,#oAp>3? A,. D>_per6orA>32e-O. + KL. D>_per6orA>32e-O2 + JL. D>_per6orA>32e-O0 + KN. D>_per6orA>32e-O1 + L/. >ppe35 D>_per6orA>32e to 9t_per6orA>32e. D>_per6orA>32e-2oAp>3? + ,#oAp>3? B,. D>_per6orA>32e-O. + 1L. D>_per6orA>32e-O2 + JL. D>_per6orA>32e-O0 + JN. D>_per6orA>32e-O1 + K/. >ppe35 D>_per6orA>32e to 9t_per6orA>32e. D>_per6orA>32e-2oAp>3? + ,#oAp>3? #,. D>_per6orA>32e-O. + KL. D>_per6orA>32e-O2 + 1L. D>_per6orA>32e-O0 + KN. D>_per6orA>32e-O1 + L%. >ppe35 D>_per6orA>32e to 9t_per6orA>32e. *>ppe3593: 4><;e8 93to t@e opt9o38 93ter3>< t>=<e D>_optt>=<e-opt9o38 + ,P0TYPE + TO,. APPEND D>_optt>=<e TO 9t_optt>=<e. D>_optt>=<e-opt9o38 + ,P2TYPE + VB,. APPEND D>_optt>=<e TO 9t_optt>=<e. D>_optt>=<e-opt9o38 + ,TISIZE + .,. APPEND D>_optt>=<e TO 9t_optt>=<e. *2><<93: t@e :r>p@ 6;32t9o3 Ao5;<e #ALL F"N#TION ,'RAP$_MATRI&_0D, E&PORTIN' 2o<. + ,P;>rter ., 2o<2 + ,P;>rter 2, 2o<0 + ,P;>rter 0, 2o<1 + ,P;>rter 1, 59A. + ,I3 Per2e3t>:eW,

8et_6o2;8 t9t< TABLES 5>t> opt8 E&#EPTIONS ot@er8

+ ,&, + ,#oAp>3? Per6orA>32e8, + 9t_per6orA>32e + 9t_optt>=<e + ..

Tabstrips on the Selection Screen


9y #andipan 4hosh, Cap)emini

Report ZTEST. DATA 6<>:B.C TYPE 2. * S"BS#REEN . SELE#TION-S#REEN BE'IN OF S#REEN .// AS SELE#TION-S#REEN BE'IN OF BLO#! =. WIT$ PARAMETERS: F9e<5.B2/C TYPE 2 F9e<52B2/C TYPE 2 F9e<50B2/C TYPE 2. SELE#TION-S#REEN END OF BLO#! =.. SELE#TION-S#REEN END OF S#REEN .//. * S"BS#REEN 2 SELE#TION-S#REEN BE'IN OF S#REEN 2// AS SELE#TION-S#REEN BE'IN OF BLO#! =2 WIT$ PARAMETERS: O.B2/C TYPE 2 O2B2/C TYPE 2

S"BS#REEN. FRAME.

S"BS#REEN. FRAME.

O0B2/C TYPE 2 . SELE#TION-S#REEN END OF BLO#! =2. SELE#TION-S#REEN END OF S#REEN 2//. * STANDARD SELE#TION S#REEN SELE#TION-S#REEN: BE'IN OF TABBED BLO#! A?t>= FOR ./ LINES TAB B2/C =;tto3. "SER-#OMMAND p;8@. TAB B2/C =;tto32 "SER-#OMMAND p;8@2 END OF BLO#! A?t>=. INITIALIZATION. =;tto3. + ,TAB.,. =;tto32 + ,TAB2,. A?t>=-pro: + 8?-rep95. A?t>=-5?33r + .//. A?t>=->2t94et>= + ,B"TTON.,. AT SELE#TION-S#REEN. #ASE 8?-5?33r. W$EN .///. #ASE 8?-;2oAA. W$EN ,P"S$.,. A?t>=-5?33r + .//. A?t>=->2t94et>= + ,B"TTON.,. W$EN ,P"S$2,. A?t>=-5?33r + 2//. A?t>=->2t94et>= + ,B"TTON2,. END#ASE. W$EN .//. MESSA'E 8LLLB8>=>p5o2;C WIT$ te7t-/1/ 8?-5?33r. W$EN 2//. MESSA'E 8LLLB8>=>p5o2;C WIT$ te7t-/%/ 8?-5?33r. END#ASE. MOD"LE 939t_/.// O"TP"T. LOOP AT S#REEN. IF 82ree3-:ro;p. + ,MOD,. #ASE 6<>:. W$EN ,&,. 82ree3-93p;t + ,.,. W$EN , ,. 82ree3-93p;t + ,/,. END#ASE. MODIFY S#REEN. ENDIF. ENDLOOP. ENDMOD"LE. MOD"LE ;8er_2oAA>35_/.// INP"T. MESSA'E 8LLLB8>=>p5o2;C WIT$ te7t-/%/ 8?-5?33r. #ASE 8?-;2oAA. W$EN ,TO''LE,. IF 6<>: + , ,. 6<>: + ,&,. ELSEIF 6<>: + ,&,. 6<>: + , ,. ENDIF. END#ASE. ENDMOD"LE. START-OF-SELE#TION. WRITE: - ,F9e<5.:, F9e<5. ,P.:, O. - ,F9e<52:, F9e<52 ,P2:, O2

- ,F9e<50:,

F9e<50 ,P0:,

O0.

Output: "A'1

"A'2

Dynamic SE&ECT Statement (Enhanced functionality of Transaction SE6: and 9nde 9dentifier)
9y Arnab 4an)"ly, Cap)emini

.ntroduction: The p"rpose o this doc"ment is to brie ly describe a development, which will dynamically retrieve data rom database tables, based "pon "ser inp"t. Here, table name can be speci ied by the "se or which ield needs to be displayed can be p"t into selection screen, even which will be the restrictin) criteria, also can be speci ied. The o"tp"t will be displayed in simple report ormat. Alon) with the report, it will also noti y the "ser whether $rimary V #econdary inde1 is bein) "sed or not d"rin) data selection. 7n prod"ction system, there can be two ways o checkin) data rom standard table V C"stom table. Conventional Method: The ollowin) section will brie ly describe what are the steps ollowed to check data "sin) Conventional methodI 0tep4: R"n transaction #E2+ G p"t table name as selection criteria. Conventional ;ethod @:sin) transaction #E2+A. Dynamitic select statements @Describe in this doc"mentA.

0tep5: Choose the ields which will be the selection criteria or data selection rom settin)s T Fields or selection

$"t the selection criteriaI

0tep3: Report will be displayed in the ollowin) ormatI

Choose the desired o"tp"t ields rom #ettin)s T Format list T Choose Fields.

The inal report will be displayedI

0tep<: ,"mber o entries in the table can also be checked "sin) #E2+ Transaction.

0tepE:

Hhether the data selection is done "sin) primary V secondary inde1 can also be checked "sin) transaction #E22 V #TB?.

$ynamitic select statements 7n this method we have written a pro)ram, which will take selection criteria dynamically @Table name, ilter criteria, display ieldsA and prod"ce a report with sin)le "ser intervention. 7t will also display whether primary V secondary inde1 is bein) "sed or not d"rin) data selection. R"n the report ZD&,!A*E @ or so"rce code, clicJ hereA.

$rovide the ield names or the selection criteria.

$rovide the selection criteria as below.

The

o"tp"t

will

be

shown

in

the

below

ormat.

This pro)ram will display data in a sin)le step e1ec"tion. Hhen we are tryin) to access live system rom remote location each step e1ec"tion @Dialo) stepA is very time e1pensive. This pro)ram will red"ce the steps taken to display desired data. Also it will analy0e the partic"lar select statement is optimi0ed or not by speci yin) the 7nde1.

Do#nloading report output to E cel using 3&E


*y =oJesh ripathi- .nfosys

.ntroduction 7n the ollowin) doc"ment we will be disc"ssin) how to download o"r report o"tp"t into e1cel in the same ormat as in the #A$ report o"tp"t by "sin) 8*E concept. To address an 8*E A"tomation #erver @e.). EOCE*A rom A9A$, the server m"st be re)istered with #A$. "*"P Jeywords

A9A$ keywords allow "s to control the applications in the orm o an 8*E3 A"tomation #erver rom an A9A$ pro)ramI The ollowin) A9A$ key words control the applicationsI 4A C#E" E 1*+EC This command )enerates an ob(ect o the class Cclass'. 9asic ormI C#E" E 1*+EC o!, class. AdditionI =")%2"%E lan(u H determines the lan)"a)e chosen or method and attrib"te names o the ob(ect class. 7 no speci ication is made, En)lish is the de a"lt. This creates the instance or the a"tomation ob(ect at the a"tomation inter ace. 5A 0E P#1PE# @ This command sets the property prop o the ob(ect ob. accordin) to the contents o o!, m"st be o type 1=E5'1*+EC . 9asic ormI 0E P#1PE# @ 16 o!, prop M fld. AdditionI )1 6=20/H The addition ,8 F*:#H contin"es the collection processZ even i the ne1t command is not an 8*E statement.Th"s we can set series o properties in a sin)le transport operation. 3A %E P#1PE# @ This command copies the property ! o the ob(ect ob. to the ield " The ob(ect ob. m"st be o type 8*E3!89XECT. 9asic ormI %E P#1PE# @ 16 o!, p M f. AdditionI )1 6=20/ <A C"== ME /1$ The A9A$ key word CA** ;ETH8D calls the method m o the ob(ect ob.. m can be a literal or a variable. 9asic ormI C"== ME /1$ 16 o!, m. AdditionsI 2. W #tores the ret"rn val"e o the method in the variable . the ield fld. The ob(ect

3. EO$8RT7,4 p2 W 2... pn W n 7t passes val"es o ields to the parameters o the method. 7 assi)nment o parameters is by se>"ence, p2, p3,... m"st be)in with P_P, ollowed bythe position n"mber o the parameter.

The e1portin) parameters always come at the end o the statement. 5. ,8 F*:#H. EA 6#EE 1*+EC This will releases the stora)e space re>"ired or the ob(ect ob. The ob(ect can then no lon)er be processed. ,ow let "nderstand the concept o 8*E by takin) one e1ample. #"ppose we want e1actly this type o o"tp"t in e1cels.

9e ore

startin)

with

8*E,

incl"de

type

pool

ole5

in

yo"r

pro)ram.

,ote that or each 8*E ob(ect there has to be a variable holdin) handle data or that ob(ect. The typeDpool Cole3' de ines the handle variable data o the type ole5'o!,ect.For all the 8*E a"tomation pro)rams C1=E5.)C=' incl"de sho"ld be "sed. 0 EP 4: First step is to create 8*E ob(ect or e1cel application. CREATE 89XECT )h!e1cel NEOCE*.A$$*7CAT78,N. )h!e1cel is the ob(ect o type ole3!ob(ect.

0 EP 5: ,ow di erent properties o the e1cel ob(ect is to be set as per o"r re>"irement. #ET $R8$ERT& 8F )h!e1cel %visible< W B. The e1cel sheet is not visible to the "ser while data trans er. CA** ;ETH8D 8F )h!e1cel NHorkbooksNW )h!mapl. This will call the method o e1cel %Horkbooks< to )et the control to ob(ect )h!mapl. )h!mapl is the ob(ect o type ole3!ob(ect. CA** ;ETH8D 8F )h!mapl NAddNW )h!map. 7t will create a new workbook. ,ow create active sheets o e1cel. CA** ;ETH8D 8F application NHorksheetsN W sheet

EO$8RT7,4 _2 W 2. CA** ;ETH8D 8F sheet NActivateN. CActivate the sheet.

#ET $R8$ERT& 8F sheet N,ameN W Nsheet!nameN. #heet is the ob(ect o type ole3!ob(ect. #imilarly yo" can create many n"mber o sheets in e1cel. 0 EP 3: ,ow ill the data part into e1cel. He will irst ill the header part in e1cel.

$ERF8R; ill!cell :#7,4 2 - 2 %;8,TH*&!97**<. 7t will print C;onthly!9ill' in the -th col"mn o the 2st row o e1cel. Here we had "sed the orm C6.=='CE==' or illin) the data into the cells. F8R; ill!cell :#7,4 i ( bold val. CFor illin) data in e1cel.

CA** ;ETH8D 8F )h!e1cel %CE**#<W )h!0l ,8 F*:#H EO$8RT7,4 _2 W i _3 W (. $ERF8R; err!handle. CTrans errin) data to row W i and CFor handlin) a"tomation error. col"mn W (.

#ET $R8$ERT& 8F )h!0l %EA*:E< W val no l"sh. 4ET $R8$ERT& 8F )h!0l %F8,T< W )h! no l"sh. #ET $R8$ERT& 8F )h! %98*D< W bold no l"sh. E,DF8R;. Here P ill!cell

i W e1cel row n"mber. + W e1cel col"mn n"mber. *old W 2 then te1t will print in 9old. B then normal te1t will be printed in e1cel. Val W te1t yo" want to print .

#imilarly ill all the header details in e1cel. i.e. $ERF8R; ill!cell :#7,4 3 2 2 %E8DA$H8,E<. $ERF8R; ill!cell :#7,4 3 3 2 %C8;$A,&<. CTrans errin) data to 3nd row and 2st col"mn. CTrans errin) data to 3nd row and 3nd col"mn.

$ERF8R; ill!cell :#7,4 5 3 2 HA!8:T$:TD$E78D. CTrans errin) data to 5rd row and 3nd col"mn. $ERF8R; ill!cell :#7,4 = 2 2 %#. ,o<. CTrans errin) data to =th row and 2st col"mn.

$ERF8R; ill!cell :#7,4 = 3 2 %C"stomer ,ame<. CTrans errin) data to =th row and 3nd col"mn. $ERF8R; ill!cell :#7,4 = 5 2 %D"ration<. $ERF8R; ill!cell :#7,4 = = 2 %Cost<. $ERF8R; ill!cell :#7,4 = ? 2 %9ill<. CTrans errin) data to =th row and 5rd col"mn.

CTrans errin) data to =th row and =th col"mn. CTrans errin) data to =th row and ?th col"mn.

A ter illin) the header part ill all the line item details in e1cel. 0 EP <: 7n this scenario we want some col"mns to be mer)ed in o"r e1cel o"tp"t. i.e. @col"mn rom A2 to E2, col"mn rom 92 to E2, etc..A

,ow, or this irst we select the ran)e o cells. And then mer)e the ran)e o cells. CA** ;ETH8D 8F )h!e1cel %RA,4E< W )h!ran) ,8 F*:#H EO$8RT7,4 _2 W %A2< _3 W %E2< CA** ;ETH8D 8F )h!ran)e %#E*ECT< ,8 F*:#H. #ET $R8$ERT& 8F )h!ran)e %;ER4E< W 2 no l"sh. 0 EP EI ,ow ormat the e1cel accordin) to the re>"irement. To set the width o the col"mn accordin) to the te1t. CA** ;ETH8D 8F application NC8*:;,#N W C8*:;,. CA** ;ETH8D 8F C8*:;, NA:T8F7TN. To delete some line rom the e1cel, then can call this method, CA** ;ETH8D 8F )h!e1cel NR8H#N W row E1portin) _2 W 2. CA** ;ETH8D 8F row NDE*ETEN. Free ob(ect row. To chan)e the ormat o some cells in e1cels. For doin) this irst set the ran)es o the cell we want to ormat and then chan)e the ormat o these cells. For e.). this will set last 2st row =th col"mn CA** ;ETH8D 8F )h!e1cel NCellsN W w !cell! rom2 EO$8RT7,4 _2 W2 _3 W =. #et last 5rd row =th col"mn. CA** ;ETH8D 8F )h!e1cel NCellsN W w !cell!to2 EO$8RT7,4 _2 W 5 _3 W =.

#et the CA** ;ETH8D 8F w !e1cel NRan)eN W w !cell2 EO$8RT7,4 _2 W w !cell! rom2 _3 W w !cell!to2.

ran)e

here,

,ow Format the ran)e o cells #ET $R8$ERT& 8F w !cell2 N,"mberFormatN W <`<. 'Here we are settin) to this ormat. To have )rid lines in o"r e1cel o"tp"t. For this irst set the ran)es o the col"mn. CA** ;ETH8D 8F )h!e1cel %RA,4E< W )h!ran)e ,8 F*:#H EO$8RT7,4 _2 W %A2< _3 W %;<. ,ow set the style o all the border position. For *e t ed)e border, set the line style to 2. CA** ;ETH8D 8F )h!ran)e %9orders< W )h!borders EO$8RT7,4 _2 W -. #ET $R8$ERT& 8F )h!borders N*ine#tyleNW 2. #imilarly we can call this method or other positions. For ri)ht ed)e border, e1port with 2B. For top ed)e border, e1port with .. For bottom ed)e border, e1port with /. For inside vertical border, e1port with 22. For inside hori0ontal border, e1port with 23. This will set the )rid lines in e1cel like this, ,8 F*:#H Cstartin) rom col"mn A C"p to col"mn ;

here

#"ppose we want to chan)e the color and width o any partic"lar col"mn. CA** ;ETH8D 8F )h!e1cel %Cells< W e!cell EO$8RT7,4 _2 W 2 _3 W 5 4ET $R8$ERT& 8F e!cell N7nteriorN W e!color. #ET $R8$ERT& 8F e!color NColor7nde1N W 5?. #ET $R8$ERT& 8F e!cell NCol"mnHidthN W 3B. Codes or di erent colors.

0 EP 6: At last ree all the reserved 8*E ob(ects. i.e. Free ob(ect col"mn.

Free ob(ect )h!e1cel. ,ow #ave e1cel spreadsheet to partic"lar ilename and >"it the e1cel application. CA** ;ETH8D 8F sheet N#aveAsN EO$8RT7,4 _2 W NcI^yo"r!e1cel.1lsN Pname o e1cel _3 W 2. P ile ormat CA** ;ETH8D 8F sheet NS:7TN. This closes the E1cel doc"ment #ET $R8$ERT& 8F application NvisibleN W B. 7t will close visible e1cel window and data is lost i not saved. ,ow o"r data )et saved into e1cel namin) %yo"r!e1cel<.

0nderstanding 2ABAP 0nit2


9y ,ithya ;"r")esan, &A#H Technolo)ies

5ntroduction: #t is a best practice to modulari8e our programs as much as &e can for better programming. #f &e &ant to chec one particular module li e subroutines2 function modules or classes for bugs then &e can do it using %'%+ @nit. %'%+ @nit is a tool for unit testing of %'%+ programs. 6o1 to 1rite these tests: %'%+ unit is based on %'%+ ob!ects. /he global class C5F%@=#/F%SS97/ contains methods &hich can be used for testing ./ests are implemented in local classes. #nside the local class the necessary method from the global class can be called for testing. /hese test classes can be &ritten inside the program for &hich the test is to be done. #t &ill not affect our production code in any&ays. 2ifference bet1een Ordinar, class and "est class: 'oth the test class and test method should have F)7 /9S/#=G addition. 93: C5%SS mytest -9F#=#/#)= 0OR "4S"57*. +7#>%/9 S9C/#)=. M9/G)-S mytest 0OR "4S"57*. 9=-C5%SS. 8ethods in .!9A375"9ASS4R" for "esting:

%SS97/F94@%5S %SS97/F-#FF97S

%SS97/F')@=%SS97/F=)/F')@=%SS97/F#=#/#%5 %SS97/F=)/F#=#/#%5 %SS97/FCG%7FC+ %SS97/FCG%7F=+ %SS97/F94@%5SFF F%#5 %')7/

%SS97/F94@%5S ( Chec s the e6uality of t&o data ob!ects. %SS97/F-#FF97S ( Chec s for the difference of t&o data ob!ects. %SS97/F')@=- ( chec s for the validity of the reference of a reference variable. %SS97/F#=#/#%5 ( chec s &hether the reference of a reference variable is invalid. %SS97/F=)/F#=#/#%5 ( chec s &hether the data ob!ect is not having its initial value. %SS97/FS@'7C ( chec s for the specific value of S?(S@'7C. ASS4R"94 3A!S: %SS97/F94@%5S is one of the methods in the class C5F%@=#/F%SS97/. /his method can be used for chec ing e6uality of t&o data ob!ects. /he parameters of the method: A." 4:P 8S* !4;4! 35" ( %ctual result ( 93pected 7esult ( Message to be displayed in the result ( 9rror level I/olerable.Critical.fatalJ ( #f the test fails2 flo& level is controlled using this I=).M9/G)-.C5%SS.+7)G7%MJ "O! !evels:

( /olerance level for F

0 ( /olerable

< ( Critical 2 ( Fatal

uit: =o I 0 J , #t &ill continue the current test Method. Method I < J , #t &ill interrupt the current test method Class I 2 J , #t &ill interrupt the current test class. +rogram I " J , abandon e3ecution of all test classes for the tested program.

"olerance: #f the tolerance limit specified is e3ceeded then error is sho&n. 93: %ctual result , 2;. 93pected 7esult , 21.
Tolerance / 0 1111 Di""erence 2 E*!ected Result & $ctual result 2 T'ere"ore dis!la5s an error 3 4 tolerance

4<ample Program: 5et us consider an e3ample for %'%+ unit test using the method %SS97/F94@%5S to chec the e6uality of t&o data ob!ects. #n this program2 &e have t&o methods divide and factorial in a local class M%/G. *e &ant to test the factorial method. So &e have created one class and one method M?/9S/ for testing. #n the test method implementation &e have called the factorial method and so the data ob!ect 79S@5/ is populated. =o& &e are going to compare the actual data ob!ect I79S@5/J &ith the e3pected result. For that &e are calling the %SS97/F94@%5S from the global class passing the e3pected result.
*----------------------------------------------------------------------* * #LASS A>t@ DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* #LASS A>t@ DEFINITION. P"BLI# SE#TION. MET$ODS 59495e IMPORTIN' opr. TYPE 9 opr2 TYPE 9 E&PORTIN' re8;<t TYPE 6 RAISIN' 27_8?_>r9t@Aet92_error. MET$ODS 6>2tor9>< IMPORTIN' 3 TYPE 9

RET"RNIN' 4><;eB6>2tC TYPE 9. END#LASS. EA>t@ DEFINITION *----------------------------------------------------------------------* * #LASS A>t@ IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* #LASS A>t@ IMPLEMENTATION. MET$OD 59495e. re8;<t + opr2 - opr.. ENDMET$OD. E59495e MET$OD 6>2tor9><. 6>2t + .. IF 3 + /. RET"RN. ELSE. DO 3 TIMES. 6>2t + 6>2t * 8?-935e7. ENDDO. ENDIF. ENDMET$OD. E6>2tor9>< END#LASS. EA>t@ IMPLEMENTATION START-OF-SELE#TION. DATA D_o=Q TYPE REF TO A>t@. DATA e72 TYPE REF TO 27_8?_>r9t@Aet92_error. DATA re8 TYPE 6. DATA re8;<t TYPE 9. DATA te7t TYPE 8tr93:. #REATE OB(E#T D_o=Q. TRY. D_o=Q-*59495eB E&PORTIN' opr. + 02 opr2 + 1 IMPORTIN' re8;<t + re8 C. WRITE : re8. te7t + re8. #AT#$ 27_8?_>r9t@Aet92_error INTO e72. te7t + e72-*:et_te7tB C. MESSA'E te7t TYPE ,I,. ENDTRY. #REATE OB(E#T D_o=Q. #OMP"TE re8;<t + D_o=Q-*6>2tor9><B 1 C. WRITE :- ,T@e re8;<t 6or 6>2tor9>< 98:, re8;<t. *----------------------------------------------------------------------* * #LASS A?te8t DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* #LASS A?te8t DEFINITION EXA" R98H_Le4e< $>rA<e88 FOR TESTIN'. EXA" D;r>t9o3 S@ort PRIVATE SE#TION. MET$ODS A?te8t FOR TESTIN'. END#LASS. EA?te8t DEFINITION *----------------------------------------------------------------------* * #LASS A?te8t IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* #LASS A?te8t IMPLEMENTATION.

MET$OD A?te8t. #REATE OB(E#T D_o=Q. re8;<t + D_o=Q-*6>2tor9><B 1 C. 2<_>;39t_>88ert+*>88ert_eO;><8B >2t e7p #orre2t<?,

+ re8;<t + ,21, A8: + ,F>2tor9>< Not 2><2;<>te5

ENDMET$OD. END#LASS.

<e4e< + ,/, O;9t + ,2, to< + ,/.NNN, C. EA?te8t EA?te8t IMPLEMENTATION

4<ecuting 3nit "ests: 0or program2 +rogram (K /est (K @nit /est. 0or class2 Class (K @nit /est. 0or 0unction 8odule/ Function Module (K /est (K @nit /est. Result of 3nit "est: #f both the actual and the e3pected result is same2 then @nit test does not find any errors. #n that case one message &ill be displayed on status bar li e2

#f it finds errors then a result &ill be displayed as follo&s:

/he tas is displayed in a tree structure &ith a +rogram name2 Class name and method name. 'oth the e3pected and the actual results can be seen in the @nit test results. %lso in the stac it &ill be displaying the line number &here the error occurred. 'y double clic ing the line number &e can enter into the source code. A'AP 3nit results in .ode 5nspector: *e can see the %'%+ unit results in code inspector. *hile creating the variant2 chec for the %'%+ unit in -ynamic chec .

#n the Code inspector results &e can chec for the %'%+ unit errors2 &arnings and informations.

0nderstanding 2Chec"point %roup2


9y Richa Tripathi, &ash Technolo)ies

The checkpoints are the type o statements introd"ced in the #A$ Heb Application #erver @#A$ HebA#A +.3B that is totally dedicated to ens"rin) pro)ram correctness and maintainability. This improves the >"ality o so tware written in A9A$. These checks are transportable and can be transported .The transaction that takes care o these checkpoints and the place where they are maintained is #AA9. The Checkpoints now can be created or breakDpoints and checkpoints and the two statements or this are 2. Assertions 3. 9reakDpoints The one which act"ally does not checks the errors b"t is "sed to lo) the data that " want is *84D$87,T. To start with step by step e1planation o the checkpoints we start irst with the Assertions. Assertions synta1 as per the #A$ *ibrary that is to be "sed in the codin) is as belowI "00E# NN.$ N6.E=$0 field4 C1)$. .1)O lo('exp. (roup field5 N02*FE@ ta!le4 su!JeyOO ta!le5...O

Assertions are "sed as a hi)h >"ality means o problem determination in the case o code ail"re. Assertions are invoked at r"n time. They can be made active or inactive. Assertions can be le t in code when promoted to prod"ction with no impact to the code. They are only invoked i the checkpoint )ro"p is activated. The checkpoint )ro"ps can be activated thro")h the transaction #AA9 and that is re erred by 7D in the pro)rams with assert statements. This is the transaction below #AA9 where in the checkpoint )ro"p we can create the )ro"p 7D.

Clickin) on the create b"tton below the ,ame we )et to the below screen.

,ow the check)ro"p activation can be done with three levels 2. $ersonal Activation 3. :ser *evel activation 5. #erver *evel Activation. 7n the personal level activation that check)ro"p will be active or the c"rrent "ser only and or the :ser the Check)ro"p will be active or that "ser that has been de ined and same is or the #erver. The :ser when clicked there yo" can de ine the #peci ic "sers or it as thisY

And similarly it can be done or speci ic #ervers on clickin) on the add #i)n as belowI

As or the screen belowID

There are three thin)s that can be controlled with the check)ro"ps. The breakpoints can be made active or inactive. 7nactive then that partic"lar statement will be i)nored and i break then in the pro)ram wherever the statement occ"rs the pro)ram )ets into deb"))in). The #tatement as per the #A$ *ibrary that )oes with this in the $ro)ram is as belowY *#E"FHP1.) Q Nlo( textO R. Ex. *#E"FHP1.) .$ @/'checJ. Hitho"t the addition .$, the breakpoint is always active. The lo) text is the te1t which yo" can speci y or the system lo) which is seen in the lo)s )ettin) created. D"rin) back)ro"nd processin) the pro)ram e1ec"tion is not interr"pted. 7 the pro)ram reaches a breakpoint, the entry P9reakpoint reachedP is written to the system protocol "nder which the pro)ram name and the location o the breakpoint in the pro)ram are recorded. An inactive breakpoint is i)nored. ,ow takin) or the assertionsY Followin) are the ways the assertion can be "sedID Inactive )de"ault,6 statement is ignored 7og6 occurrence is logged $bort6 !rogram terminates 8it' runtime error $SSERTI#N_F$I7ED P N.$ (roup.$O

T'e belo8 t8o o!tions come 8it' a !o!&u! 'aving o!tions as6&

+rea9:7og6 !rogram is interru!ted and starts t'e debugger : li9e 7#G mode in bac9ground; batc' etc +rea9:$bort6 !rogram is interru!ted and starts t'e debugger : li9e $+#RT mode in bac9ground; batc' etc below two options come as this...

The

Assertion R:*E#I 2. E1ception handlin) sho"ld always be "sed to trap and handle ail"res. D8 ,8T "se an assertion in the place o e1ceptions. 3. Assertions sho"ld only be "sed on c"stom code rather than on standard codes. 5. Hhen an assertion is invoked, it sho"ld create a lo) entry "nless and "ntil there is a compellin) reason to terminate with a r"n time error. Here is a sample pro)ram where the *84D$oints and A##ERT78,# are "sed. RE$8RT yh252+!test!check)rp.. LL $arameters Declarations $ARA;ETER#I p!carrid *7FE s li)htDcarrid. Ldata I ma1 type i. LTypes Declarations o s li)ht T&$E# I 9E47, 8F type!s!s li)ht, carrid T&$E s li)htDcarrid, connid T&$E s li)htDconnid, ldate T&$E s li)htD ldate, price T&$E s li)htDprice, ma1 T&$E i, E,D 8F type!s!s li)ht.

LField #trin) Declarations or s li)ht DATAI s!s li)ht T&$E type!s!s li)ht. L7nternal table or # li)ht Data DATA I t!s li)ht *7FE #TA,DARD TA9*E 8F s!s li)ht. DATA yh252+!s"bkey T&$E char3BB. 7F p!carrid 7# 7,7T7A*. #E*ECT carrid connid ldate price FR8; s li)ht 7,T8 s!s li)ht. HR7TEI s!s li)htDconnid, s!s li)htD ldate, s!s li)htDprice. A$$E,D s!s li)ht T8 t!s li)ht. A##ERT 7D yh252+!check #:9FE& N&H252+!parameter!i !initialN F7E*D# p!carrid t!s li)ht s!s li)htDcarrid s!s li)htDconnid s!s li)htD ldate s!s li)htDprice condition p!carrid e> N*HN . E,D#E*ECT. A##ERT 7D yh252+!check #:9FE& N&H252+!2N F7E*D# p!carrid t!s li)ht C8,D7T78, p!carrid ES N*HN . EO7T. E*#E. A##ERT 7D yh252+!check #:9FE& F7E*D# p!carrid t!s li)ht C8,D7T78, p!carrid ES <*H<. N&H252+!3N

V s!s li)htDcarrid,

#E*ECT carrid connid ldate ;AO@ price A A# ma1 7,T8 C8RRE#$8,D7,4 F7E*D# 8F s!s li)ht FR8; s li)ht HHERE carrid ES p!carrid 4R8:$ 9& carrid connid ldate 8RDER 9& carrid ma1 DE#CE,D7,4. 7F syDdbcnt U =. A$$E,D s!s li)ht T8 t!s li)ht.

*84D$87,T 7D yh252+!check #:9FE& N*84!$87,TN F7E*D# p!carrid t!s li)ht s!s li)htDconnid s!s li)htD ldate s!s li)htDma1. HR7TEI V s!s li)htDcarrid, s!s li)htDconnid, s!s li)htD ldate, s!s li)htDma1. E,D7F. E,D#E*ECT. E,D7F. A variant is created or the $artic"lar Check)ro"p created. Eariant can be created as a *ocal as well as at a "ser level. Here it is created at the :ser *evel.

Click on create and enter the ollowin) entries.

There are o"r kind o ob(ect type or which a variant can be created as 2. Check 4ro"p 3. $ro)ram 5. Class =. F"nction 4ro"p And or partic"lar 8b(ect type the Di erent options can be )iven or 9reakpoint, *o)point and Assert. The 8ptions or them are same as stated be ore in the $ersonal Activation screen or check )ro"p. ,ow save the variant and then )o back to the check)ro"p or which we have created the variant. Don<t or)et to activate the variant.

As above it is seen the *ocal variant is visible in the Eariants tab the same way we can create a 4lobal variant also. ,ow r"n the $ro)ram. 7 the assertion condition is violated the listed lo)s are created or the assertion as we have selected the lo) or assertion in the #AA9 transaction in the Check 4ro"p. The lo) will also be created or the *84D$87,T statement and the #:9FE& there de ines the Fey to distin)"ish that the lo) has been created or which Assertion and checkpoint. 7n the *o) the data is se)re)ated accordin) to the two HierarchiesID 2. 4rop"V#"bkeyV$ro)ramV$roced"re 3. 4ro"pV$ro)ramV$roced"reV#"bkey The lo) seen is like this.

Do"ble clickin) on the *ine where the 7ncl"de line n"mber is seen we can see the description o the lo) as below.

As we have lo))ed the table entries also do"ble clickin) on the table we can see the table entries too.

0nderstanding 2Co)erage Analy;er2


9y Tanveer Zaha>"e, &A#H Technolo)ies

Covera)e Analy0er is a very power "l r"ntime analysis tool provided by #A$ that enables an A9A$ developer to monitor processin) blocks s"ch as reports, s"bro"tines, "nctionDmod"les and methods. $ower "l ilterin) system in Covera)e Analy0er acilitates developer to enter the n"mber o calls separately accordin) to periods, "sers and "nctional areas. 7n a n"tDshellZ Covera)e Analy0er is a "nction or monitorin) the systemDwide e1ec"tion o A9A$ pro)ramsZ It enables the success of test activities to be assessed for quality checks. It also provides an overview of the use of programs for development purposes. Developer can "se this tool to trace pro)rams or development p"rpose and S"ality ;ana)er can "se this tool to check system per ormance or >"ality ass"rance. 7t helps carry o"t a ran)e o Administration #ettin)s and the ;onitorin) Activity. ;oreover it helps )et s"mmari0ed in ormation o n"mber o pro)ram e1ec"tions, n"mber o r"ntime errors, n"mber o pro)ram resets. Fascinatin)ly, the res"lts can be ormatted separately accordin) to "serD)ro"pZ each "serD)ro"p can contain any n"mber o "sers "nder one test key.

9roadly, "nctions o Covera)e Analy0er are classi ied into twoZ 2. Administration #ettin)s 3. Display 4lobal. Detail. 8nV8 . Test 4ro"ps. Re)istrations. Reset. #ettin)s. ;onitor. Consistency Checks.

A simple e1ercise will help "s easily "nderstand Covera)e Analy0er, rather simply )oin) thro")h doc"mentation. 7n order to make "se o Covera)e Analy0er, "ser has to have an appropriate role. To check "ser a"thori0ationZ Call "p transaction #:7; @:ser 7n ormation #ystemA. E1pand A"thori0ations node. Choose +5 #b.ect and e1ec"te it @press F.A.

Check the presence o a"thori0ation ob(ect 0'C1V'"$M in the system.

Con irm

the

whereD"sed

list

or

pro iles

"sin)

icon

or

Ctrl6#hi t6F22.

8nce "ser a"thori0ation is checked to have absol"te access to 0C1V ?Covera(e "nalySerA transactionZ "ser can proceed "rther. 7 a role is not assi)ned to a "ser, 9asis cons"ltant has to be cons"lted in this re)ards. 7n act, a tip to be remembered is that Covera)e Analy0er tool sho"ld be "sed on weekends or in the evenin), when all "sers and packa)es are on loose ends. #ince back"p server collects data rom all the servers incl"din) local and remoteZ system needs all packa)es and "sers to be in the passive mode. *et<s start "p with a simple e1ample to "nderstand Covera)e Analy0er in a better wayI 0 EP 4: Call "p the transaction 0C1V or navi)ate thro")h #A$ Easy AccessDT#A$ ;en"DTToolsDTA9A$ HorkbenchDTTestDT#C8E @Covera)e Analy0erA.

4eneral #tat"s o the system is shown on the ri)ht hand pane o the windowZ

Covera)e Analy0er administration incl"des all o the "nctions re>"ired or carryin) o"t settin)s and checks.

Administration and Display nodes are shown on the le t pane o the window. 0 EP 5: 9e ore the Covera)e Analy0er bein) switched on, settin)s have to be maintained or back"p server and ilters are to be set. Havin) not made settin)s or back"p server, i Covera)e Analy0er is started, it simply throws o"t an in ormation messa)e to maintain back)ro"nd server or data collection.

#o, Administration settin)s are to be done be ore startin) "p the Covera)e Analy0er. E1pand Administration node, select #ettin)sZ #ettin)s "nction is "sed to set the parameters or the 4lobal and Detail views, and to ilter the pro)rams to be checked via the packa)e. 7n order to make settin)s, switch settin)s to Chan)e ;ode @Cntrl6F2A. ip to remem!er: A pro)ram is re)arded as tested i the ollowin) conditions are "l illedZ Co"nt2 Absol"te Eal"e T Co"nt3 Absol"te Eal"e T B. B.

RA9AO3 Absol"te Eal"e :nicode Check W

W 2.

B.

Co"nt2 and RA9AO2 indicate the n"mber o pro)rams e1ec"ted and r"ntime errors since t'e Coverage $nal5<er 8as started Co"nt3 and RA9AO3 indicate the n"mber o pro)rams e1ec"ted and r"ntime errors since t'e last reset F"rther, assi)n packa)e to be "sed d"rin) analysis. Hhen a packa)e is preDselected, the eval"ation or the 4lobal view is only per ormed or this packa)e. 7 this restriction is not applied, all o the pro)rams are incl"ded to)ether with those rom local pacJa(es ?87A and pro)rams )enerated locally without pacJa(es ? A.

7 A9A$ pro)rams with a set :nicode la) are only to be traced by the Covera)e Analy0er, then select Unicode checkbo1. Checkin) Unicode is to mark it as T:U- else leave it "nattended.

7t<s optional to set the li)htsZ li)hts provide a vis"al means o representin) the stat"s o the res"lts or the de)ree o covera)e in the 4lobal and Detail views. *i)hts are set by de a"lt, which can be set accordin) to developer<s way o analysis. #E$ @E==1G B *T 55 M 55 *T ++ M

%#EE) ++ *E 2BBM

F"rther, ;onitor #ettin)s have to be done, which incl"des settin) Trace *evel and ;a1im"m Entries *o) and ;a1im"m Entries Data ;onitor. There are = di erent trace levels @2D=A, the hi)her the trace level, the more in ormation is drawn or deb"))in).

ip: The val"es or ;a1im"m Entries *o) and ;a1im"m Entries Data ;onitor limit the lines displayed or the 4eneral *o) and ;onitor Data Eol"mes in the monitor "nction. The de a"lted lines or log "ile are 2BB and or data volume are 3BB. +ac9ground server has to be speci ied, where precisely data is to be collected. ;oreover, the period or which back)ro"nd (ob has to be repeated is also to be speci ied. The de a"lted val"e or Data Collection6 %eriod )Min, is 5B mins, which can be modi ied based on developer<s way o analysis. 7n this case, c"rrent server is speci ied as 9ack)ro"nd server.

F"rther, Summari<ation "nction acilitates checkin) the same processin) blocks in several systems sim"ltaneo"sly. ip to remem!er: The res"lts rom the individual s5stems are local and those rom the remote s5stems are summari<ed *ocal De)ree o covera)e #"mmari0ed de)ree o covera)e *E *E 2BBM. 2BBM.

*ocal De)ree o covera)e 4E #"mmari0ed de)ree o covera)e. To determine RFC connection with c"rrent server, call "p transaction 0MEDHVRFC DestinationsDTRV5 ConnectionsDTE60C=) DWW.

Desired RFC connections in #"mmari0e covera)e res"lts can be speci iedZ moreover period and start time or s"mmari0e data can also be speci ied.

Finally, save the Settings 0 EP 3: Choose #n:#""; Status in the Administration node and start "p the Covera)e Analy0er. S8itc' Coverage $nal5<er #n:#""6 This displays the n"mber o pro)rams that have been initiali0ed. S8itc' $utomatic Recordings #n:#""6 This displays the a"tomatic recordin) period and the version n"mber or the 4lobal view. S8itc' Data $ggregations "rom Di""erent Remote S5stems6 This displays back)ro"nd server and all o the other systems whose res"lts are "sed or DataDa))re)ation.

7 the server is in switchedDo mode e1ception shows #E$ si)nal, %#EE) si)ni ies server to be in switchedDon mode and @E==1G represents either RFC problem or database and shared memory inconsistency. 7n this case, we<ll proceed witho"t switchin) on S8itc' $utomatic Recording #n:#""

The servers which are act"ally r"nnin) are shown as la))ed "p. 0 EP <: Create estH%roupsX TestD4ro"ps are made to s"mmari0e and display the res"lts o the Covera)e Analy0er or a partic"lar set o "sers "nder one )eneric keyVheadin). ip to remem!er: TestD)ro"ps sho"ld not be created more than 2B. ;oreover, only "sers assi)ned a role with the a"thori0ation ob(ect #!C8E!AD; are allowed to de ine )ro"p. Two preDde ined TestD)ro"ps are always availableZ "== B Covera)e res"lts s"mmari0ed or all test )ro"ps on the local s5stem.

C1)$ B Covera)e res"lts on the local s5stem as well as remote s5stem. 7n this case, we create a testD)ro"p. To create a testD)ro"pZ switch on the C'ange Mode, click $!!end Ro8 icon provided in the application toolD bar.

De ine a TestD)ro"p ollowin) &VZ namin) conventionZ then save it.

0 EP E: ,e1t step is to assi)n "sers to the ("stDmade testD)ro"p. To assi)n :sers to a testD)ro"pZ switch on the C'ange Mode, click $!!end Ro8 icon provided in the application toolDbar.

#elect desired testD)ro"p or which "sers have to be assi)nedZ in this case we assi)n #A$DEEB3 as "ser to testD)ro"p ZT#T.

ip: A testD)ro"p can contain any n"mber o "sers, or e1ample, all HR developers in one )ro"p. That makes ilterin) pretty easy. ;oreover, comparison o per ormance o testD)ro"ps can be done in 4lobal view. 0 EP 6: An optional "nction to be done is ResetZ e1plicitly this "nction is intended or sit"ations in which the res"lts o the previo"s analyses are no lon)er re>"ired. 7t resets all the co"nters o the Covera)e Analy0er to B or all the pro)rams o a selected )ro"p.

F"rther more, implicit reset is carried o"t a"tomatically as soon as the low or the data o a pro)ram chan)es. A ter s"ccess "l reset, an in ormation messa)e is poppedD"pZ

#TE$ -I Consistency check has to be done or all the servers incl"din) remote ones, be ore proceedin) to

act"al analysisZ C'ec9 Status o" $ll Servers checks whether the stat"s in the shared memory matches the stat"s in the database. C'ec9 Status o" +ac9ground =obs checks whether all the batch (obs o the Covera)e Analy0er are activated. 7 this is not the case, the batch (obs are all resched"led by means o the Re!air "nction.

C'ec9 Table Consistenc5 )7ong Runtime, may become inconsistent i the Covera)e Analy0er ails on an application server d"e to system error. Re!air "nction also brid)es the )ap between activatin) and )eneratin) a pro)ram. #o, in order to check inconsistencies, check the types o inconsistencies accordin)ly and E*ecute C'ec9s, and then choose monitor to check or the inconsistency messa)es, %#EE) indicates 7n ormation messa)e, @E==1G indicates Harnin) messa)e and #E$ indicates Error messa)e.

7n the present caseZ no inconsistencies have been o"nd while startin) All #ervers. 7n case, there arise any warnin) or error messa)es, those problems are to be i1ed and then select partic"lar row o the warnin)Verror messa)e and click Com!leted General 7og )ives )eneral in ormation, while Monitor >olume gives detailed in ormation o started server.

8nce the warnin) is attended, select the row and hit Com!leted, which will )oin) to t"rn yellow si)nal to )reen si)nal.

ip: Every time inconsistencies are checkedZ General 7og sho"ld be re"res'ed. To select more than 2 messa)e, keep Cntrl key pressed.

#TE$ .I DisplayZ )ives covera)e res"lts at a"thor or packa)e level accordin) to criteria yo" select "nder Settings Display )ives hi)hDlevel view. Eiews can be based on $ut'or or %ac9age ALL si)ni ies all the a"thors on local system based on view )iven and the CO ! @yV0 test )ro"psA si)ni ies all the a"thors on both local and remote systems based on view )iven. 7 ?#t'er vie8@ is selected as %ac9age, then selection is done accordin)ly.

)ote: #ince $utomatic Recordings were not switched onZ percenta)eDbased pro)ress display over time cannot be seen or selected #A$DEEB3 a"thor. ,ormally, Display view )ives S"ality ;ana)ers to view the system, the ollowin) wayZ

2nicode: This val"e indicates how many percent o the processin) blocks have the :nicode la) set @the la) itsel is set per pro)ramA Capacity 2tiliSation: This val"e is comp"ted as the ratio o "sed processin) blocks to loaded processin) blocks to loaded processin) blocks. "ccumulated Executions ?PercentA This val"e indicates in percent how many processin) blocks have been e1ec"ted since the start o the Covera)e Analy0er. ested processin( !locJs ?PercentA This val"e indicates in percent how many processin) blocks have been e1ec"ted in the act"al version witho"t r"ntime errors. 7n the e1ample above yo" can see that c"rrently /.M o the processin) blocks in the system belon) to a pro)ram that has the :nicode la) set, 3+M have been e1ec"ted since start o the covera)e analy0er, /M have been e1ec"ted in the active version witho"t errors and the capacity "tili0ation is 3/M.

0 EP D: E*act >alue Table can be viewed or a"thor #A$DEEB3Z which displays n"mber processin) blocks or a"thor #A$DEEB3 on timely manner.

4raphical view o the selected row can be seen "sin) individ"al date and all dates when no row is selected. All rows selected or )raphical analysisZ

iconZ that displays )raphical view o the

7ndivid"al selection or )raphical analysisZ

ip: ;oreover, previo"s saved history can also be viewed or the speci ic "ser. #TE$ 2BI Details viewZ )ives s"mmari0ed and detailed res"lts. Details )ive lowDlevel view. #tron) ilterin) options allow "ser to select on what conditions res"lts are to be displayed.

Conditions can be set or ran)e o testD)ro"ps, packa)es and a"thors pertainin) to those testD)ro"ps. 7n the present e1ampleZ testD)ro"p ZT#T and A"thor #A$DEEB3 is taken as sin)leDval"e selection, which )ives res"lts pertainin) to speci ied criteria. ;oreover, other ilters can also be set and settin)s sho"ld be done de inin) access via %ac9age #b.ect; %ac9age and $ut'or. De a"lted accessDvia is %rogram #b.ect.

Hittin) Standard Settings is )oin) to reset all the val"es. 8nce settin)s are doneZ hit e1ec"te b"tton, that is )oin) to )et detailed in ormation, incl"din) n"mber o calls made to that partic"lar ob(ect, n"mber o processin) blocks, load si0e in Filo byte. 9esides all the in ormation )ivenZ do"bleDclickin) the ob(ect name will navi)ate to the partic"lar pro)ram or e1ec"tin) block where e1actly error has been o"nd.

)ote: C"rrent E1ec"tions W $ro)ram "nits c"rrently "sed V Total no. o $ro)ram "nits. Capacity :tili0ation W ,o. o $ro)ram "nits c"rrently "sed V *oaded $ro)ram "nits. Conclusion: *ikewise, many s"ch pro)ram e1ec"tions, r"ntime errors and pro)ram resets can be easily traced "sin) this power "l A9A$ r"ntime analysis tool D Covera)e Analy0er.

*TP file transfer in Bac"ground


9y Xo y Xohn, Collabera

4A

Creatin( #6C $estination for 6 P.

R"n pro)ramI #06 PWWE. The RFC destinations 0"P6 P and 0"P6 P" will be created a"tomatically. aA bA 5A #A$FT$ @ or local systemA #A$FT$A @ or r"nnin) in Application serverA@This is "sed or ile trans er in back)ro"nd.

Code sample for developin( 6 P pro(rams can !e (ot from report pro(ram aA bA R#FT$BB3 R#FT$BB-

cA 3A

R#FT$BB.

0ample code for (ettin( customer details as ta! delimited . : file in !acJ(round.

*&---------------------------------------------------------------------* *& Report Z#"STOMER *& *&---------------------------------------------------------------------* *&-#;8toAer -A<< 3eD-2@>3:e5 2;8toAer re2or58 2re>te5 5;r93: t@e per9o5. *&---------------------------------------------------------------------* *Le5:er!e?-------------#@>rB%/C *A22o;3tN>Ae-----------#@>rBL/C *A22o;3tRe6ere32e -----#@>rB%/C *A55re88. -------------#@>rBL/C *A55re882 -------------#@>rBL/C *ToD3 -----------------#@>rB%/C *#o;3t? - St>te -------#@>rB%/C *Po8t #o5e - ZIP ------#@>rB2/C *#o;3tr?---------------#@>rB2C *A22o;3t#;rre32?#o5e --#@>rB0C *#o3t>2tTe<ep@o3e -----#@>rB2/C REPORT M2;8toAer. TABLES: H3>. H3=.. TYPES: BE'IN OF 8t_2;8toAer <e5:erHe? TYPE 2@>r%/ 3>Ae. TYPE H3>.-3>Ae. H;33r TYPE H3>.-H;33r 3>Ae2 TYPE H3>.-3>Ae2 8tr>8 TYPE H3>.-8tr>8 ort/. TYPE H3>.-ort/. re:9o TYPE H3>.-re:9o p8t<M TYPE H3>.-p8t<M <>35. TYPE H3>.-<>35. D>er8 TYPE H344-D>er8 te<6. TYPE H3>.-te<6. END OF 8t_2;8toAer. TYPES : BE'IN OF 8t_2;8 <e5:erHe?B%/C TYPE 2 ELe5:er!e? DrH_5e<9A. TYPE 7 3>Ae.BL/C TYPE 2 EA22o;3tN>Ae DrH_5e<9A2 TYPE 7 H;33rB%/C TYPE 2 EA22o;3tRe6ere32e DrH_5e<9A0 TYPE 7 3>Ae2BL/C TYPE 2 EA55re88. DrH_5e<9A1 TYPE 7 8tr>8BL/C TYPE 2 E A55re882 DrH_5e<9A% TYPE 7 ort/.B%/C TYPE 2 E ToD3 DrH_5e<9AJ TYPE 7 re:9oB%/C TYPE 2 E #o;3t? - St>te DrH_5e<9AK TYPE 7 p8t<MB./C TYPE 2 EPo8t #o5e - ZIP DrH_5e<9AL TYPE 7 <>35.B2C TYPE 2 E#o;3tr? DrH_5e<9AN TYPE 7 D>er8B0C TYPE 2 EA22o;3t#;rre32?#o5e

DrH_5e<9A./ TYPE 7 te<6.B2/C TYPE 2 E#o3t>2tTe<ep@o3e END OF 8t_2;8 . DATA: DrH_69<e TYPE 2@>r2//. DATA: 9t_2;8toAer TYPE STANDARD TABLE OF 8t_2;8toAer D>_2;8toAer LI!E LINE OF 9t_2;8toAer. DATA: 9t_5>t TYPE STANDARD TABLE OF 8t_2;8 D>_5>t LI!E LINE OF 9t_5>t. SELE#TION-S#REEN BE'IN OF BLO#! =2 WIT$ FRAME TITLE te7t-//.. SELE#T-OPTIONS:2;8t_3o FOR H3>.-H;33r E2;8toAer 3o 2oA_2o5e FOR H3=.-=;Hr8 E2oAp>3? 2o5e 2o;3tr? FOR H3>.-<>35. E2o;3tr? 2re>t_o3 FOR H3>.-er5>t 5e6>;<t 8?-5>t;A. E2re>te5 or 2@>3:e5 o3 SELE#TION-S#REEN END OF BLO#! =2. START-OF-SELE#TION. IF 2re>t_o3-@9:@ IS INITIAL. 2re>t_o3-@9:@ + 2re>t_o3-<oD. ENDIF. #ON#ATENATE 8?-A>35t ,_._, 2re>t_o3-<oD ,_, 2re>t_o3-@9:@ ,_#;8t.t7t, INTO DrH_69<e. PERFORM 2;8toAer_5>t>_8e<e2t. E#;8toAer D>t> F9<e PERFORM =;9<5_teAp<>te_5>t>. PERFORM 6tp_69<e_2;8toAer. *&---------------------------------------------------------------------* *& ForA #"STOMER_DATA_SELE#T *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* * --* p. te7t * )-- p2 te7t *----------------------------------------------------------------------* FORM 2;8toAer_5>t>_8e<e2t . SELE#T >Y3>Ae. >Y3>Ae2 >YH;33r >Y8tr>8 >Yort/. >Yre:9o >Yp8t<M >Y<>35. >Yte<6. EDet>9<8 o6 t@e #;8toAer =>8e5 o3 !NA.. FROM H3>. AS > INNER (OIN H3=. AS = ON >YH;33r + =YH;33r INTO #ORRESPONDIN' FIELDS OF TABLE 9t_2;8toAer W$ERE >YH;33r IN 2;8t_3o AND B B >Yer5>t IN 2re>t_o3 OR >Y;p5>t IN 2re>t_o3 C OR B =Yer5>t IN 2re>t_o3 OR =Y;p5>t IN 2re>t_o3 C C AND >Y<>35. IN 2o;3tr? AND =Y=;Hr8 IN 2oA_2o5e. IF 8?-8;=r2 + /. LOOP AT 9t_2;8toAer INTO D>_2;8toAer. SELE#T SIN'LE D>er8 FROM H344 INTO D>_2;8toAer-D>er8 W$ERE H;33r + D>_2;8toAer-H;33r.. D>_2;8toAer-<e5:erHe? + ,.201%,. MODIFY 9t_2;8toAer FROM D>_2;8toAer. ENDLOOP. ENDIF. ENDFORM. E #"STOMER_DATA_SELE#T *&---------------------------------------------------------------------* *& ForA B"ILD_TEMPLATE_DATA *&---------------------------------------------------------------------* * te7t

*----------------------------------------------------------------------* * --* p. te7t * )-- p2 te7t *----------------------------------------------------------------------* FORM =;9<5_teAp<>te_5>t> . LOOP AT 9t_2;8toAer INTO D>_2;8toAer. MOVE-#ORRESPONDIN' D>_2;8toAer TO D>_5>t. D>_5>t-DrH_5e<9A. + ,/N,. E6or >5593: t>= >6ter e>2@ 69e<5 D>_5>t-DrH_5e<9A2 + ,/N,. D>_5>t-DrH_5e<9A0 + ,/N,. D>_5>t-DrH_5e<9A1 + ,/N,. D>_5>t-DrH_5e<9A% + ,/N,. D>_5>t-DrH_5e<9AJ + ,/N,. D>_5>t-DrH_5e<9AK + ,/N,. D>_5>t-DrH_5e<9AL + ,/N,. D>_5>t-DrH_5e<9AN + ,/N,. D>_5>t-DrH_5e<9A./ + ,/N,. APPEND D>_5>t TO 9t_5>t. ENDLOOP. ENDFORM. E B"ILD_TEMPLATE_DATA *&---------------------------------------------------------------------* *& ForA FTP_FILE_#"STOMER *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* * --* p. te7t * )-- p2 te7t *----------------------------------------------------------------------* FORM 6tp_69<e_2;8toAer . DATA: <_;8erB0/C TYPE 2 VAL"E ,ZTEST, E;8er 3>Ae o6 6tp 8er4er <_pD5B0/C TYPE 2 VAL"E ,.201, Ep>88Dor5 o6 6tp 8er4er <_@o8tBJ1C TYPE 2 VAL"E ,....2....NL, E9p >55re88 o6 FTP 8er4er <_5e8t LI!E r625e8-r625e8t VAL"E ,SAPFTPA,.EB>2H:ro;35 RF# 5e8t93>t9o3 DATA: D_@5< TYPE 9 2_He? TYPE 9 VAL"E 2J./.N%K <_8<e3 TYPE 9. *$TTP_S#RAMBLE: ;8e5 to 82r>A=<e t@e p>88Dor5 pro495e5 93 > 6orA>t re2o:39Me5 =? SAP. SET E&TENDED #$E#! OFF. <_8<e3 + STRLENB <_pD5 C. #ALL F"N#TION ,$TTP_S#RAMBLE, E&PORTIN' SO"R#E + <_pD5 8o;r2e<e3 + <_8<e3 He? + 2_He? IMPORTIN' 5e8t93>t9o3 + <_pD5. * To #o33e2t to t@e Ser4er ;893: FTP #ALL F"N#TION ,FTP_#ONNE#T, E&PORTIN' ;8er + <_;8er p>88Dor5 + <_pD5 @o8t + <_@o8t r62_5e8t93>t9o3 + <_5e8t IMPORTIN' @>35<e + D_@5<

E&#EPTIONS OT$ERS + .. . *FTP_R0_TO_SERVER:;8e5 to tr>386er t@e 93ter3>< t>=<e 5>t> >8 > 69<e to ot@er 8?8teA 93 t@e 2@>r>2ter Ao5e. #ALL F"N#TION ,FTP_R0_TO_SERVER, E&PORTIN' @>35<e + D_@5< 63>Ae + DrH_69<e E69<e p>t@ o6 5e8t93>t9o3 8?8teA 2@>r>2ter_Ao5e + ,&, TABLES te7t + 9t_5>t E&#EPTIONS t2p9p_error + . 2oAA>35_error + 2 5>t>_error + 0 OT$ERS + 1. IF 8?-8;=r2 )* /. MESSA'E ID 8?-A8:95 TYPE 8?-A8:t? N"MBER 8?-A8:3o WIT$ 8?-A8:4. 8?-A8:42 8?-A8:40 8?-A8:41 RAISIN' 934><95_o;tp;t_69<e. ENDIF. *FTP_DIS#ONNE#T: T@98 98 ;8e5 to 5982o33e2t t@e 2o33e2t9o3 =etDee3 SAP >35 ot@er 8?8teA. * To 5982o33e2t t@e FTP #ALL F"N#TION ,FTP_DIS#ONNE#T, E&PORTIN' @>35<e + D_@5<. *RF#_#ONNE#TION_#LOSE:T@98 98 ;8e5 to 5982o33e2t t@e RF# 2o33e2t9o3 =etDee3 SAP >35 ot@er 8?8teA. #ALL F"N#TION ,RF#_#ONNE#TION_#LOSE, E&PORTIN' 5e8t93>t9o3 + <_5e8t E&#EPTIONS OT$ERS + .. ENDFORM. E FTP_FILE_#"STOMER 8n r"nnin) this report in back)ro"nd a ile will be created in tp server location.

Con)erting an <$& file #ith many hierarchy le)els to ABAP format


9y #"bhashini Foll"ri, 79; 7ndia

This e1ample shows how we can convert an O;* ile with many hierarchy levels to A9A$ ormat. Copy and paste the ollowin) code in notepad and save it as test.1ml ile. #ave the O;* ile which in desktop or some other path )S7A< 4er89o3+E../E e32o593:+E"TF-LE S* )ZE"_MATMAS/0* )IDO# BE'IN+E.E* )EDI_D#1/ SE'MENT+E.E* )DO#N"M*///////////0L1N.)-DO#N"M* )MESTYP*ZE"_MATMAS)-MESTYP*

)-EDI_D#1/* )E.MARAM SE'MENT+E.E* )MS'FN*//1)-MS'FN* )MATNR*/////////////.///0)-MATNR* )E.MA!TM SE'MENT+E.E* )MS'FN*//%)-MS'FN* )SPRAS*E)-SPRAS* )MA!T&*proAo p>2H 3orA><)-MA!T&* )SPRAS_ISO*EN)-SPRAS_ISO* )-E.MA!TM* )-E.MARAM* )-IDO#* )-ZE"_MATMAS/0* Here we can see that the root node is ZE:!;AT;A#B5 which is the main str"ct"re containin) all other str"ct"res. 7t contains 7D8C str"ct"re which in t"rn contains E2;ARA; and ED7!DC=B str"ct"res within. ED7!DC=B contains D8C,:; and ;E#T&$ ields. E2;ARA; contains E2;AFT; str"ct"re and ;#4F, and ;AT,R ields. 7n #A$ we have to create correspondin) str"ct"res to store this data rom O;* to A9A$.The main str"ct"re contains many deep str"ct"res. #o in A9A$ dictionary we irst create the str"ct"re Z7D8C!TE#T which contains #tr"ct"res ZED7DC=B and Z2E;ARA;!TE#T2.

Z7D8C!TE#T str"ct"re contains ZE2;ARA;!TE#T2 and ZED7DC=B str"ct"res within. ZED7DC=B contains D8C,:; and ;E#T&$ ields. ZE2;ARA;!TE#T2 contains E2;AFT; str"ct"re and ;#4F, and ;AT,R ields. The str"ct"res Z2E;ARA;!TE#T2 and ZED7DC=B are also created as shown in the below slides. This is the str"ct"re o ZED7DC=B D Control record with ields D8C,:; and ;E#T&$..

The str"ct"re ZE2;ARA;!TE#T2 contains the ollowin) ields ;#4F, and ;AT,R.Also a deep str"ct"re E2;AFT;.

E2;AFT; #tr"ct"re is a standard dictionary str"ct"re we are "sin) directly with the ;#4F,,#$RA#,;AFTO and #$RA#!7#8.

ields

The ollowin) A9A$ pro)ram converts the )iven inp"t O;* ile to A9A$ ormat. T&$ED$88*# abap.

AIn!ut "ile contents as string BM7 "ile !at' 8'ere 8e saved t'e "ile A(ere it is saved in des9to! AIn!ut "ile C8,#TA,T# )s! ile T&$E strin) 8it' !at' as constant EA*:E NCI^Doc"ments and #ettin)s^Administrator^Desktop^test2.1mlN. or the data rom the O;* ile str"ct"re we created rom in #E22 ile

LThis is the str"ct"re type T&$E#I 9E47, 8F ts!0e"!matmasB5, idoc T&$E Z7D8C!TE#T, CZ7D8C!TE#T E,D 8F ts!0e"!matmasB5.

L Table or storin) the O;* content DATAI )t!itab T&$E #TA,DARD TA9*E 8F char3B=..

L Table and work areas or the data rom the O;* ile DATAI )t!0e"!matmasB5 T&$E #TA,DARD TA9*E 8F ts!0e"!matmasB5, )s!0e"!matmasB5 T&$E ts!0e"!matmasB5. L Res"lt table that contains re erences L o the internal tables to be illed DATAI )t!res"lt!1ml T&$E abap!trans!resbind!tab, )s!res"lt!1ml T&$E abap!trans!resbind. L For error handlin) DATAI )s!ri !e1 T&$E REF T8 c1!root, )s!var!te1t T&$E strin). L 4et the O;* ile rom yo"r client CA** ;ETH8D cl!)"i! rontend!servicesWT)"i!"pload EO$8RT7,4 ilename W )s! ile CHA,47,4 data!tab W )t!itab EOCE$T78,# ile!open!error W2 ile!read!error W3 no!batch W5 )"i!re "se! iletrans er W = invalid!type W? no!a"thority W+ "nknown!error Wbad!data! ormat W. header!not!allowed W/ separator!not!allowed W 2B header!too!lon) W 22 "nknown!dp!error W 23 access!denied W 25 dp!o"t!o !memory W 2= disk! "ll W 2? dp!timeo"t W 2+ not!s"pported!by!)"i W 2error!no!)"i W 2. 8THER# W 2/. 7F syDs"brc UT B. ;E##A4E 7D syDms)id T&$E syDms)ty ,:;9ER syDms)no H7TH syDms)v2 syDms)v3 syDms)v5 syDms)v=.

E,D7F. L Fill the res"lt table with a re erence to the data table. L Hithin the O#*T style L P7D8C!4ETP. sheet, the data table can be accessed with

4ET REFERE,CE 8F )t!0e"!matmasB5 7,T8 )s!res"lt!1mlDval"e. )s!res"lt!1mlDname W N7D8C!4ETN. A$$E,D )s!res"lt!1ml T8 )t!res"lt!1ml. L $er orm the O#*T stylesheet TR&. CA** TRA,#F8R;AT78, 0!1ml!idoc #8:RCE O;* )t!itab RE#:*T @)t!res"lt!1mlA. 7n this part o the code &':M='.$1C sho"ld be created in O#*T Editor and write code or that as ollowsID He can )o there by do"ble clickin) on Z!O;*!7D8C.Create it and a ter copyin) this code activate it. O#*T is a lan)"a)e is "sed to convert O;* rom one ormat to another ormat. Copy paste the ollowin) code in O#*T editor ID #ome r"les which were applied or conversion to O#*T areID 7D8C!4ET is "sed to )et the data rom 7D8C.7n the O;* ile the main node is 7D8C which has E2;ARA; and ED7DC!=B which in t"rn contains ;#4F,,;AT,R and E2;AFT; and ED7DC!=B contains ;#4F, and D8C,:; respectively. The same type o str"ct"re which is "sed in o"r pro)ram needs to be illed.7n o"r pro)ram ED7DC!=B is "sed as ZED7DC=B and E2;ARA; is "sed as ZE2;ARA;!TE#T2. The basic template is already illed when we enter the O#*T editor. He "se 7D8C!4ET to "se the 7D8C data.He sho"ld "se the ta)s to be illed in the hierarchy str"ct"re as we declared it in the pro)ram.To "se the val"es we need to "se the str"ct"res in the O;* ile.:se the correspondin) path to access the val"es. A ter trans ormation the )t!0e"!matmasB5 is illed which can be "sed or displayin). )78<:tr>386orA 7A<38:78<+E@ttp:--DDD.D0.or:-.NNN-&SL-Tr>386orAE 4er89o3+E../E* )78<:o;tp;t e32o593:+E98o-LL%N-.E 935e3t+E?e8E Aet@o5+E7A<E 4er89o3+E../E-* )78<:8tr9p-8p>2e e<eAe3t8+E*E-* )78<:teAp<>te A>t2@+E-E* )>87:>=>p 7A<38:>87+E@ttp:--DDD.8>p.2oA->=>p7A<E 4er89o3+E../E* )>87:4><;e8* )IDO#_'ET* )78<:>pp<?-teAp<>te8 8e<e2t+E--IDO#E-*

)-IDO#_'ET* )->87:4><;e8* )->87:>=>p* )-78<:teAp<>te* )78<:teAp<>te A>t2@+EIDO#E* )9teA* )IDO#* )ZEDID#1/* )MESTYP*)78<:4><;e-o6 8e<e2t+EEDI_D#1/-MESTYPE-*)-MESTYP* )DO#N"M*)78<:4><;e-o6 8e<e2t+EEDI_D#1/-DO#N"ME-*)-DO#N"M* )-ZEDID#1/* )ZE.MARAM_TEST.* )MS'FN*)78<:4><;e-o6 8e<e2t+EE.MARAM-MS'FNE-*)-MS'FN* )MATNR*)78<:4><;e-o6 8e<e2t+EE.MARAM-MATNRE-*)-MATNR* )E.MA!TM* )MS'FN*)78<:4><;e-o6 8e<e2t+EE.MARAM-E.MA!TM-MS'FNE-*)-MS'FN* )SPRAS*)78<:4><;e-o6 8e<e2t+EE.MARAM-E.MA!TM-SPRASE-*)-SPRAS* )MA!T&*)78<:4><;e-o6 8e<e2t+EE.MARAM-E.MA!TM-MA!T&E-*)-MA!T&* )SPRAS_ISO*)78<:4><;e-o6 8e<e2t+EE.MARAM-E.MA!TM-SPRAS_ISOE-*)-SPRAS_ISO* )-E.MA!TM* )-ZE.MARAM_TEST.* )-IDO#* )-9teA* )-78<:teAp<>te* )-78<:tr>386orA*

ACome bac9 to $+$% editor and co!5 t'is code "or error 'andling

CATCH c1!root 7,T8 )s!ri !e1. )s!var!te1t W )s!ri !e1DT)et!te1t@ A. ;E##A4E )s!var!te1t T&$E NEN. E,DTR&. ADis!la5 t'e "ile contents 7F syDs"brc W B. *88$ at )t!0e"!matmasB5 7,T8 )s!0e"!matmasB5. HR7TEI )s!0e"!matmasB5DidocD0edidc=BDdocn"m, V )s!0e"!matmasB5DidocD0edidc=BDmestyp, V )s!0e"!matmasB5DidocD0e2maram!test2Dms) n,'messa)e V )s!0e"!matmasB5DidocD0e2maram!test2Dmatnr,'material no Aall on Cdoc"ment Cmessa)e screen no type "nction

"ields o" E3M$CTM V )s!0e"!matmasB5DidocD0e2maram!test2De2maktmDms) n, V )s!0e"!matmasB5DidocD0e2maram!test2De2maktmDspras, V )s!0e"!matmasB5DidocD0e2maram!test2De2maktmDmakt1, V )s!0e"!matmasB5DidocD0e2maram!test2De2maktmDspras!iso. E,D*88$. E,D7F. He can see the val"es illed in the heirarchy str"ct"re o 7D8C as ollowsID

segment

E1ec"te the A9A$ pro)ram and we )et the ile contents displayed as below.#o we have converted the )iven O;* File to a str"ct"re and display the contents.

Final o"tp"t o the pro)ram isID

Dialog Programming
Table Control using !i;ard in $odule Pool Programming
9y Eenkatraman ,, 79;

PreHreIuisites: The readers m"st be able to create a mod"le pool pro)ram and they sho"ld be amiliar with screen pro)rammin). Purpose of this tutorial: This is to demonstrate the step by step t"torial o how to make "se o table control with wi0ard, where the developer<s e ort to write code with table control witho"t wi0ard is avoided. .ntroduction: Table control with wi0ard is the control provided by #A$, in which the "sers are not needed to code separately or table control operations. 7t )enerates a"tomatically system )enerated code or the ollowin) table control operations. 2. 3. 5. =. ?. +. -. .. /. 2B. 22. 7nsertion Deletion #crollin) First *ast ,e1t $revio"s #elect #elect all Deselect Deselect all

#tep 2I Create an internal table and work area, which we are )oin) to deploy in table control.

#tep 3I Create a screen called %/BBB<.

7np"t the screen n"mber as /BBB.

Fill "p the screen attrib"te val"es.

#tep 5I 4o to the layo"t o the screen, where yo" can ind the table control with wi0ard. Dra) and drop the table control with wi0ard to the layo"t o the screen.

8nce yo" dra) and drop the control a pop"p will appear.

$ress Contin"e. 7n the ne1t screen enter the table control name as %T9C!/BBB< or yo"r own name.

7n the ne1t screen yo" inp"t the internal table and work area which has been created earlier. ,oteI 9e ore it is done, yo" m"st activate the pa)e, in which yo" have declared the internal table and work area. Then only this table control screen will take its properties.

The ne1t screen will a"tomatically retrieve the ields available in the internal table and show. He have to select those ields, which and all sho"ld be displayed in table control. 7 yo" have declared any character ield or table control line selection, that sho"ld not be selected in this screen.

#elect the inp"tVo"tp"t attrib"tes as %7np"t control< and )ive the ield or selection o table control rows. #elect the m"ltiple line selection.

Click on Contin"e. The table control with a"to )enerated code will a"tomatically be created.

This will a"tomatically create $98 G $A7 mod"les or table control operations.

#tep =I For testin) this t"torial, write a simple >"ery to pop"late the internal table o table control and test the inp"t controls associated with it.

The e1pected o"tp"t will be like

0ummary : As a res"lt o this t"torial, the "ser will be able to 2. :se table control with wi0ard in mod"le pool pro)rammin) and 3. Create table control operations with system )enerated code.

8= Splitter Controls and %raphs


?; *y 0warna 0- ata Consultancy 0ervices

1,

J. *&----------------------------------------------------------------K. *& Report Z_SPLIT_'RAP$ L. *& A;t@or: SD>r3>.S.BT>t> #o38;<t>32? Ser492e8C N. * P;=<98@e5 >t SAPTe2@392><.#OM ./. *&----------------------------------------------------------------... *& AS : S>Ap<e 2o5e 6or 2re>t93: > 8p<9tter 82ree3 >35 :r>p@. .2. *& T@e 82ree3 98 59495e5 93to tDo =? 8p<9tter 2o3tro< >35 2>3 =e re89Me5 .0. *& TDo :r>p@8 >re 5r>D3 o3 t@e tDo 8p<9tter 2o3t>93er8. .1. *& T@e 8>Ap<e 2o5e ><8o 5e82r9=e8 2re>t93: :r>p@8 93 ABAP. .%. *&----------------------------------------------------------------.J. REPORT M_8p<9t_:r>p@ . .K. *t?pe poo< 5e2<>r>t9o38 6or :r>p@92>< 6r>Ae DorH .L. TYPE-POOLS: 'FW. .N. *O! 2o5e 5e2<>r>t9o3 2/. DATA: O!_#ODE TYPE SY-"#OMM. 2.. *8tr;2t;re 5e2<>r>t9o3 6or :r>p@ . 4><;e8 22. t?pe8 : =e:93 o6 t?_:r4><D>.. 20. 932<;5e 8tr;2t;re :pr4><. 21. t?pe8 : e35 o6 t?_:r4><D>.. 2%. *8tr;2t;re 5e2<>r>t9o3 6or :r>p@ . 2o<;A3 3>Ae8 2J. t?pe8 : =e:93 o6 t?_2o<._te7t8. 2K. 932<;5e 8tr;2t;re :prt7t. 2L. t?pe8 : e35 o6 t?_2o<._te7t8. 2N. *5>t> 5e2<>r>t9o38 6or :r>p@ . 0/. 5>t> : :r4><. TYPE 8t>35>r5 TABLE OF t?_:r4><D>.

0.. 02. 00. 01. 0%. 0J. 0K. 0L. 0N. 1/. 1.. 12. 10. 11. 1%. 1J. 1K. 1L. 1N. %/. %.. %2. %0. %1. %%. %J. %K. %L. %N. J/. J.. J2. J0. J1. J%. JJ. JK. JL. JN. K/. K.. K2. K0. K1. K%. KJ. KK. KL. KN. L/. L.. L2. L0. L1. L%. LJ. LK.

:r4><D>. t?pe t?_:r4><D>. #OL._TE&TS TYPE 8t>35>r5 TABLE OF t?_2o<._te7t8 2o<._D> t?pe t?_2o<._te7t8. *8tr;2t;re 5e2<>r>t9o3 6or :r>p@ 2 4><;e8 t?pe8 : =e:93 o6 t?_:r4><D>2. 932<;5e 8tr;2t;re :pr4><. t?pe8 : e35 o6 t?_:r4><D>2. *8tr;2t;re 5e2<>r>t9o3 6or :r>p@ 2 2o<;A3 3>Ae8 t?pe8 : =e:93 o6 t?_2o<2_te7t8. 932<;5e 8tr;2t;re :prt7t. t?pe8 : e35 o6 t?_2o<2_te7t8. *5>t> 5e2<>r>t9o38 6or :r>p@2 5>t> : :r4><2 TYPE 8t>35>r5 TABLE OF t?_:r4><D>2 :r4><D>2 t?pe t?_:r4><D>2 #OL2_TE&TS TYPE 8t>35>r5 TABLE OF t?_2o<2_te7t8 2o<2_D> t?pe t?_2o<2_te7t8. *5>t> 5e2<>r>t9o38 6or 2o3t>93er8 8p<9tter8 >35 2;8toA 2o3t>93er 5>t> :#"STOM_#ONTAINER TYPE REF TO #L_'"I_#"STOM_#ONTAINER SPLITTER TYPE REF TO #L_'"I_SPLITTER_#ONTAINER #ONT. t?pe re6 to 2<_:;9_2o3t>93er #ONT2 t?pe re6 to 2<_:;9_2o3t>93er. *I39t9><98>t9o3 e4e3t INITIALIZATION. *8t>rt o6 8e<e2t9o3 e4e3t START-OF-SELE#TION. *#><< 82ree3 6or t@e 2o3t>93er 6or o;tp;t #ALL S#REEN J//. *PBO Ao5;<e 6or t@e o;tp;t 598p<>? *&----------------------------------------------------------------* *& Mo5;<e PBO_/J// O"TP"T *&----------------------------------------------------------------* MOD"LE PBO_/J// O"TP"T. *Sett93: t@e '"I 8t>t;8 6or t@e 8p<9tter 82ree3BE&IT =;tto3C SET PF-STAT"S ,SPLIT'RAP$,. *Sett93: t@e t9t<e 6or t@e 8p<9tter 2o3tro< SET t9t<e=>r ,SPLIT'RAP$,. *#re>t93: 2;8toA 2o3t>93er #REATE OB(E#T #"STOM_#ONTAINER E&PORTIN' #ONTAINER_NAME + ,#ONTAINER,. *2re>t93: t@e 8p<9tter 2o3tro< #REATE OB(E#T 8p<9tter E&PORTIN' PARENT + #"STOM_#ONTAINER ROWS + . #OL"MNS + 2 ALI'N + .%. *2><<93: t@e 2o3t>93er Aet@o5 o6 t@e 8p<9tter 2<>88 *6or t@e 69r8t :r>p@92 #ALL MET$OD SPLITTER-*'ET_#ONTAINER E&PORTIN' ROW + . #OL"MN + . RE#EIVIN' #ONTAINER + #ONT.. *2><<93: t@e 2o3t>93er Aet@o5 o6 t@e 8p<9tter 2<>88 *6or t@e 8e2o35 :r>p@92

LL. #ALL MET$OD SPLITTER-*'ET_#ONTAINER LN. E&PORTIN' N/. ROW + . N.. #OL"MN + 2 N2. RE#EIVIN' N0. #ONTAINER + #ONT2. N1. *'r>p@92 . 598p<>? N%. REFRES$ : :r4><. #o<._te7t8. NJ. :r4><D>.-roDt7t + ,R92e,. NK. :r4><D>.-4><. + ..//. NL. :r4><D>.-VAL2 + 1%//. NN. APPEND :r4><D>. to :r4><.. .//. :r4><D>.-ROWT&T + ,#o66ee,. ./.. :r4><D>.-VAL. + 2///. ./2. :r4><D>.-VAL2 + J///. ./0. APPEND :r4><D>. to :r4><.. ./1. :r4><D>.-ROWT&T + ,Te>,. ./%. :r4><D>.-VAL. + 0%//. ./J. :r4><D>.-VAL2 + K///. ./K. APPEND :r4><D>. to :r4><.. ./L. :r4><D>.-ROWT&T + ,#ere><8,. ./N. :r4><D>.-VAL. + J///. ../. :r4><D>.-4><2 + K///. .... APPEND :r4><D>. to :r4><.. ..2. 2o<._D>-2o<t7t + ,2//%,. ..0. APPEND 2o<._D> to #OL._TE&TS. ..1. #OL._D>-#OLT&T + ,2//J,. ..%. APPEND 2o<._D> to #OL._TE&TS. ..J. *F;32t9o3 Ao5;<e to 598p<>? :r>p@ B'r>p@ .C ..K. #ALL F"N#TION ,'FW_PRES_S$OW_M"LT, ..L. E&PORTIN' ..N. PARENT + #ONT. .2/. PRESENTATION_TYPE + 'FW_PRESTYPE_LINES .2.. S$OW + 'FW_FALSE .22. TABLES .20. VAL"ES + :r4><. .21. #OL"MN_TE&TS + #OL._TE&TS .2%. E&#EPTIONS .2J. ERROR_O##"RRED + .. .2K. *'r>p@92 2 598p<>? .2L. REFRES$ : :r4><2 2o<2_te7t8. .2N. :r4><D>2-ROWT&T + ,W@e>t,. .0/. :r4><D>2-VAL. + 0///. .0.. :r4><D>2-VAL2 + %%//. .02. APPEND :r4><D>2 to :r4><2. .00. :r4><D>2-ROWT&T + ,#or3,. .01. :r4><D>2-VAL. + 2K//. .0%. :r4><D>2-VAL2 + L///. .0J. APPEND :r4><D>2 to :r4><2. .0K. :r4><D>2-ROWT&T + ,M>9Me,. .0L. :r4><D>2-VAL. + 02%/. .0N. :r4><D>2-VAL2 + %///. .1/. APPEND :r4><D>2 to :r4><2. .1.. :r4><D>2-ROWT&T + ,B>r<e?,. .12. :r4><D>2-VAL. + J%//. .10. :r4><D>2-VAL2 + N///. .11. APPEND :r4><D>2 to :r4><2.

.1%. .1J. .1K. .1L. .1N. .%/. .%.. .%2. .%0. .%1. .%%. .%J. .%K. .%L. .%N. .J/. .J.. .J2. .J0. .J1. .J%. .JJ. .JK. .JL. .JN. .K/. .K.. 142,

#OL2_D>-#OLT&T + ,2//%,. APPEND 2o<2_D> to #OL2_TE&TS. #OL2_D>-#OLT&T + ,2//J,. APPEND 2o<2_D> to #OL2_TE&TS. *F;32t9o3 Ao5;<e to 598p<>? 'r>p@ 2 #ALL F"N#TION ,'FW_PRES_S$OW_M"LT, E&PORTIN' PARENT + #ONT2 PRESENTATION_TYPE + 'FW_PRESTYPE_LINES S$OW + 'FW_TR"E TABLES VAL"ES + :r4><2 #OL"MN_TE&TS + #OL2_TE&TS E&#EPTIONS ERROR_O##"RRED + .. ENDMOD"LE. E PBO_/J// O"TP"T *PAI Ao5;<e : B>8e5 o3 ;8er 93p;t >2t9o3 98 per6orAe5 *E&IT 2><<e5 to <e>4e pro:r>A D@e3 ;8er 2<92H8 9t *&----------------------------------------------------------------* *& Mo5;<e PAI_/J// INP"T *&----------------------------------------------------------------* MOD"LE PAI_/J// INP"T. O!_#ODE + SY-"#OMM. IF O!_#ODE EP ,E&IT,. LEAVE PRO'RAM. ENDIF. ENDMOD"LE. E PAI_/J// INP"T Screen s$ots o( t$e output,

4D6;

146,

Screen s$ot o( t$e splitter containers can )e resi9ed as s$o&n )elo&:

141,

Te t Edit control , 0sage and Demo


*y 0aiJumar *onaJurthi- Ente( .nfotech As an A9A$ developer, we all know that i we drop a ield o type char and len)th 3?? in to the conventional screen painter it will be displayed in a sin)le line. 7t will not be )ood inter ace "nless we provide a m"ltiDline inp"t ield in the screen. This can be achieved by te1t editor control.

The ollowin) is o"r attempt to e1plain how to implement the te1t editor control on classic dynpros. Te1t editor is displayed on screen "sin) c"stom control. #o we need a container or the c"stom control. And te1t editor control is implemented "sin) class C*!4:7!TEOTED7T. 8"r declaration part contains DATAI *7,E!*E,4TH ED7T8R!C8,TA7,ER T&$E REF T8 C*!4:7!C:#T8;!C8,TA7,ER, TEOT!ED7T8R T&$E REF T8 C*!4:7!TEOTED7T, TEOT T&$E #TR7,4. Then call the screen @can be any n"mberA T&$E 7 EA*:E 3?=,

#TARTD8FD#E*ECT78,. CA** #CREE, N2BBN. 4o to screen 2BB by do"ble clickin) on N2BBN. Create a c"stom control on screen with name TEOTED7T.

:ncomment both $98 and $A7 mod"les in low lo)ic screen $R8CE## 9EF8RE 8:T$:T. ;8D:*E #TAT:#!B2BB. L $R8CE## AFTER 7,$:T. ;8D:*E :#ER!C8;;A,D!B2BB. De ine and implement both the mod"les in the main pro)ram itsel . 7n $98 create ob(ect container ED7T8R!C8,TA7,ER. Then create te1t editor ob(ect by e1portin) the container ED7T8R!C8,TA7,ER. CREATE 89XECT ED7T8R!C8,TA7,ER EO$8RT7,4 C8,TA7,ER!,A;E W NTEOTED7T8RN EOCE$T78,# C,T*!ERR8R W2 C,T*!#&#TE;!ERR8R W3 CREATE!ERR8R W5 *7FET7;E!ERR8R W= *7FET7;E!D&,$R8!D&,$R8!*7,F W ?. CREATE 89XECT TEOT!ED7T8R

EO$8RT7,4 $ARE,T W ED7T8R!C8,TA7,ER H8RDHRA$!;8DE W C*!4:7!TEOTED7TWTH8RDHRA$!AT!F7OED!$8#7T78, H8RDHRA$!$8#7T78, W *7,E!*E,4TH H8RDHRA$!T8!*7,E9REAF!;8DE W C*!4:7!TEOTED7TWTTR:E. &o" can hide the toolbar and as well as stat"s bar or the te1t editor control. CA** ;ETH8D TEOT!ED7T8RDT#ET!T88*9AR!;8DE EO$8RT7,4 T88*9AR!;8DE W C*!4:7!TEOTED7TWTFA*#E. CA** ;ETH8D TEOT!ED7T8RDT#ET!#TAT:#9AR!;8DE EO$8RT7,4 #TAT:#9AR!;8DE W C*!4:7!TEOTED7TWTFA*#E. De ine and create a 4:7 #tat"s in the $98. #ET $FD#TAT:# N#TAT:#!B2BBN. Eery minim"m set o tool bar b"ttons de ined in this e1ample

7n $A7 o the screen 2BB, handle the save and other "ser commands. CA#E #&D:C8;;. HHE, NEO7TN. *EAEE $R84RA;. HHE, N#AEEN. CA** ;ETH8D TEOT!ED7T8RDT4ET!TEOT#TREA; L EO$8RT7,4 L 8,*&!HHE,!;8D7F7ED W C*!4:7!TEOTED7TWTTR:E 7;$8RT7,4 TEOT W TEOT L 7#!;8D7F7ED W EOCE$T78,# ERR8R!C,T*!CA**!;ETH8D W 2 ,8T!#:$$8RTED!9&!4:7 W 3 8THER# W 5. 7F #&D#:9RC UT B.

;E##A4E 7D #&D;#47D T&$E #&D;#4T& ,:;9ER #&D;#4,8 H7TH #&D;#4E2 #&D;#4E3 #&D;#4E5 #&D;#4E=. E,D7F. CA** ;ETH8D C*!4:7!CFHWTF*:#H EOCE$T78,# C,T*!#&#TE;!ERR8R W 2 C,T*!ERR8R W3 8THER# W 5. ;E##A4E TEOT T&$E N7N. E,DCA#E. To read the te1t that is typed in the editor we need to call the method 4ET!TEOT#TREA; o the editor instance. He are ("st displayin) the te1t typed in the editor in an in ormative messa)eZ the same can be inserted V "pdated into a database table also. The complete codin) o the e1ec"table pro)ram is )iven below.. RE$8RT ZTEOT!ED7T8R. DATAI *7,E!*E,4TH T&$E 7 EA*:E 3?=, ED7T8R!C8,TA7,ER T&$E REF T8 C*!4:7!C:#T8;!C8,TA7,ER, TEOT!ED7T8R T&$E REF T8 C*!4:7!TEOTED7T, TEOT T&$E #TR7,4. #TARTD8FD#E*ECT78,. CA** #CREE, N2BBN. LLGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL LLG ;od"le #TAT:#!B2BB 8:T$:T LLGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL LL te1t LLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL ;8D:*E #TAT:#!B2BB 8:T$:T. #ET $FD#TAT:# N#TAT:#!B2BBN. 7F TEOT!ED7T8R 7# 7,7T7A*. CREATE 89XECT ED7T8R!C8,TA7,ER EO$8RT7,4 C8,TA7,ER!,A;E W NTEOTED7T8RN EOCE$T78,# C,T*!ERR8R W2 C,T*!#&#TE;!ERR8R W3 CREATE!ERR8R W5 *7FET7;E!ERR8R W= *7FET7;E!D&,$R8!D&,$R8!*7,F W ?. CREATE 89XECT TEOT!ED7T8R EO$8RT7,4 $ARE,T W ED7T8R!C8,TA7,ER

H8RDHRA$!;8DE W C*!4:7!TEOTED7TWTH8RDHRA$!AT!F7OED!$8#7T78, H8RDHRA$!$8#7T78, W *7,E!*E,4TH H8RDHRA$!T8!*7,E9REAF!;8DE W C*!4:7!TEOTED7TWTTR:E. L5AH7DE T88*9AR A,D #TAT:#9AR CA** ;ETH8D TEOT!ED7T8RDT#ET!T88*9AR!;8DE EO$8RT7,4 T88*9AR!;8DE W C*!4:7!TEOTED7TWTFA*#E. CA** ;ETH8D TEOT!ED7T8RDT#ET!#TAT:#9AR!;8DE EO$8RT7,4 #TAT:#9AR!;8DE W C*!4:7!TEOTED7TWTFA*#E. E,D7F. E,D;8D:*E. P #TAT:#!B2BB 8:T$:T LGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL LG ;od"le :#ER!C8;;A,D!B2BB 7,$:T LGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL L te1t LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL ;8D:*E :#ER!C8;;A,D!B2BB 7,$:T. CA#E #&D:C8;;. HHE, NEO7TN. *EAEE $R84RA;. HHE, N#AEEN. CA** ;ETH8D TEOT!ED7T8RDT4ET!TEOT#TREA; L EO$8RT7,4 L 8,*&!HHE,!;8D7F7ED W C*!4:7!TEOTED7TWTTR:E 7;$8RT7,4 TEOT W TEOT L 7#!;8D7F7ED W EOCE$T78,# ERR8R!C,T*!CA**!;ETH8D W 2 ,8T!#:$$8RTED!9&!4:7 W 3 8THER# W 5. 7F #&D#:9RC UT B. ;E##A4E 7D #&D;#47D T&$E #&D;#4T& ,:;9ER #&D;#4,8 H7TH #&D;#4E2 #&D;#4E3 #&D;#4E5 #&D;#4E=. E,D7F. CA** ;ETH8D C*!4:7!CFHWTF*:#H EOCE$T78,# C,T*!#&#TE;!ERR8R W 2 C,T*!ERR8R W3 8THER# W 5. ;E##A4E TEOT T&$E N7N. E,DCA#E. E,D;8D:*E. P :#ER!C8;;A,D!B2BB 7,$:T The inal #creen shot o the editorI

Display images on the screen


9y Aditya ,iyo)i, *GT 7n otech

0tep 4I :pload pict"re into #A$ "sin) the transaction #E-.. Test pict"re.

0tep 5I Create a c"stom screen section in the screen.

0tep 3I 7n the $98 mod"le o the screen, attach the ollowin) code. $lease note that the ob(ect name is %winny<, please pass yo"r own ob(ect name to the methodI *&---------------------------------------------------------------------* *& Mo5;<e STAT"S_N/// O"TP"T *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* MOD"LE STAT"S_N/// O"TP"T. DATA: W_LINES TYPE I. TYPES PI#T_LINEB2%JC TYPE #. DATA : #ONTAINER TYPE REF TO #L_'"I_#"STOM_#ONTAINER EDITOR TYPE REF TO #L_'"I_TE&TEDIT PI#T"RE TYPE REF TO #L_'"I_PI#T"RE PI#T_TAB TYPE TABLE OF PI#T_LINE "RLB2%%C TYPE #. DATA: 'RAP$I#_"RLB2%%C. DATA: BE'IN OF 'RAP$I#_TABLE O##"RS / LINEB2%%C TYPE & END OF 'RAP$I#_TABLE. DATA: L_'RAP$I#_#ONV TYPE I. DATA: L_'RAP$I#_OFFS TYPE I. DATA: 'RAP$I#_SIZE TYPE I. DATA: L_'RAP$I#_&STR TYPE &STRIN'.

. #ALL MET$OD #L_'"I_#FW+*FL"S$. #REATE OB(E#T: #ONTAINER E&PORTIN' #ONTAINER_NAME + ,PI#T"RE_#ONTAINER, PI#T"RE E&PORTIN' PARENT + #ONTAINER. #ALL MET$OD #L_SSF_&SF_"TILITIES+*'ET_BDS_'RAP$I#_AS_BMP E&PORTIN' P_OB(E#T + ,'RAP$I#S, P_NAME + ,WINNY, P_ID + ,BMAP, P_BTYPE + ,B#OL, RE#EIVIN' P_BMP + L_'RAP$I#_&STR * E&#EPTIONS * NOT_FO"ND + . * INTERNAL_ERROR + 2 * ot@er8 + 0 . IF SY-S"BR# )* /. * MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO * WIT$ SY-MS'V. SY-MS'V2 SY-MS'V0 SY-MS'V1. ENDIF. 'RAP$I#_SIZE + &STRLENB L_'RAP$I#_&STR C. L_'RAP$I#_#ONV + 'RAP$I#_SIZE. L_'RAP$I#_OFFS + /. W$ILE L_'RAP$I#_#ONV * 2%%. 'RAP$I#_TABLE-LINE + L_'RAP$I#_&STRTL_'RAP$I#_OFFSB2%%C. APPEND 'RAP$I#_TABLE. L_'RAP$I#_OFFS + L_'RAP$I#_OFFS T 2%%. L_'RAP$I#_#ONV + L_'RAP$I#_#ONV - 2%%. ENDW$ILE. 'RAP$I#_TABLE-LINE + L_'RAP$I#_&STRTL_'RAP$I#_OFFSBL_'RAP$I#_#ONVC. APPEND 'RAP$I#_TABLE. #ALL F"N#TION ,DP_#REATE_"RL, E&PORTIN' TYPE + ,IMA'E, S"BTYPE + ,&-"N!NOWN, SIZE + 'RAP$I#_SIZE LIFETIME + ,T, TABLES DATA + 'RAP$I#_TABLE #$AN'IN' "RL + "RL. #ALL MET$OD PI#T"RE-*LOAD_PI#T"RE_FROM_"RL E&PORTIN' "RL + "RL. #ALL MET$OD PI#T"RE-*SET_DISPLAY_MODE E&PORTIN' DISPLAY_MODE + PI#T"RE-*DISPLAY_MODE_FIT_#ENTER. ENDMOD"LE. E STAT"S_N/// O"TP"T 1utputI

!or"ing #ith Screen Painter


9y Eikram Chellappa, ;o"ri Tech #ol"tions

S.R447 PA57"4R:= Screen painter is a tool in %'%+ dev &or bench used to create the screens using the /(code S91<. #n the screen painter2 you can define the follo&ing interface elements &ith their associated attributes. <. #nput.)utput Fields 2. Field =ames ". Chec bo3es ;. 7adio 'uttons 1. Group 'o3es 6. Sub screens. B. +ushbuttons &ith =o Fi3ed +osition and others S"4P='>=S"4P 248O 0OR S.R447 PA57"4R#

Create a E program in S43?.

Clic on Save. *e &ill &rite the code later in this. Go to transaction S4%1.

9nter the created program name and screen number.

9nter the short description and clic on save#

Clic on flo1logic tab.

@ncomment the statement R *1D.%E STAT.SE3433 R;

-ouble clic the $ statusE3433;S /he belo& screen &ill be displayed2 Clic on yes.

Follo&ing pop(up screen appears. Select the $8demoFscreenFpainterM $main programM and clic on continue.

Clic on yes.

Screen &ould be displayed as follo&s:

=o& come bac to the transaction S91<. Select flo& logic. Clic in layout.

Screen painter &indo& &ill be displayed li e this. Gere &e &ill design the re6uired screen fields.
Click on the middle icon dictionary V pro)ram ields window. 8r F+.

Followin) screen appearsI

Enter the table name in the table ield name. Click on )et rom dictionary.

#elect the re>"ired ields rom ;ARA table rom dictionary. Click on 8F or contin"e.

A ter placin) the re>"ired ields, yo" can view the below screen.

Create the p"sh b"tton rom the toolbo1.

#elect the p"shb"tton, dra) and drop the b"tton onto the screen.

Create the other re>"ired b"ttons in the same proced"re mentioned above and assi)n the name, te1t, and "nction code or each one.

A ter creatin) the screen click on save check and activate. press flow lo(ic !utton. .

Click on tab Element *ist enter 8F!C8DE.

$aste the below Code in created 0 pro)ram created earlierI *&-------------------------------------------------------------------* *& Report ZDEMO_S#REEN_PAINTER *& *&-------------------------------------------------------------------* *& DeAo 6or S2ree3 P>93ter. *& B? V9Hr>A2@e<<>pp>. *&-------------------------------------------------------------------* REPORT ZDEMO_S#REEN_PAINTER.

****************************************************************** * TABLE DE#LARATIONS. ****************************************************************** TABLES: MARA. ****************************************************************** * DATA DE#LARATIONS. ***************************************************************** DATA: MATNR TYPE MARA-MATNR ERSDA TYPE MARA-ERSDA ERNAM TYPE MARA-ERNAM MTART TYPE MARA-MTART MAT!L TYPE MARA-MAT!L DISPLAY TYPE # SAVE TYPE # DELETE TYPE # #LEAR TYPE # E&IT TYPE # O!_#ODE LI!E SY-"#OMM. ***************************************************************** * #ALLIN' S#REEN. ***************************************************************** #ALL S#REEN .//. *&--------------------------------------------------------------* *& Mo5;<e STAT"S_/.// O"TP"T *&--------------------------------------------------------------* * te7t *--------------------------------------------------------------* MOD"LE STAT"S_/.// O"TP"T. * SET PF-STAT"S ,ZMEN",. * SET TITLEBAR ,ZMEN"_PAINTER,. #ASE SY-"#OMM. W$EN ,E&IT,. LEAVE PRO'RAM. W$EN ,BA#!,. LEAVE PRO'RAM. W$EN ,DISPLAY,. SELE#T SIN'LE ERSDA ERNAM MTART MAT!L FROM MARA INTO BMARA-ERSDA MARA-ERNAM MARA-MTART MARA-MAT!LC W$ERE MATNR + MARA-MATNR. W$EN ,#LEAR,. #LEAR MARA. END#ASE. ENDMOD"LE. E STAT"S_/.// O"TP"T 1utput:H Enter ;aterial n"mber 8n ;aterial Field. Click on Display.

;aterial 7n ormation is displayed as shown belowI

Demo on Tabstrips
9y Eikram Chellappa, ;o"ri Tech #ol"tions

.n this document- we would worJ on creatin( a simple screen with a ta!strip on it. 4o to #E5. TDcode. Create a Z pro)ram.

$aste the below code in the so"rce code. REPORT ZTABSTRIP. ************************************************************************ * DATA DE#LARATIONS * ************************************************************************ DATA : N"MBER. TYPE I N"MBER2 TYPE I RES"LT TYPE I N. TYPE I N2 TYPE I O!_#ODE LI!E SY-"#OMM. #ONTROLS TABSTRIP TYPE TABSTRIP. #ALL S#REEN .//. #ALL S#REEN ../. #ALL S#REEN .0/. *&---------------------------------------------------------------------* *& Mo5;<e STAT"S_/.// O"TP"T *&---------------------------------------------------------------------* te7t *----------------------------------------------------------------------* MOD"LE STAT"S_/.// O"TP"T. SET PF-STAT"S ,BA#!,. ENDMOD"LE. E STAT"S_/.// O"TP"T *&---------------------------------------------------------------------* *& Mo5;<e "SER_#OMMAND_/.// INP"T *&---------------------------------------------------------------------* te7t *----------------------------------------------------------------------*

MOD"LE "SER_#OMMAND_/.// INP"T. #ASE O!_#ODE. W$EN ,TAB.,. TABSTRIP-A#TIVETAB + ,TAB.,. W$EN ,TAB2,. TABSTRIP-A#TIVETAB + ,TAB2,. RES"LT + N"MBER. T N"MBER2. W$EN ,BA#!,. LEAVE PRO'RAM. END#ASE. ENDMOD"LE. E "SER_#OMMAND_/.// INP"T *&---------------------------------------------------------------------* *& Mo5;<e "SER_#OMMAND_/.0/ INP"T *&---------------------------------------------------------------------* te7t *----------------------------------------------------------------------* MOD"LE "SER_#OMMAND_/.0/ INP"T. RES"LT + N"MBER. T N"MBER2. ENDMOD"LE. E "SER_#OMMAND_/.0/ INP"T *&---------------------------------------------------------------------* *& Mo5;<e "SER_#OMMAND_/../ INP"T *&---------------------------------------------------------------------* te7t *----------------------------------------------------------------------* MOD"LE "SER_#OMMAND_/../ INP"T. N. + N"MBER.. N2 + N"MBER2. ENDMOD"LE. E "SER_#OMMAND_/../ INP"T *&---------------------------------------------------------------------* *& Mo5;<e STAT"S_/../ O"TP"T *&---------------------------------------------------------------------* te7t *----------------------------------------------------------------------* MOD"LE STAT"S_/../ O"TP"T. SET PF-STAT"S ,77777777,. SET TITLEBAR ,777,. ENDMOD"LE. E STAT"S_/../ O"TP"T *&---------------------------------------------------------------------* *& Mo5;<e STAT"S_/.0/ O"TP"T *&---------------------------------------------------------------------* te7t *----------------------------------------------------------------------* MOD"LE STAT"S_/.0/ O"TP"T. SET PF-STAT"S ,77777777,. SET TITLEBAR ,777,. RES"LT + N"MBER. T N"MBER2. ENDMOD"LE. E STAT"S_/.0/ O"TP"T

Do"ble Click on Pcall screen 2BBP.

Enter #hort descriptions.

Come to Flow lo)ic.

Click on *ayo"t 9"tton.

or $ress Ctrl6F-.

Create A Tab #trip and #"b screens and place #"b screen in the appropriate tab strip.

Enter the name o the created TA9#TR7$ and s"b #CREE,.

Enter the re>"ired ,ame, Te1t, F"nction code.

Enter the 8F!C8DE.

Do"ble click on CA** #CREE, 22B. 4ive the short description. Click on #AEE
....Previous

, CHECF, ACT7EATE

Click on Flow lo)ic and come to layo"t. Create 3 7np"t ields. Enter the name description and Format.

Click on #AEE

, CHECF, ACT7EATE

Do"ble click on CA** #CREE, 25B.

4ive the #H8RT DE#CR7$T78,. Click on *A&8:T

Create a te1t or Res"lt.

Click on #AEE

, CHECF, ACT7EATE

Come 9ack To #o"rce Code. Click on #AEE And EOEC:TE. #esult:H , CHECF, ACT7EATE .

Enter the Eal"e on A W ?B and 9 W ?B.

Eiew the Res"lt on Tab3.

Demo on using Table Control


*y #a(hav VaJada- Mouri ech 0olutions

*&---------------------------------------------------------------------* *& Report Z_DB_TABLE#ONTROL * *& * *&---------------------------------------------------------------------* *& * *& * *&---------------------------------------------------------------------* REPORT Z_DB_TABLE#ONTROL. TABLES: MARA. #ONTROLS MATERIAL TYPE TABLEVIEW "SIN' S#REEN .0/. TYPES: BE'IN OF ST_MARA MATNR TYPE MARA-MATNR ERSDA TYPE MARA-ERSDA ERNAM TYPE MARA-ERNAM LAEDA TYPE MARA-LAEDA END OF ST_MARA. DATA: IT_ST TYPE TABLE OF ST_MARA WA_ST TYPE ST_MARA IT_MARA TYPE MARA WA_MARA TYPE MARA O!_#ODE LI!E SY-"#OMM. #ALL S#REEN .0/. *&---------------------------------------------------------------------* *& Mo5;<e V. INP"T *&---------------------------------------------------------------------*

* te7t *----------------------------------------------------------------------* MOD"LE V. INP"T. #ASE O!_#ODE. W$EN ,SAVE,. WA_ST-MATNR + MARA-MATNR. WA_ST-ERSDA + MARA-ERSDA. WA_ST-ERNAM + MARA-ERNAM. WA_ST-LAEDA + MARA-LAEDA. MOVE-#ORRESPONDIN' WA_ST TO WA_MARA. INSERT INTO MARA VAL"ES WA_MARA. W$EN ,DELETE,. WA_ST-MATNR + MARA-MATNR. WA_ST-ERSDA + MARA-ERSDA. WA_ST-ERNAM + MARA-ERNAM. WA_ST-LAEDA + MARA-LAEDA. MOVE-#ORRESPONDIN' WA_ST TO WA_MARA. DELETE MARA FROM WA_MARA. W$EN ,MODIFY,. WA_ST-MATNR + MARA-MATNR. WA_ST-ERSDA + MARA-ERSDA. WA_ST-ERNAM + MARA-ERNAM. WA_ST-LAEDA + MARA-LAEDA. MOVE-#ORRESPONDIN' WA_ST TO WA_MARA. MODIFY MARA FROM WA_MARA. END#ASE. ENDMOD"LE. E V. INP"T *&---------------------------------------------------------------------* *& Mo5;<e E&IT INP"T *&---------------------------------------------------------------------* * te7t *----------------------------------------------------------------------* MOD"LE E&IT INP"T. IF O!_#ODE + ,E&IT,. LEAVE PRO'RAM. ENDIF. ENDMOD"LE. E E&IT INP"T #re>te > 82ree3 =? 3;A=er .0/ >35 pro495e t@e 6o<<oD93: >ttr9=;te8:

!A>O3":

4!4847" !5S":

0!O@ !O*5.#

4:4.3"4:

Display *ogo on Screen


*y 0uresh Fumar Parvathaneni &o" can display lo)o@sA on yo"r screen "sin) the c"stom control "nction. A c"stom control is an area on the screen, created "sin) the screen painter. C"stom controls are "sed to embed controls. Container controls are instances o special )lobal classes rom the #A$ Control Framework. The )lobal class or c"stom controls is called C*!4:7!C:#T8;!C8,TA7,ER. To link a c"stom control to a container control, pass the c"stom control name to the C8,TA7,ER!,A;E parameter o the container control constr"ctor when yo" instantiate it. The ollowin) is a sample pro)ram to demonstrate the lo)o display "sin) the c"stom control. This pro)ram was written in #A$=.+C. Desi)n a screen with the c"stom control, by name $7CT:RE!C8,TA7,ER. 7t has the ollowin) low lo)icI $R8CE## ;8D:*E L $R8CE## ;8D:*E 9EF8RE AFTER CA,CE* AT 8:T$:T. #TAT:#!B2BB. 7,$:T. EO7TDC8;;A,D.

The 4:7 stat"s #CREE,2BB has the "nctions 9ACF, EO7T, and CA,CE* @all with type EA.

Code
RE$8RT Z#:RE#H!TE#T . L Type declarations..................... T&$E# pict!line@3?+A T&$E c. L data declarations...................... DATA Iinit,

container T&$E REF T8 cl!)"i!c"stom!container, editor T&$E REF T8 cl!)"i!te1tedit,

pict"re T&$E REF T8 cl!)"i!pict"re, pict!tab T&$E TA9*E 8F pict!line, "rl@3??A T&$E c. CA** #CREE, 2BB. L Dialo) mod"les...................................... ;8D:*E stat"s!B2BB 8:T$:T. #ET $FD#TAT:# N#CREE,2BBN. 7F init is initial. init W NON. CREATE 89XECTI container EO$8RT7,4 container!name W N$7CT:RE!C8,TA7,ERN, pict"re E,D7F. 7;$8RT pict!tab W pict!tab FR8; DATA9A#E abtree@piA 7D NE,X8&N. CA** F:,CT78, ND$!CREATE!:R*N EO$8RT7,4 type W N7;A4EN EO$8RT7,4 parent W container.

s"btype W N47FN TA9*E# data W pict!tab

CHA,47,4 "rl W "rl.

CA** ;ETH8D pict"reDTload!pict"re! rom!"rl EO$8RT7,4 "rl W "rl. CA** ;ETH8D pict"reDTset!display!mode

EO$8RT7,4 display!mode W pict"reDTdisplay!mode! it!center. E,D;8D:*E. ;8D:*E cancel 7,$:T. *EAEE T8 #CREE, B. E,D;8D:*E.

BDC Programming
Ho# to do BDC #ithout #riting BDC program
*y ViJram Chellappa- Mouri ech 0olutions

7n this e1ample, 7 have "sed the transaction EE52 @Create 8"tp"t J Condition Records D 9illin)A to do the 9DC. 2. 4o to Transaction #HD9 and click C,ew Recordin)' b"tton.

3.

The ollowin) pop"p screen )ets pop"lated, there yo" enter the Recordin) name and transaction or which yo" wish to do the 9DC @7n this e1ample it is EE52A. Click C#tart recordin)' b"tton.

5.

7n the Transaction, enter the mandatory ield. 7n this case it is 8"tp"t type @A:#2A. Hit enter key.

=.

The ollowin) screen appears or more entry. Enter all the mandatory ields and click on save.

?.

#A$

will

)ive

the

Recorded

pro)ram

as

shown

in

the

ollowin)

screen

shot.

+.

Click the E1port b"tton

and save the ile as word doc"ment ile into the system.

-.

,ow

open

the

newly

created

word

doc"ment

ile.

..

#electVHi)hli)ht the irst ield in the word doc"ment or which or which 9DC needs to done. @7n this case it is o"tp"t type i.e. A:#2A and )o to the men" path 7nsert Field

/.

A new screen will )et pop"lated and there yo" select the C;er)e Field' option rom the list bo1 and enter the Col"mn ,ame @7n this case the 2st col"mn is o"tp"t!typeA.

2B.

,ow yo" can see in the word doc"ment that the hi)hli)hted ield will )et replaced with the col"mn name.

22.

#imilarly yo" hi)hli)ht the other ields or which we need to create the 9DC and )ive the "ni>"e col"mn names or those ields.

23. ,ow yo" can see that all the re>"ired ields have been mapped with "ni>"e col"mn names.

25. ,ow )o the men" path Tools *etters and ;ailin)s ;ail ;er)e Hi0ard.

2=. A mail mer)e wi0ard will )ets opened in the ri)ht hand side.

2?. ,ow open the e1cel ile where which yo" have the data to do the 9DC or transaction EE52. Check that the col"mn name in the word doc"ment is matchin) with the col"mn name in the E1cel ile.

2+. Close the E1cel File. 2-. #witch to world doc"ment and ,ow Click C,e1tI #tart doc"ment' link in the bottom o ;ail ;er)e wi0ard

2.. ,ow click on C,e1tI #elect recipients' link

2/. ,ow click on C9rowse' link

3B. 7t will open the pop"p or selectin) the ile @which is havin) data or 9DCA.

32. $ress C8pen' b"tton

33. A new pop"p will )et tri))ered.

35.

#elect the work sheet o the E1cel ile where the act"al data present. 7n this case it is #heet2a and Click C8F' b"tton. A new pop"p screen wo"ld appear with the data. Click C8F' b"tton.

3=.

3?.

,ow click C,e1tI Hrite yo"r letter' link.

3+.

Click C,e1tI $review yo"r letters' link.

3-.

,ow yo" can see the irst record )ot mer)ed with the word doc"ment.

3..

Click C,e1tI Complete the mer)e' link.

3/.

Click the CEdit individ"al lettersY' link

5B.

A new pop"p will )et tri))ered, there yo" select CAll' radio b"tton and click C8F' b"tton.

52.

,ow yo" can see the mer)e has been done in the word doc"ment and it will create the 9DC pro)ram or all the records in the E1cel sheet. @7n this case we had 2B records in e1cel sheet, hence the mer)e has created 2B pa)es in the word doc"ment. 8ne pa)e or each recordA ,ow #elect the entire content in the word doc"ment @i.e. all the 2B pa)esA and copy it in a notepad and save as separate CTOT' ile.

53.

55. 4o to the #HD9 transaction and select yo"r recordin) and click CChan)e' b"tton.

5=. ,ow "se the C7mport' b"tton

to download the TOT ile which we saved in #tep _ 53.

5?. 8nce yo" click the 7mport b"tton, a pop"p will come rom there yo" select the ile and click CTrans er' b"tton.

5+. 7t will trans er the entire content to the #HD9. ,ow #ave the chan)es. Click C9ack' b"tton. 5-. ,ow click the C#ession' b"tton, in order to create a new session.

5..

The ollowin) pop"p will )et tri))ered, there yo" enter the new session name and check the CFeep session' check bo1 and click CContin"e' b"tton.

5/.

&o" will )et the C#"ccess ;essa)e' that C9atch inp"t session ZT#T!48F was created'.

=B.

,ow )o to the Transaction #;5? @9atch 7np"tI #ession 8verviewA, there yo" select yo"r C#ession' which yo" have created in #tep _ 5. @&o" can the stat"s o yo"r session will be ,ewA and click C$rocess' b"tton.

=2.

A small pop"p will )et tri))ered, there yo" select the C9ack)ro"nd' radio b"tton and check the CE1tended *o)' check bo1. Click C$rocess' b"tton.

=3.

&o" will )et the s"ccess messa)e C2 session@sA trans erred to back)ro"nd processin)'.

=5.

And yo" can also see the stat"s o yo"r session has been chan)ed rom C,ew' to C7n back)ro"nd'.

==.

Click C*o)' b"tton, to see the details abo"t the 9DC.

=?.

&o" will taken to the another screen, there yo" can see stat"s o the 9DC.

=+.

7n o"r case, the stat"s is CErrors', to know the details "rther. #elect the entry and click CAnaly0e session'. 7t will display the stat"s o all the records.

=-.

7n the above screen shot yo" can see the irst two records were ailed and others were processed. The reason or the same isI For the irst time when we "sed #HD9 we created the irst condition record. #ince this record is already there it ailed in the second time. The same thin) applies to the second ail"re case.

Creating a simple database table using BDC


9y 9an"priya R, &A#H Technolo)ies

Report ?pr9?>te8t. TABLES: =525>t>. DATA:t_=525>t> LI!E STANDARD TABLE OF =525>t>. PARAMETERS : p_t>=<eB.%C TYPE 2.

DATA: MS' LI!E BD#MS'#OLL T_MS' LI!E TABLE OF MS' MESSA'EBK2C TYPE #. PERFORM PRO#ESS. *&--------------------------------------------------------------------* *& ForA 69<<_82ree35>t> *&--------------------------------------------------------------------6orA 69<<_82ree35>t> ;893: 4><;eBp_//.%C 4><;eBp_//.JC.

BD#DATA-PRO'RAM + P_//.%. BD#DATA-DYNPRO + P_//.J. BD#DATA-DYNBE'IN + ,&,. APPEND BD#DATA TO T_BD#DATA. #LEAR BD#DATA. e356orA. E 69<<_82ree35>t> *&--------------------------------------------------------------------* *& ForA FILL_FIELD_DATA *&--------------------------------------------------------------------6orA FILL_FIELD_DATA ;893: 4><;eBp_//2/C 4><;eBp_//2.C.

BD#DATA-FNAM + P_//2/. BD#DATA-FVAL + P_//2.. APPEND BD#DATA TO T_BD#DATA. #LEAR BD#DATA. e356orA. E FILL_FIELD_DATA *&--------------------------------------------------------------------* *& ForA PRO#ESS *&--------------------------------------------------------------------6orA PRO#ESS . **69r8t 82ree3 PERFORM 69<<_82ree35>t> "SIN' ,SAPMSRD/, ,/./2,. PERFORM FILL_FIELD_DATA "SIN' ,RSRD.-TBMA, ,&,. PERFORM FILL_FIELD_DATA "SIN' ,RSRD.-TBMA_VAL, p_t>=<e. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+ADD,. **8e2o35 82ree3 PERFORM 69<<_82ree35>t> "SIN' ,SAPLSD1., ,22//,. PERFORM FILL_FIELD_DATA "SIN' ,DD/2D-DDTE&T, ,B52 T>=<e,. PERFORM FILL_FIELD_DATA "SIN' ,DD/2D-#ONTFLA', ,A,. PERFORM FILL_FIELD_DATA "SIN' ,DD/2D-MAINFLA', ,&,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+#$AN'E_MAINTFLA',. PERFORM FILL_FIELD_DATA

"SIN' ,BD#_O!#ODE, ,-//,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+DEF,. **8e2o35 82ree3 69<<93: t>=<e 69e<58 PERFORM 69<<_82ree35>t> "SIN' ,SAPLSD1., ,22//,. PERFORM FILL_FIELD_DATA "SIN' ,DD/0P-FIELDNAMEB/.C, ,A>35t,. PERFORM FILL_FIELD_DATA "SIN' ,DD/0P-FIELDNAMEB/2C, ,3>Ae,. PERFORM FILL_FIELD_DATA "SIN' ,DD/0P-FIELDNAMEB/0C, ,eAp95,. PERFORM FILL_FIELD_DATA "SIN' ,DD/0D-ROLLNAMEB/.C, ,A>35t,. PERFORM FILL_FIELD_DATA "SIN' ,DD/0D-ROLLNAMEB/2C, ,2@>r2/,. PERFORM FILL_FIELD_DATA "SIN' ,DD/0D-ROLLNAMEB/0C, ,3;A21,. PERFORM FILL_FIELD_DATA "SIN' ,DD/0P-!EYFLA'B/.C, ,&,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,-//,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+WB_SAVE,. **8>493: t@e t>=<e**** PERFORM 69<<_82ree35>t> "SIN' ,SAPLSTRD, ,/.//,. PERFORM FILL_FIELD_DATA "SIN' ,!O//K-L_DEV#LASS, ,ZTMP,. PERFORM FILL_FIELD_DATA "SIN' ,!O//K-L_A"T$OR, ,SAPDEV/2,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+TEMP,. **69<<93: te2@392>< 8ett93:8. PERFORM 69<<_82ree35>t> "SIN' ,SAPLSD1., ,22//,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+SE.0,. PERFORM 69<<_82ree35>t> "SIN' ,SAPMSEDS, ,//%/,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_#"RSOR, ,DD/NV-TABART,. PERFORM FILL_FIELD_DATA "SIN' ,DD/NV-TABART, ,APPL/,. PERFORM FILL_FIELD_DATA "SIN' ,DD/NV-TAB!AT, ,/,. PERFORM FILL_FIELD_DATA "SIN' ,ALLOWSTATE-NOT_ALLOWED, ,&,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+SI#$,. PERFORM 69<<_82ree35>t> "SIN' ,SAPMSEDS, ,//%/,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+BA#!,. PERFORM 69<<_82ree35>t> "SIN' ,SAPLSD1., ,22//,. PERFORM FILL_FIELD_DATA

"SIN' ,BD#_O!#ODE, ,+WB_SAVE,. PERFORM 69<<_82ree35>t> "SIN' ,SAPLSD1., ,22//,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+WB_#$E#!,. PERFORM 69<<_82ree35>t> "SIN' ,SAPLSD1., ,22//,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+WB_A#TIVATE,. PERFORM FILL_S#REENDATA "SIN' ,SAPLSEWOR!IN'AREA, ,/2/%,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+WEIT,. PERFORM 69<<_82ree35>t> "SIN' ,SAPLSD1., ,22//,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+BA#!,. PERFORM 69<<_82ree35>t> "SIN' ,SAPMSRD/, ,/./2,. PERFORM FILL_FIELD_DATA "SIN' ,BD#_O!#ODE, ,+BA#!,. #ALL TRANSA#TION ,SE.., "SIN' T_BD#DATA MODE ,A, MESSA'ES INTO T_MS'. LOOP AT T_MS' INTO MS'. #ALL F"N#TION ,FORMAT_MESSA'E, E&PORTIN' ID + MS'-MS'ID LAN' + ,EN, NO + MS'-MS'NR V. + MS'-MS'V. V2 + MS'-MS'V2 V0 + MS'-MS'V0 V1 + MS'-MS'V1 IMPORTIN' MS' + MESSA'E E&#EPTIONS NOT_FO"ND + . OT$ERS + 2 . IF 8?-8;=r2 )* /. * MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO * WIT$ SY-MS'V. SY-MS'V2 SY-MS'V0 SY-MS'V1. ENDIF. IF 8?-8;=r2 EP /. WRITE - MESSA'E. ENDIF. ENDLOOP. e356orA. E PRO#ESS

Output 0irst Screen

Setting the deliver, class and maintenance

Saving the table

"echnical

Settings

Activating "he "able

BDC recording from testing client to de)elopment client

9y Eenkatraman ,, 79;

This method wo"ld be "se "l, when yo" don<t have re>"ired dat"m in development client and when yo" have same in testin) client and yo" want to 9DC recordin) with that dat"m. *o)in to the Testin) client where yo" will have data. 4o to transaction #HD9 and press new recordin).

As an instance, here we will try to modi y vendor<s postal code o his address. #o, )ive FFB3 as the transaction code to be e1ec"ted and )ive recordin) name like %ZREC8RD<.

,ow it )oes to Eendor master "pdate screen. 8pt a vendor and click the address checkbo1 and press enter.

7t will show the vendor<s address in ormation.

,ow chan)e the e1istin) $7, code -BBB2/ to ?+BB-+ and press save. 7t will take yo" to the recordin) screen.

,ow yo" cannot create a pro)ram with this recordin) in ormation in testin) client. #o, import yo"r recordin) in ormation to one presentation server ile. $ress import b"tton.

4ive a te1t ile name and save it in the presentation server.

Then 4o to #HD9 transaction in development client and )o to new recordin). 4ive the recordin) name as ZREC8RD7,4,EH and opt the same vendor master "pdation transaction code FFB3.

7n this case yo"r development client sho"ld have at least one vendor. 7 not create it and inp"t the vendor in FFB3 transaction and as yo" did earlier select the address checkbo1.

7t will show yo" the address in ormation. &o" don<t chan)e anythin) in that and come back. 9eca"se this is not the vendor to whom we are )oin) to chan)e his $7, Code.

,ow it will show yo" the recordin) in ormation. Delete all the recordin) in ormation and press the import b"tton and browse bdc!recordin) ile rom the presentation server.

The previo"s recordin) in ormation will loaded in to 9DC recordin) and )o back rom the screen. 7t wo"ld pop"p or savin) the recordin). ,ow save that recordin).

#elect the recordin) and press %pro)ram< b"tton. 7t will pop"p or new pro)ram creation. 7np"t the re>"ired details and the e1pected 9DC recordin) pro)ram will )et created.

report ZEE,D8R:$DATE no standard pa)e headin) lineDsi0e 3??. incl"de bdcrec12. startDo Dselection.

per orm open!)ro"p. per orm bdc!dynpro "sin) N#A$;FB3FN NB2B+N. per orm bdc! ield "sin) N9DC!C:R#8RN NRFB3FD*7F,RN. per orm bdc! ield "sin) N9DC!8FC8DEN NVBBN. per orm bdc! ield "sin) NRFB3FD*7F,RN N9BB3?+.N. per orm bdc! ield "sin) NRFB3FDDB22BN NON. per orm bdc!dynpro "sin) N#A$;FB3FN NB22BN. per orm bdc! ield "sin) N9DC!C:R#8RN N*FA2D$#T*ZN. per orm bdc! ield "sin) N9DC!8FC8DEN NW:$DAN. per orm bdc! ield "sin) N*FA2D,A;E2N N;:RAR7 #HARA, #R7EA#TAEAN. per orm bdc! ield "sin) N*FA2D#8RT*N NBBB?+.N. per orm bdc! ield "sin) N*FA2D#TRA#N N9rook Ho"se, #hakespeare #araniN. per orm bdc! ield "sin) N*FA2D8RTB2N NFolkattaN. per orm bdc! ield "sin) N*FA2D$#T*ZN N?+BB-+N. per orm bdc! ield "sin) N*FA2D*A,D2N N7,N. per orm bdc! ield "sin) N*FA2DRE478N N3?N. per orm bdc! ield "sin) N*FA2D#$RA#N NE,N. per orm bdc!transaction "sin) NFFB3N. per orm close!)ro"p.

PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP

You might also like