1-6 Report_alv I

合集下载

ALV完整功能代码实现

ALV完整功能代码实现
*& Form f_field_table
*&---------------------------------------------------------------------*
num TYPE zrecord-num,
END OF ty_out.
TYPES:BEGIN OF ty_truck,
cbo TYPE c, "选择列
truckid TYPE ztruckinfo-truckid,
name TYPE ztruckinfo-name, "车名
PERFORM f_field_table USING 'VOLEH' '体积单位' 'VOLEH' 'LIPS'.
PERFORM f_field_table USING 'VSTEL' '销售点' 'VSTEL' 'LIKP'.
PERFORM f_field_table USING 'TRUCKID' '分配车辆' 'TRUCKID' ''.
LOOP AT it_out INTO wa_out.
wa_out-truckid = '@06@'. "图标名称
MODIFY it_out FROM wa_out.
ENDLOOP.
ENDFORM. "get_data
*&---------------------------------------------------------------------*

ABAP ALV 总结整理

ABAP ALV 总结整理

主题一:ABAP ALV 总结整理目录一、ALV简介1、简介2、ALV_GRID介绍3、其它描述二、开发ALV的基本流程三、ALV相关开发细节1、标准ALV与对象ALV的共同开发细节2、标准ALV开发相关细节3、对象ALV开发相关细节四、注意事项五、附属信息1、ALV快捷工具栏功能说明(如下图)2、类型SLIS_FIELDCAT_ALV常用参数说明3、类型SLIS_T_SORTINFO_ALV常用参数说明4、类型SLIS_LAYOUT_ALV常用参数说明5、类型SLIS_T_EVENT常用参数说明6、结构LVC_S_FCAT参数说明(清单观察器控制的字段目录)7、结构LVC_S_LAYO参数说明(ALV 控制: 布局结构)8、打印的参数控制请参考结构 [LVC_S_PRNT]9、排序的参数控制请参考结构[LVC_S_SORT]11、'REUSE_ALV_GRID_DISPLAY'函数常用参数12、'REUSE_ALV_LIST_DISPLAY'函数常用参数13、方法"set_table_for_first_display"的参数说明14、方法"REFRESH_TABLE_DISPLAY"的参数说明六、ALV常见问题七、示例程序一、ALV简介1、简介ALV――SAP LIST VIEWER是SAP中的一种报表方式,这里姑且称之为ABAP表单浏览器,用它可以标准化,简单化R/3系统中的表单,它可以提供给用户一个统一的表单格式及用户接口。

ALV是系统的一种网格的显示方式,这种方式带有汇总\排序\筛选等功能,ALV格式的数据是以单元格为单位显示,SAP提供了一套ALV的功能模块,可以对输出报表的样式作修饰,提高报表输出的可读性和功能性,对于动态报表程序是一个很有效率的工具。

ALV家族包含3中ALV工具:简易的,两层ALV,分等级连续的列表和树形结构的ALV。

SAP实例

SAP实例

*==================================================================== =** PROGRAM ID : ZMMR001 ** APPLICATION NAME : MM ** AUTHOR : Zion_tian ** TRANSACTION : N/A ** PROGRAM TYPE : N/A ** INPUT FILES : N/A ** OUTPUT FILES : N/A ** Development class : ZDEV ** Message class : Z01 ** DESCRIPTION : 采购收货单*‘* 程序说明:* 1、取出ALV输出限制条件的所有值进行smartforms输出* 2、检查ALV中选中打印项* 3、过滤出不等的mblnr单号唯一* 4、smartforms中输出*---------------------------------------------------------------------** 000 2011/10/26 NEW PROGRAM Zion_tian **---------------------------------------------------------------------*REPORT z_yangxinze_mmr001.TYPE-POOLS: slis.TABLES: mseg, makt, mkpf, ekpo, v_024, t006a.*---------------------------------------------------------------------** declare work area for storing the select result ** work area 声明,用于存放查询的数据结果 * *---------------------------------------------------------------------*DATA: it_listall LIKE TABLE OF zmmrst001 WITH HEADER LINE.DATA: it_list LIKE TABLE OF it_listall WITH HEADER LINE.DATA: it_checked LIKE TABLE OF it_listall WITH HEADER LINE.DATA: it_chk_mblnr LIKE TABLE OF it_listall WITH HEADER LINE.DATA: it_chk_details LIKE TABLE OF it_listall WITH HEADER LINE. DATA: tabix TYPE sy-index.DATA: x_mblnr(20) TYPE c."收货单号,smartforms循环get_it_details循环条件DATA: it_title TYPE zsmftitle OCCURS 0 WITH HEADER LINE. " 用于SMARTFORM titleDATA: it_details LIKE TABLE OF it_listall WITH HEADER LINE . " 用于SMARTFORM 明细数据DATA: it_layouttemp TYPE slis_layout_alv,it_exclude TYPE slis_t_extab,git_events TYPE slis_t_event,git_list_comments TYPE slis_t_listheader.*&---------------------------------------------------------------------**& 宏定义区*& 初始化FIELDCATLOG*&---------------------------------------------------------------------*DATA: gt_fcat TYPE STANDARD TABLE OF slis_fieldcat_alv.DATA: ps_fcat TYPE slis_fieldcat_alv.DEFINE mac_initfieldcatalog.clear: ps_fcat.ps_fcat-fieldname = &1.ps_fcat-seltext_m = &2.ps_fcat-key = &3.ps_fcat-outputlen = &4.ps_fcat-edit = &5.ps_fcat-checkbox = &6.append ps_fcat to gt_fcat.END-OF-DEFINITION.*&---------------------------------------------------------------------**& 为不满的页面增加空行,字段要根据明细结构重新定义*& &1 传递的明细表*& &2 固定为 PAGE_LINES 每页行数*&---------------------------------------------------------------------*DATA: c_pagelines TYPE i VALUE 8."每页显示行数DEFINE mac_addspacelines.data: l_spacelines type i,l_lins type i.l_spacelines = lines( &1[] ) mod &2.if l_spacelines > 0.l_lins = &2 - l_spacelines.do l_lins times.clear: &1."给一个全角空格默认值,解决SMARTFORMS打印行高不是5MM的问题(打印行数少于规定行数输出空行)&1-matnr = ''.&1-maktx = ''.&1-erfme = ''.append &1.enddo.endif.END-OF-DEFINITION.********************************************************************* **** SELECTION SCREEN********************************************************************* ***SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001. "选择屏幕块SELECT-OPTIONS: s_mblnr FOR mseg-mblnr ."收货凭证SELECT-OPTIONS: s_budat FOR mkpf-budat ."过账时间SELECT-OPTIONS: s_lgort FOR mseg-lgort ."收货库存地点SELECT-OPTIONS: s_ebeln FOR mseg-ebeln ."采购订单号SELECT-OPTIONS: s_matnr FOR mseg-matnr ."物料号SELECT-OPTIONS: s_lifnr FOR mseg-lifnr ."供应商SELECT-OPTIONS: s_usnam FOR mkpf-usnam ."收货人SELECTION-SCREEN END OF BLOCK block1 .********************************************************************* **** INITIALIZATION SCREEN********************************************************************* ***"START-OF-SELECTION.PERFORM main.END-OF-SELECTION.*&---------------------------------------------------------------------**& Form MAIN*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*FORM main .PERFORM get_data.PERFORM frm_get_events.PERFORM frm_ref_field .PERFORM frm_layout.PERFORM frm_alv_display .ENDFORM. "MAIN*&---------------------------------------------------------------------**& FORM FRM_REF_FIELD*&---------------------------------------------------------------------** 此顺序决定显示列的顺序*----------------------------------------------------------------------** --> P1 TEXT* <-- P2 TEXT*----------------------------------------------------------------------*FORM frm_ref_field .CLEAR: gt_fcat[].mac_initfieldcatalog 'MBLNR' '收货凭证' '' '' '' ''.mac_initfieldcatalog 'CPUDT' '凭证输入日期' '' '' '' ''.mac_initfieldcatalog 'BUDAT' '过账日期' '' '' '' ''.mac_initfieldcatalog 'CPUTM' '过账时间' '' '' '' ''.mac_initfieldcatalog 'LGORT' '收货库存地点' '' '' '' ''.mac_initfieldcatalog 'EBELN' '采购订单号' '' '' '' ''.mac_initfieldcatalog 'MATNR' '物料号' '' '' '' ''.mac_initfieldcatalog 'TXZ01' '物料描述' '' '' '' ''.mac_initfieldcatalog 'MENGE' '收货数量' '' '' '' ''.mac_initfieldcatalog 'MEINS' '收货单位' '' '' '' ''.mac_initfieldcatalog 'LIFNR' '供应商' '' '' '' ''.mac_initfieldcatalog 'NAME1' '供应商名称' '' '' '' ''.mac_initfieldcatalog 'USNAM' '收货人' '' '' '' ''.ENDFORM. " FRM_REF_FIELD*&---------------------------------------------------------------------**& Form GET_DATA*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM get_data .SELECTmkpf~cpudtmkpf~budatmkpf~cputmmkpf~usnammkpf~vgartmseg~lgortmseg~mblnrmseg~ebelnmseg~matnr "物料号mseg~zeilemseg~chargmseg~erfmgmseg~erfmemseg~lifnrmseg~bwartmseg~menge "收货数量1mseg~meins "收货单位1 mseg~bpmng "收货数量2 mseg~bprme "收货单位2 mseg~sgtxt "收货单位2ekpo~txz01 "物料描述ekpo~menge AS menge2ekpo~umren AS umren2ekpo~umrez AS umrez2ekpo~lmein AS lmein2lfa1~name1t006a~mseht "单位文本INTO CORRESPONDING FIELDS OF TABLE it_listFROM msegINNER JOIN mkpf ON mseg~mblnr = mkpf~mblnrINNER JOIN ekpo ON ekpo~ebeln = mseg~ebeln AND ekpo~ebelp = mseg~ebelpINNER JOIN lfa1 ON mseg~lifnr = lfa1~lifnrINNER JOIN t006a ON t006a~msehi = mseg~bprme AND t006a~spra s = sy-languWHEREmseg~mblnr IN s_mblnr ANDmkpf~budat IN s_budat ANDmseg~lgort IN s_lgort ANDmseg~ebeln IN s_ebeln ANDmseg~matnr IN s_matnr ANDmseg~lifnr IN s_lifnr ANDmkpf~usnam IN s_usnam ANDmkpf~vgart = 'WE' AND( mseg~bwart = '101' OR mseg~bwart = '105' ).DATA: zbstme TYPE mara-bstme . " 订单单位(备注单位)基本单位(采购收货单单位,打印)* zmenge TYPE mseg-menge . " 转换后数量LOOP AT it_list.* SELECT SINGLE mara~bstme INTO zbstme FROM mara WHERE mara~matnr = it_list-matnr.* CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'* EXPORTING* i_matnr = it_list-matnr "'物料号'* i_in_me = it_list-meins "'输入单位' 基本单位(采购收货单单位,打印)* i_out_me = zbstme "'输出单位'* i_menge = it_list-MENGE "'输入数量'** IMPORTING* e_menge = it_list-zmenge " '输出数量'* EXCEPTIONS* error_in_application = 1* error = 2* OTHERS = 3.* IF sy-subrc <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.* ENDIF.MOVE-CORRESPONDING it_list TO it_listall.IF it_list-menge = 0.it_listall-menge = it_list-bpmng.it_listall-meins = it_list-bprme.ENDIF.IF it_list-lmein2 <> ''.it_listall-menge2 = it_list-menge2 * it_list-umrez2 / it_list-u mren2.ENDIF.APPEND it_listall.ENDLOOP.SORT it_listall BY mblnr zeile .ENDFORM. " GET_DATA*&---------------------------------------------------------------------** TEXT*----------------------------------------------------------------------** --> P1 TEXT* <-- P2 TEXT*--------------------------------------------------------------------FORM frm_get_events .DATA l_events TYPE slis_alv_event.CALL FUNCTION 'REUSE_ALV_EVENTS_GET'EXPORTINGi_list_type = 0IMPORTINGet_events = git_eventsEXCEPTIONSlist_type_wrong = 1OTHERS = 2.IF sy-subrc <> 0.MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.ENDIF.CLEAR l_events.READ TABLE git_events WITH KEY name = slis_ev_user_command INTO l_e vents.IF sy-subrc = 0.MOVE 'USER_COMMAND' TO l_events-form.MODIFY git_events INDEX sy-tabix FROM l_events.ENDIF.READ TABLE git_events WITH KEY name = slis_ev_top_of_page INTO l_ev ents.IF sy-subrc = 0.MOVE 'FRM_TOP_OF_PAGE' TO l_events-form.APPEND l_events TO git_events.ENDIF.ENDFORM. " FRM_GET_EVENTS*&---------------------------------------------------------------------**& FORM TOP_OF_PAGE*&---------------------------------------------------------------------** 表头*----------------------------------------------------------------------** --> P1 TEXT* <-- P2 TEXT*----------------------------------------------------------------------*FORM frm_top_of_page.DATA: l_listheader TYPE slis_listheader,info(20) TYPE c .CLEAR: git_list_comments[].*$BEINGinfo = '采购收货单查询'.l_listheader-typ = 'H'.l_listheader-info = info.*$ENDAPPEND l_listheader TO git_list_comments.CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'EXPORTINGit_list_commentary = git_list_comments.ENDFORM. "FRM_TOP_OF_PAGE*&---------------------------------------------------------------------**& FORM USER_COMMAND*&---------------------------------------------------------------------** TEXT*----------------------------------------------------------------------** -->R_UCOMM TEXT* -->RS_SELFIELD TEXT*----------------------------------------------------------------------*FORM user_command USING r_ucomm LIKE sy-ucommrs_selfield TYPE slis_selfield. tabix = rs_selfield-tabindex .CASE r_ucomm.WHEN 'BACK' OR 'EXIT' OR 'CANC'.SET SCREEN 0.* LEAVE TO SCREEN 0.WHEN '&IC1' . "双击CASE rs_selfield-fieldname .WHEN 'EBELN'.SET PARAMETER ID 'BES' FIELD rs_selfield-value.CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.WHEN 'MATNR'.SET PARAMETER ID 'MAT' FIELD rs_selfield-value.CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.ENDCASE.* PERFORM CHECK_ALV_SEL.* PERFORM DISP_DOCUMENT.WHEN 'DISP'.MESSAGE 'DISP显示信息' TYPE 'I'.WHEN 'PRNT'.CLEAR:it_checked[].LOOP AT it_listall WHERE chk EQ 'X'.it_checked = it_listall.APPEND it_checked.CLEAR it_checked.ENDLOOP.IF lines( it_checked[] ) = 0.MESSAGE '没有选中任何行,请选中数据行再选择打印!!!' TYPE 'I'.ENDIF.PERFORM frm_martform.WHEN 'CLOG' . "创建网恋凭证* PERFORM CREATE_DOCUMENT.* PERFORM REFRESHALV.ENDCASE.ENDFORM. "USER_COMMAND*&---------------------------------------------------------------------** TEXT*----------------------------------------------------------------------** --> P1 TEXT* <-- P2 TEXT*----------------------------------------------------------------------*FORM frm_layout .it_layouttemp-colwidth_optimize = 'X'.it_layouttemp-info_fieldname = 'COLOR'.it_layouttemp-box_fieldname = 'CHK'. "确定选择列 LOOP AT it_listAll WHERE chk EQ 'X'.ENDFORM. " FRM_LAYOUT*&---------------------------------------------------------------------**& FORM FRM_SET_STATUS*&---------------------------------------------------------------------** TEXT*----------------------------------------------------------------------** -->RT_EXTAB TEXT*----------------------------------------------------------------------*FORM frm_set_status USING rt_extab TYPE slis_t_extab.CLEAR: rt_extab.REFRESH: rt_extab.SET PF-STATUS 'GUI_STATUS' .ENDFORM. "FRM_SET_STATUS*&---------------------------------------------------------------------**& FORM FRM_ALV_DISPLAY*&---------------------------------------------------------------------** TEXT*----------------------------------------------------------------------** --> P1 TEXT* <-- P2 TEXT*----------------------------------------------------------------------*FORM frm_alv_display .CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTINGi_callback_program = sy-repidi_callback_pf_status_set = 'FRM_SET_STATUS' "将下句注销,则使用标准工具栏,否则使用用户定义工具栏is_layout = it_layouttempit_fieldcat = gt_fcatit_excluding = it_excludei_save = 'A'it_events = git_eventsTABLESt_outtab = it_listall "T_DATA_IN "显示上传前信息显示上传后信息EXCEPTIONSprogram_error = 1OTHERS = 2.IF sy-subrc <> 0.MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.ENDIF.ENDFORM. " FRM_ALV_DISPLAY*&---------------------------------------------------------------------**& Form FRM_MARTFORM*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------** FORM FRM_MARTFORM USING I_AUFNR TYPE RESB-AUFNR.FORM frm_martform .DATA: gwk_fname TYPE rs38l_fnam.DATA: ls_control_parameters TYPE ssfctrlop.DATA: ls_output_options TYPE ssfcompop.DATA: l_smf_name TYPE rs38l_fnam.DATA: l_e_devtype TYPE rspoptype.DATA: archive_parameters TYPE arc_params.DATA: ls_job_output_info TYPE ssfcrescl.DATA: ls_document_output_info TYPE ssfcrespd.DATA: ls_job_output_options TYPE ssfcresop.DATA: lv_sn TYPE num8.DATA: lv_vcsn(12) TYPE c.DATA: lv_mblnr LIKE mseg-mblnr. " 收货料凭证编号DATA: lv_mblnr_xblnr(80) TYPE c.archive_parameters-printer = 'LOCL'.* l_language = sy-langu.CLEAR: ls_output_options.*****************取选中收货凭证,筛选出不同,删除相同*************x_mblnr = ''.CLEAR:it_chk_details[].LOOP AT it_checked WHERE mblnr <> x_mblnr.IF it_checked-mblnr EQ x_mblnr.CONTINUE.ENDIF.x_mblnr = it_checked-mblnr.MOVE it_checked TO it_chk_details.APPEND it_chk_details.ENDLOOP.lv_mblnr = '' .CLEAR:it_chk_mblnr[].LOOP AT it_checked.IF it_checked-mblnr EQ lv_mblnr.CONTINUE.ENDIF.lv_mblnr = it_checked-mblnr.MOVE it_checked TO it_chk_mblnr.APPEND it_chk_mblnr.ENDLOOP.* 循环输出LOOP AT it_chk_details.lv_mblnr = it_chk_details-mblnr. " 收货料凭证编号CLEAR: it_details[].LOOP AT it_listall WHERE mblnr = lv_mblnr.MOVE it_listall TO it_details.APPEND it_details.SORT it_details BY zeile .ENDLOOP.mac_addspacelines it_details c_pagelines.IF lines( it_details[] ) = 0 .MESSAGE '没有可打印内容' TYPE 'I'.ELSEIF it_listall-bwart = '103' . " add by YADONG_LI 2012-2-10MESSAGE '103收货不可打印' TYPE 'I'.EXIT.ENDIF.* 获得凭证号CALL FUNCTION 'NUMBER_GET_NEXT'EXPORTINGnr_range_nr = '01'object = 'ZPPRSN006'toyear = sy-datum(4)IMPORTINGnumber = lv_sn* quantity = quant* returncode = codeEXCEPTIONSinterval_not_found = 1number_range_not_intern = 2object_not_found = 3quantity_is_0 = 4quantity_is_not_1 = 5interval_overflow = 6buffer_overflow = 7OTHERS = 8.IF sy-subrc <> 0.MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.ENDIF.CONCATENATE sy-datum(4) lv_sn INTO lv_vcsn.CONCATENATE it_listall-mblnr ' ' it_listall-xblnr INTO lv_mblnr_x blnr.* CONCATENATE str1 str2 INTO STR3.it_title-ch1 = '采购收货单'. "smartforms title.it_title-ch2 = lv_mblnr_xblnr. "收货单号+交货单编号合并it_title-ch3 = 'OMEC-COP-11-01'. " 表格编号it_title-ch4 = lv_mblnr_xblnr. " 表格序号-流水号* it_title-dt1 = it_chk_mblnr-budat. " 过账日期it_title-dt1 = it_listall-budat. " 过账日期it_title-ch5 = it_listall-ebeln. "采购订单编号it_title-ch6 = it_listall-lifnr. "供应商编码* it_title-ch5 = it_listAll-budat. "过账日期1* it_title-ch6 = it_listAll-cputm. "过账日前2it_title-ch7 = it_listall-name1. "供应商名称it_title-dt2 = sy-datlo. " 当前日期CALL FUNCTION 'ZGET_EMPNO_NAME' " 获取当前用户号和名EXPORTINGpc_userid = sy-unameIMPORTING" PC_EMPNO = lv_oprno" PC_EMPNAME = lv_oprnamepc_empnoname = it_title-ch8 ." 采购员SELECT SINGLE t024~eknamINTO it_title-ch12FROM t024INNER JOIN ekko ON t024~ekgrp = ekko~ekgrpAND ekko~ebeln = it_chk_mblnr-ebeln.it_title-ch13 = it_chk_mblnr-usnam. " 收货员* LOOP AT it_details.AT FIRST.ls_control_parameters-no_close = 'X'.ls_output_options-tdimmed = 'X'. "立即打印ls_output_options-tdcopies = '1'.ls_output_options-tdnoprint = ''. "没有打印预览的打印输出ls_output_options-tddelete = 'X'.ls_output_options-tddest = 'LOCL'. "默认本地打印机ls_control_parameters-no_dialog = 'X'. "是否显示对话框 X 不显示,为空显示ls_control_parameters-preview = 'X'. "是否打印预览ls_control_parameters-langu = '1'.CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'EXPORTINGformname = 'ZMMRSF001'IMPORTINGfm_name = l_smf_name.ENDAT.AT LAST.ls_control_parameters-no_close = space.ENDAT.CALL FUNCTION l_smf_nameEXPORTINGarchive_parameters = archive_parameterscontrol_parameters = ls_control_parametersoutput_options = ls_output_optionsuser_settings = 'X'wa_title = it_titleIMPORTINGdocument_output_info = ls_document_output_infojob_output_info = ls_job_output_infojob_output_options = ls_job_output_options TABLESft_details = it_details "item table EXCEPTIONSformatting_error = 1internal_error = 2send_error = 3user_canceled = 4OTHERS = 5.IF sy-subrc <> 0.MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.ENDIF.ls_control_parameters-no_open = 'X'.* ENDLOOP.ENDLOOP.ENDFORM. " FRM_MARTFORM。

