Chinaunix首页 | 论坛 | 博客
  • 博客访问: 232423
  • 博文数量: 17
  • 博客积分: 50
  • 博客等级: 民兵
  • 技术积分: 329
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-31 20:05
个人简介

linux kernal research

文章分类

全部博文(17)

文章存档

2023年(7)

2013年(10)

分类: 项目管理

2013-09-12 17:33:45


  1. *&---------------------------------------------------------------------*
  2. *& Report ZBCRP1_ZHAOYANG_009
  3. *&
  4. *&---------------------------------------------------------------------*
  5. *& 选择屏幕输入销售组织(单选)和销售订单创建日期(多选)
  6. *& 1.对选择屏幕输入销售组织的值进行有效性检查.
  7. *& 2.用ALV输出选择屏幕对应的: 销售组织(VBAK-VKORG)、销售订单号(VBAP-VBELN)、
  8. *& 销售订单行号(VBAP-POSNR)、销售物料号码(VBAP-MATNR)、销售订单数量(VBAP-KWMENG)、
  9. *& 发货单号码(LIPS-VBELN)、发货单行号(LIPS-POSNR)、发货物料号码(LIPS-MATNR)、
  10. *& 发货数量(LIPS-LFIMG)、基本单位(VBAP-MEINS)。
  11. *&
  12. *& date: 20130911
  13. *& developer: zhaoyang
  14. *&---------------------------------------------------------------------*

  15. REPORT ZBCRP1_ZHAOYANG_009.

  16. *申明类型池
  17. TYPE-POOLS: slis.
  18. *申明与数据库表同名的工作区
  19. TABLES: vbak, vbap, lips.

  20. *--------------------------------------------------------------------*
  21. *定义数据类型
  22. *--------------------------------------------------------------------*
  23. TYPES: BEGIN OF ty_out,
  24.   vkorg TYPE vbak-vkorg, "销售组织
  25. p_vbeln TYPE vbap-vbeln, "销售订单号
  26. p_posnr TYPE vbap-posnr, "销售订单行号
  27. p_matnr TYPE vbap-matnr, "销售物料号码
  28.  kwmeng TYPE vbap-kwmeng, "销售订单数量
  29. l_vbeln TYPE lips-vbeln, "发货单号码
  30. l_posnr TYPE lips-posnr, "发货单行号
  31. l_matnr TYPE lips-matnr, "发货物料号码
  32.   lfimg TYPE lips-lfimg, "发货数量
  33.   meins TYPE vbap-meins, "基本单位
  34. END OF ty_out.

  35. *--------------------------------------------------------------------*
  36. *定义数据对象 工作区 内表
  37. *--------------------------------------------------------------------*
  38. DATA: wa_out TYPE ty_out, "工作区
  39.       it_out TYPE STANDARD TABLE OF ty_out. "内表

  40. DATA: wa_layout TYPE slis_layout_alv, "布局
  41.       wa_fieldcat TYPE slis_fieldcat_alv,
  42.       it_fieldcat TYPE slis_t_fieldcat_alv. "内表传参

  43. DATA: wa_sort TYPE slis_sortinfo_alv,
  44.       it_sort TYPE slis_t_sortinfo_alv.

  45. *--------------------------------------------------------------------*
  46. *选择屏幕
  47. *--------------------------------------------------------------------*
  48. SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
  49.   PARAMETERS s_vkorg TYPE vbak-vkorg OBLIGATORY.
  50.   SELECT-OPTIONS d_erdat FOR vbap-erdat.
  51. SELECTION-SCREEN END OF BLOCK bl1.

  52. *--------------------------------------------------------------------*
  53. *主处理
  54. *--------------------------------------------------------------------*
  55. START-OF-SELECTION.
  56. *取数
  57. PERFORM F_SELECT_DATA.

  58. *设置alv的全局属性
  59. PERFORM F_SET_LAYOUT.

  60. *编辑同列名字段
  61. PERFORM ZY_FIELDCAT USING: '1' 'VKORG' '销售组织' 'X',
  62.                             '2' 'P_VBELN' '销售订单号' 'X',
  63.                             '3' 'P_POSNR' '销售订单行号' 'X',
  64.                             '4' 'P_MATNR' '销售物料号码' '',
  65.                             '5' 'KWMENG' '销售订单数量' '',
  66.                             '6' 'L_VBELN' '发货单号码' '',
  67.                             '7' 'L_POSNR' '发货单行号' '',
  68.                             '8' 'L_MATNR' '发货物料号码' '',
  69.                             '9' 'LFIMG' '发货数量' '',
  70.                             '10' 'MEINS' '基本单位' ''.

  71. **显示alv
  72. PERFORM F_SHOW_ALV.

  73. *&---------------------------------------------------------------------*
  74. *& Form ZY_FIELDCAT
  75. *&---------------------------------------------------------------------*
  76. * text
  77. *----------------------------------------------------------------------*
  78. * -->F_COL_POS text
  79. * -->F_FIELDNAME text
  80. * -->F_SELTEXT_L text
  81. * -->F_KEY text
  82. *----------------------------------------------------------------------*
  83. FORM ZY_FIELDCAT USING F_COL_POS
  84.                        F_FIELDNAME "列名字段
  85.                        F_SELTEXT_L "列名
  86.                        F_KEY. "X
  87.   CLEAR WA_FIELDCAT.
  88.   WA_FIELDCAT-FIELDNAME = F_FIELDNAME.
  89.   WA_FIELDCAT-SELTEXT_L = F_SELTEXT_L. "列名长文本
  90.   WA_FIELDCAT-COL_POS = F_COL_POS. "列的位置
  91.   WA_FIELDCAT-KEY = F_KEY.
  92.   WA_FIELDCAT-DO_SUM = 'X'. "求和
  93.   APPEND WA_FIELDCAT TO IT_FIELDCAT.

  94. ENDFORM. " ZY_FIELDCAT

  95. *&---------------------------------------------------------------------*
  96. *& Form SET_LAYOUT
  97. *&---------------------------------------------------------------------*
  98. * F_SET_LAYOUT
  99. *----------------------------------------------------------------------*
  100. FORM F_SET_LAYOUT.
  101.   WA_LAYOUT-ZEBRA = 'X'.
  102.   WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
  103. ENDFORM. " SET_LAYOUT

  104. *&---------------------------------------------------------------------*
  105. *& Form SELECT_DATA
  106. *&---------------------------------------------------------------------*
  107. * F_SELECT_DATA
  108. *----------------------------------------------------------------------*
  109. FORM F_SELECT_DATA .
  110. SELECT k~vkorg "销售组织
  111.        p~vbeln AS p_vbeln "销售订单号
  112.        p~posnr AS p_posnr "销售订单行号
  113.        p~matnr AS p_matnr "销售物料号码
  114.        p~kwmeng "销售订单数量
  115.        l~vbeln AS l_vbeln "发货单号码
  116.        l~posnr AS l_posnr "发货单行号
  117.        l~matnr AS l_matnr "发货物料号码
  118.        l~lfimg "发货数量
  119.        p~meins "基本单位
  120.   INTO CORRESPONDING FIELDS OF TABLE it_out
  121.   FROM vbap AS p
  122.  INNER JOIN vbak AS k ON k~vbeln = p~vbeln
  123.   LEFT JOIN lips AS l ON l~vgbel = p~vbeln AND l~vgpos = p~posnr
  124.  WHERE k~vkorg = s_vkorg AND k~erdat IN d_erdat.
  125. ENDFORM. " SELECT_DATA

  126. *&---------------------------------------------------------------------*
  127. *& Form F_SHOW_ALV
  128. *&---------------------------------------------------------------------*
  129. * F_SHOW_ALV
  130. *----------------------------------------------------------------------*
  131. FORM F_SHOW_ALV .
  132. " BREAK-POINT.
  133.   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  134.    EXPORTING
  135. * I_INTERFACE_CHECK = ' '
  136. * I_BYPASSING_BUFFER = ' '
  137. * I_BUFFER_ACTIVE = ' '
  138. * I_CALLBACK_PROGRAM = ' '
  139. * I_CALLBACK_PF_STATUS_SET = ' '
  140. * I_CALLBACK_USER_COMMAND = ' '
  141. * I_CALLBACK_TOP_OF_PAGE = ' '
  142. * I_CALLBACK_HTML_TOP_OF_PAGE = ' '
  143. * I_CALLBACK_HTML_END_OF_LIST = ' '
  144. * I_STRUCTURE_NAME =
  145. * I_BACKGROUND_ID = ' '
  146. * I_GRID_TITLE =
  147. * I_GRID_SETTINGS =
  148.      IS_LAYOUT = wa_layout
  149.      IT_FIELDCAT = it_fieldcat
  150. * IT_EXCLUDING =
  151. * IT_SPECIAL_GROUPS =
  152. " IT_SORT = it_sort
  153. * IT_FILTER =
  154. * IS_SEL_HIDE =
  155. * I_DEFAULT = 'X'
  156. * I_SAVE = ' '
  157. * IS_VARIANT =
  158. * IT_EVENTS =
  159. * IT_EVENT_EXIT =
  160. * IS_PRINT =
  161. * IS_REPREP_ID =
  162. * I_SCREEN_START_COLUMN = 0
  163. * I_SCREEN_START_LINE = 0
  164. * I_SCREEN_END_COLUMN = 0
  165. * I_SCREEN_END_LINE = 0
  166. * I_HTML_HEIGHT_TOP = 0
  167. * I_HTML_HEIGHT_END = 0
  168. * IT_ALV_GRAPHICS =
  169. * IT_HYPERLINK =
  170. * IT_ADD_FIELDCAT =
  171. * IT_EXCEPT_QINFO =
  172. * IR_SALV_FULLSCREEN_ADAPTER =
  173. * IMPORTING
  174. * E_EXIT_CAUSED_BY_CALLER =
  175. * ES_EXIT_CAUSED_BY_USER =
  176.     TABLES
  177.       T_OUTTAB = it_out
  178. * EXCEPTIONS
  179. * PROGRAM_ERROR = 1
  180. * OTHERS = 2
  181.             .
  182.   IF SY-SUBRC <> 0.
  183. * Implement suitable error handling here
  184.   ENDIF.
  185. ENDFORM. " F_SHOW_ALV

阅读(2273) | 评论(0) | 转发(0) |
0

上一篇:SAP 内表的ALV输出

下一篇:SAP OO定义:例题

给主人留下些什么吧!~~