【崗位說明書】SAPABArogrammingIntroduction
【崗位說明書】SAPABArogrammingIntroductionznnonIntroduction to ABAP/4Author:Date:Dec, 2002一 OverviewSAP/R3的鷹用程式是在 ABAP Workbench璟境中,使用的程式言吾言 SAP命名懸 ABAP/4(Advanced Business Application Programming),依不同的功能,程式型魅(Program Type)可分成:Type 1Type 1程式軌行謾程首先H User輸入?yún)?shù)在輸入逗攆重面上,根擄數(shù)僚件自Database中H取資 料,最彳爰符結(jié)果示在輸出重面上 ,道槿程式在 SAP上通常幸艮表程式(Reports),你也可以在程 式中使用Submit指令去軌行另一支幸艮表程式,符輸入?yún)?shù)傅入.Type M使用重面程序控制(Screen flow logic control)慮理程式不同功能,軌行需使用Transaction code感程式 的第T固重面(Initial screen),慮理的重面要使用Screen Painte褸tF工具,整彳固程式由官午多的screen所成,也被耦作懸 module pools.Type FType F 程式包含數(shù)彳固Function modules ,不能由transaction code感回J而是另一支程式所呼叫軌行,因可包含算午多的Function modules, 也被耦作懸 Function groups .使用的工具懸Function Builder .Type K不能由 transaction code改勤,包含數(shù)彳固 global classes , Type K 程式class definitions .使用 Class Builder 懸工具.Type J同檬不能由 transaction code改勤,包含數(shù)彳固 global interface , Type K 程式interfacedefinitions .使用 Class Builder 懸工具.Type S不能由transaction code改勤,包含數(shù)彳固副程式 (subroutine), Type S程式耦懸 subroutine pool ,不能包含screen敘述.Type IABAP program 使用 INCLUDE 指令符Type I程式includes,目的在減少程式石房,可以在另Type I的程式包含迤來,通常使用在資料宣告及程式K ABAP Statement附注明(Comments):在每列程式的第一偃I位置檄明*或在同一列的任一位置以 "檄示.程式每列第一偃I字必須是 ABAP指令,如write Test program每列程式的最彳爰必須以.檄示程式結(jié)束.指令的型魅可分成:宣告U料(Declarative Statements)宣告程式孰行所需燮數(shù)名耦,如TYPES, DATA, TABLES模宣告指令(Modularization Statements)在ABAP程式中宣告111敘述:? Event KeywordsAT SELECTION SCREEN, START-OF-SELECTION, AT USER-COMMAND? Defining keywordsFORM .ENDFORM, FUNCTION . ENDFUNCTION, MODULE . ENDMODULE.控制指令(Control Statements)根摞資料值修彳行程序 ,如IF, WHILE, CASE呼叫指令(Call Statements)呼叫模程式敘述 (modulation statement), 如 PERFORM, CALL, SET USER-COMMAND,SUBMIT, LEAVE TO算指令(Operational Statements)軌行資料的算如WRITE, MOVE, ADDIt料康指令(Database Statements)軌行資料康槽案的It理,可使用Open SQL或Native SQL言吾法.Open SQLOpen SQL 依循檄型SQL92言吾法,透謾資料康介面至資料理資料 ,如SELECT, INSERT, and DELETE.但不包含WWI定薪吾法,如 CREATE TABLE 或 CREATE INDEX.Native SQLNative SQL 直接存取資料康不透謾資料康介面,在一月的ABAP程式3t不使用.只使用在某些特殊資料康虞理,如Data Dictionary 即是使用 Native SQL 去Create TableCreating and Change Program Using ABAP Editor使用 ABAP Editor 直接來褊It程式,軌彳T Transaction code SE38(Tools-> ABAP Workbench -> User Interface -> ABAP Editor).Prog ranfCHOU804Crea teSubobjecrs/Source codeVar iani5 AttributesIkicLmEnrati on Q Text elementsDi 印 lay ) Cha 曄.Source CodeABAP程式重面Variants定兼程式軌行畤輸入楠位的值,存入指定Variant名耦,軌行程式日寺可供逗取Attributes(1) .Title:程式描述或功能明(2) .Type :Execute mode: 1: Stand-along Program 如 Reports1: Include ProgramM: Module PoolF: Function GroupS: Subroutine Pool(3) .Status :Program development status: P: SAP standard production programK: Customer production programS: System programT: Test program(4) .Application: 程式所腐的 application module, 如 F 表 Financial acounting(5) .Development class:用於同一 SAP系統(tǒng)中各彳固program,用於停至另一 SAP系統(tǒng),測封港1式可 使用$TMP? Documentation撰K程式相信封的程式文件.? Text elements指定程式text elements 的內(nèi)容,用在程式軌行日寺的輸入提示敘述或幸艮表輸出Begin to Writing ABAB Program以撰示系統(tǒng)日期日寺的程式卷例,需求輸出卷This is my first ABAP ProgramSystem Date: 12/29/2002System Time: 16:58:51Step1: Assign Program Name孰彳T Transaction code SE38(Tools-> ABAP Workbench -> User Interface -> ABAP Editor).Piogratn SCH0120020011g) Create5ubot)jECt59 5口um code怕 r iants口 kttrilbutesUocumentatwn/ Tux t elecaentsq Di splay 夕 ChangeIt入程式名耦懸 ZCHOU2002001,第一偃I字母 Z或丫表Add-on Program, 按n CreateStep2: Edit Program Attributionft入 Title, Type 及 Status 彳爰按號A3AP: Program ATtiibutes 2noJNtlK口口: ChanEeStep3: Assign Development ClassLocal object如果目的,逗擇ft 入指定的 Development Class,Step4: Writing Program SourceReportZCHOU2002001Inactv.第同 百扇ii匾 畫面 EEPORT ZCHOU200200r.可RITE: / This is iy first ABAP progran1.可RITE: / System Date: 1 ,SY-DATIJM .可RITE; / System Tli: 1 PSY-UZEIT.WRITE指令懸符之彳爰的資料輸出在蟄幕上,加上/表示跳列Step5: Statement Syntax CheckProgram-Check-> Syntax check 或按Ctrl + F2檢查言吾法是否瓢嵌 ,需完全沒有嵌程式才 可孰行.Step6: Save ProgramSProgram-Save 或按 Ctrl + S I?存程式.Step7: Active ProgramProgram->Active 或按 Ctrl + F3 Active 程式,如果程式未 Active 同M堇能使用 ABAP Editor 軌 行,不能使用Transaction code 或由另一程式呼叫.Step8: Execute ProgramSProgram-> Execute 或按 F8 軌行程式.Step9: Display Result如果程式至It出重面II示結(jié)果:_ 白| qe曰聞圈|豹的電團(tuán)_國Tra in ing ProgramTraining ProgramThis is iy first ABAP proeranSystem Date: 11/29/2002System Tine: 16:58:51Step10: Left Display Screen按下 或F3回Source Screen, 恭喜你!你已完成彳第一偃I ABAP/4 Program.Dat Data TypeSAP的H料型熊名耦最是:& 30他I字元,使用型熊可分成三H :Predefined Data Type由SAP系統(tǒng)定兼的資料型熊,做懸程式中資料宣告及槽案楠位型熊,有下列黑槿:TypeLengthRangeInitial ValueDescriptionC11-65535ByteSpace字串資料,如Program F88Byte0浮黑惻P81-16Byte0Packed數(shù),用在小數(shù)黑占數(shù)I4-2人31 至 2A31-10整數(shù)N11-65535Byte00 0數(shù)值所成的字串D88ByteOooooooo 日期資料,格式潟1 YYYYMMDDT66Byte000000 日寺資料,格式熱HHMMSSX11-65535ByteX00 16迤位數(shù)STRINGDynamic 1-65535ByteSpaceJI度不固定的字串Local Data Type in Program用在程式中宣告自定的資料型魅,使用TYPES指令宣告TYPES <T> TYPE <type> / LIKE <object>Example:TYPES: length TYPE I.Example:TYPES: name(10) TYPE C.Example:TYPES: BEGIN OF person,Name(10)TYPEC,Tel(25)TYPE C,END OF person.Example:TYPES ty_p TYPE p.DATA gv_p TYPE ty_p.gv_p = 1.Data Type in ABAP DictionaryU料型熊名耦由 ABAP Dictionary(Transaction code SE11) 定H ,冢 rans pa rmt" taliTeVBAKActiveShort descriptionAttributesSales DocLiienc. Headei EataFitldspicM type Eaca Type山.Chtc .Short rtAtGVLDTGffLDT _DATS8juarantee dateSUEKISUBHI SD CHAR10Collective number (5D)L1FSELIFSK CHAR2TVLSDeliveiy block (document header)1F螳罪卡缺、一2TVFSBilling block in 5D dociuinentHETURWETPR AK CURE J)15Net Value of the Sales Order in Duct皿ent Qjriency叫 EEK_諭ERK _匚呼/5 Tme5D document currency?K0RGHVKORG CHAR4ITOSales DrianisatiDiiPTIEGHVTVEG CHAR2TVKQVDistribution channtlASPAR!IDSPART CHAR2TVTADivision*園尋同lg囪New rowsD& e element/Di red typefields CuTiencquan:. fieldi如上6I檄示資料型熊名耦懸VBAK-NETWR, 是度及其它腐性在 Data Element NETWR_AK ”定兼Data ObjectsData Objects 存在於程式軌行期(run time),在程式中先宣告 Object Name,自U料康槽案或程式算得到的結(jié)果都要先存入Data Object中供程式其它指令軌行.二 Literals以下是合法的資料表示:Numeric Data1000-3500125.56 12E2 ?小數(shù)黑占數(shù)及科擘符虢瓷料前彳爰必以Text DataNeihu, Taipei Kenny "s Document 字串前彳爰必須以 檄示.Text Symbols在ABAP Editor中的 Text Elements指定,Symbol ID 篇3礁,曾瞬上自001 始褊礁Pros 整國ZCIDV2002002ActiveTcjst( 5rIrction trargLi it hrgdtngi團(tuán)花畫闞國道Text> 1 ti El cc tram c Inc JIdiLen rn0(Ino-LEH.0如上6I靶例,程式中使用懸WRITE:/ text-001.慚出結(jié)果左y :Delta Electronics Inc,Variables名耦最是懸30 Character,第一偃I字元必懸英文字母 避免使用特殊符虢,使用DATA指令宣告:(A-Z),由文數(shù)字及特殊字元成 ()所!成,Example:DATA: age TYPE I.Predefined data type 使用 TYPEExample:DATA: money LIKE VBAK-NETWR.Dictionary Object 使用 LIKEExample:DATA: BEGIN OF ADDRESS,CITY(20)TYPEC,STREET(30)TYPEC,TELLIKEADRC-TELFX,END OF ADDRESS.宣告 Structure ADDRESS 包含 CITY ,STREET,TEL 楠位.* ConstantsConstants懸在程式中所指定的固定值名度最是30彳固字兀Syntax:CONSTANTSVALUEExample:CONSTANTS:Example:CONSTANTS<Object> TYPES / LIKE <data type> DECIMALS n<const> / VALUES IS INITIALcompany LIKE VBAK-BUKRS VALUES TW00pdate TYPES D VALUES SY-DATUM.Predefined Data Objects由SAP系統(tǒng)定兼的 Data Objects, 如:SPACEData Type 篇C, 度1彳固字元,是T固Constant, 值懸空白字元System ObjectSY-SUBRC系統(tǒng)軌行傅回值,0表示成功SY-UNAME logon 巧SY-DATUM 系統(tǒng)日期SY-UZEIT系統(tǒng)畤SY-TCODE目前的 transaction code得知所有 System Object可至 Dictionary 查Structure SYSTProcessing DataAssign ValueSyntax:MOVE <F1> TO <F2>> F1的值存至燮數(shù) F2中,也可K成 F2 = F1Example:MOVE MONEY TO M_NAME.M_NAME = CHERSyntax: MOVE-CORRESPONDING <Struc1> TO <Struc2> > Structure <Struc1>所有楠位內(nèi)容存至 Structure <Struc2>相同名耦楠位中Example:DATA: BEGIN OF ADDRESS, FIRSTNAME(10)VALUELULU,LASTNAME(10)VALUECHOU,TEL(12) VALUE 4660570 , END OF ADDRESS.DATA:BEGIN OF NAME, FIRSTNAME(10), LASTNAME(10), E_MAIL(30), END OF NAME.MOVE-CORRESPONDING ADDRESS TO NAME. NAME-FIRSTNAME 建成 LULU , NAME-LASTNAME 建成 CHOU 而NAME-E_MAIL 即不燮Syntax:MOVE <F1>+<O1> TO <F2>+<O2>Example:DATA: F1(10) VALUE ABCDEFGHIJ .F2(5).5偃I字元F2 = F1+3(5). 自第4偃I位置始取出F2的內(nèi)容曾建成 DEFGH哆 Initial Variable ObjectsSyntax: CLEAR <f>清除燮數(shù)現(xiàn)在內(nèi)容,恢彳復(fù)成初值Example:DATA N TYPE I VALUE 100.CLEAR N.燮數(shù)N的內(nèi)容建成 0I 可 Numeric Operand*乘幕* 乘/除+加- 3成DIV整數(shù)除法MOD繪數(shù)除法在算符虢前彳爰至少需一偃I空白字元.Example:Amount = Qty * Price.鄉(xiāng) Numeric Function1.ABS( N ):?;財?shù)值N的觸射值2.SIGN( N ):1 if N > 00 if N = 0-1 if N < 03 .CEIL(N):傅回大於數(shù)值 N的最小整數(shù)Example:WRITECEIL(-5.65)印出 500WRITECELL(4.54)印出 5.004 .FLOOR(N):傅回小於數(shù)值 N的最大整數(shù)Example:WRITE FLOOR(-5.65) 印出 600WRITE FLOOR(4.54)印出 4.005 .TRUNC(N):?;財?shù)值N的整數(shù)部分Example:WRITE TRUNC(5.65) 印出 5.006 .FRAC(N):停回數(shù)值 N的小數(shù)部分Example:WRITE FRAC(5.65)印出 0.657 .COS(A),SIN(A),TAN(A):?;厝呛瘮?shù) cos A, sin A, tan A 的值,A 懸蟀度量8 .EXP(N):?;?eAN 值9 .LOG(N):停回 log eN 值10 LOG10(N): ?;?log N 值11 .SQRT(N):停回N的平方根值Date and Time Data Calculation1 .日期資料的算日期資料可以直接算,如加法輿減法的算Example:DATA: Mdata TYPE D.Mdate = SY-DATUM. “如?;?19971015Mdate+6(2) =01 Mdate 建成 19971001Mdate = Mdate - 1 “Mdate 建成 199709302 .日寺資料的算日寺格式懸hhmmss,如 212030 表21:20:30Example:DATA: HOURS TYPE I,MINUTES TYPE I,T2 TYPE T VALUE 200000 T1 TYPE T VALUE 183000 HOURS = (T2 - T1) / 3600.算有黑小日寺MINUTES = (T2T1) / 60. 算黑分金童T2 T1得到結(jié)果的軍位懸秒String Object CalculationShifting field contentsSyntax:SHIFT <c> BY <n> PLACES <modes> <modes> : (1).空白,字串往左移一位.LEFT,字串往左移 n位(3) .RIGHT,字串往右移 n位(4) .CIRCULAR:字串以璟狀方式移位Example:DATA STRING(10) VALUE ABCDEFGHIJ .SHIFT STRING.得至U BCDEFGHI SHIFT STRING BY 2 PLACES RIGHT. 得至U ABCDEFGH2.Replacing field contentsSyntax:REPLACE <string1> WITH <string2> INTO <c> 月等字串 <c>中的<string1> 以<string2> 來取代Example:DATA: STRING(10) VALUE ABCDEFGHI ,STR1(3) VALUEDEF,STR2(3) VALUE123.REPLACE STR1 WITH STR2 INTO STRING. WRITE / STRING.得至U ABC123GHI3.Converting to uppercase or lowercase characters Syntax:TRANSLATE <c> TO UPPER CASE.傅成大嘉TRANSLATE <c> TO LOWER CASE.傅成小嘉4.Searching character stringSyntax:SEARCH <c> FOR <str>Example:DATA STRING(10) VALUEABCDEFGHIJ .曾回存至廂固 System Object, SY-SUBRC 和 SY-FDPOS,若找到HU SY-SUBRC 熱 0 SY-FDPOS 存始位置,若找不到HU SY-SUBRC 熱 4, SY-FDPOS 熱 05.String length STRLEN(<c>)Example:LEN = STRLEN( XYZABC ).得到6LEN = STRLEN( ABC). 得至 U 36.Substring<f>+<o><l>Example:DATA T(10) VALUEABCDEFGHIJ .WRITE / T+2(4). “得到 CDEF7 .Condencing character stringSyntax:CONDENSE <String> NO-GAPS去除<String>前彳爰的空白字串,加上參數(shù) NO-GAPS表去除<String>中的所有空白 Example:DATA: NAME(20) TYPE C VALUEGreen Tea! .LEN = STRLEN(NAME).“得到20CONDENSE NAME.LEN = STRLEN(NAME).“得到10CONDENSE NAME NO-GAPS.WRITE:/ NAME.得到的結(jié)果是 GreenTea! 是度建成 98 .Concatenating character fieldsSyntax:CONCATENATE <str1> <str2> INTO <str0> SEPARATED BY <deli> 合伊 <Str1> 和 <Str2> 至 <Str0>,力口上SEPARATED BY <deli> 可以 <deli> 分隔 Example:STR1 = NEIHU .STR2 = TAIPEI .CONCATENATE STR1 STR2 INTO NAME.WRITE: / NAME.結(jié)果懸 NEUHUTAIPEICONCATENATE STR1 STR2 INTO NAME SEPARATED BY SPACE.WRITE: / NAME.結(jié)果懸 NEUHU TAIPEI9 .Splitting character fieldsSyntax:SPLIT <str0> AT <deli> INTO <str1> <str2>依字元<deli>分割字串<str0>懸<Str1>和<Str2>Example:NAME = NEIHU ,TAIPEI . .SPLIT NAME AT, INTO STR1 STR2.WRITE:/ STR1.WRITE:/ STR2.結(jié)果NEIHUTAIPEIFlow ControllingPComparedOperand1.二或EQ:等於2.或或NE:不等於3.或LT:小於4.二或 LE:小於等於5.>或GT:大於6.>=或 GE:大於等於7.AND:且8.OR:或9.NOT:非Branch Cointrolling1.IF述敘Syntax:IF <Condition1>.Statement 1 >ELSEIF <Condition2>.Statement 2>ELSEIF <Condition3>.Statement 3>.ELSE.else Statement >ENDIF.Example:IF 3 > 8.WRITE /3 is less than 8ENDIF.2. CASE敘述Syntax:CASE 燮數(shù) f>.WHENValue1>.Statement。WHEN <Value2>.<Statement2> .WHEN OTHERS.others StatementENDCASE.Example:S = A.CASE S.WHENX.WRITE /String is X .WHEN A.WRITE /String isA.WHEN OTHERS.WRITE /String isOTHERS .ENDCASE.根擄I Variable S的值(A),得到輸出結(jié)果懸String is A包L Loop ControllingSyntax:WHILE Condition.Statement BlockENDWHILEExample:I = 1.S=0.WHILE I <= 10.S = S+I.I=I+1.ENDWHILE.WRITE: / 1+2+3+ +10= ,S軌行結(jié)果懸:1+2+3+10=551. SY-INDEXSY-INDEX 懸言己金氮1圈次數(shù)的 System Object. Data type 懸整數(shù)型魅2. Skip to next loopCONTINUE跳至迥圈的下一次Example:I = 1.WHILE I <= 3.IF SY-INDEX = 2.CONTINUE.WRITE: / SY-INDEX.ENDIF.I = I + 1.ENDWHILE.軌行結(jié)果:133. Condition check for next loopCHECK <Condition>CHECK修件成立才畿往下軌行迥圈Example:I = 1.WHILE I <= 5.4.CHECK SY-INDEX BETWEEN 2 ANDWRITE / SY-INDEX.ENDWHILE.軌行結(jié)果:2344. Terminated from loopEXIT跳雕迥圈敘述Example:I = 1.WHILE I <=10.IF SY-INDEX = 4.EXIT.ENDIFWRITE / SY-INDEX.ENDWHILE.軌行結(jié)果:1Output and Input CommandsWRITE command蟄幕上ft出 Data Object內(nèi)容Syntax:WRITE / <Object> ParametersExample:WRITE This is sampleWRITE: COMPANY: :STFL-CARRID.Represent positionSyntax:WRITE / <pos> (<len>) Object/ :先往下一列pos :蟄幕X軸座檄(len): 示資料的是度Example:WRITE / 6 Second Line.輸出結(jié)果:Second LineExample:DATA: NUMBER TYPE I VALUE 1234567890 TEXT(10) VALUE ABCDEFGHIJ .WRITE: /(5)NUMBER.WRITE: /(6)TEXT.輸出結(jié)果:*7890 aaaABCDEF字串資料由左至右取出5偃I字元Output FormattingSyntax:WRITE <Object><Format> Parameters:LEFT-JUSTIFIEDCENTERED<Format>資料靠左II示資料靠中示資料靠右II示在資料項<g>的X*蠅O臺座檄IK示聚接著II示,不留空格使用內(nèi)嵌字元I1示 ,如11:20:30不使用內(nèi)嵌字元數(shù)字前面0的部分不I1示不II示正I1虢II示d位小數(shù)位數(shù)F(浮黑占矍攵)exponent的值四拾五人至小數(shù)位數(shù)下r位整別II示日期示格式RIGHT-JUSTIFIEDUNDER <g>NO-GAPUSING EDIT MASK <m>USING NO EDIT MASKNO-ZERONO-SIGNDECIMALS <d>EXPONENT<e>ROUND <r>CURRENCY <c>DD/MM/YYMM/DD/YYDD/MM/YYYYMM/DD/YYYYDDMMYYMMDDYYYYMMDDExample:DATA: X TYPE I VALUE 112030, A(5) VALUE ABCDE .WRITE X USING EDIT MASK It出結(jié)果懸 11:20:30WRITE X USING EDIT MASK $,It出結(jié)果懸 $112,030SKIP commandSyntax:SKIP <n>罩褐一偃I SKIP曾生一偃I空白列Example:WRITE PASS1.SKIP.WRITE PASS2.輸出結(jié)果:PASS1PASS2Display icons可以H示R/3系統(tǒng)所提供的符虢或圃示Syntax:WRITE <symbol-name> AS SYMBOLWRITE <icon-name> AS ICONExample:INCLUDE <SYMBOL>INCLUDE <ICON>WRITE: / Phone Symbol:, SYM_PHONE AS SYMBOL.WRITE: / Alarm Icon: , ICON_ALARM AS ICON.軌行結(jié)果:Phone Spmbol:雙Alarn Icun:如要查看系統(tǒng)所提供有那些符虢及圃示,可逗攆 Edit”下的 Pattern ”,逗攆WRITE ”接下來1攆要查的群 ,如SYM_*或ICON*,按下拉查前即可.Asscnib lc a WRITE Sts /II can sin 1 i q M Copy 赦 Display InitializeIconNamePrints blOntput frocaICOH_NEXr_VALUE ICON PREVIOUS VALUEyyFidiconIejecute.objectVWol|5YM_*ICOf_SELECT_SrULICOK_PRINTICOH_CDPy_比犯口1ICOW_tl/1/3 LineLINE *ICOH SORT DOWVCheckbsx1COM S3RTJPIOT SEARCHICON INSERT ROW11/Ol tpiu t toII/XStruct-t口 naw J ine_| Ttii thcut liai 1 ing blankICOlf_DELETE_RO1 ICOf_OiAUGE_TEXr IC01T_CREiTE_IEXr icoujisplayjekt ICOK.ANNOTATION ICOJ.CREiTEJIOTE ICOlf.DISPLAY HOTE ICOlf ADDRESS81/1/1/undtr fid1/aKColor HcOL_*I COILGRAPH ICS ICOIJNFDRSATIOW ICON_CALCULATIOWit/| Intcnsi f icd display1 Invtrse displayDi splay Es inpu t fi =!d/ l/.*LDi splay . hotsuDt/ aoose M fflnm>n多 Display data as check box以字串資料內(nèi)容的第一偃|字元懸CHECK BOX的輸出,如果是空白,CHECK BOX 示懸空白,相反HUil示X ,可用在暹輯判H檢查Syntax:WRITE <Object> AS CHECKBOX.Example:DATA:FLAG1 VALUE.FLAG2 VALUEX:WRITE: /CHECK FLAG 1:,FLAG1ASCHECKBOX.WRITE: /CHECK FLAG 2:,FLAG2ASCHECKBOX.軌行結(jié)果:CheckFlag 1: rCheckFlag 2:一 PARAMETERS command基本的輸入命令,似如BASIC的INPUT命令,It入 Data object內(nèi)容,但瓢法使用 F(Floating)資料格式Syntax:PARAMETERS <p> LIKE <Object> DEFAULT <f> LOWER CASEOBLIGATORY AS CHECKBOXRADIOBUTTON GROUP <rad>Example:PARAMETERS:NAME(8),AGE TYPE I,BIRTH TYPE D.軌行結(jié)果:NAIVEl.lLtfAGE32BIRTHUSfVn/19f>6在日期的 It 入格式上懸MM/DD/YY, MM/DD/YYYY , MMDDYY或 MMDDYYYY ,如It入 020165 表 1965 年 02 月 01 日,輿 02/01/65的輸入是一檬的,日期輸入靶圉懸西元1950年至2049年LIKE指定輸入箭逗逗攆懸<Object>資料內(nèi)容Example: PARAMETERS: MID LIKE VBAK-VBELN.DEFAULT定輸入的51值Example: PARAMETERS:COMPANY(20) DEFAULT DELTA ,BIRTH TYPE D DEFAULT 19650201 .LOWER CASEABAP/4 J1骰:是符字串輸入值自勤醇換卷大K,加上此參數(shù)曾符輸入的資料醇成小K ,OBLIGATORY弓金制要求輸入,螯幕上曾出現(xiàn)一彳固 ?,使用者必要輸入值.AS CHECKBOX輸入CHECKBOX的格式Example: PARAMETERS: TAX AS CHECKBOX DEFAULT X, NTD AS CHECKBOX.軌行結(jié)果:g : TAX | IM TORADIOBUTTON GROUP <rad>It入 RADIO BUTTON GROUP 的方式Example:PARAMETERS: BOY RADIOBUTTON GROUP SEX DEFAULT X,GIRLRADIOBUTTON GROUPSEX.軌行結(jié)果:BOYffGIRLCSELECT-OPTIONS command修件甄圉輸入重面指令,Syntax:SELEC-OPTIONS <check-option> FOR <table-field>Example:TABLES SPFLI.SELECT-OPTIONS AIRLINE FOR SPFLI-CONNID.符修件的It入值存放入AIRLINE,箭國圜載 SPFLI中的CONNID楠位軌行結(jié)果:Selediora options如 RUNE可直接輸入起始靶圉或按下逗擇重面,輸入完彳爰按下左上角的軌行HFrom search help按下輸入1的右遏往下箭H,叫出育德量巽擇楠位 Table中資料XK ,逗取始和結(jié)束的甄圉Selection Options軌行日寺按下Edit”-> Selection options ”輸入Option及Sign 11數(shù)內(nèi)容,蟄幕如下M IDDescriptionSingle valueGreatei than ci equal toLt5 5 tWn 口 i rquml toGreatei thanLr5 5 tlianNat equal to_ Ik,.105Elec1: | Ek elude frcim 弓2 1,2匚 tiu Multi-Options按下最右遏的4 H,輸入僚件逗取的甄圉,重面如下O Single s OOQO Sinfile a I s ,<? Rarges可輸多彳固不速值或修件靶圉,修件輸入完彳爰按下口DEFAULT定始結(jié)束甄圉輸入51值Example:SELECT-OPTIONS: AIRLINE FOR SPFLI-CONNIDDEFAULT2042 TO 4555NO-EXTENSION骰:定不要Multi-Option ft入重面NO INTERVALS定不要甄圉輸入重面LOWER CASE輸入醇換成大癮OBLIGATORY弓金制要求輸入SELECTION-SCREEN command如外框等.SKIP <n>SKIP 2.ULINE / <pos>(length)ULINE /10(30).30的底BEGIN OF BLOCK <block> FRAME TITLE <title>.END OF BLOCK <block>.BEGIN OF BLOCK RADIO WITHFRAME.崖生輸入重面的效果Insert space lineSyntax:SELECTION-SCREENExample:SELECTION-SCREENfg生雨列空白列Under scoreSyntax:SELECTION-SCREENExample:SELECTION-SCREEN自第10格始生辰度Printing block panelSyntax:SELECTION-SCREENWITHSELECTION-SCREENExample:SELECTION-SCREENPARAMETER R1PARAMETER R2PARAMETER R3SELECTION-SCREENRADIOBUTTONGROUPGR1.RADIOBUTTONGROUPGR1.RADIOBUTTONGROUPGR1.END OF BLOCKRADIO.int Internal TablesABAP/4的Internal Table如同其它言吾言的 Array資料結(jié)情,由言午多具有相同楠位的言己金泉所仙成,在程式孰行中存於系統(tǒng)制隨ft,在慮理上可以有,刪除,新增插入等功能.自 SAP R/3 4.0 彳菱 Table type 可分成:Standard TableStandard table 具有 internal linea門ndex ,在U料H取日f可藉由 index 或 key field 至U料位置,key field可指定懸可重覆值(non-unique)或不可重覆值,所以在增加新言己金翱寺速度較快,但H取U料祝 table4圖肇數(shù)而定,Mtm愈多,速度愈慢.Sorted Table同檬也具有internal linear index ,在U料H取日f可藉由 index或key field 至U料位置,在key field 可指定懸可重覆值(non-unique)或不可重覆值,U料取速度相封 standard table較快,新增加言己金錄 日寺由於key field 故較慢.Hashed Table沒有internal linear index , U料取日寺藉由 key field 做二元搜尊(binary search),搜尊速度不受4 1sli 數(shù)影!是固定的,key field 一定要指定懸不可重覆(unique),較遹合用在大量肇數(shù)的internal table M理.sapDB table 分為三種類型:1 .透明表(Transp table ),這個表中的字段是與數(shù)據(jù)庫里的字段一一對應(yīng),是最常用,最多的表例如:Mara2 .共享表Pooled Table 在數(shù)據(jù)庫里的存儲是存儲到一個表中,存儲是多對一的關(guān)系,可能多個Pooled Table存儲到一個數(shù)據(jù)庫表。例如:A004,A005Cluster Table 存3 .聚集表 Cluster Table 和Pooled Table 一樣,存儲也是多對一的關(guān)系,區(qū)別是Cluster Table儲關(guān)鍵字段(鍵),其中有一個字段存儲了Cluster Table的其它字段。注意一點:除主鍵其它字段不能寫其它表進(jìn)行連接(join )。例如:BSEG(BSEG于一般的透明表不同,它是一個簇表。對于一個簇表來說,除了 主鍵項目外,其他項目都被編輯到一個長文本項目