ALV表头

ALV表头

text = 'Company Code Data'.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'HEADING' " 显示文字的STYLE设置
* ' ' ' '
* ' '
* ' '
* ' '
* ' '
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
url = ''THOD document->new_line.
EXCEPTIONS
pr = 2.
*&---------------------------------------------------------------------*
it_fieldcat = it_fieldcat
I_HTML_HEIGHT_TOP = 25 " 设置抬头宽度
TABLES
t_outtab = it_comp
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 2.

受注状况一覧

受注状况一覧
posnr2 TYPE lips-posnr, "出荷明細
vbeln3 TYPE vbrp-vbeln, "請求伝票
posnr3 TYPE vbrp-posnr, "請求明細
lfdat TYPE likp-lfdat, "納入期日
*受注状況一覧用内部テーブル
DATA: it_output TYPE STANDARD TABLE OF ty_output.
*
DATA: it_fcat TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV.
*----------------------------------------------------------------------*
END OF ty_kna1,
BEGIN OF ty_adrc,
name1 TYPE adrc-name1, "名称 1
END OF ty_adrc,
BEGIN OF ty_output,
fkdat TYPE vbrk-fkdat, "請求索引および印刷に対する請求日
END OF ty_vbrk,
BEGIN OF ty_kna1,
adrnr TYPE kna1-adrnr, "
DATA: it_unite TYPE STANDARD TABLE OF ty_unite.
*請求伝票: 明細データ用内部テーブル
DATA: it_vbrp TYPE STANDARD TABLE OF ty_vbrp.
*請求書: ヘッダデータ用内部テーブル
wa_output TYPE ty_output,

SAP技术名词

SAP技术名词

1.MIGO(事务代码)---是物料移动,收货,消耗等的集成例如MB1A(输入发货)、MB1C(输入其他收货)、MB31(按订单收货)的功能;可以做采购入库、入库取消、退货、后续调整(如委外加工等)2.Dynpro程序开发:SAP 为Web Dynpro提供两种开发语言:ABAP和Java,于是就有了Web Dynpro for ABAP 和Web Dynpro for Java。

Web Dynpro采用了一种高级的MVC / Data Binding 架构模式,并且提供非常友好的编程界面。

Web 界面可以使用拖拉的形式进行开发。

由于Web Dynpro运行于SAP NetWeaver平台,该平台在传统Dynpro开发上的优势也被使用的淋漓尽致。

使用Web Dynpro可以非常迅速的开发出企业级的应用程序,开发者只需要关注其业务流程,关于版本管理、质量控制、发布、性能等内容仍然由NetWeaver平台帮助完成。

SAP WEB Dynpro的实例包:Package:SWDP_TEST 里面有很多实例,可供学习。

3.Report(报表)---报表程序的主要作用是从数据库中抓取数据通过整理陈列出来,给企业高层或具有相关需求的人员查看。

如无特殊需求,此类程序一般不需客制screen、menu、title。

