用ABAP语言编写一个公司联系表,如下去,求大佬帮忙。谢谢
展开全部
REPORT YTEST_032.
TYPES:BEGIN OF TY_ADDRS,
LAND1 TYPE T001W-LAND1,"国家
REGIO TYPE T001W-REGIO,"省
CITYC TYPE T001W-CITYC,"城市
END OF TY_ADDRS.
DATA:GS_ADDRS TYPE TY_ADDRS,
GT_ADDRS TYPE TABLE OF TY_ADDRS.
TYPES:BEGIN OF TY_CONTACT,
TEL01 TYPE TELF1,
TEL02 TYPE TELF1,
TEL03 TYPE TELF1,
END OF TY_CONTACT.
DATA:GS_CONTACT TYPE TY_CONTACT,
GT_CONTACT TYPE TABLE OF TY_CONTACT.
DATA:BEGIN OF GS_NAME1,
T_ADRS LIKE GT_ADDRS,
T_CONT LIKE GT_CONTACT,
END OF GS_NAME1.
DATA:BEGIN OF GS_MAIN,
NAME1 LIKE GS_NAME1,
NAME2 TYPE C LENGTH 20,
NAME3 TYPE C LENGTH 30,
END OF GS_MAIN.
BREAK-POINT.
GS_ADDRS-LAND1 = 'CN'.
GS_ADDRS-REGIO = '190'.
GS_ADDRS-CITYC = '0001'.
APPEND GS_ADDRS TO GT_ADDRS.
GS_ADDRS-CITYC = '0002'.
APPEND GS_ADDRS TO GT_ADDRS.
GS_CONTACT-TEL01 = '13012345678'.
GS_CONTACT-TEL02 = '15900001111'.
GS_CONTACT-TEL03 = '17022223333'.
APPEND GS_CONTACT TO GT_CONTACT.
GS_CONTACT-TEL01 = '87654321'.
GS_CONTACT-TEL02 = '13866665555'.
GS_CONTACT-TEL03 = ''.
APPEND GS_CONTACT TO GT_CONTACT.
GS_NAME1-T_ADRS = GT_ADDRS[].
GS_NAME1-T_CONT = GT_CONTACT[].
GS_MAIN-NAME1 = GS_NAME1.
GS_MAIN-NAME2 = 'TEST'.
CHECK GS_MAIN IS NOT INITIAL.
*新建一个程序测试,把上述代码拷贝激活
*点击F8执行,调试界面双击GS_MAIN结构查看
TYPES:BEGIN OF TY_ADDRS,
LAND1 TYPE T001W-LAND1,"国家
REGIO TYPE T001W-REGIO,"省
CITYC TYPE T001W-CITYC,"城市
END OF TY_ADDRS.
DATA:GS_ADDRS TYPE TY_ADDRS,
GT_ADDRS TYPE TABLE OF TY_ADDRS.
TYPES:BEGIN OF TY_CONTACT,
TEL01 TYPE TELF1,
TEL02 TYPE TELF1,
TEL03 TYPE TELF1,
END OF TY_CONTACT.
DATA:GS_CONTACT TYPE TY_CONTACT,
GT_CONTACT TYPE TABLE OF TY_CONTACT.
DATA:BEGIN OF GS_NAME1,
T_ADRS LIKE GT_ADDRS,
T_CONT LIKE GT_CONTACT,
END OF GS_NAME1.
DATA:BEGIN OF GS_MAIN,
NAME1 LIKE GS_NAME1,
NAME2 TYPE C LENGTH 20,
NAME3 TYPE C LENGTH 30,
END OF GS_MAIN.
BREAK-POINT.
GS_ADDRS-LAND1 = 'CN'.
GS_ADDRS-REGIO = '190'.
GS_ADDRS-CITYC = '0001'.
APPEND GS_ADDRS TO GT_ADDRS.
GS_ADDRS-CITYC = '0002'.
APPEND GS_ADDRS TO GT_ADDRS.
GS_CONTACT-TEL01 = '13012345678'.
GS_CONTACT-TEL02 = '15900001111'.
GS_CONTACT-TEL03 = '17022223333'.
APPEND GS_CONTACT TO GT_CONTACT.
GS_CONTACT-TEL01 = '87654321'.
GS_CONTACT-TEL02 = '13866665555'.
GS_CONTACT-TEL03 = ''.
APPEND GS_CONTACT TO GT_CONTACT.
GS_NAME1-T_ADRS = GT_ADDRS[].
GS_NAME1-T_CONT = GT_CONTACT[].
GS_MAIN-NAME1 = GS_NAME1.
GS_MAIN-NAME2 = 'TEST'.
CHECK GS_MAIN IS NOT INITIAL.
*新建一个程序测试,把上述代码拷贝激活
*点击F8执行,调试界面双击GS_MAIN结构查看
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询