You are on page 1of 23

ualesLech LLd

age 1 of 23




















uLlllLy Classes - Cvervlew

verslon 14 servlce pack 9


ualesLech LLd
age 2 of 23



! "#$%&%'( *%&+',- ............................................................................................................................./
3.1 Changes slnce SS8.............................................................................................................................4
0 1,2(&3',+ 4'(+#(+&........................................................................................................................5
3.1 Cvervlew.............................................................................................................................................6
3.2 Lxample and demo programs .............................................................................................................6
3.3 Classes.................................................................................................................................................7
5 672&& '$#,$%#8.................................................................................................................................9
6.1 ZCL_u1_ASL8vL8............................................................................................................................9
6.2 ZCL_u1_8ACkC8Cunu!C8.................................................................................................................9
6.3 ZCL_u1_8C!C8_L88C8PAnuLlnC.....................................................................................................9
6.4 ZCL_u1_CCnS1An1S.........................................................................................................................11
6.3 ZCL_u1_CCnvL8SlCnS.....................................................................................................................11
6.6 ZCL_u1_LMAlL8LCllLn1S................................................................................................................12
6.7 ZCL_u1_Lx1L8nALCCMMAnuS .......................................................................................................13
6.8 ZCL_u1_llLL......................................................................................................................................13
6.9 ZCL_u1_l1_SA ..............................................................................................................................13
6.1 ZCL_u1_l1_SC8l1 .........................................................................................................................16
6.2 ZCL_u1_P1ML...................................................................................................................................16
6.3 ZCL_u1_LlS1Cu1u1 ........................................................................................................................16
6.4 ZCL_u1_LCClCALllLLnAMLS ............................................................................................................17
6.3 ZCL_u1_LCClCALllLLA1PS .............................................................................................................18
6.6 ZCL_u1_MAlL ....................................................................................................................................18
6.7 ZCL_u1_MLSSACL.............................................................................................................................19
6.8 ZCL_u1_8un1lMLMLSSACL .............................................................................................................20
6.9 ZCL_u1_S8LAuSPLL1......................................................................................................................20
6.10 ZCL_u1_18AnSC81S.....................................................................................................................21
6.11 ZCL_u1_u1lLl1lLS ...........................................................................................................................22
6.12 ZCL_u1_xML ...................................................................................................................................22
: 12;7# <2%(+#(2(4#...................................................................................................................... =!

ualesLech LLd
age 3 of 23

! "#$%&'#(
1he classes (of whlch Lhere are LwenLy one) have many uses, Lhey can be used for flle handllng l1, fleld
converslons eLc, and all use Lhe new excepLlon-handllng concepL lmplemenLed ln SA basls 6.20. LeL's
Lake Lhe flle handllng class as an example. Pow many Llmes have you wrlLLen a program whlch
reads/wrlLes a flle Lo Lhe appllcaLlon server? 1hls lnvarlably lnvolves you havlng Lo use Lhe A8A daLaseL
sLaLemenL and pass each llne Lo Lhe flle aL a Llme, handllng excepLlons along Lhe way. And whaL
happens Lhe nexL Llme you need Lhls funcLlon, you mosL llkely re-code a new verslon changlng Lhe error
handllng and messaglng as you go.
WlLh Lhe flle class you can upload a flle from Lhe appllcaLlon server wlLh Lwo meLhod calls, a LoLal of slx
llnes of code. 1hls lncorporaLes boLh excepLlon and success message handllng. And on Lop of Lhls
provldes one polnL of conLacL lf Lhe code needs Lo be modlfled Lo accommodaLe any sap enhancemenLs
such as unlcode.
1he classes are non-dependanL on Lhe operaLlng sysLem Lhey are lnsLalled on. 1he codlng uses exLernal
commands, loglcal flle paLhs & names Lo keep appllcaLlon server lnLeracLlon conslsLenL.
1he soluLlon also lncorporaLes example programs LhaL can be used as a basls for Lralnlng purposes and
mosL lmporLanLly as a drlver programs Lo ald Lhe LesLlng of changes Lo Lhe classes.


ualesLech LLd
age 4 of 23

* "+,%-%&' .%-$&/0
*1! 23#'4+- -%'5+ 6768
! Class ZCL_u1_8ACkC8Cunu. 1he class was lncorrecLly speclfled as publlc", lL has now been
changed Lo AbsLracL".
! new meLhod - lCk18AnSC81 added Lo class ZCL_u1_18AnSC81S.
! llx - ln meLhod ZCL_u1_LCClCALllLLnAMLS=>lCkllLLnAMLS, whlch prevenLed any fllenames
belng reLurned
! new MeLhod - ZCL_u1_CCnvL8SlCnS=>lC8MA1CASLC8Au. lf Lhe passed ln value conLalns
ALPAnuML8lC Lhen converL Lo upper case. lf Lhe fleld conLalns nuML8lC only Lhen pad wlLh
leadlng zeros.
! Class ZCL_u1_l1 spllL lnLo Lwo new classes, ZCL_u1_l1_SA and ZCL_u1_l1_SC8l1 Lo make
Lhem more undersLandable and useable.
! updaLed MeLhod - ZCL_u1_S8LAuSPLL1=>C8LA1LCCn1Ln1S. Allows dlfferenL formaLLlng of
declmal conLenLs Lo Lhe one speclfled ln Lhe user masLer seLLlngs. L.g a spreadhseeL may have
been creaLed ln german buL loaded ln SA by a user wlLh Lngllsh seLLlngs.
! Added Loglcal fllepaLh Zu1_1LMC8A8?_A1P Lo Lhe LransporL as lL was mlsslng and causlng
new lnsLances of class ZCL_u1_llLL Lo fall wlLh an error message.
! updaLed MeLhod - ZCL_u1_u1lLl1lLS=lSuL8uCClnCLnA8LLu. Changed Lhe memory lu from x
Lo Lhe currenL runnlng program.



ualesLech LLd
age 3 of 23

9 :#;%'4 5&',+'$%&'-
1he followlng SA ob[ecL namlng convenLlons are used LhroughouL Lhe lmplemenLaLlon. 1he namlng
convenLlon ls easy Lo read and ln mosL cases wlll allow Lhe ob[ecLs Lo be lmporLed lnLo a cllenL sysLem
wlLhouL namlng confllcLs occurrlng. Pere ls a llsL of all Lhe namlng sLandards used LhroughouL Lhe
soluLlon:

Convention Used for
SAPMZDT_* Module Pool
ZDTP_* Programs
ZDTINC_* Includes
ZCL_DT_* Global classes
ZCX_DT* Global exception classes
ZDTM_* Message classes
Z_DT_* Function modules
ZDTFG_* Function groups
ZDT_* DD tables
ZDTT_* DD: Table types
ZDTS_* DD: Structures
ZDTD_* DD: Data elements
ZDTDOM_* DD: Domains
ZDTV_* DD: Views
ZDTXSLT_* XSLT programs
ZDT_* Transaction codes
ZDT_* Packages
ZDT_* Logical file paths & names
ZDTX_* External commands

All of Lhe ob[ecLs are held wlLhln Lhe package Zu1_u1lLl1?CLASSLS', whlch ls a sub package of
Zu1_uLvLLCMLn1


ualesLech LLd
age 6 of 23

< =/#'->&/$ 5&'$+'$-
<1! ?,+/,%+@
1here are Lwo LransporLs for Lhe uLlllLy classes, Lhe flrsL conLalns Lhe classes Lhemselves, and
Lhe second conLalns a sub-package wlLh all Lhe demo programs llsLed.
!"#$%&'"(%
!"#$%&'"( (*&+ !"#$%&'"( ,#-+
uLlllLy Classes Auk90033
uemo rograms Auk90043
1he demo programs LransporL ls dependenL on Lhe uLlllLy classes LransporL belng lnsLalled.

<1* AB#;>(+ #'C C+;& >/&4/#;-
1here are 13 programs lncluded wlLh Lhe uLlllLy classes, 14 of Lhese are used for LesLlng/demonsLraLlng
and one ls a reporL. 8elow ls a llsL of all Lhe programs and Lhelr roles:

Demo Programs
."'/"#- $#-+ 0+%1"2&(2'$
Zu1_CC?llLLl8CMSA Copy a flle from Lhe SA server Lo Lhe user local C
Zu1_CC?llLL1CSA Copy a flle from Lhe users c Lo Lhe SA server
Zu1_LMAlL_uLMC 1esL Lhe e-mall class
Zu1_llLL_uLMC 1esLs Lhe flle lnLerface class
Zu1_l1llLLl8CMSA l1 a flle from SA Lhrough a scrlpL
Zu1_l1llLL1CSA l1 a flle Lo SA Lhrough a scrlpL
Zu1_!C8_uLMC 8ackground [ob demo program
Zu1_LCClCALllLL_uLMC 1esLs Lhe loglcal flle class
Zu1_S8LAuSPLL1_uLMC 1esLs Lhe spreadsheeL class
Zu1_SAl1_CCMMAnu_uLMC 1esLs Lhe l1 class
Zu1_SAl1_CC?_uLMC 1esLs Lhe l1 class

ualesLech LLd
age 7 of 23

Zu1_SAl1_PLL_uLMC 1esLs Lhe l1 class
Zu1_SAl1_83CC?_uLMC 1esLs Lhe l1 class
Zu1_SAl1_vL8SlCn_uLMC 1esLs Lhe l1 class


3+&'"(%
."'/"#- $#-+ 0+%1"2&(2'$
Zu1_8ACkC8Cunu!C8LCC 8eporL Lo show Lhe messages sLored ln Lhe u8 from Lhe
background [ob logglng class


<19 2(#--+-
1here are elghLeen uLlllLy classes ln LoLal, whlch are summarlsed below.

4(252(* 15#%%+%
65#%% $#-+ 0+%1"2&(2'$
ZCL_u1_ASL8vL8 ulrecLory llsLlng & plcklng
ZCL_u1_8ACkC8Cunu!C8 CreaLlng and deleLlng of background [obs ln Lhe scheduler
ZCL_u1_8C!C8_L88C8PAnuLlnC Messaglng of boLh foreground and background [obs and
conLrolled cancelllng of background [obs.
ZCL_u1_CCnS1An1S ConsLanLs used by all Lhe classes
ZCL_u1_CCnvL8SlCnS uaLa converslon
ZCL_u1_LMAlL8LClLln1S L-mall reclplenLs for Lhe mall class
ZCL_u1_Lx1L8nALCCMMAnuS LxLernal command handllng
ZCL_u1_llLL llle handllng on Lhe appllcaLlon server and local C
ZCL_u1_l1 l1 of flles beLween SA sysLems
ZCL_u1_P1ML Converslon of sLrucLures/Lables Lo P1ML
ZCL_u1_LlS1Cu1u1 Adds user deflned selecLlon screen deLalls Lo an A8A llsL.
ZCL_u1_LCClCALllLLnAMLS Pandles all aspecLs of loglcal flle names.
ZCL_u1_LCClCALllLLA1PS Pandles all aspecLs of loglcal flle paLhs.
ZCL_u1_MAlL L-mall sendlng from A8A boLh LexL and blnary.
ZCL_u1_MLSSACL vlsual messages Lo Lhe user

ualesLech LLd
age 8 of 23

ZCL_u1_8un1lMLMLSSACL CeneraLed message ln an ob[ecL
ZCL_u1_S8LAuSPLL1 SpreadsheeL lnLegraLlon
ZCL_u1_18AnSC81S CeL lnformaLlon abouL Lhe LransporL sysLem
ZCL_u1_u1lLl1lLS CollecLlon of useful meLhods
ZCL_u1_xML ConverL daLa Lo xML or P1ML vla xSL1

ualesLech LLd
age 9 of 23

D 2(#-- &,+/,%+@
D1! E2FGH=GI776A"JA"
1he ASL8vL8 class ls used for acLlvlLles on Lhe SA appllcaLlon server. CurrenLly lL has Lhe ablllLy Lo
check lf a dlrecLory exlsLs, and secondly Lo allow Lhe conLenLs of a dlrecLory Lo be llsLed and reLurned Lo
an A8A program, or presenLed Lo a user as a pop up wlndow from whlch Lhe user can choose one or
more flles.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
Add1ralllngSlash Adds a Lralllng slash Lo a flle paLh
CheckulrLxlsLs Checks Lo see lf a speclfled dlrecLory exlsLs.
LlsLllles 8eLurns a llsL of flles ln a dlrecLory Lo Lhe A8A program.
lckllles Allows a user Lo plck one or more flles form a dlrecLory.

D1* E2FGH=GKI2LM"?N:HO?K
1hls class ls used Lo manage [obs ln Lhe SA sLandard [ob scheduler SM36.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
Cancel!ob Cancel a runnlng background [ob
CreaLe8ackground!ob CreaLe a new background [ob
ueleLe8ackground!ob ueleLe a background [ob
uoes!obLxlsL uoes a [ob exlsL wlLh Lhe speclfled name
CeL!oblnfo CeL Lhe [ob lnfo of Lhe currenL runnlng background [ob

D19 E2FGH=GKMO?KGA""?".I:HFP:M
1he !ob class handles any messaglng and errors generaLed by a program wheLher wlLhln a foreground
run or a background [ob. Lach program lnsLanLlaLes a [ob ob[ecL, agalnsL Lhls ob[ecL we can add
messages.

ualesLech LLd
age 10 of 23

ln addlLlon Lo recelvlng and sLorlng messages ln Lhe SA daLabase Lhe ob[ecL can also send elLher
success or error e-malls. lurLher lf Lhe program ls runnlng ln background Lhe ob[ecL has Lhe ablllLy Lo
LermlnaLe Lhe currenL background [ob. 1hls mlghL be useful lf furLher [ob sLeps musLn'L run wlLhouL Lhe
prevlous one compleLlng successfully.

1he ob[ecL can Lake Lwo courses of acLlon, elLher
o =3+ >/&4/#; Q#%(-. Any messages sLored agalnsL Lhe [ob ob[ecL can be saved Lo Lhe daLabase,
Lhe ob[ecL can choose Lo send elLher a problem or cancel e-mall Lo a user or dlsLrlbuLlon group.
lf runnlng ln background Lhe background [ob can Lhen be cancelled.

o =3+ >/&4/#; @&/R-. Any messages sLored agalnsL Lhe [ob ob[ecL can be saved Lo Lhe daLabase,
Lhe ob[ecL can choose Lo send a success e-mall Lo a user or dlsLrlbuLlon group. 1he program
flnlshes and Lhe nexL program ln Lhe [ob lnsLanLlaLes a new ob[ecL.
;$%(#$1+ 15#%%
8+(9': 0+%1"2&(2'$
AddLxcepLlonCb[Message Adds an excepLlon ob[ecL message Lo Lhe background [ob
AddMessage Add a sLrlng based message Lo Lhe background [ob
Add8unLlmeMessage Adds a runLlme message Lo Lhe background [ob
Add1100Message Add a 1100 based message Lo Lhe background [ob
Cancel Cancel an acLlve background [ob
ConsLrucLor lnsLanLlaLe Lhls class
ueleLeAllMessages ueleLe all messages generaLed for a background [ob
CeLnumberCfMessages CeL Lhe currenL number of messages for Lhe background [ob
lsAlerLercenLage Pas Lhe alerL percenLage been meL? 1hls ls useful lf Lhe [ob ls supposed
Lo cancel afLer x percenLage fallures.
Save Save all messages Lo Lhe u8 message logglng Lables
SendLmall Send success, problem or cancellaLlon e-mall.
SorLAndCompress SorL and compress Lhe ob[ecL message Lo geL rld of dupllcaLes

Any messages sLored agalnsL Lhe [ob ob[ecLs can be vlewed wlLh LransacLlon Zu1_!C8LCC. 1he
messages are sLored for a perlod of 60 days before deleLlon.


ualesLech LLd
age 11 of 23

D1< E2FGH=G2?:6=I:=6
1hls class holds all of Lhe global consLanLs used wlLhln Lhe uLlllLy classes. lL has no meLhods. Lxample
consLanLs are 18uL & lALSL.

<=%("#1( 15#%%
6'$%(#$( 0+%1"2&(2'$ >#5?+
18uL x
lALSL
S1A1uSCPAnCLu CPAnCLu
S1A1uSnLW nLW
S1A1uSL88C8 L88C8
S1A1uSCS1Lu CS1Lu
S1A1uSSAvLu SAvLu
S1A1uSuLLL1Lu uLLL1Lu
8AlL88C8 L
8AlSuCCLSS S
8AllnlC l
8AlWA8nlnC W

D1D E2FGH=G2?:JA"6P?:6
1hls class performs converslons on daLa, elLher converLlng slngle flelds, addlng values lnLo sLrlng flelds or
converLlng lnLernal Lables Lo/from CSv Lo/from lnLernal A8A formaL.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
AppendConLrolCharacLer Append a hexadeclmal value Lo Lhe end of a sLrlng fleld.
lnserLConLrolCharacLer lnserL a hexadeclmal value lnLo a sLrlng aL a cerLaln offseL.
adWlLhLeadlngZeros ad a fleld ouL wlLh leadlng zeros.
8emoveLeadlngZeros 8emove leadlng zeros from a fleld.
SpllLSLrlngALllxedLengLh SpllL a sLrlng fleld aL a flxed lengLh lnLo a Lable of Lype sLrlng.

ualesLech LLd
age 12 of 23

7(#(21 15#%%
ConverLuaLe1oLxLernal ConverL a daLe from lnLernal Lo exLernal formaL.
ConverLuaLeLolnLernal ConverL a daLe from exLernal Lo lnLernal formaL.
ConverLCSv1olLab ConverL a sLrlng Lable full of CSv daLa Lo an lnLernal Lable based on an
lnLernal A8A sLrucLure.
ConverLlLab1oCSv ConverL an lnLernal Lable Lo a Lable of CSv daLa. Can also add a header
llne o Lhe CSv wlLh Lhe name of Lhe A8A flelds. Can call mulLlple Llmes
Lo append more Lhan one l1A8 Lo Lhe CSv daLa.
ConverLCSv1oWa ConverL a sLrlng of CSv daLa Lo an A8A work area.
ConverLWa1oCSv ConverL an A8A work area Lo CSv formaL.
xsLrlng1oSollx_1ab ConverLs a blnary sLrlng lnLo a Lable of Lype sollx_Lab.
lormaLCaseCrad ConverLs ony alphas Lo uppercase. ads wlLhleadlng zeros lf conLalns
numbers.


D1S E2FGH=GATIPF"A2P7PA:=6
1hls class ls used for handllng emall reclplenLs for Lhe class ZCL_u1_MAlL. lL ls used Lo guaranLee daLa
lnLegrlLy for passlng reclplenLs lnLo Lhe mall class. valldlLy checks are carrled ouL agalnsL Lhe e-mall
addresses added.
;$%(#$1+ 15#%%
8+(9': 0+%1"2&(2'$
Add8CC8eclplenLs Add a 8CC reclplenL Lo Lhe ob[ecL
AddCC8eclplenL Add a CC reclplenL Lo Lhe ob[ecL
Add8eclplenL Add a reclplenL Lo Lhe ob[ecL
AddSapulsLrlbuLlonLlsL Add all Lhe members of an SA dlsLrlbuLlon llsL
CheckulsLLlsLLxlsLs Check LhaL Lhe SA dlsLrlbuLlon llsL exlsLs
CheckLmallAddressvalldlLy Check Lo see lf Lhe e-mall address ls consLrucLed properly
ClearSAulsLLlsLs Clear Lhe ob[ecL of all SA dlsLrlbuLlon llsLs
ClearMall8eclplenLs Clear all mall reclplenLs ouL of Lhe ob[ecL
geL8CC8eclplenLs CeL 8CC reclplenLs from Lhe ob[ecL
geLCC8eclplenL CeL CC reclplenL from Lhe ob[ecL
geL8eclplenL CeL reclplenLs from Lhe ob[ecL

ualesLech LLd
age 13 of 23

;$%(#$1+ 15#%%
plckulsLrlbuLlonLlsL Allow a user Lo choose one of Lhe dlsLrlbuLlon llsLs deflned ln SC23. 1hls
can be resLrlcLed Lo only prlvaLe llsLs lf requlred.

1he SA dlsLrlbuLlon llsL can be creaLed wlLhln LransacLlon SC23, users can be deflned as reclplenLs, CC
reclplenLs and 8CC reclplenLs.

D1U E2FGH=GAV=A":IF2?TTI:H6
1hls class encapsulaLes SAs' sLandard approach for calllng exLernal commands on Lhe SA server and
provlde a sLandard error framework for handllng excepLlons.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
CallLxLernalCommand Calls an exLernal operaLlng sysLem command on Lhe SA server
ConsLanL uescrlpLlon value
CCMMAnuLlS1 LlsL all flle sln a dlrecLory Zu1x_LlS1
CCMMAnuCCM8LSS Compress flles lnLo an archlve Zu1x_CCM8LSS
CCMMAnuCC? Copy a flle Zu1x_CC?
CCMMAnuuLCCM8LSS ue-compress an archlve flle Zu1x_uLCCM8LSS
CCMMAnuMCvL Move a flle Zu1x_MCvL
CCMMAnu8LnAML 8ename a flle Zu1x_8LnAML
CCMMAnul1 l1 a flle Lo anoLher server Zu1x_l1_u1
CCMMAnuSl1 l1 a flle from anoLher server Zu1x_l1_CL1
CCMMAnuMkul8 Make a dlrecLory Zu1x_Mkul8

D18 E2FGH=GWPFA
1he flle class was deslgned Lo make flle handllng slmpler. 1he meLhods ln Lhls class apply Lo boLh flles on
Lhe SA server and Lhe local C. Cf all Lhe classes deLalled ln Lhls documenL Lhls class ls Lhe mosL useful
and generally Lhe mosL frequenLly used. lL was creaLed Lo slmpllfy flle handllng and mosL lmporLanLly
error handllng. lL works by absLracLlng boLh Lhe daLaseL and Cul commands and provldes a slmple
lnLerface for flle lnLeracLlon.

ualesLech LLd
age 14 of 23

Slnce all Lhe meLhods apply boLh Lo Lhe appllcaLlon server and C lL ls posslble Lo change Lhe flle
processlng locaLlon by a slmple flag on Lhe consLrucLlng facLory meLhod. no oLher codlng ls necessary.
1he class derlves lf Lhe flle handllng ls Laklng place on elLher an unlx or Wlndows plaLform (boLh on Lhe
appllcaLlon server and local C) and handles operaLlng sysLem calls accordlngly.
1he oLher advanLage of Lhe class ls LhaL lL reduces Lhe lmpacL polnL of uslng SAs Cul meLhods, and any
changes or updaLes only need Lo be compleLed ln one place and noL ln every calllng program.

1he class can also use Lhe loglcal flle paLh 'Zu1_A1P_8LS18lC1lCn' Lo llmlL access Lo a speclflc dlrecLory
and lLs subdlrecLorles on Lhe appllcaLlon server.
;$%(#$1+ 15#%%
8+(9': 0+%1"2&(2'$
Add1ralllngSlash Add a Lralllng slash Lo a flle paLh
Archlvellle Archlves Lhe flle lnLo Lhe speclfled dlrecLory, wlLh or wlLhouL a
daLe/LlmesLamp. 1he source flle can also be deleLed
ArchlvellleuslngLoglcal Archlve a flle uslng a desLlnaLlon loglcal flle paLh
CheckflleLxlsLs Check Lhe flle exlsLs ln Lhe locaLlon speclfled.
Compressllle Compress Lhe flle (only applles Lo Lhe appllcaLlon server)
Copyflle lrom one locaLlon Lo anoLher.
Copy1oC Copy a flle on Lhe SA sever Lo Lhe local compuLer
Copy1oSA Copy a flle on Lhe local compuLer Lo Lhe SA server.
CreaLe8yLoglcallllename CreaLe a flle lnsLance based upon a loglcal fllename
CreaLe8yLoglcallllepaLh CreaLe a flle lnsLance based upon a loglcal flle paLh and a physlcal
fllename
CreaLe8yhyslcallllename CreaLe a flle lnsLance based upon a physlcal paLh and physlcal fllename
CreaLe8yCompleLeaLhAdnllle CreaLe a flle lnsLance based upon a concaLenaLed physlcal flle paLh and
physlcal fllename.
ueleLellle ueleLe Lhe speclfled flle
ueleLe1emporaryllle ueleLe a flle ln Lhe Lemporary flle dlrecLory
ueLermlnelllesysLem ueLermlne Lhe underlylng server flle sysLem Lype
ueLermlneCsysLem ueLermlne Lhe server operaLlng sysLem.
uownload uownload Lhe flle, wlLh or wlLhouL conflrmaLlon
llnd1empaLh 8eLrleves Lemp paLh from loglcal flle paLh Zu1_1LMC8A8?_A1P.

ualesLech LLd
age 13 of 23

CeLaLh8esLrlcLlon CeL Lhe paLh resLrlcLlon for flle operaLlons. Any flle acLlvlLy cannoL Lake
place above Lhls paLh.
Movellle lorm one dlrecLory Lo anoLher
adlllename ads a fllename and cycle counL ouL wlLh zeros. 8esulL = fllename +
zeros + cycle counL.
8enamellle 8enames a flle
SeLAscllllle SeL Lhe flle Lo be of Lype ASCll.
SeL8lnaryllle SeL Lhe flle Lype Lo be blnary
SeLLncodlng SeL Lhe flle encodlng Lype
SeLLegacyCodeage SeL Lhe legacy codepage of Lhe flle
SeL1abuellmlLed SeL Lhe ASCll flle Lo be Lab dellmlLed (Cnly applles Lo Cul flles).
SpllLlllename SpllL a fllename or paLh + fllename lnLo all lLs consLlLuenL parLs.
uncompressllle uncompress a zlp flle (only applles Lo Lhe appllcaLlon server)
upload upload a flle, from llne/all llnes, ln blocks of x.
unzlpllle unzlp a speclfled flle
Zlpllle Zlp a speclfled flle

D1X E2FGH=GW=7G6I7
1hls class encapsulaLes he sLandard SA l1 commands. l1 connecLlon deLalls can be sLored uslng
LransacLlon Zu1_l1vA8 & Zu1_vA8uL1 ready Lo be used ln any l1 meLhod calls.
;$%(#$1+ $++:+: @'" 7<. A!.
,++:+: 2@ ?%2$/ (9+ %(#$:#": 7<. A!. @?$1(2'$#52(*
8+(9': 0+%1"2&(2'$
ConsLrucLor lnsLanLlaLe Lhe ob[ecL
l1Command ass a command Lo Lhe 8/3 l1 server
l1ulsconnecL ulsconnecL from Lhe 8/3 l1 server
l1CommandLlsL LlsL of avallable l1 commands on Lhe lnLernal 8/3 l1 server
l1Copy Copy a flle from Lhls 8/3 server Lo anoLher 8/3 server.
l1Server1o838lob l1 a blnary flle from anoLher 8/3 server lnLo an lnLernal Lable
l1Server1o831exL l1 a LexL flle from anoLher 8/3 server lnLo an lnLernal Lable
LxecuLeScrlpL LxecuLe a scrlpL of l1 commands beLween Lhe Lwo 8/3 sysLems

ualesLech LLd
age 16 of 23

l1831oServer1exL l1 a LexL Lable from Lhls 8/3 server Lo anoLher 8/3 server as a flle.
l1831oServer8lob l1 a blnary Lable from Lhls 8/3 server Lo anoLher 8/3 server as a flle.
SeLlllename SeL Lhe name of Lhe flle we are deallng wlLh.
SeLllleaLh SeL Lhe flle paLh of Lhe flle we are deallng wlLh.
l1verslon CeL Lhe verslon of Lhe SA 8/3 l1 command.


D1! E2FGH=GW=7G62"P7=
1hls class provldes a meLhod of calllng exLernal scrlpLs on Lhe SA appllcaLlon server. l1 connecLlon
deLalls can be sLored uslng LransacLlon Zu1_l1vA8 & Zu1_vA8uL1 ready Lo be used ln any l1 meLhod
calls.
7(#(21 -+(9':% @'" 4%+" %1"2&(+: A!.
,++:+: 2@ ?%2$/ ?%+"B:+@2$+: %1"2&( =#%+: @?$1(2'$#52(*
8+(9': 0+%1"2&(2'$
l1llLL l1 a flle Lo/from SA based upon deLalls ln Lhe varlanLs Lable.

D1* E2FGH=G.=TF
1he P1ML class deals wlLh creaLlng P1ML, ln Lhe example below lL ls posslble Lo converL and lnLernal
Lable Lo P1ML. 1he P1ML generaLed ls W3C compaLlble, alLhough does noL generaLe ln-llne CSS sLyle
sheeL daLa.
7(#(21 15#%%
Method 0+%1"2&(2'$
ConvertItabToHTML ConverL an lnLernal Lable Lo P1ML. lf Lhe Lable ls based upon a uu
sLrucLure Lhen you can add column headlngs, elLher uslng Lechnlcal uu
fleld names or by addlng uu descrlpLlve LexLs.

D19 E2FGH=GFP6=?N=7N=
1he LlS1Cu1u1 class ls used wlLhln Lhe prlnL evenL recelver meLhods of ALv processlng. When a user
chooses Lo prlnL form an ALv grld Lhe followlng meLhods are called:

ualesLech LLd
age 17 of 23

o prlnL_end_of_llsL
o prlnL_end_of_page
o prlnL_Lop_of_llsL
o prlnL_Lop_of_page
WlLhln Lhese meLhods lL ls posslble Lo lnfluence Lhe prlnLed verslon of Lhe reporL and add cusLom LexL
and varlables ln Lhe headers and fooLers. lL ls also posslble Lo add any reporL selecL-opLlons and
parameLers and have Lhem dlsplayed wlLh Lhelr values on Lhe reporL header.
;$%(#$1+ 15#%%
8+(9': 0+%1"2&(2'$
ConsLrucLor lnsLanLlaLes Lhe ob[ecL
rlnLLlsLlooLer WrlLes user deflned LexL aL Lhe end of Lhe prlnLouL.
rlnLLlsLPeader WrlLes user and sysLem deLalls Lo Lhe sLarL of Lhe reporL, plus addlLlonal
program deflned conLenL.
rlnLagelooLer rlnL an addlLlonal LexL on Lhe fooLer of every page
rlnLagePeader rlnLs Lhe reporL name and currenL page number on Lhe header of each
reporL page.
rlnLarameLer Add a selecLlon screen parameLer and lLs values Lo Lhe reporL prlnLouL.
rlnLSelecLCpLlon Add a selecLlon screen selecL-opLlon and lLs values Lo Lhe reporL ouLpuL.

D1< E2FGH=GF?MP2IFWPFA:ITA6
Loglcal fllenames have been lmplemenLed ln SA for years buL are very rarely lmplemenLed on cusLomer
slLes. 1hls class has adds funcLlonallLy whlch ls lmporLanL for end users Lo use plck Lhe requlred loglcal
fllename Lhey wlsh Lo use and for developers Lo converL Lhe loglcal flle names Lo operaLlng sysLem level
fllenames and correspondlng flle paLhs. 1hls class can be used dlrecLly by Lhe ZCL_u1_llLL class. An
example of lmplemenLlng Lhls class can be seen wlLhln program Zu1_LCClCALllLL_uLMC.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
llndAlllllenames llnd all loglcal fllenames and reLurn Lhem ln an lnLernal Lable
8esLrlcLlllenames 8esLrlcL Lhe llsL of loglcal fllenames we have reLurned from meLhod
llndAlllllenames().
lckfllename lck a loglcal fllename from a l4 drop down.
CeLhyslcalaLh lrom a loglcal fllename derlve Lhe physlcal flle paLh belng used

ualesLech LLd
age 18 of 23

7(#(21 15#%%
geLhyslcallllename lrom a loglcal fllename derlve Lhe physlcal flle, lLs Lype, and Lhe physlcal
fllepaLh lL uses.
CeLLoglcalaLh lrom a loglcal fllename derlve Lhe paLh lL ls uslng

D1D E2FGH=GF?MP2IFWPFA7I=.6
Loglcal flle paLhs (llke loglcal fllenames) have been lmplemenLed ln SA for years buL are very rarely
lmplemenLed on cusLomer slLes. 1hls class has adds funcLlonallLy whlch ls lmporLanL for end users Lo
use plck Lhe requlred loglcal paLh Lhey wlsh Lo use and for developers Lo converL Lhe loglcal flle paLhs Lo
operaLlng sysLem level flle paLhs. 1hls class can be used dlrecLly by Lhe ZCL_u1_llLL class. An example
of lmplemenLlng Lhls class can be seen wlLhln program Zu1_LCClCALllLL_uLMC.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
llndAllaLhs llnd all loglcal flle paLhs and reLurn Lhem ln an lnLernal Lable
8esLrlcLaLhs 8esLrlcL Lhe llsL of loglcal flle paLhs we have reLurned from meLhod
llndAllaLhs().
lckfllepaLh lck a loglcal flle paLh from an l4 drop down.
CeLhyslcalaLh ueLermlne a physlcal flle paLh form a loglcal flle paLh.

D1S E2FGH=GTIPF
Sendlng e-malls from wlLhln SA has never been parLlcularly easy. Lspeclally when you wlsh Lo add
aLLachmenLs, or send P1ML or blnary messages. Powever Lhe MAlL class has been deslgned wlLh all of
Lhese scenarlos ln mlnd.
;$%(#$1+ 15#%%
8+(9': 0+%1"2&(2'$
CreaLe8ySenderAddress CreaLe an e-mall lnsLance wlLh reply Lo user deflned
CreaLe8yusername CreaLe an e-mall lnsLance wlLh reply Lo derlved from Lhe currenL users
username.
CreaLeMall8ody CreaLe Lhe mall body as 1Lx1, P1ML or 8lnA8?.
AddALLachmenL Add a 1Lx1, P1ML or 8lnA8? aLLachmenL Lo Lhe mall. ?ou do noL need
Lo add a mall body Lo add an aLLachmenL.

ualesLech LLd
age 19 of 23

;$%(#$1+ 15#%%
SeL1race SeL Lhe SCC1 Lrace on for Lhls e-mall. ldeal for problem solvlng.
SeLLxplresCn SeL Lhe daLe on whlch Lhe e-mall explres.
SeLrlorlLy SeL Lhe mall prlorlLy.
Send Send Lhe e-mall lmmedlaLely or parL of a baLch [ob

SendP1MLMall SLaLlc meLhod: Send a slmple P1ML based e-mall wlLhouL havlng Lo call
all Lhe meLhods above.
Send1exLMall SLaLlc meLhod: Send a slmple LexL based e-mall wlLhouL havlng Lo call all
Lhe meLhods above.
SendP1MLMalllromuuuslng
xSL1
SLaLlc meLhod: Comblnes an lnLernal Lable wlLh an xSL1 program Lo
generaLe an e-mall wlLhouL havlng Lo call all Lhe meLhods above.
SendP1MLMalllromxMLusl
ngxSL1
SLaLlc meLhod: Comblnes an xML sLrucLure wlLh an xSL1 program Lo
generaLe an e-mall wlLhouL havlng Lo call all Lhe meLhods above.


D1U E2FGH=GTA66IMA

Static class used for converting messages or statuses from one format to another.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
8aplSLaLus1oALvlcon ConverLs a 8Al sLaLus Lo ALv lcon lCCn_LLu_C8LLn,
lCCn_LLu_?LLLCW and lCCn_LLu_8Lu.
8aplSLaLus1oALvsLaLus ConverL a Lable of 8Al resulL and updaLes Lhelr sLaLuses for ALv
dlsplay. 8Al sLaLus (l,L,W,S) Lo ALv sLaLus (1,2,3).
8aplSLaLus1oALvsLaLusSlngle ConverL a 8Al resulL and updaLes Lhe sLaLus for ALv dlsplay. 8Al
sLaLus (l,L,W,S) Lo ALv sLaLus (1,2,3).
8ooleanSLaLus1oALvlcon ConverLs 18uL Lo ALv lcon lCCn_LLu_C8LLn, and lALSL Lo error ALv
lcon lCCn_LLu_8Lu.
8ooleanSLaLus1oALvSLaLus ConverLs 18uL Lo ALv sLaLus success (3), and lALSL Lo error ALv sLaLus
error (1).
MessageSLaLus1oAlvSLaLus ConverL a slngle message (l,L,W,S) Lo ALv sLaLus (1,2,3).
Message1o8aplMessage ConverL a 1100 based message wlLh parameLers Lo a Lype of 8Al_MSC
Message1oSLrlng ConverL a 1100 based message wlLh parameLers Lo a sLrlng
1exL1oSLrlng ConverL a program LexL wlLh parameLers Lo a sLrlng. useful lf your base

ualesLech LLd
age 20 of 23

7(#(21 15#%%
message needs Lo be longer Lhan a 1100 message of 72 chars.
updaLeSACullndlcaLor Calls Lhe funcLlon Lo dlsplay Lhe SACul progress lndlcaLor

D18 E2FGH=G"N:=PTATA66IMA
1hls class ls exLremely useful lL allows a message Lo be passed back from a meLhod wlLhouL dlsplaylng lL
on Lhe screen. When codlng meLhods lL ls lmporLanL LhaL we allow Lhe calllng program Lo declde Lhe
program flow. An example of Lhls ls lf we wlsh Lo check Lhe ouLcome of a loglcal LesL.
o Call meLhod 1
o Call meLhod 2
o ueclde whaL Lo do - Lhen dlsplay message
lf we wlshed Lo do Lhls and Lhe flrsL meLhod produced a message of Lype 'W' Lhen Lhe program would
ralse a warnlng message wlLhln Lhe program and Lhls would be lncorrecL.
8alslng a message sLaLemenL wlLhln a globally shared meLhod ls lncorrecL, as we don'L know how Lhe
calllng ob[ecL lnLends Lo handle lL.
WlLh Lhe runLlme message class we can reLurn or exporL a message as an ob[ecL and leL Lhe calllng
program handle lL.

;$%(#$1+ 15#%%
Method 0+%1"2&(2'$
Constructor ass ln Lhe message Lype (l,L,W,S), 1100 message class, message
number and up Lo 4 message parameLers.

D1X E2FGH=G67"AIH6.AA=
1hls class encapsulaLes Lhe sLandard SA CLL spreadsheeL lmplemenLaLlon Lo allow you Lo elLher sLarL
MS Lxcel lndependenLly or embedded lnLo Lhe SACul. An exlsLlng spreadsheeL can be uploaded on
sLarL or a new blank spreadsheeL creaLed. An example program Lo demonsLraLe Lhe usage of Lhls ls
avallable lL ls called Zu1_S8LAuSPLL1_uLMC.

ualesLech LLd
age 21 of 23

;$%(#$1+ 15#%%
8+(9': 0+%1"2&(2'$
CreaLeuslngCusLConLalner CreaLe an lnsLance of Lhe spreadsheeL ob[ecL based on a SACul cusLom
conLalner. LlLher sLarL wlLh a blank spreadsheeL, or pop-up a flle plcker
wlndow, or pass ln a paLh and flle name and Lhe spreadsheeL wlll
auLomaLlcally uploaded.
CreaLeuslngCulConLalner CreaLe an lnsLance of Lhe spreadsheeL ob[ecL based on a SACul gul
conLalner. LlLher sLarL wlLh a blank spreadsheeL, or pop-up a flle plcker
wlndow, or pass ln a paLh and flle name and Lhe spreadsheeL wlll
auLomaLlcally uploaded.
AddCommenL Add a commenL Lo a slngle cell
AddCommenLs Add a commenL Lo mulLlple cells
ClearCommenLslrom8ange Clear all Lhe commenLs from a pre-deflned range
CloseuocumenL Close Lhe documenL and lf necessary prompL Lo save.
ColourCell Colour a spreadsheeL cell
CeLuaLalromCurrenLSheeL CeL all Lhe daLa from Lhe currenL sheeL
CeLuaLalrom8ange CeL all Lhe daLa from a pre-deflned range ln Lhe currenL sheeL
PasWorkbookChanged Pas Lhe workbook changed slnce laodlng
lnserL1ablelnLoSheeL lnserL an lnLernal Lable lnLo Lhe currenL sheeL
lnserL1ablelnLo8ange lnserL an lnLernal Lable lnLo a pre-deflned range ln Lhe spreadsheeL
SeLCurrenLSheeL SeL a sheeL Lo be dlsplayed as Lhe currenL sheeL
SeLllushlnglndlcaLor 1ell SA Lo send Lhe prevlous meLhod calls Lo Lhe fronL-end
;$(+"@#1+ 0+%1"2&(2'$
l_ol_spreadsheeL AddlLlonal meLhods avallable for spreadsheeL lnLeracLlon. Accesslble by
ob[SpreadsheeL->ob[WorkSheeL->meLhod name

D1!Y E2FGH=G="I:67?"=6
lnformaLlon on Lhe currenL LransporL sysLem.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
CeL1ransporLuomaln CeL Lhe currenL LransporL domaln
CeL1ransporLaLh CeL Lhe currenL LransporL paLh
lck1ransporLs Allows a user Lo plck a LransporL from /usr/sap/Lrans

ualesLech LLd
age 22 of 23



D1!! E2FGH=GN=PFP=PA6
1hls class ls a collecLlon of useful meLhods. ln pracLlce Lhe class wlll need Lo be re-deflned as Lhe
meLhods 'llnd8ackend8lCuesL' and 'llnd8ackendSAServer' wlll depend on your own sysLem
landscape.
;$%(#$1+ 15#%%
MeLhod uescrlpLlon
llnd8ackend8lCuesL llnd Lhe back-end 8lC desLlnaLlon lf Lhls sysLem relles on 8/3
llnd8ackendSAServer llnd Lhe Slu of Lhe back-end SA sysLem lf Lhls sysLem relles on 8/3
CeneraLeCulu CeneraLe a 32-blL Culu
lsuebugglngLnabled Pas Lhe user speclfled debugglng by seLLlng global parameLer
Zu1_uL8uC ln Lhelr user proflle. 1hls allows Lhe programmer Lo add
addlLlonal debug code Lo Lhelr program and enable lL wlLhouL codlng
change or seLLlng manual break-polnLs.
lsuynpro ueLermlnes lf Lhls call ls called form wlLhln Lhe SACul or from an non
SACul envlronmenL e.g. 8lC or web servlce.
lckCllenL uropdown plcker of all Lhe avallable cllenLs wlLhln Lhe currenL SA
sysLem
plck8lCuesLlnaLlon uropdown plcker of all Lhe avallable SA 8lC desLlnaLlons wlLhln Lhe
currenL SA sysLem

D1!* E2FGH=GVTF
ConverL an A8A daLa sLrucLure/Lable Lo xML or addlLlonally Lo P1ML lf used ln con[uncLlon wlLh an
xSL1 program. 1hls class ls especlally useful lf you wlsh Lo converL daLa lnLo a formaL sulLable for
dlsplaylng Lo Lhe end user.
7(#(21 15#%%
8+(9': 0+%1"2&(2'$
ConverLSLrucLure1oP1ML ConverLs a daLa dlcLlonary sLrucLure Lo P1ML uslng an xSL1 program
ConverLSLrucLure1CxML ConverLs a daLa dlcLlonary sLrucLure Lo xML
TransformViaXSLT Transform XML into HTML using an XSTL program.


ualesLech LLd
age 23 of 23

S =#Z(+ T#%'$+'#'5+
1he followlng Lables have Lable malnLenances assoclaLed wlLh Lhem.
!#=5+ 0+%1"2&(2'$
Zu1_l1PCS1S l1 hosLname and descrlpLlon
Zu1_l1A1PS l1 hosLname and flle paLh mapplng
Zu1C_l1vA8uL1 l1 varlanL mapplng Lo lnclude server, paLh, fLp meLhod, username and
password
Zu1C_l1vA8lAn1 l1 varlanLs

You might also like