报表主要有一下几类:A、ABAP LIST(最简单的一种报表程序,显示在屏幕上的数据及格式都通过ABAP中的WRITE语句实现,开发工具:SE38)B、ALV REPORT(属于报表的一种高级形式,显示出来的报表整洁美观,具有很大的交互功能,屏幕上的数据及格式主要通过系统的FUNCTION实现,开发工具:SE38)C、SAPSCRIPT(属于商务报表,主要应用于商业用途或对外的报表设计,开发工具:SE38、SE71)D、SMARTFORM (属于商务报表,主要应用于商业用途或对外的报表设计,是SAPSCRIPT的升级版,包含了SAPSCRIPT的绝大多数功能,但开发起来比SAPSCRIPT更方便,快捷。

abap增删改查1

abap增删改查1
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form FRM_GETDATA
*NUM是跳转条件
DATA: OK_CODE TYPE SY-UCOMM,
SAVE_OK TYPE SY-UCOMM.
DATA: NUM1(4) TYPE N VALUE '800'.
DATA: NUM(12) TYPE N.
DATA: LINEA TYPE I.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& 包括 Z_ZHE_FORMS
TABLES:ZTRA.
*800屏
SELECTION-SCREEN BEGIN OF SCREEN 800 AS SUBSCREEN.
*选择屏幕
INCLUDE Z_ZSERACHS.
SELECTION-SCREEN END OF SCREEN 800.
START-OF-SELECTION.
*&---------------------------------------------------------------------*

FUNCTION ALV 强大功能

FUNCTION ALV 强大功能

一。

在ALV报表设计有时候需要根据一定条件将特定的单元显示成特定的颜色,具体实现步骤如下:1. 在需要显示的内表中添加新的字段,字段类型为lvc_t_scol2. 根据条件设置颜色数据;3. 设置layout-coltab_fieldname的数据指定显示颜色的字段.代码如下:(注意红色部分)REPORT z_alv_color.TYPE-POOLS: slis.DATA: BEGIN OF it_flight OCCURS 0,carrid LIKE sflight-carrid,connid LIKE sflight-connid,fldate LIKE sflight-fldate,seatsmax LIKE sflight-seatsmax,seatsocc LIKE sflight-seatsocc,color TYPE lvc_t_scol,END OF it_flight.DATA: it_fieldcat TYPE slis_t_fieldcat_alv,layout TYPE slis_layout_alv.CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'EXPORTINGi_program_name = sy-repidi_internal_tabname = 'IT_FLIGHT'i_inclname = sy-repidCHANGINGct_fieldcat = it_fieldcatEXCEPTIONSinconsistent_interface = 1program_error = 2.SELECT carridconnidfldateseatsmaxseatsoccFROM sflightINTO CORRESPONDING FIELDS OF TABLE it_flightUP TO 20 ROWS.DATA: col TYPE lvc_s_scol,coltab TYPE lvc_t_scol,color TYPE lvc_s_colo.color-col = '6'.color-int = '0'.color-inv = '0'.LOOP AT it_flight.IF it_flight-seatsocc Eq 0.col-fname = 'SEATSOCC'.col-color = color.APPEND col TO coltab.CLEAR col.it_flight-color = coltab.MODIFY it_flight.ENDIF.ENDLOOP.layout-coltab_fieldname = 'COLOR'.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTINGi_callback_program = sy-repidis_layout = layoutit_fieldcat = it_fieldcatTABLESt_outtab = it_flightEXCEPTIONSprogram_error = 1.二。

レポート作成ツール概要

レポート作成ツール概要

LIS
テーブル
CCSS 原価要素 原価センタ 受注 ……. 原価 数量
ライブラリ
財務会計/管理会計/在庫・購買管理 データベース
特性 キー数値 #####xxxxxxx##### #####xxxxxxx##### #####xxxxxxx##### #####xxxxxxx##### #####xxxxxxx##### #####xxxxxxx##### #####xxxxxxx##### #####xxxxxxx#####

ALV
非定型

ABAP開発
非定型

SAPscr ipt
定型
関発言語 ABAP によるコーディングに コーディングにより 、細 かい 表 現 力 に 限 界 あ り よってレポートを作成する手法。 ユーザ要件を実現。 ( フォント ・ 色 ・ 罫 線な ど) 以前のSAP標準帳票ツール。但し、今 SAP標準との統合。定型 ABAP以外の言語必 でも標準機能の浸透率は高い。いくつ フォームの作成可能。 要。ツール知識が必 か標準シナリオがある。 要。 4.6C以降の新しいSAP標準帳票ツー SAP標準との統合。定型 ツール知識が必要。 ル。いくつか標準シナリオが用意されて フォームの作成可能。 いる。 SAPscriptよりユーザインター フェイス向上。XML出力。
計画 45000 94500 40000 6000
差異 600 500 44004003700-
181800 185500
SAP Japan 2002, レポート作成ツール概要 , Technical Sol---- -------- -------- --------
原価要素 原価センタ

Abap查表程序

Abap查表程序

SAP 查表程序(通过字段,元素,表名,描述)查表对于对SAP不是很熟悉的人来说,查表是件痛苦的事,对于ABAPER菜鸟来说更是痛苦,为些我写了一个查表程序,大多数情况下我是用它来找表的。

REPORT ZKFTB.PARAMETERS: p_tb LIKE DD02L-TABNAME, "Table Name p_tbTx LIKE DD02T-DDTEXT, "Table Namep_fld LIKE DD03L-FIELDNAME, "Field NameP_fldTx LIKE DD04T-DDTEXT,p_cls LIKE DD02L-TABCLASS DEFAULT 'TRANSP', "Table categoryp_ROLL LIKE DD03L-ROLLNAME, "ElementP_value(80) TYPE C, "Field Valuep_lang LIKE DD02T-DDLANGUAGE DEFAULT 'EN'. "LanguagTYPE-POOLS: SLIS.DATA: WA_LINE TYPE SLIS_FIELDCAT_ALV.DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV .DATA: WA_LAYOUT TYPE SLIS_LAYOUT_ALV.DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE.DATA: BEGIN OF IT_Tab OCCURS 0,TABNAME LIKE DD02L-TABNAME,TABCLASS LIKE DD02L-TABCLASS,TABTEXT LIKE DD02T-DDTEXT,FIELDNAME LIKE DD03L-FIELDNAME,DATATYPE LIKE DD03L-DATATYPE,ROLLNAME LIKE DD04T-ROLLNAME,FILDTEXT LIKE DD04T-DDTEXT,DEL_IND(1) TYPE C. "Deleted indicator.DATA: END OF IT_Tab.DATA: g_command_form TYPE slis_formname VALUE 'USER_COMMAND', it_event TYPE slis_t_event,wa_event TYPE slis_alv_event,g_repid LIKE sy-repid.INITIALIZATION.g_repid = sy-repid.START-OF-SELECTION.PERFORM PERFORMSQL.PERFORM ALV_FIELDS.PERFORM Dispaly_ALV.END-OF-SELECTION.*e+ Delete reducing Informaton from Internal TableFORM Clean_DATA.*DATA: v_value TYPE REF TO DATA,* V_INDEX like sy-tabix.*FIELD-SYMBOLS <FS> TYPE ANY.if ( p_value is not initial )AND ( p_fld is not initial )AND LINES( IT_TAB ) > 0.Loop at it_tab where Fieldname = p_fld.V_INDEX = SY-TABIX.if sy-subrc NE 0.it_tab-del_ind = 'X'.modify it_tab index v_index.else.ASSIGN it_tab-FIELDNAME TO <FS>.ENDFORM.FORM Dispaly_ALV.DATA:report_name LIKE sy-repid,alvlo_stb TYPE slis_layout_alv.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTINGIT_FIELDCAT = IT_FIELDCAT[]IS_LAYOUT = WA_LAYOUTI_callback_program = g_repidi_callback_user_command = g_command_formit_events = it_eventIT_SORT = IT_SORT[]TABLEST_OUTTAB = IT_TabEXCEPTIONSPROGRAM_ERROR = 1OTHERS = 2.IF SY-SUBRC <> 0.MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDIF.ENDFORM.DEFINE APPEND_ALV_FIELD.CLEAR WA_LINE .WA_LINE-FIELDNAME = &1.WA_LINE-SELTEXT_L = &2.WA_LINE-SELTEXT_M = &2.WA_LINE-SELTEXT_S = &2.WA_LINE-CFIELDNAME = &3.WA_LINE-TECH = &4.WA_LINE-QFIELDNAME = &5.WA_LINE-EDIT_MASK = &6.WA_LINE-OUTPUTLEN = &7.WA_LINE-DDICTXT = 'L'.APPEND WA_LINE TO IT_FIELDCAT.END-OF-DEFINITION .FORM ALV_FIELDS .CLEAR IT_FIELDCAT[].APPEND_ALV_FIELD 'TABNAME' TEXT-H01 '' '' '' '' 10.APPEND_ALV_FIELD 'TABCLASS' TEXT-H02 '' '' '' '' 10.APPEND_ALV_FIELD 'TABTEXT' TEXT-H03 '' '' '' '' 30.APPEND_ALV_FIELD 'FIELDNAME' TEXT-H04 '' '' '' '' 15.APPEND_ALV_FIELD 'DATATYPE' TEXT-H08 '' '' '' '' 10.APPEND_ALV_FIELD 'ROLLNAME' TEXT-H05 '' '' '' '' 15.APPEND_ALV_FIELD 'FILDTEXT' TEXT-H06 '' '' '' '' 30.* APPEND_ALV_FIELD 'Language' TEXT-H07 '' '' '' '' 10.ENDFORM. " ALV_FIELDSFORM PERFORMSQL.DATA: SQLstr(72) TYPE c,itabSQL LIKE TABLE OF SQLstr,v_text(30) TYPE C.CONCATENATE SPACE 't2~DDLANGUAGE = ''' p_lang '''' INTO SQLstr. CONCATENATE SPACE 't4~DDLANGUAGE = ''' p_lang '''' INTO SQLstr. APPEND SQLstr TO itabSQL.IF ( p_tb IS NOT INITIAL ).CONCATENATE SPACE 'AND t1~TABNAME = ''' p_tb '''' INTO SQLstr. APPEND SQLstr TO itabSQL.ENDIF.IF ( p_tbtx is not initial ).clear v_text.concatenate p_tbtx '%' into v_text.CONCATENATE SPACE 'AND t2~DDTEXT Like ''' v_text '''' INTO SQLstr. APPEND SQLstr TO itabSQL.ENDIF.IF ( p_fld is not initial ).CONCATENATE SPACE 'AND t3~FIELDNAME = ''' p_fld '''' INTO SQLstr. APPEND SQLstr TO itabSQL.ENDIF.if ( p_fldtx is not initial ).clear v_text.concatenate P_fldTx '%' into v_text.CONCATENATE SPACE 'AND t4~DDTEXT Like ''' v_text '''' INTO SQLstr. APPEND SQLstr TO itabSQL.ENDIF.IF ( p_cls is not initial ).CONCATENATE SPACE 'AND t1~TABCLASS = ''' p_cls '''' INTO SQLstr.APPEND SQLstr TO itabSQL.ENDIF.IF ( p_ROLL is not initial ).clear v_text.concatenate p_ROLL '%' into v_text.CONCATENATE SPACE 'AND t3~ROLLNAME Like ''' v_text '''' INTO SQLstr. APPEND SQLstr TO itabSQL.ENDIF.SELECT DISTINCT T1~TABNAME t1~TABCLASS t2~DDTEXT AS TABTEXT T3~FIELDNAME t3~DATATYPE t3~ROLLNAMEt4~DDTEXT as FILDTEXTINTO Corresponding fields of table it_tabFROM DD02L AS t1INNER JOIN DD02T as t2ON t1~TABNAME = t2~TABNAMEINNER JOIN DD03L AS t3ON t2~TABNAME = t3~TABNAMEINNER JOIN DD04T as t4ON t3~ROLLNAME = t4~ROLLNAMEAND t2~DDLANGUAGE = t4~DDLANGUAGEWHERE (itabSQL).sort it_tab by tabname fieldname.ENDFORM.FORM user_command USING r_ucomm LIKE sy-ucommrs_selfield TYPE slis_selfield.CASE r_ucomm.WHEN '&IC1'. "doubleclickREAD TABLE it_tab INDEX rs_selfield-tabindex.IF sy-subrc = 0.IF rs_selfield-fieldname EQ 'TABNAME' ANDit_TAB-TABNAME IS NOT INITIAL.SET PARAMETER ID 'DTB' FIELD it_TAB-TABNAME .CALL TRANSACTION 'SE11' AND SKIP FIRST SCREEN.CLEAR r_ucomm.ENDIF.ENDIF.ENDCASE.ENDFORM. "user_command。

ALV响应回车事件、响应回车命令、ALV编辑

ALV响应回车事件、响应回车命令、ALV编辑

haixu.li 于2012/9/6 20:25 修改ALV响应回车事件2012年7月21日13:30REPORT zztest .************************************************************************ *DATEN DEFINITION************************************************************************* TYPE-POOLS:slis.TYPES:BEGIN OF t_data,matnr TYPE makt-matnr,maktx TYPE makt-maktx,spras TYPE makt-spras,END OF t_data,BEGIN OF t_alv,matnr TYPE makt-matnr,maktx TYPE makt-maktx,spras TYPE makt-spras,dd_handle TYPE int4,END OF t_alv.DATA:gt_fieldcatalog TYPE lvc_t_fcat,gw_fieldcatalog TYPE lvc_s_fcat,*定义存储下拉列表的数据gt_ddval TYPE lvc_t_drop,gw_ddval TYPE lvc_s_drop,gt_events TYPE slis_t_event,gw_events TYPE slis_alv_event,gt_data TYPE TABLE OF t_data,gw_data TYPE t_data,gt_alv TYPE TABLE OF t_alv,gw_alv TYPE t_alv,g_repid TYPE sy-repid VALUE sy-repid.DATA:l_grid_settings TYPE lvc_s_glay.************************************************************************ *SELECTION SCREEN************************************************************************* SELECT-OPTIONS:s_matnr FOR gw_data-matnr.************************************************************************ *START-OF-SELECTION************************************************************************* START-OF-SELECTION.SELECT matnr maktx sprasINTO TABLE gt_data UP TO50ROWSFROM maktWHERE matnr IN s_matnrAND spras='EN'.LOOP AT gt_data INTO gw_data.MOVE-CORRESPONDING gw_data TO gw_alv.APPEND gw_alv TO gt_alv.ENDLOOP.PERFORM creat_fieldcat.PERFORM creat_dropdown_values.PERFORM creat_event_exits.PERFORM frm_create_events.CALL FUNCTION'REUSE_ALV_GRID_DISPLAY_LVC'CALL FUNCTION'REUSE_ALV_GRID_DISPLAY_LVC'EXPORTINGi_callback_program=g_repidit_fieldcat_lvc =gt_fieldcatalogi_grid_settings =l_grid_settingsit_events =gt_eventsTABLESt_outtab =gt_alv.*---------------------------------------------------------------------* *设置输出字段的格式*---------------------------------------------------------------------* FORM creat_fieldcat.CLEAR gw_fieldcatalog.gw_fieldcatalog-fieldname='MATNR'.gw_fieldcatalog-ref_field='MATNR'.gw_fieldcatalog-ref_table='MAKT'.APPEND gw_fieldcatalog TO gt_fieldcatalog.CLEAR gw_fieldcatalog.gw_fieldcatalog-fieldname='MAKTX'.gw_fieldcatalog-ref_field='MAKTX'.gw_fieldcatalog-ref_table='MAKT'.gw_fieldcatalog-edit='X'.APPEND gw_fieldcatalog TO gt_fieldcatalog.CLEAR gw_fieldcatalog.gw_fieldcatalog-fieldname='SPRAS'.gw_fieldcatalog-outputlen='7'.gw_fieldcatalog-dd_outlen='7'.gw_fieldcatalog-intlen='2'.gw_fieldcatalog-inttype='C'.gw_fieldcatalog-coltext='Language'.gw_fieldcatalog-tooltip='Language'.gw_fieldcatalog-seltext='Language'.gw_fieldcatalog-drdn_field='DD_HANDLE'.gw_fieldcatalog-edit='X'.APPEND gw_fieldcatalog TO gt_fieldcatalog.l_grid_settings-edt_cll_cb='X'. "这句话不能少ENDFORM."creat_fieldcat*---------------------------------------------------------------------* *根据物料的所有的语言生成不同的生成下拉列表*---------------------------------------------------------------------* FORM creat_dropdown_values.DATA:l_spras TYPE makt-spras,l_count TYPE i.LOOP AT gt_alv INTO gw_alv.ADD1TO l_count.SELECT sprasINTO l_sprasFROM maktWHERE matnr=gw_alv-matnr.CLEAR gw_ddval.gw_ddval-handle=l_count.gw_ddval-value=l_spras.APPEND gw_ddval TO gt_ddval.ENDSELECT.CLEAR gw_ddval.gw_ddval-handle=l_count.gw_ddval-value=''.APPEND gw_ddval TO gt_ddval.*设置对应*设置对应gw_alv-dd_handle=l_count.MODIFY gt_alv FROM gw_alv.ENDLOOP.ENDFORM."creat_dropdown_values*---------------------------------------------------------------------* *Form creat_event_exits*---------------------------------------------------------------------* FORM creat_event_exits.gw_events-name='CALLER_EXIT'.gw_events-form='CALLER_EXIT'.APPEND gw_events TO gt_events.ENDFORM."creat_event_exits*---------------------------------------------------------------------* *设置下拉列表,使Grid和内表能链接上*---------------------------------------------------------------------* FORM caller_exit USING ls_data TYPE slis_data_caller_exit.DATA:l_ref_alv TYPE REF TO cl_gui_alv_grid.CALL FUNCTION'GET_GLOBALS_FROM_SLVC_FULLSCR'IMPORTINGe_grid=l_ref_alv.CALL METHOD l_ref_alv->set_drop_down_tableEXPORTINGit_drop_down=gt_ddval.ENDFORM."CALLER_EXIT*&---------------------------------------------------------------------* *& Form frm_create_events*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* FORM frm_create_events.DATA:ls_events TYPE slis_alv_event.ls_events-name=slis_ev_data_changed.ls_events-form='FRM_DATA_CHANGED'.APPEND ls_events TO gt_events.ENDFORM. "frm_create_events*&---------------------------------------------------------------------* *& Form frm_data_changed*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* * -->RR_DATA_CHANGED text*----------------------------------------------------------------------* FORM frm_data_changed USING rr_data_changedTYPE REF TO cl_alv_changed_data_protocol.MESSAGE'修改数据后按了回车'TYPE'I'.ENDFORM. "frm_data_changed。

显示ALV的三种方法

显示ALV的三种方法

使用前提:存在数据库表ZZP_PEOPLE2,如图,有以下数据第一种,最古老的方法,用CL_SALV_TABLEREPORT ZALV_ZZP_1.INCLUDE <ICON>.DATA : BEGIN OF ZZP.INCLUDE TYPE ZZP_PEOPLE2. "ZZP_PEOPLE2自定义数据库表,结构:ZID,ZNAME,ZPASSWORDDATA : BUTTON TYPE ICON_D.DATA : END OF ZZP.DATA : IT_ZZP LIKE TABLE OF ZZP.DATA : O_TABLE TYPE REF TO CL_SALV_TABLE,O_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE,O_COLUMN TYPE REF TO CL_SALV_COLUMN_TABLE.SELECT * FROM ZZP_PEOPLE2 INTO CORRESPONDING FIELDS OF TABLE IT_ZZP. LOOP AT IT_ZZP INTO ZZP.MOVE ICON_OKAY TO ZZP-BUTTON.MODIFY IT_ZZP FROM ZZP INDEX SY-TABIX.ENDLOOP.TRY .CL_SALV_TABLE=>FACTORY(IMPORTINGR_SALV_TABLE = O_TABLECHANGINGT_TABLE = IT_ZZP ).CATCH CX_SALV_MSG.ENDTRY.O_COLUMNS = O_TABLE->GET_COLUMNS( ).O_COLUMNS->SET_OPTIMIZE( ABAP_TRUE ).O_COLUMN ?= O_COLUMNS->GET_COLUMN( 'ZID' ).O_COLUMN->SET_ICON( IF_SALV_C_BOOL_SAP=>TRUE ). "居中O_COLUMN->SET_CELL_TYPE( IF_SALV_C_CELL_TYPE=>HOTSPOT ). "下划线O_COLUMN->SET_LONG_TEXT( 'MY_BUTTON' ).O_TABLE->DISPLAY( ).效果:注意,这里默认的status是空第二种,比较普遍的用法:REUSE_ALV_GRID_DISPLAY REPORT ZALV_ZZP_2.TYPE-POOLS: SLIS.INCLUDE <ICON>.DATA : BEGIN OF ZZP.INCLUDE TYPE ZZP_PEOPLE2.DATA : BUTTON TYPE ICON_D.DATA : END OF ZZP.DATA : IT_ZZP LIKE TABLE OF ZZP.DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.DEFINE MAN.CLEAR WA_FIELDCAT.WA_FIELDCAT-COL_POS = &1.WA_FIELDCAT-FIELDNAME = &2.WA_FIELDCAT-SELTEXT_L = &3.WA_FIELDCAT-JUST = 'C'.APPEND WA_FIELDCAT TO IT_FIELDCAT.END-OF-DEFINITION.MAN:'1' 'ZID' 'ID号','2' 'ZNAME' '名字','3' 'ZPASSWORD' '密码','4' 'BUTTON' '图标'.SELECT * FROM ZZP_PEOPLE2 INTO CORRESPONDING FIELDS OF TABLE IT_ZZP. LOOP AT IT_ZZP INTO ZZP.MOVE ICON_OKAY TO ZZP-BUTTON.MODIFY IT_ZZP FROM ZZP.ENDLOOP.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTINGIT_FIELDCAT = IT_FIELDCATTABLEST_OUTTAB = IT_ZZP.效果:第三种,用SCREEN显示的方法REPORT ZALV_ZZP_3.DATA : BEGIN OF ZZP.INCLUDE TYPE ZZP_PEOPLE2.DATA : BUTTON TYPE ICON_D.DATA : END OF ZZP.DATA : IT_ZZP LIKE TABLE OF ZZP WITH HEADER LINE.DATA :GRID TYPE REF TO CL_GUI_ALV_GRID,G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.DATA GT_FIELDCAT TYPE LVC_T_FCAT .DATA LS_FCAT TYPE LVC_S_FCAT .DEFINE MAN.CLEAR LS_FCAT.LS_FCAT-FIELDNAME = &1.LS_FCAT-OUTPUTLEN = &2.LS_FCAT-COLTEXT = &3.APPEND LS_FCAT TO GT_FIELDCAT .END-OF-DEFINITION.DATA BEGIN OF GT_LIST OCCURS 0 .INCLUDE STRUCTURE IT_ZZP .DATA END OF GT_LIST .call SCREEN 100.MODULE status_0100 OUTPUT.CLEAR GT_FIELDCAT[].SET PF-STATUS 'STA1'.IF G_CUSTOM_CONTAINER IS INITIAL.CREATE OBJECT G_CUSTOM_CONTAINEREXPORTINGCONTAINER_NAME = 'ALVDATA'.CREATE OBJECT GRIDEXPORTINGI_PARENT = G_CUSTOM_CONTAINER.ENDIF.SELECT * FROM ZZP_PEOPLE2 INTO CORRESPONDING FIELDS OF TABLE GT_LIST.LOOP AT GT_LIST INTO ZZP.MOVE ICON_OKAY TO ZZP-BUTTON.MODIFY GT_LIST FROM ZZP.ENDLOOP.MAN:'ZID' '13' 'ID号码','ZNAME' '10' '名字','ZPASSWORD' '10' '密码','BUTTON' '3' '图标'.CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY CHANGINGIT_OUTTAB = GT_LIST[]IT_FIELDCATALOG = GT_FIELDCATEXCEPTIONSINVALID_PARAMETER_COMBINATION = 1PROGRAM_ERROR = 2TOO_MANY_LINES = 3OTHERS = 4 .ENDMODULE.效果:。

1008 2010 EU

1008 2010 EU

REGULATIONSCOMMISSION REGULATION (EU) No 1008/2010of 9 November 2010concerning type-approval requirements for windscreen wiper and washer systems of certain motorvehicles and implementing Regulation (EC) No 661/2009 of the European Parliament and of the Council concerning type-approval requirements for the general safety of motor vehicles, theirtrailers and systems, components and separate technical units intended therefor(Text with EEA relevance)THE EUROPEAN COMMISSION,Having regard to the Treaty on the Functioning of the European Union,Having regard to Regulation (EC) No 661/2009 of the European Parliament and of the Council of 13 July 2009 concerning type- approval requirements for the general safety of motor vehicles, their trailers and systems, components and separate technical units intended therefor ( 1 ), and in particular Article 14(1)(a) thereof, Whereas:(1) Regulation (EC) No 661/2009 is a separate Regulation for the purposes of the type-approval procedure provided for by Directive 2007/46/EC of the European Parliament and of the Council of 5 September 2007 establishing aframework for the approval of motor vehicles and theirtrailers, and of systems, components and separatetechnical units intended for such vehicles (Framework Directive) ( 2 ). (2) Regulation (EC) No 661/2009 repeals Council Directive78/318/EEC of 21 December 1977 on the approxi ­mation of the laws of the Member States relating tothe wiper and washer systems of motor vehicles ( 3 ).The requirements set out in that Directive should be carried over to this Regulation and, where necessary, amended in order to adapt them to the development of scientific and technical knowledge.(3) The scope of this Regulation should be in line with thatof Directive 78/318/EEC and thus limited to vehicles ofcategory M 1 .(4) Regulation (EC) No 661/2009 lays down fundamentalprovisions on requirements for the type-approval of motor vehicles with regard to their windscreen wiper and washer systems and the type-approval of windscreenwasher systems as separate technical units. Therefore, it is necessary to set out the specific procedures, tests and requirements for such type-approval.(5) Themeasures provided for in this Regulation are in accordance with the opinion of the Technical Committee – Motor Vehicles,HAS ADOPTED THIS REGULATION:Article 1 ScopeThis Regulation applies to motor vehicles of category M 1, as defined in Annex II to Directive 2007/46/EC, which are fittedwith a windscreen, as well as to windscreen washer systemsintended for fitment to motor vehicles of category M 1 . Article 2 DefinitionsFor the purposes of this Regulation, the following definitionsshall apply:(1) ‘vehicle type with regard to the windscreen wiper andwasher system’ means vehicles which do not differ in such essential respects as: the characteristics of the wiper and washer system or the shape, size and characteristics of the windscreen and its mounting; (2) ‘type of windscreen washer system’ means a group ofwindscreen washer systems which do not differ in such essential respects as the pump performance, materials used, storage capacity, number of nozzles, sizes, wall thicknesses or shape of the washer system; (3) ‘engine’ means a combustion engine running on eitherliquid or gaseous fuel; (4) ‘windscreen wiper system’ means the system consisting ofa device for wiping the outer face of the windscreen, together with the accessories and controls necessary for starting and stopping the device;( 1 ) OJ L 200, 31.7.2009, p. 1. ( 2 ) OJ L 263, 9.10.2007, p. 1. ( 3 ) OJ L 81, 28.3.1978, p. 49.(5) ‘wiper field’ means the area(s) on the windscreen which iswiped by the wiper blade(s) when the wiper system is operating under normal conditions.(6) ‘intermittent operation of the wiper system’ means anautomatic non-continuous mode of operation of the wiper system, where after each full cycle there is a period during which the wipers are stationary in one specific designated halting position;(7) ‘windscreen washer system’ means the system consisting ofdevices for storing, transferring and aiming fluid towards the outer face of the windscreen, together with the controls necessary for starting and stopping the device;(8) ‘washer control’ means the device by which the washersystem is manually activated and deactivated;(9) ‘washer pump’ means a device for transferring fluid fromthe washer system storage reservoir to the outer face of the windscreen;(10) ‘nozzle’ means a device which serves to direct fluid ontothe windscreen;(11) ‘fully primed system’ means a system which has beenactivated normally for a period of time and where fluid has been transferred through the pump, tubing and has exited the nozzle(s);(12) ‘cleaned area’ means the previously soiled area which doesnot have any traces of drops and remaining dirt after it hasdried completely;(13) ‘vision area A’ means test area A as defined in paragraph2.2. of Annex 18 to UNECE Regulation No 43 (1);(14) ‘vision area B’ means reduced test area B as defined inparagraph 2.4. of Annex 18 to UNECE Regulation No 43, without the exclusion of the area defined in paragraph 2.4.1. thereof;(15) ‘design torso angle’ means the angle measured between avertical line through the R-point or seating reference pointand the torso line in a position which corresponds to the design position of the seat-back as declared by the vehicle manufacturer;(16) ‘R-point’ or seating reference point means the design pointdefined by the vehicle manufacturer for each seating position with respect to the three-dimensional reference system;(17) ‘three-dimensional reference system’ means a reference gridwhich consists of a vertical longitudinal plane X-Z, a hori­zontal plane X-Y and a vertical transverse plane Y-Z in accordance with the provisions of Appendix 2 of Annex III to this Regulation; (18) ‘primary reference marks’ means holes, surfaces, marks orother identification signs on the vehicle body or chassis ofwhich the X, Y and Z coordinates within the three-dimen­sional reference grid are specified by the vehicle manu­facturer;(19) ‘vehicle master control switch’ means the device by whichthe vehicle's on-board electronics system is brought frombeing switched off, as is the case when a vehicle is parkedwithout the driver being present, to normal operationmode;Article 3EC type-approval of a vehicle with regard to its windscreen wiper and washer systems1. The manufacturer or his representative shall submit to the type-approval authority the application for EC type-approval of a vehicle with regard to its windscreen wiper and washer systems.2. The application shall be drawn up in accordance with the model of the information document set out in Part 1 of Annex I.3. If the relevant requirements set out in Annex III to this Regulation are met, the approval authority shall grant an EC type-approval and issue a type-approval number in accordance with the numbering system set out in Annex VII to Directive 2007/46/EC.A Member State may not assign the same number to another vehicle type.4. For the purposes of paragraph 3, the type-approval authority shall deliver an EC type-approval certificate establishedin accordance with the model set out in Part 2 of Annex I.Article 4EC separate technical unit type-approval of windscreenwasher systems1. The manufacturer or his representative shall submit to the type-approval authority the application for EC separate technical unit type-approval for a type of windscreen washer system.The application shall be drawn up in accordance with the model of the information document set out in Part 1 of Annex II.2. If the relevant requirements set out in Annex III to this Regulation are met, the approval authority shall grant an EC separate technical unit type-approval and issue a type-approval number in accordance with the numbering system set out in Annex VII to Directive 2007/46/EC.(1) OJ L 230, 31.8.2010, p. 119.A Member State may not assign the same number to another type of separate technical unit.3. For the purposes of paragraph 2, the type-approval authority shall deliver an EC type-approval certificate established in accordance with the model set out in Part 2 of Annex II.Article 5EC separate technical unit type-approval mark Every separate technical unit conforming to a type in respect of which EC separate technical unit type-approval has been granted pursuant to this Regulation shall bear an EC separate technical unit type-approval mark as set out in Part 3 of Annex II.Article 6Validity and extension of approvals granted underDirective 78/318/EECNational authorities shall permit the sale and entry into service of vehicles and separate technical units type-approved before the date referred to in Article 13(2) of Regulation (EC) No 661/2009, and continue to grant extension of approvals to those vehicles and separate technical units under the terms of Directive 78/318/EEC.Article 7Entry into forceThis Regulation shall enter into force on the twentieth day following that of its publication in the Official Journal of the European Union.This Regulation shall be binding in its entirety and directly applicable in all Member States. Done at Brussels, 9 November 2010.For the CommissionThe PresidentJosé Manuel BARROSOANNEX IAdministrative documents for EC type-approval of motor vehicles with regard to their windscreen wiper andwasher systemsPART 1Information documentMODELInformation document No … relating to the EC type-approval of a motor vehicle with regard to its windscreen wiper and washer systems.The following information shall be supplied in triplicate and include a list of contents. Any drawings shall be supplied in appropriate scale and in sufficient detail on size A4 or on a folder of A4 format. Photographs, if any, shall show sufficient detail.If the systems, components or separate technical units referred to in this information document have electronic controls, information concerning their performance shall be supplied.0. GENERAL......................................................................................................................................ofmanufacturer):name(trade0.1. Make..................................................................................................................................................................................................0.2. Type:(if...........................................................................................................................................available):0.2.1. Commercialname(s)0.3. Means of identification of type, if marked on the vehicle (b): .......................................................................................marking:..........................................................................................................................................................ofthat0.3.1. Locationvehicle(c): .................................................................................................................................................................of0.4. Category.......................................................................................................................................manufacturer:of0.5. Nameandaddressplant(s):.....................................................................................................................assemblyandof0.8. Name(s)address(es)(ifrepresentative..................................................................................manufacturer'sany):addresstheand0.9. NameofTHEVEHICLEOFCHARACTERISTICSCONSTRUCTION1. GENERALrepresentativevehicle:...............................................................................................aand/orof1.1. Photographsdrawings(k)3. POWERPLANTengine3.2. Internalcombustion(n): ................................. kW at .................................. min–1(manufacturer's declared value) powernet3.2.1.8. Maximumsystem3.2.5. Electricalvoltage:...................................................................................................................... V, positive/negative ground (1) 3.2.5.1. Rated3.2.5.2. Generator3.2.5.2.1. Type: ..................................................................................................................................................................................................3.2.5.2.2. Nominal output: ....................................................................................................................................................................VAmotor3.3. Electric3.3.1.1. Maximumoutput:................................................................................................................................................... k W hourly (V)3.3.1.2. Operatingvoltage:3.3.2. Battery3.3.2.3. Capacity:.......................................................................................................................................................... A h (Amp-hours)combinationmotoror3.4. Engine(1)yes/noelectricvehicle:3.4.1. Hybridcharging/notoff-vehiclecharging:off-vehicle(1)electricvehicle:of3.4.2. Categoryhybrid(battery,capacitor,flywheel/generator)device:the3.4.4. Descriptionofenergystorage3.4.4.5. Energy:..............................................................................................................................................................................................(for battery: voltage and capacity Ah in 2 h, for capacitor: J, ......................................................................................)(1)board/external/withouton3.4.4.6. Charger:(p)4. TRANSMISSIONkm/h)(q): ......................................................................................................................speed(in4.7. Maximumvehicledesign9. BODYWORKofconstruction:......................................................................................................................andmethods9.2. Materialsusedvision9.4. Fieldof9.4.1. Particulars of the primary reference marks in sufficient detail to enable them to be readily identified and theposition of each in relation to the others and to the R-point to be verified: .........................................................windowsother9.5. Windscreenand9.5.1. Windscreen................................................................................................................................................................................used:9.5.1.1. Materials...................................................................................................................................................................mounting:9.5.1.2. Methodof....................................................................................................................................................................inclination:9.5.1.3. Angleofnumber(s):........................................................................................................................................................... 9.5.1.4. Type-approvalfittedwithatogetherofanydescriptionbriefinandaccessoriesarethe9.5.1.5. Windscreenpositiontheywhichelectrical/electronic components involved: ............................................................................................................................systemwiper9.6. Windscreenordrawings):...........................................................................photographs9.6.1. Detailedtechnicaldescription(includingsystemwasher9.7. Windscreen9.7.1. Detailed technical description (including photographs or drawings) or, if approved as separate technical unit,type-approval number: .................................................................................................................................................................demisting9.8. Defrostingand...................................................................................................................................kWconsumption:electrical9.8.2. Maximumarrangement9.10. Interior9.10.3. Seats9.10.3.5. Coordinates or drawing of the R-point9.10.3.5.1. Driver's seat: .................................................................................................................................................................................... 9.10.3.6. Design torso angle9.10.3.6.1. Driver's seat: ....................................................................................................................................................................................Explanatory notes(1) Delete where not applicable.(b) If the means of identification of type contains characters not relevant to describe the vehicle, component or separatetechnical unit types covered by this information document, such characters shall be represented in the documentation by the symbol ‘?’ (e.g. ABC??123??).(c) Classified according to the definitions set out in Directive 2007/46/EC Part A of Annex II.(k) In the case of a vehicle that can run either on petrol, diesel, etc., or also in combination with another fuel, items shall be repeated. In the case of non-conventional engines and systems, particulars equivalent to those referred to here shall be supplied by the manufacturer.(n) Determined in accordance with the requirements of Council Directive 80/1269/EEC (OJ L 375, 31.12.1980, p. 46). (p) The specified particulars are to be given for any proposed variants.(q) With respect to trailers, maximum speed permitted by the manufacturer.EC type-approval certificateMODELFormat: A4 (210 × 297 mm)EC TYPE-APPROVAL CERTIFICATECommunication concerning:— EC type-approval (1)— extension of EC type-approval (1) — refusal of EC type-approval (1) — withdrawal of EC type-approval (1)9 > > > >> => > > > > ;of a type of vehicle with regard to its windscreen wiper and washer systemswith regard to Regulation (EU) No 1008/2010, as last amended by Regulation (EU) No .../ (1)EC type-approval number: ............................................................................................................................................................................... Reason for extension: ........................................................................................................................................................................................SECTION I0.1. Make (trade name of manufacturer): .................................................................................................................................................0.2. Type: ............................................................................................................................................................................................................0.2.1. Commercial name(s) (if available): ......................................................................................................................................................0.3. Means of identification of type, if marked on the vehicle (2): ..................................................................................................0.3.1. Location of that marking: .....................................................................................................................................................................0.4. Category of vehicle (3): ...........................................................................................................................................................................0.5. Name and address of manufacturer: ..................................................................................................................................................0.8. Name(s) and address(es) of assembly plant(s): ................................................................................................................................0.9. Name and address of the manufacturer's representative (if any): ............................................................................................SECTION II1. Additional information: see Addendum.2. Technical service responsible for carrying out the tests: ...................................................................................................................3. Date of test report: .........................................................................................................................................................................................4. Number of test report: ..................................................................................................................................................................................5. Remarks (if any): see Addendum.6. Place: ...................................................................................................................................................................................................................7. Date: ....................................................................................................................................................................................................................8. Signature: ........................................................................................................................................................................................................... Attachments: Information packageTest report(1) Delete where not applicable.(2) If the means of identification of type contains characters not relevant to describe the vehicle, component or separate technical unittypes covered by this information document, such characters shall be represented in the documentation by the symbol ‘?’ (e.g.ABC??123??).(3) As defined in Directive 2007/46/EC, Annex II, Section A.to EC type-approval certificate No …1. Additional information:1.1. Brief description of the vehicle type as regards its structure, dimensions, lines and constituent materials: .............................................................................................................................................................................................................................................1.2. Description of the method of operation of the wiper and washing systems: ........................................................................1.3. Detailed description of the wiper system (i.e. number of blades, blade lengths, wiper arm dimensions, etc.): ..........1.4. Detailed description of the washer system (i.e. number of nozzles, number of outlet ports per nozzle, washer pump,fluid storage container, washer line hoses and their mounting to pump and nozzles, etc.) .............................................1.5. Fluid storage capacity (litre): ....................................................................................................................................................................1.6. Maximum vehicle design speed (km/h): ...............................................................................................................................................2. Hand of drive: left/right (1)3. Left hand drive and mirror-opposite right hand drive systems: yes/no (1)4. Aerodynamic spoiler fitted onto the wiper arm/wiper blade (1) at driver side/centre/passenger side/ (1)5. Remarks: .........................................................................................................................................................................................................(1) Delete as appropriate.ANNEX IIAdministrative documents for EC type-approval of windscreen washer systems as separate technical unitsPART 1Information documentMODELInformation document No … relating to the EC type-approval as a separate technical unit of windscreen washer systems.The following information shall be supplied in triplicate and include a list of contents. Any drawings shall be supplied in appropriate scale and in sufficient detail on size A4 or on a folder of A4 format. Photographs, if any, shall show sufficient detail.If the systems, components or separate technical units referred to in this information document have electronic controls, information concerning their performance shall be supplied.0. GENERAL0.1. Make (trade name of manufacturer): .................................................................................................................................................0.2. Type: ............................................................................................................................................................................................................0.3. Means of identification of type, if marked on the separate technical unit (b): ....................................................................0.3.1. Location of that marking: .....................................................................................................................................................................0.5. Name and address of manufacturer: ..................................................................................................................................................0.7. In case of separate technical units, location and method of affixing the EC approval mark: .......................................0.8. Name(s) and address(es) of assembly plant(s): ................................................................................................................................0.9. Name and address of the manufacturer's representative (if any): ............................................................................................9.7. Windscreen washer9.7.1. Detailed technical description (including photographs or drawings): .....................................................................................Explanatory notes(b) If the means of identification of type contains characters not relevant to describe the vehicle, component or separatetechnical unit types covered by this information document, such characters shall be represented in the documentation by the symbol ‘?’ (e.g. ABC??123??).EC type-approval certificateMODELFormat: A4 (210 × 297 mm)EC TYPE-APPROVAL CERTIFICATECommunication concerning:— EC type-approval (1)— extension of EC type-approval (1) — refusal of EC type-approval (1) — withdrawal of EC type-approval (1)9 > > > >> => > > > > ;of a type of windscreen washer system as a separate technical unitwith regard to Regulation (EU) No 1008/2010, as last amended by Regulation (EU) No .../ (1)EC type-approval number: ............................................................................................................................................................................... Reason for extension: ........................................................................................................................................................................................SECTION I0.1. Make (trade name of manufacturer): .................................................................................................................................................0.2. Type: ............................................................................................................................................................................................................0.3. Means of identification of type, if marked on the separate technical unit (2): ....................................................................0.3.1. Location of that marking: .....................................................................................................................................................................0.5. Name and address of manufacturer: ..................................................................................................................................................0.7. Location and method of affixing of the EC approval mark: ....................................................................................................0.8. Name(s) and address(es) of assembly plant(s): ................................................................................................................................0.9. Name and address of the manufacturer's representative (if any): ............................................................................................SECTION II1. Additional information: see Addendum.2. Technical service responsible for carrying out the tests: ...................................................................................................................3. Date of test report: .........................................................................................................................................................................................4. Number of test report: ..................................................................................................................................................................................5. Remarks (if any): see Addendum.6. Place: ...................................................................................................................................................................................................................7. Date: ....................................................................................................................................................................................................................8. Signature: ........................................................................................................................................................................................................... Attachments: Information packageTest report(1) Delete where not applicable.(2) If the means of identification of type contains characters not relevant to describe the vehicle, component or separate technical unittypes covered by this information document, such characters shall be represented in the documentation by the symbol ‘?’ (e.g.ABC??123??).。

英文报告序号层级

英文报告序号层级

英文报告序号层级When crafting an English report, the use of clear and logical numbering is crucial for organization. Begin with the main sections, such as Introduction, Body, and Conclusion, each denoted by Roman numerals (I, II, III).Within the Body section, further divide the content into subtopics, using capital letters (A, B, C) to indicate the first level of subheadings. Each subtopic should address a specific aspect of the main section.For a more detailed breakdown, use Arabic numerals (1, 2, 3) to create second-level headings. These should elaborate on the points within each subtopic, providing supporting details or examples.If necessary, you can add a third layer of headings using lowercase letters (a, b, c). This layer is ideal for presenting specific data points, research findings, or arguments that support the second-level headings.Consistency is key when using numbering in a report. Ensure that the same format is applied throughout the document to maintain a professional and organized appearance.Remember to leave a space between the number and the text for each heading, and capitalize the first letter of each major word in the heading for readability.Finally, the conclusion should succinctly summarize the main points discussed in the report, providing a sense of closure to the reader.By following these guidelines, your report will not only be well-structured but also easy to navigate, making it accessible and engaging for your audience.。

sap abap采购订单报表

sap abap采购订单报表

*&---------------------------------------------------------------------* *& Report ZMM_TEST01*& Author: 杨路*&---------------------------------------------------------------------* *&*&*&---------------------------------------------------------------------*REPORT ZMM_TEST01.TABLES:EKKO,EKPO,EKET,MAKT.TYPE-POOLS: SLIS. "类似.net引入命名空间*-----------------------------------------------------------------------* * Define types*-----------------------------------------------------------------------* TYPES: BEGIN OF TYP_LIST,BUKRS TYPE EKKO-BUKRS,EKORG TYPE EKKO-EKORG,EKGRP TYPE EKKO-EKGRP,EBELN TYPE EKKO-EBELN,EBELP TYPE EKPO-EBELP,MATNR TYPE MAKT-MATNR,MAKTX TYPE MAKT-MAKTX,MENGE TYPE EKPO-MENGE,MEINS TYPE EKPO-MEINS,NETPR TYPE EKPO-NETPR,WAERS TYPE EKKO-WAERS,EINDT TYPE EKET-EINDT,END OF TYP_LIST.*-----------------------------------------------------------------------* * Define data*-----------------------------------------------------------------------*DATA: GTD_DATA TYPE STANDARD TABLE OF TYP_LIST,GTH_DATA TYPE TYP_LIST.DATA: GTD_TITLE TYPE SLIS_T_LISTHEADER,GTH_TITLE TYPE SLIS_LISTHEADER.DATA: GTD_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,GTH_FIELDCAT TYPE SLIS_FIELDCAT_ALV.DATA: GTH_LAYOUT TYPE SLIS_LAYOUT_ALV.DATA: GD_SPRAS TYPE SPRAS.data P_DATUM type d.*--------------------------------------------------------------------------** selection-screen*--------------------------------------------------------------------------*SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.SELECT-OPTIONS:S_LLIEF FOR EKKO-LLIEF,S_EBELN FOR EKKO-EBELN,S_MATNR FOR EKPO-MATNR ,S_AEDAT for EKKO-AEDAT OBLIGATORY.SELECTION-SCREEN END OF BLOCK B1.INITIALIZATION.P_DATUM = sy-datum.P_DATUM+6(2) = '01'.P_DATUM = P_DATUM .S_AEDAT-low = P_DATUM.S_AEDAT-high = sy-datum .APPEND S_AEDAT.*----------------------------------------------------------------------* * START-OF-SELECTION*----------------------------------------------------------------------* START-OF-SELECTION.PERFORM SUB_GET_DATA.PERFORM SUB_DISPLAY.PERFORM SUB_CLEAR.*&---------------------------------------------------------------------* *& Form SUB_GET_DATA*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* FORM SUB_GET_DATA .*------SELECT HEADER DATASELECTEKKO~BUKRSEKKO~EKORGEKKO~EKGRPEKKO~EBELNEKPO~EBELPMAKT~MATNRMAKT~MAKTXEKPO~MENGEEKPO~MEINSEKPO~NETPREKKO~WAERSEKET~EINDTINTO CORRESPONDING FIELDS OF TABLE GTD_DATAFROM EKKOINNER JOIN EKPO ON EKKO~EBELN = EKPO~EBELNLEFT JOIN EKET ON EKPO~EBELN = EKET~EBELNAND EKPO~EBELP = EKET~EBELPLEFT JOIN MAKT ON EKPO~MATNR = MAKT~MATNRWHERE EKKO~AEDAT in S_AEDATAND EKKO~LLIEF IN S_LLIEFAND EKKO~EBELN IN S_EBELNAND EKPO~MATNR IN S_MATNR.ENDFORM.*&---------------------------------------------------------------------* *& Form SUB_TITLE*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------*FORM SUB_TITLE.REFRESH GTD_TITLE.CLEAR GTH_TITLE.PERFORM SUB_SET_TITLE USING 'H' '' '采购订单报表'.PERFORM SUB_SET_TITLE USING 'S' '日期 :' SY-DATUM.PERFORM SUB_SET_TITLE USING 'S' '作者 :' SY-UNAME.ENDFORM. "SET_TITLE*&---------------------------------------------------------------------* *& Form sub_field*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* * --> p1 text* <-- p2 text*----------------------------------------------------------------------* FORM SUB_FIELD .* PERFORM SUB_SET_FIELD USING 1 'CHECK_BOX' 'GTD_DATA' '' '1'* '选取' 'X' 'X' '' .PERFORM SUB_SET_FIELD USING 1 'BUKRS' 'GTD_DATA' '' '10''公司代码' '' '' 'X' .PERFORM SUB_SET_FIELD USING 2 'EKORG' 'GTD_DATA' '' '4''采购组织' '' '' 'X' .PERFORM SUB_SET_FIELD USING 3 'EKGRP' 'GTD_DATA' '' '3''采购组' '' '' '' .PERFORM SUB_SET_FIELD USING 4 'EBELN' 'GTD_DATA' '' '4''采购凭证号' '' '' '' .PERFORM SUB_SET_FIELD USING 5 'EBELP' 'GTD_DATA' '' '3''项目编号' '' '' '' .PERFORM SUB_SET_FIELD USING 6 'MATNR' 'GTD_DATA' '' '10''物料号' '' '' '' .PERFORM SUB_SET_FIELD USING 7 'MAKTX' 'GTD_DATA' '' '5''物料描述' '' '' 'X' .PERFORM SUB_SET_FIELD USING 8 'MENGE' 'GTD_DATA' '' '18''数量' '' '' 'X' .PERFORM SUB_SET_FIELD USING 9 'MEINS' 'GTD_DATA' '' '40''单位' '' '' '' .PERFORM SUB_SET_FIELD USING 10 'NETPR' 'GTD_DATA' '' '9''价格' '' '' '' .PERFORM SUB_SET_FIELD USING 11 'WAERS' 'GTD_DATA' '' '4''货币' '' '' '' .PERFORM SUB_SET_FIELD USING 12 'EINDT' 'GTD_DATA' '' '17''交货日期' '' '' '' .ENDFORM. " sub_field*&---------------------------------------------------------------------* *& Form sub_set_layout*&---------------------------------------------------------------------* * 设置ALV列表显示的布局*&---------------------------------------------------------------------* FORM SUB_SET_LAYOUT.CLEAR GTH_LAYOUT.GTH_LAYOUT-COLWIDTH_OPTIMIZE = 'X'. "设置为最适合的布局GTH_LAYOUT-ZEBRA = 'X'.ENDFORM. " sub_set_layout*&---------------------------------------------------------------------* *& Form set_pf_status*&---------------------------------------------------------------------* * AVL STATUS*&---------------------------------------------------------------------* FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.SET TITLEBAR 'PO2'. "设置报表标题SET PF-STATUS 'ZSTATUS2' . "设置工具栏等ENDFORM. "set_pf_status*&---------------------------------------------------------------------* *& Form sub_display*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* FORM SUB_DISPLAY .PERFORM SUB_TITLE.PERFORM SUB_FIELD.PERFORM SUB_SET_LAYOUT.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTINGI_CALLBACK_PROGRAM = SY-CPROGI_CALLBACK_TOP_OF_PAGE = 'ALV_TOP_OF_PAGE'I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'I_CALLBACK_USER_COMMAND = 'USER_COMMAND_ALV'IT_FIELDCAT = GTD_FIELDCATIS_LAYOUT = GTH_LAYOUTTABLEST_OUTTAB = GTD_DATA "内表EXCEPTIONSPROGRAM_ERROR = 1OTHERS = 2.IF SY-SUBRC <> 0.MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNOWITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDIF.ENDFORM. "SUB_DISPLAY*&---------------------------------------------------------------------* *& Form alv_top_of_page*&---------------------------------------------------------------------* * ALV列表抬头的设定*&---------------------------------------------------------------------* FORM ALV_TOP_OF_PAGE.CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'EXPORTINGIT_LIST_COMMENTARY = GTD_TITLE.ENDFORM. "alv_top_of_page*&---------------------------------------------------------------------* *& Form user_command_alv*&---------------------------------------------------------------------* * ALV 用户事件*&---------------------------------------------------------------------**&---------------------------------------------------------------------* *& Form sub_clear*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* FORM SUB_CLEAR .FREE: GTD_DATA,GTH_DATA.ENDFORM. " sub_clear*&---------------------------------------------------------------------* *& Form sub_set_title*&---------------------------------------------------------------------* * ALV列表抬头信息的属性设置*&---------------------------------------------------------------------* * --> i_typ "输出的类型* --> i_key "文本* --> i_info "数值*&---------------------------------------------------------------------* FORM SUB_SET_TITLE USING I_TYP TYPE ANYI_KEY TYPE ANYI_INFO TYPE ANY.CLEAR GTH_TITLE.GTH_TITLE-TYP = I_TYP. "输出的类型GTH_TITLE-KEY = I_KEY. "文本GTH_TITLE-INFO = I_INFO. "数值APPEND GTH_TITLE TO GTD_TITLE.ENDFORM. "sub_set_title*&---------------------------------------------------------------------* *& Form sub_set_field*&---------------------------------------------------------------------* * 设置ALV字段的属性*&---------------------------------------------------------------------* * -->i_pos "显示列的位置* -->i_fieldname "内表的字段名* -->i_tabname "内表名* -->i_box "显示复选框* -->i_edit "是否为可输入* -->i_key "设置主键* -->i_hotspot "单击控制* -->i_outputlen "控制输出列的宽度* -->i_seltext "设置列的名称* -->i_edit "可编辑*&---------------------------------------------------------------------* FORM SUB_SET_FIELD USING I_POS TYPE ANYI_FIELDNAME TYPE ANYI_TABNAME TYPE ANYI_KEY TYPE ANYI_OUTPUTLEN TYPE ANYI_SELTEXT TYPE ANYI_EDIT TYPE ANYI_BOX TYPE ANYI_NO_ZERO TYPE ANY.GTH_FIELDCAT-COL_POS = I_POS. "显示列的位置GTH_FIELDCAT-FIELDNAME = I_FIELDNAME. "内表的字段名GTH_FIELDCAT-TABNAME = I_TABNAME. "内表名GTH_FIELDCAT-KEY = I_KEY. "设置主键GTH_FIELDCAT-OUTPUTLEN = I_OUTPUTLEN. "控制输出列的宽度GTH_FIELDCAT-SELTEXT_M = I_SELTEXT. "设置列的名称GTH_FIELDCAT-EDIT = I_EDIT.GTH_FIELDCAT-CHECKBOX = I_BOX.GTH_FIELDCAT-NO_ZERO = I_NO_ZERO.APPEND GTH_FIELDCAT TO GTD_FIELDCAT.CLEAR GTH_FIELDCAT.ENDFORM. "sub_set_field。

OOALV+双击+选择行+按钮+单元格变色

OOALV+双击+选择行+按钮+单元格变色

OOALV+双击+选择⾏+按钮+单元格变⾊*&---------------------------------------------------------------------**& Report Z4760_ALV*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORT Z4760_ALV.TABLES:SFLIGHT.DATA GR_ALVGRID TYPE REF TO CL_GUI_ALV_GRID. "alv实例存放DATA GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC_ALV'. "对应画的控制区DATA GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER. " 容器存放DATA GT_FIELDCAT TYPE LVC_T_FCAT. "栏位DATA GS_LAYOUT TYPE LVC_S_LAYO. "布局DATA :save_code TYPE sy-ucomm,ok_code TYPE sy-ucomm."从这⾥开始⾃定义变量DATA:BEGIN OF IT_SFLIGHT OCCURS 0,CARRID LIKE SFLIGHT-CARRID,CONNID LIKE SFLIGHT-CONNID,FLDATE LIKE SFLIGHT-FLDATE,PRICE LIKE SFLIGHT-PRICE,COLOR(4) TYPE C,FLAG TYPE C,CELLCOLOR TYPE LVC_T_SCOL, "某个单元格的颜⾊END OF IT_SFLIGHT.DATA:BEGIN OF IT_SFLIGHT1 OCCURS 0,CARRID LIKE SFLIGHT-CARRID,CONNID LIKE SFLIGHT-CONNID,FLDATE LIKE SFLIGHT-FLDATE,PRICE LIKE SFLIGHT-PRICE,COLOR(4) TYPE C,FLAG TYPE C,CELLCOLOR TYPE LVC_T_SCOL, "某个单元格的颜⾊END OF IT_SFLIGHT1."*------双击事件定义CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED.*定义事件DATA EVENT_RECEIVER TYPE REF TO LCL_EVENT_RECEIVER.* 定义事件属性跟⽅法CLASS LCL_EVENT_RECEIVER DEFINITION.PUBLIC SECTION.METHODS:* 双击⽅法HANDLE_DOUBLE_CLICKFOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRIDIMPORTING E_ROW E_COLUMN,"*----按钮处理⽅法HANDLE_TOOLBARFOR EVENT TOOLBAR OF CL_GUI_ALV_GRIDIMPORTING E_OBJECT E_INTERACTIVE,"*-----⽤户交互处理事件HANDLE_USER_COMMANDFOR EVENT USER_COMMAND OF CL_GUI_ALV_GRIDIMPORTING E_UCOMM.ENDCLASS. "LCL_EVENT_RECEIVER DEFINITION*----------------------------------------------------------------------** CLASS LCL_EVENT_RECEIVER IMPLEMENTATION*----------------------------------------------------------------------** * 双击⽅法实现*----------------------------------------------------------------------*CLASS LCL_EVENT_RECEIVER IMPLEMENTATION."*------双击的实现METHOD HANDLE_DOUBLE_CLICK.PERFORM GETRECORD USING E_ROW-INDEX E_COLUMN-FIELDNAME. ENDMETHOD. "HANDLE_DOUBLE_CLICK"*-------处理按钮事件METHOD HANDLE_TOOLBAR.DATA: LS_TOOLBAR TYPE STB_BUTTON.CLEAR LS_TOOLBAR.MOVE 3 TO LS_TOOLBAR-BUTN_TYPE.* 取⼯具条接⼝APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR."开始插⼊按钮CLEAR LS_TOOLBAR.*加⼊功能码MOVE 'SHOW_DETA' TO LS_TOOLBAR-FUNCTION.*图标,可以⽤SHOWICON系统程序查阅使⽤的图标MOVE ICON_PPE_ENODE TO LS_TOOLBAR-ICON.*按钮⽂本和提⽰MOVE '明细显⽰' TO LS_TOOLBAR-QUICKINFO.MOVE '明细显⽰'(112) TO LS_TOOLBAR-TEXT.MOVE '' TO LS_TOOLBAR-DISABLED.*添加到⼯具条APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.CLEAR LS_TOOLBAR.*加⼊功能码MOVE 'BAPI' TO LS_TOOLBAR-FUNCTION.*图标,可以⽤SHOWICON系统程序查阅使⽤的图标MOVE ICON_PPE_ENODE TO LS_TOOLBAR-ICON.*按钮⽂本和提⽰MOVE 'bapi显⽰' TO LS_TOOLBAR-QUICKINFO.MOVE 'bapi显⽰'(112) TO LS_TOOLBAR-TEXT.MOVE '' TO LS_TOOLBAR-DISABLED.*添加到⼯具条APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.ENDMETHOD. "HANDLE_TOOLBAR* 处理功能码事件METHOD HANDLE_USER_COMMAND.DATA: LT_ROWS TYPE LVC_T_ROW.CASE E_UCOMM.* 定义的按钮事件WHEN 'SHOW_DETA'.*取得所有选择⾏CALL METHOD GR_ALVGRID->GET_SELECTED_ROWSIMPORTINGET_INDEX_ROWS = LT_ROWS.CALL METHOD CL_GUI_CFW=>FLUSH.IF SY-SUBRC EQ 0.* 提⽰成功MESSAGE '已经选择⾏!' TYPE 'S'.*调⽤⼦程序显⽰⾏内容PERFORM READDATA TABLES LT_ROWS.ENDIF.ENDCASE.ENDMETHOD. "HANDLE_USER_COMMANDENDCLASS. "LCL_EVENT_RECEIVER IMPLEMENTATION*&---------------------------------------------------------------------**& Form GETRECORD*&---------------------------------------------------------------------** 具体事件*----------------------------------------------------------------------*FORM GETRECORD USING A B."E_ROW-INDEX E_COLUMN-FIELDNAME.READ TABLE IT_SFLIGHT INDEX A."E_ROW-INDEX.*将⾏列等信息合并到字符串DATA: MSG(100).CONCATENATE '⾏:' A '列名:' B INTO MSG."E_COLUMN-FIELDNAME INTO MSG.CONCATENATE MSG ' CONNID:' IT_SFLIGHT-CONNID INTO MSG.CONCATENATE MSG ' CARRID:' IT_SFLIGHT-CARRID INTO MSG.MESSAGE MSG TYPE 'I'.ENDFORM. "GETRECORDSELECT-OPTIONS S_CARRID FOR SFLIGHT-CARRID.SELECT-OPTIONS S_CONNID FOR SFLIGHT-CONNID.SELECT-OPTIONS S_FLDATE FOR SFLIGHT-FLDATE.SELECT-OPTIONS S_PRICE FOR SFLIGHT-PRICE.START-OF-SELECTION.PERFORM GETDATA. "读取数据CALL SCREEN 9000. "呼叫屏幕*&---------------------------------------------------------------------**& Form GETDATA*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM GETDATA .DATA DECI_COUNT TYPE i.DATA TMP_TITLE(60) TYPE c.DATA: W_CELLCOLOR TYPE LVC_S_SCOL. "单元格颜⾊DATA:SET_COLOR TYPE I.SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_SFLIGHT FROM SFLIGHT WHERE CARRID IN S_CARRIDAND CONNID IN S_CONNIDAND FLDATE IN S_FLDATEAND PRICE IN S_PRICE.DESCRIBE TABLE IT_SFLIGHT LINES DECI_COUNT. "获取记录数 LOOP AT IT_SFLIGHT.SET_COLOR = SY-TABIX MOD 2.IF SET_COLOR = 0.IT_SFLIGHT-COLOR = 'C500'. "设置颜⾊ELSE.CLEAR IT_SFLIGHT-COLOR.ENDIF."*------单元格颜⾊设置IF IT_SFLIGHT-PRICE <= 1000. "数值⼩于1000的加红⾊CLEAR IT_SFLIGHT-COLOR.W_CELLCOLOR-FNAME = 'PRICE'. "加颜⾊的栏位W_CELLCOLOR-COLOR-COL = '6'. "红⾊W_CELLCOLOR-COLOR-INT = '1'. "颜⾊加深 0代表不加深APPEND W_CELLCOLOR TO IT_SFLIGHT-CELLCOLOR.ENDIF.MODIFY IT_SFLIGHT.ENDLOOP.TMP_TITLE = 'ALV⾯向对象测试'. "报表名称ENDFORM. " GETDATA"以下开始display*&---------------------------------------------------------------------**& Module DISPPLY_ALV OUTPUT*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*MODULE DISPPLY_ALV OUTPUT.PERFORM DISPPLY_ALV1 USING IT_SFLIGHT[] . ENDMODULE. " DISPPLY_ALV OUTPUT*&---------------------------------------------------------------------**& Form DISPPLY_ALV1*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** -->P_IT_SFLIGHT[] text*----------------------------------------------------------------------*FORM DISPPLY_ALV1 USING P_IT_SFLIGHT TYPE TABLE.IF GR_ALVGRID IS INITIAL. "r如果实例对象为空CREATE OBJECT GR_CCONTAINER "建⽴容器EXPORTINGCONTAINER_NAME = GC_CUSTOM_CONTROL_NAMEEXCEPTIONSCNTL_ERROR = 1CNTL_SYSTEM_ERROR = 2CREATE_ERROR = 3LIFETIME_ERROR = 4LIFETIME_DYNPRO_DYNPRO_LINK = 5OTHERS = 6.IF sy-subrc eq 0. "容器创建成功则创建实例CREATE OBJECT GR_ALVGRIDEXPORTINGI_PARENT = GR_CCONTAINEREXCEPTIONSERROR_CNTL_CREATE = 1ERROR_CNTL_INIT = 2ERROR_CNTL_LINK = 3ERROR_DP_CREATE = 4OTHERS = 5.ENDIF."实例创建成功了IF SY-SUBRC EQ 0.ENDIF."*-----准备获取栏位列表PERFORM SETFIELDS."*-----设置布局PERFORM PREPARE_LAYOUT CHANGING GS_LAYOUT ."*-----准备完毕,显⽰ALVCALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGIS_LAYOUT = GS_LAYOUTI_SAVE = 'A'CHANGINGIT_OUTTAB = P_IT_SFLIGHT "设置成⾃⼰的内表IT_FIELDCATALOG = GT_FIELDCATEXCEPTIONSINVALID_PARAMETER_COMBINATION = 1PROGRAM_ERROR = 2TOO_MANY_LINES = 3OTHERS = 4 ."*-----创建双击事件CREATE OBJECT EVENT_RECEIVER.SET HANDLER EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR GR_ALVGRID. SET HANDLER EVENT_RECEIVER->HANDLE_TOOLBAR FOR GR_ALVGRID.SET HANDLER EVENT_RECEIVER->HANDLE_USER_COMMAND FOR GR_ALVGRID. "*-----刷新ALVCALL METHOD GR_ALVGRID->REFRESH_TABLE_DISPLAY* EXPORTINGEXCEPTIONSFINISHED = 1OTHERS = 2.IF SY-SUBRC = 0.ENDIF.ENDIF.ENDFORM. " DISPPLY_ALV1*&---------------------------------------------------------------------**& Form SETFIELDS*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM SETFIELDS .PERFORM SETFIELD USING 'FLAG' 'FLAG' 2.PERFORM SETFIELD USING 'CARRID' '航线承运⼈ID' 3.PERFORM SETFIELD USING 'CONNID' '航班连接 Id' 4.PERFORM SETFIELD USING 'FLDATE' '航班⽇期' 8.PERFORM SETFIELD USING 'PRICE' '航空运费' 15.ENDFORM. " SETFIELDS"*----设置ALV表栏位的宏DEFINE DSETFIELDS.DATA LS_FCAT TYPE LVC_S_FCAT .LS_FCAT-FIELDNAME = &1.LS_FCAT-INTTYPE = 'C' .LS_FCAT-OUTPUTLEN = &3.LS_FCAT-COLTEXT = &2.LS_FCAT-SELTEXT = &2.* LS_FCAT-edit = 'X'.APPEND LS_FCAT TO GT_FIELDCAT .END-OF-DEFINITION.* 调⽤宏设置栏位*----------------------------------------------------------------------*FORM SETFIELD USING TMP_FIELD TYPE CTMP_NAME TYPE CTMP_LENGTH TYPE I.DSETFIELDS TMP_FIELD TMP_NAME TMP_LENGTH.ENDFORM. "SETFIELDS"*-----输出格式*&---------------------------------------------------------------------**& Form PREPARE_LAYOUT*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** <--P_GS_LAYOUT text*----------------------------------------------------------------------*FORM PREPARE_LAYOUT CHANGING P_GS_LAYOUT TYPE LVC_S_LAYO. P_GS_LAYOUT-ZEBRA = 'X' .* P_GS_LAYOUT-GRID_TITLE = TITLE .P_GS_LAYOUT-SMALLTITLE = 'X' .P_GS_LAYOUT-SEL_MODE = 'A'.P_GS_LAYOUT-INFO_FNAME = 'COLOR'.P_GS_LAYOUT-CWIDTH_OPT = 'X'.P_GS_LAYOUT-DETAILINIT = 'X'.P_GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'. "⼀定要⼤写* p_gs_layout-zebra = 'X'.* p_gs_layout-cwidth_opt = 'X'.** "设置checkbox** P_GS_LAYOUT-BOX_FNAME = 'FLAG'.ENDFORM. " PREPARE_LAYOUT*&---------------------------------------------------------------------**& Module STATUS_9000 OUTPUT*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*MODULE STATUS_9000 OUTPUT.SET PF-STATUS 'STA_9000'.SET TITLEBAR 'TIT_9000'.ENDMODULE. " STATUS_9000 OUTPUT*&---------------------------------------------------------------------**& Module USER_COMMAND_9000 INPUT*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*MODULE USER_COMMAND_9000 INPUT.CLEAR save_code.save_code = ok_code.CLEAR ok_code.CASE save_code.WHEN 'BACK'.LEAVE to SCREEN 0.WHEN 'EXIT'.LEAVE PROGRAM.WHEN 'CANCLE'.LEAVE TO TRANSACTION SY-TCODE.WHEN OTHERS.ENDCASE.ENDMODULE. " USER_COMMAND_9000 INPUT*&---------------------------------------------------------------------**& Form READDATA*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** -->P_LT_ROWS text*----------------------------------------------------------------------*FORM READDATA TABLES P_LT_ROWS STRUCTURE LVC_S_ROW. * 定义选择⾏DATA: LS_SELECTED_LINE LIKE LVC_S_ROW,LF_ROW_INDEX TYPE LVC_INDEX.LOOP AT P_LT_ROWS INTO LS_SELECTED_LINE .LF_ROW_INDEX = LS_SELECTED_LINE-INDEX.* 从内表中按顺序读取内容READ TABLE IT_SFLIGHT[] INTO IT_SFLIGHT INDEX LF_ROW_INDEX. MOVE-CORRESPONDING IT_SFLIGHT to IT_SFLIGHT1.APPEND IT_SFLIGHT1 to IT_SFLIGHT1[].ENDLOOP.ENDFORM. " READDATA。

关于ALV中编码字段需要显示描述的快捷处理办法

关于ALV中编码字段需要显示描述的快捷处理办法

关于ALV中编码字段需要显⽰描述的快捷处理办法在ALV显⽰清单时.有些编码字段⽤户希望显⽰编码的描述.如下图所⽰处理⽅式:1.找到对应的域定义: 调整域的显⽰长度2.然后创建转换函数(备注: 转换函数格式中ZYCGD限制为5位字符.每个需要转换的数据元素给不同的5位字符.代码需要按照下图的代码产⽣后,调整⼀下域名(⽬前尚未解决动态识别域名的问题).3.CONVERSION_EXIT_ZYCGD_OUTPUT CONVERSION_EXIT_ZYCGD_INPUT4.代码如下:5.⽰例程序ZTS_ALV_CONVERT 程序中的注意事项. 详见下⾯的程序注释6.*&---------------------------------------------------------------------**& Report ZTS_ALV_CONVERT*&*&---------------------------------------------------------------------* *&*&*&---------------------------------------------------------------------*REPORT zts_alv_convert.PARAMETERS: p_1 RADIOBUTTON GROUP ra1,p_2 RADIOBUTTON GROUP ra1.DATA: gt_data LIKE TABLE OF zts_convert WITH HEADER LINE. START-OF-SELECTION.*读取数据SELECT * FROM zts_convert INTO TABLE gt_data.*ALV显⽰.PERFORM dia_process.*&---------------------------------------------------------------------**& Form dia_process*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*FORM dia_process .*通过结构获取字段清单DATA: l_tname TYPE tabname,lt_ftab TYPE lvc_t_fcat.FIELD-SYMBOLS: TYPE lvc_s_fcat.DATA: lt_ftab_key TYPE lvc_t_fcat.*获取表的字段.CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' EXPORTINGi_structure_name = 'ZTS_CONVERT'CHANGINGct_fieldcat = lt_ftabEXCEPTIONSOTHERS = 1.*使⽤不同的转换CASE 'X'.WHEN p_1.READ TABLE lt_ftab ASSIGNING WITH KEY fieldname = 'ZYCGD'.IF sy-subrc = 0.-convexit = 'ZYCGE'.ENDIF.WHEN p_2.READ TABLE lt_ftab ASSIGNING WITH KEY fieldname = 'ZYCGD'.IF sy-subrc = 0.-convexit = 'ZYCGD'.ENDIF.ENDCASE.*调⽤函数显⽰ALV. 如果是调⽤REUSE_ALV_GRID_DISPLAY,必须修改为调⽤下⾯的函数显⽰ALV. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'EXPORTING* i_callback_program = f_repid* i_callback_pf_status_set = 'FRM_SET_PF' "传⼊设置界⾯的FORM名称* i_callback_user_command = 'FRM_USER_COM' "传⼊响应按钮的FORM名称* i_grid_title = f_title* i_grid_settings = lc_glay* is_layout = gs_layoutit_fieldcat_lvc = lt_ftab[]* it_events = gt_events[] * i_screen_end_column = 2i_save = 'A'* is_variant = ls_variant TABLESt_outtab = gt_data. ENDFORM. " DIA_PROCESS7.。

lcov 报告格式

lcov 报告格式

lcov报告格式
LCOV(Lines Coverage)是一种代码覆盖率测试工具,它生成的报告采用一种文本格式,用于展示源代码的覆盖率情况。

下面是LCOV报告的一般格式:
1.总览部分:报告的开头通常包含有关测试运行总体覆盖率的概要信息,如总行数、覆盖的行数和覆盖率百分比。

```
总行数:xxx
覆盖行数:xxx
覆盖率:xx%
```
2.文件详细信息:接下来是每个被测试文件的详细信息,包括文件路径、总行数、覆盖的行数和覆盖率百分比。

```
文件'path/to/your/file.cpp'
------------------------------------
行数:xxx
覆盖行数:xxx
覆盖率:xx%
```
3.每行的覆盖情况:对于每一行代码,报告都会显示是否被覆盖以及该行的覆盖次数。

```
LCOV:源文件'path/to/your/file.cpp'
函数'your_function':
Lines executed:xx.xx%of xxx
path/to/your/file.cpp:10:some_code();//被执行过一次
path/to/your/file.cpp:20:another_code();//未被执行
```
以上只是一种常见的LCOV报告格式,具体的格式可能会根据LCOV版本和配置而有所不同。

你可以通过查阅LCOV的官方文档或具体使用的测试工具的文档来获取更详细的信息。

关于ALV 布局变式问题

关于ALV 布局变式问题
* text
*----------------------------------------------------------------------*
FORM ALV_GRID_DISPLAY2 .
GV_ALV_VARIANT-REPORT = SY-REPID.
GV_ALV_HANDLE = GV_ALV_HANDLE + 1.
GV_ALV_VARIANT-HANDLE = GV_ALV_HANDLE.
* Display
CALL METHOD GO_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = GS_LAYOCAT2
IT_TOOLBAR_EXCLUDING = GT_EXCLUDE2
GV_ALV_HANDLE LIKE DISVARIANT-HANDLE.
*&---------------------------------------------------------------------*
*& Form ALV_GRID_DISPLAY2
*&--------------------------------------------------------- = 'A'
IS_VARIANT = GV_ALV_VARIANT
CHANGING
IT_OUTTAB = GT_DISPLAY2[]
IT_SORT = GT_SORT2
IT_FIELDCATALOG = GT_FIELDCAT2[].
ENDFORM. "ALV_GRID_DISPLAY2
可以保存布局变式的,效果如下图:

sap abap查询透明表、表结构 显示方式为ALV(主要用于快速复制表、结构的字段用)

sap abap查询透明表、表结构 显示方式为ALV(主要用于快速复制表、结构的字段用)

注意:本程序只能用于方便查看和导出透明表、表结构的结构。

在使用的时候,只需要输入表名或结构名即可,其他不用输入。

REPORT: z_test1.TABLES:tadir,trdirt,tstc,dd03l,dd02l,dd04l,dd02t,dd03t,dd04t. DATA: BEGIN OF ytadir OCCURS 0.INCLUDE STRUCTURE tadir.INCLUDE STRUCTURE trdirt.DATA: END OF ytadir.DATA:prog(72) TYPE c OCCURS 0 WITH HEADER LINE.*表结构DATA:BEGIN OF tab OCCURS 0.INCLUDE STRUCTURE dd03l.DATA:text(40).DATA:END OF tab.DATA:BEGIN OF t1 OCCURS 0,tabname LIKE dd02l-tabname,ddtext LIKE dd02t-ddtext,END OF t1.DATA:BEGIN OF itab OCCURS 0,field(15), "字段key(6), "关键字elment(15), "字段类型type(10), "数据类型leng(8) , "长度decimals(8) , "小数chk(10), "表检查can(10), "参考表cfi(10), "参考字段text(40), "字段描述END OF itab.DATA wa_itab LIKE LINE OF itab.DATA: yyname(150).DATA: tt(500) OCCURS 0 WITH HEADER LINE.DATA: rn(72).DATA: f_dir TYPE string.DATA:fields(40),lin TYPE i,val(30),rep(40).SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.PARAMETERS:dow AS CHECKBOX. "是否下载PARAMETERS:p_dir TYPE localfile DEFAULT 'D:\SAP开发程序'. "下载路径PARAMETERS:stype(6) DEFAULT 'TXT'.PARAMETERS:r1 RADIOBUTTON GROUP r ,r2 RADIOBUTTON GROUP r DEFAULT 'X'.SELECTION-SCREEN END OF BLOCK blk1.SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME.SELECT-OPTIONS:author FOR tadir-author. "开发人SELECT-OPTIONS:devclass FOR tadir-devclass. "开发类SELECT-OPTIONS:obj FOR tadir-obj_name . "下载程序名称SELECT-OPTIONS:tabname FOR dd02l-tabname . "下载表名称SELECTION-SCREEN END OF BLOCK blk2.INITIALIZATION .START-OF-SELECTION .IF r1 = 'X'.PERFORM get_data.ENDIF.IF r2 = 'X'.IF tabname IS INITIAL.MESSAGE i000(znyj13) WITH '请输入要下载的表名!'.ELSE.PERFORM get_table_data.ENDIF.ENDIF.AT LINE-SELECTION.CLEAR: fields, lin.GET CURSOR FIELD fields LINE lin VALUE val.lin = lin - 1.IF lin >= 1.READ TABLE ytadir INDEX lin.IF sy-subrc = 0.CLEAR rep.CLEAR prog.rep = ytadir-obj_name.READ REPORT rep INTO prog.EDITOR-CALL FOR prog.* SET PARAMETER ID 'RID' FIELD REP.* CALL TRANSACTION 'SE38' AND SKIP FIRST SCREEN.ENDIF.ENDIF.END-OF-SELECTION.*---------------------------------------------------------------------** FORM GET_DATA **---------------------------------------------------------------------** ........ **---------------------------------------------------------------------*FORM get_data.SELECT * INTO CORRESPONDING FIELDS OF TABLE ytadirFROM tadirINNER JOIN trdirt ON tadir~obj_name = trdirt~nameWHERE object = 'PROG'AND obj_name IN objAND devclass IN devclassAND author IN author.SORT ytadir BY obj_name.WRITE:/ '开发类','开发人','程序名称','程序标题'.LOOP AT ytadir.IF dow = 'X'.REFRESH tt.rn = ytadir-obj_name.READ REPORT rn INTO tt.CONCATENATE p_dir ytadir-author '_' ytadir-obj_name'_' ytadir-text '.' stypeINTO yyname.CALL FUNCTION 'WS_DOWNLOAD'EXPORTINGfilename = yynamefiletype = 'ASC'TABLESdata_tab = tt.IF sy-subrc = 0.WRITE:/1(10) ytadir-devclass,(8) ytadir-author,(15) ytadir-obj_name,(40) ytadir-text.FORMAT COLOR 5.WRITE: '已下载'.FORMAT COLOR OFF.ELSE.WRITE:/ ytadir-devclass,ytadir-author,ytadir-obj_name,ytadir-text.FORMAT COLOR 4.WRITE: '无法下载'.FORMAT COLOR OFF.ENDIF.ELSE.WRITE:/ ytadir-devclass,ytadir-author,ytadir-obj_name,ytadir-te xt.ENDIF.ENDLOOP.ENDFORM. "GET_DATA*---------------------------------------------------------------------** FORM GET_TABLE_DATA **---------------------------------------------------------------------** ........ **---------------------------------------------------------------------*FORM get_table_data.SELECT DISTINCT * INTO CORRESPONDING FIELDS OF TABLE t1FROM dd02t WHERE tabname IN tabnameAND ddlanguage EQ '1'.SELECT * INTO CORRESPONDING FIELDS OF TABLE tab FROM dd03l AS a WHERE a~tabname IN tabname.SORT tab BY tabname position.* uline.* write:/ sy-vline, at 2(10) '字段名',* sy-vline,at 14(10)'关键字',* sy-vline,at 26(10) '数据元素',* sy-vline,at 38(10) '数据类型',* sy-vline,at 50(10)'长度',* sy-vline,at 62(10)'小数',* sy-vline,at 74(10)'表检查',* sy-vline,at 86(10)'参考表',* sy-vline,at 98(10)'参考字段',* sy-vline,at 110(30)'字段描述',* at 142 sy-vline.* uline.LOOP AT t1.REFRESH itab.CLEAR yyname.IF dow = 'X'.itab-field = '字段名'.itab-key = '关键字'.itab-elment = '数据元素'.itab-type = '数据类型'.itab-leng = '长度'.itab-decimals = '小数'.itab-text = '字段描述'.itab-chk = '表检查'.itab-can = '参考表'.itab-cfi = '参考字段'.APPEND itab.CLEAR itab.ENDIF.CONCATENATE t1-tabname '_' t1-ddtext '的表结构如下:'INTO yyname.FORMAT COLOR 3.* WRITE:/ yyname.FORMAT COLOR OFF.LOOP AT tab WHERE tabname = t1-tabname.itab-field = tab-fieldname.itab-key = tab-keyflag.itab-elment = tab-rollname.itab-type = tab-datatype.itab-leng = tab-leng.itab-chk = tab-checktable.itab-can = tab-reftable.itab-cfi = tab-reffield.itab-decimals = tab-decimals.IF tab-rollname NE space.SELECT SINGLE * FROM dd04t WHERE rollname = tab-rollnameAND ddlanguage = '1'.IF sy-subrc = 0.itab-text = dd04t-ddtext.ELSE.CLEAR itab-text.ENDIF.ELSE.SELECT SINGLE * FROM dd03t WHERE tabname = tab-tabnameAND ddlanguage = '1'AND fieldname = tab-fieldname.IF sy-subrc = 0.itab-text = dd03t-ddtext.ELSE.CLEAR itab-text.ENDIF.ENDIF.APPEND itab.* write: /* sy-vline,at 2(10) itab-field,* sy-vline,at 14(10) itab-key,* sy-vline,at 26(10) itab-elment,* sy-vline,at 38(10) itab-type,* sy-vline,at 50(10) itab-leng,* sy-vline,at 62(10) itab-decimals,* sy-vline,at 74(10) itab-chk,* sy-vline,at 86(10) itab-can,* sy-vline,at 98(10) itab-cfi,* sy-vline,at 110(30) itab-text,* at 142 sy-vline.* clear itab.* uline.ENDLOOP.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'EXPORTING* I_INTERFACE_CHECK = ' '* I_BYPASSING_BUFFER =* I_BUFFER_ACTIVE =* I_CALLBACK_PROGRAM = ' '* I_CALLBACK_PF_STATUS_SET = ' '* I_CALLBACK_USER_COMMAND = ' '* I_CALLBACK_TOP_OF_PAGE = ' '* I_CALLBACK_HTML_TOP_OF_PAGE = ' '* I_CALLBACK_HTML_END_OF_LIST = ' 'i_structure_name = 'ZTEST_ITAB' * I_BACKGROUND_ID = ' '* I_GRID_TITLE =* I_GRID_SETTINGS =* IS_LAYOUT_LVC =* IT_FIELDCAT_LVC =* IT_EXCLUDING =* IT_SPECIAL_GROUPS_LVC =* IT_SORT_LVC =* IT_FILTER_LVC =* IT_HYPERLINK =* IS_SEL_HIDE =* I_DEFAULT = 'X'* I_SAVE = ' '* IS_VARIANT =* IT_EVENTS =* IT_EVENT_EXIT =* IS_PRINT_LVC =* IS_REPREP_ID_LVC =* I_SCREEN_START_COLUMN = 0* I_SCREEN_START_LINE = 0* I_SCREEN_END_COLUMN = 0* I_SCREEN_END_LINE = 0* I_HTML_HEIGHT_TOP =* I_HTML_HEIGHT_END =* IT_ALV_GRAPHICS =* IT_EXCEPT_QINFO_LVC =* IR_SALV_FULLSCREEN_ADAPTER =* IMPORTING* E_EXIT_CAUSED_BY_CALLER =* ES_EXIT_CAUSED_BY_USER =TABLESt_outtab = itab.* EXCEPTIONS* PROGRAM_ERROR = 1* OTHERS = 2.IF sy-subrc <> 0.* Implement suitable error handling hereENDIF.IF dow = 'X'.CONCATENATE p_dir t1-tabname '_' t1-ddtext '.' stypeINTO yyname.CALL FUNCTION 'WS_DOWNLOAD'EXPORTINGfilename = yynamefiletype = 'ASC'TABLESdata_tab = itab.ELSE.ENDIF.ENDLOOP.ENDFORM. "GET_TABLE_DATA*&---------------------------------------------------------------------**& Form checkdir*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** -->DIR text* -->RET text*----------------------------------------------------------------------*FORM checkdir USING dir TYPE localfile CHANGING ret TYPE c.CALL FUNCTION 'WS_QUERY'EXPORTINGfilename = dirquery = 'DE'IMPORTINGreturn = retEXCEPTIONSinv_query = 1no_batch = 2frontend_error = 3OTHERS = 4.ENDFORM. "checkdir。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档