ABAP课堂笔记

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

message'HELLOKETY'type'i'.messagei338(bc400)with'hello'kety''hello'.WRITE:/'HelloKety1',(/'HelloKety2',/'HelloKety3',/'HelloKety4'.Dataintitypeivalue100相同PARAMETERint2TYPE1default200.(不只占内存,运行时系统为用户设置一个输入屏幕。)PARAMETERint2TYPEiDEFAULT200.Dataintitypeivalue100.WRITE/'HelloKety1'.WRITE/'HelloKety2'.WRITE/'HelloKety3'.WRITE/'HelloKety4'.inti=inti+1.WRITE:/'inti=',inti.WRITE:/'int2=',int2.S打头的都是sap公司的东西。航空公司表:(se11)ClientID:MANDTREPORTz00_tabletest_08.DATAwaTYPEz00_scarr_08.wa-carrid='CSA'.wa-carrname='ChinaSouthernAirline'.insertintoz00_scarr_08valueswa.WRITE:/wa-carrid,/wa-carrname.插入语句:INSERT{{INTOtargetVALUESsource}|{targetFROMsource}}.REPORTz00_tabletest_08.DATAwaTYPEz00_scarr_08.PARAMETERmycarridtypez00_scarr_08-carrid.PARAMETERmycntypez00_scarr_08-carrname.wa-carrid=mycarrid.'CSA'.wa-carrname=mycn.'ChinaSouthernAirline'.insertintoz00_scarr_08valueswa.WRITE:/wa-carrid,/wa-carrnameAbap中的三有三无。没有for循环,没有布尔类型。(只有X表示true,没有X则表示false)没有数组,只有一个数组结构叫做内表(internaltable)。内表属性:1.行类型linetype2.表键keydefinitiona.表键的构成字段b.构成表键字段的顺序c.表键是否唯一(unique/non-unique)3.访问类型dataaccesstype标准表无序,可以通过编程修改。练习:建一个学生表。前缀_student_后缀。ManidStudentid(char11)-Name(char8)Sex(char6)Birthday(char)Tel编程:利用刚刚的透明表,作为一个内表的行类型,定义一个内表。Studentid和name作为tablekey。各添加10条记录。内表中,用*&---------------------------------------------------------------------**&ReportZ00_SUBROUTINE_08*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORTz00_subroutine_08.PARAMETER:int1TYPEiDEFAULT1,int2TYPEiDEFAULT100.dataireturntypei.PERFORMsum_numberUSING15CHANGINGireturn.write:/ireturn.PERFORMsum_numberUSINGint1int2CHANGINGireturn.write:/ireturn.*&---------------------------------------------------------------------**&Formsum_number*&---------------------------------------------------------------------**text*----------------------------------------------------------------------**--P_INT1text*--P_INT2text*--P_INT3text*----------------------------------------------------------------------*formsum_numberusingp_int1p_int2changingp_int3.dataisumtypei.dataibegintypei.ibegin=p_int1.WHILEibegin=p_int2.isum=isum+ibegin.ibegin=ibegin+1.ENDWHILE.p_int3=isum.endform.sum_number\老师的:(一)REPORTzg08_db_test_01.DATAwaTYPEzg08_scarr_01.DATAitabTYPETABLEofzg08_scarr_01.START-OF-SELECTION.SELECTSINGLE*FROMzg08_scarr_01INTOwaWHEREcarrid='AA'.IFsy-subrc=0.WRITE:/wa-carrid,wa-carrname.ENDIF.(二)REPORTzg08_db_test_01.DATAwaTYPEzg08_scarr_01.DATAitabTYPETABLEofzg08_scarr_01.START-OF-SELECTION.SELECTSINGLE*FROMzg08_scarr_01INTOwaWHEREcarrid='AA'.IFsy-subrc=0.WRITE:/wa-carrid,wa-carrname.ENDIF.(三)REPORTzg08_db2_test_01.DATAwaTYPEzg08_scarr_01.DATAitabTYPETABLEOFzg08_scarr_01.START-OF-SELECTION.SELECT*FROMzg08_scarr_01INTOwaWHEREcarrid='00'.WRITE:/wa-carrid,wa-carrname.ENDSELECT.(四)REPORTzg08_fm_test_01.DATAirTYPEi.START-OF-SELECTION.CALLFUNCTION'ZG08_FM_SUM_01'EXPORTINGint1=100int2=2011int3=300IMPORTINGireturn=ir.WRITE:'themaximumnumberis:',ir.CALLFUNCTION'POPUP_TO_CONFIRM'EXPORTINGtext_question='Areyousureyouareok?'.IFsy-subrc0.ENDIF.(五)REPORTzg08_fm_test_01.DATAirTYPEi.START-OF-SELECTION.CALLFUNCTION'ZG08_FM_SUM_01'EXPORTINGint1=100int2=2011int3=300IMPORTINGireturn=ir.WRITE:'themaximumnumberis:',ir.CALLFUNCTION'POPUP_TO_CONFIRM'EXPORTINGtext_question='Areyousureyouareok?'.IFsy-subrc0.ENDIF.(六)*&---------------------------------------------------------------------**&ReportZG08_ITABLE_TEST_01*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORTzg08_itable_test_01.TYPES:BEGINOFmy_stru_type,carridTYPEscarr-carrid,carrnameTYPEscarr-carrname,carrurlTYPEscarr-url,ENDOFmy_stru_type.TYPES:myit_typeTYPESTANDARDTABLEOFsbc400foccWITHNON-UNIQUEKEYcarridconnidfldate.**************************************************************DATAitgTYPEsbc400_t_sbc400focc.DATAitlTYPEmyit_type.DATAitsTYPESTANDARDTABLEOFmy_stru_typeWITHNON-UNIQUEKEYcarridcarrname.DATAits1TYPETABLEOFmy_stru_type.***************************************************************DATAit_spfliTYPETABLEOFspfli.DATAwa1TYPEspfli.DATAwa4LIKELINEOFit_spfli.******************************************************************************************************************************DATAit_scarrTYPETABLEOFscarr.DATAwa2TYPEscarr.DATAwa3LIKELINEOFit_scarr.wa2-carrid='ABC'.wa2-carrname='ABC_name1'.*INSERTwa2INTOit_scarrindex1.APPENDwa2TOit_scarr.wa2-carrid='ABD'.wa2-carrname='ABD_name2'.APPENDwa2TOit_scarr.READTABLEit_scarrINTOwa3INDEX1.WRITE:wa3-carrid,wa3-carrname.================================================================*&---------------------------------------------------------------------**&ReportZ00_TSYMBOL_TEST_08*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORTz00_tsymbol_test_08.WRITE:/'HelloHope!'.WRITE:/text-090.WRITE:/'HelloHope!'.WRITE:/te

1 / 14
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功