`

read change document

阅读更多
REPORT  ztest.

TABLES: cdhdr.    "Change document header
*--------------------------------------------------------------------*
*  SELECTION SCREEN
*--------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
PARAMETERS: p_class LIKE cdhdr-objectclas OBLIGATORY DEFAULT 'ADRESSE',
            p_obj   LIKE cdhdr-objectid   OBLIGATORY DEFAULT 'BP  0000016234'.
SELECTION-SCREEN END OF BLOCK blk.

*--------------------------------------------------------------------*
*  TYPE DECLARATION
*--------------------------------------------------------------------*
TYPES: BEGIN OF type_dis,
           udate LIKE cdred-udate,
           ftext LIKE cdred-ftext,
           new   LIKE cdred-f_new,
           old   LIKE cdred-f_old,
       END OF type_dis.

*--------------------------------------------------------------------*
* INTERNAL TABLE DECLARATION
*--------------------------------------------------------------------*
DATA: itab_hdr LIKE TABLE OF cdhdr,
      itab_pos LIKE TABLE OF cdred,
      itab_dis TYPE TABLE OF type_dis.

*--------------------------------------------------------------------*
*  WORKAREA
*--------------------------------------------------------------------*
DATA: wa_hdr LIKE cdhdr,
      wa_pos LIKE cdred,
      wa_dis TYPE type_dis.

*--------------------------------------------------------------------*
*  VARIABLE DECLARATION
*--------------------------------------------------------------------*
DATA: w_cols TYPE REF TO cl_salv_columns_table,
      w_grid TYPE REF TO cl_salv_table.

*--------------------------------------------------------------------*
*  START-OF-SELECTION
*--------------------------------------------------------------------*
START-OF-SELECTION.
  CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
    EXPORTING
      objectclass                = p_class
      objectid                   = p_obj
      username                   = ''
    TABLES
      i_cdhdr                    = itab_hdr
    EXCEPTIONS
      no_position_found          = 1
      wrong_access_to_archive    = 2
      time_zone_conversion_error = 3
      OTHERS                     = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    LOOP AT itab_hdr INTO wa_hdr.
      CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
        EXPORTING
          changenumber            = wa_hdr-changenr
        TABLES
          editpos_with_header     = itab_pos
        EXCEPTIONS
          no_position_found       = 1
          wrong_access_to_archive = 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.
      ELSE.
        LOOP AT itab_pos INTO wa_pos.
          CLEAR wa_dis.
          wa_dis-udate   = wa_pos-udate.
          wa_dis-new     = wa_pos-f_new.
          wa_dis-old     = wa_pos-f_old.
          wa_dis-ftext   = wa_pos-ftext.
          APPEND wa_dis TO itab_dis.
        ENDLOOP.
        REFRESH itab_pos.
      ENDIF.
    ENDLOOP.
    CALL METHOD cl_salv_table=>factory
      EXPORTING
        list_display = 'X'
      IMPORTING
        r_salv_table = w_grid
      CHANGING
        t_table      = itab_dis.
    w_cols = w_grid->get_columns( ).
    w_cols->set_optimize( 'X' ).
    w_grid->display( ).
  ENDIF.
分享到:
评论

相关推荐

    BAPI_ACC_DOCUMENT_POST增强

    read table c_accit with key posnr = into wa_accit. if sy-subrc is initial. move-corresponding &lt;l_struc&gt; to wa_accit. modify c_accit from wa_accit index sy-tabix. endif. endloop. ``` 在实现代码...

    BAPI-ACC-DOCUMENT-POST 结构字段扩展

    具体来说,需要实现`ACC_DOCUMENT` BADI中的`CHANGE`方法。在这个方法中,将`BAPI_ACC_DOCUMENT_POST`的参数表`EXTENSION2`传入系统表中。这一步骤可以通过以下步骤完成: 1. 打开SE19,并选择`ACC_DOCUMENT` BADI...

    read-excel-file:在浏览器或 Node.js 中读取 *.xlsx 文件。 使用严格的模式解析为 JSON

    read-excel-file ...const input = document . getElementById ( 'input' ) input . addEventListener ( 'change' , ( ) =&gt; { readXlsxFile &#40; input . files [ 0 ] &#41; . then ( ( rows ) =&gt; {

    U-Boot relocation and Debug.zip

    关于U-boot代码重定位的文档. U-Boot relocation and Debug The relocation on arm...Before read this document ,read my another document &lt;Building and Debuging U-Boot in Eclipse Helios On Window XP&gt; at first.

    61850 mms ethereal install_v116

    mms_ethereal_install_v116....Document (read before using). Removed file change log from this document. Changed the label GSSE to IECGSSE in order to Get grouping of IEC 61850 profiles in Ethereal lists.

    High-Definition-Audio-Specification

    3. 如果不支持64位寻址,则流描述符中的BDL指针上基础地址寄存器属性是只读的(Read Only,RO)。 4. 在“编解码器发现”章节中修正了一个时序错误,规定软件在读取CRST#为“1”之后至少要等待521微秒(25帧)才能...

    记录SAP自建表的修改记录

    - **数据元素配置**:首先需要访问数据元素(Data Element)的“进一步特性”(Further Characteristics)视图,并勾选“更改文档”(Change Document)选项。这样,当该字段的数据发生变更时,系统将自动记录这一...

    常用FUNCTIONS(无示例).doc

    15. SO_NEW_DOCUMENT_ATT_SEND_API1, SO_SPOOL_READ, 和 SO_WIND_SPOOL_LIST: 处理打印作业,包括发送文档作为邮件附件、读取打印队列和列出打印队列。 16. LIST_TO_ASCII, SX_OBJECT_CONVERT_OTF_PDF, SX_OBJECT...

    Android代码-changeloglib

    ChangeLog Library ChangeLog Library provides an easy way to display a change log in ...For more examples and screenshots you can read this document: Feature ChangeLog Library provides a custom RecyclerVi

    pmc firmware document

    - **"pmc firmware document"**:该文档涉及PMC公司(PMC-Sierra)的一个固件设计文档。 #### 描述分析: - **RMW组件**:作为PMC公司的SRC固件产品的一部分,RMW是Read-Modify-Write(读取-修改-写入)功能的关键...

    前端js解析/读取excel文件

    document.getElementById('fileInput').addEventListener('change', (e) =&gt; { const file = e.target.files[0]; const reader = new FileReader(); reader.onload = () =&gt; { const binaryStr = reader.result; ...

    Beginning JavaScript with DOM Scripting and Ajax, 2nd Edition

    After you read it, you’ll be able to Understand JavaScript syntax and structures. • Create scripts that are easy to understand and maintain. • Write scripts that do not interfere with others. •...

    ASP.NET——XML文件操作篇

    writer.WriteElementString("Change", XmlConvert.ToString(change)); writer.WriteElementString("Volume", XmlConvert.ToString(volume)); writer.WriteEndElement(); } ``` 在这个例子中,我们首先创建了一个...

    html js 遍历一个文件夹里的指定类型的所有文件,查找文件夹中所有的html文件并可读取内容

    document.getElementById('folderSelect').addEventListener('change', handleFiles); ``` 3. 遍历文件:在`handleFiles`函数中,我们可以遍历`event.target.files`,这是一个FileList对象,包含了用户选择的所有...

    sap abap常用bapi

    CREATE/BAPI_CHARACT_CHANGE/BAPI_CHARACT_DELETE/BAPI_CHARACT_RENAME/BAPI_CHARACT_GETDETAIL/BAPI_CHARACT_ADDLONGTEXT/BAPI_CHARACT_REMOVELONGTEXT/BAPI_CHARACT_GETLONGTEXT/CARD_CHARACTERISTIC_READ ...

    带进度条的文件上传

    var input = document.getElementById('fileInput'); input.addEventListener('change', function(e) { var file = e.target.files[0]; var formData = new FormData(); formData.append('file', file); var...

    MPEG Video Wizard

    and the LICENSE agreement document. Revision history. Revision 1.00 (01/03) Revision 1.01 (11/03) Revision 1.02 (07/04) Revision 2.00 (12/05) internet: www.womble.com email: support@womble.com

    js控制操作表格

    - **Read(读取)**: 通过遍历行和单元格获取数据,可以使用`textContent`或`innerHTML`获取单元格内容。 - **Update(更新)**: 修改现有单元格的`textContent`或`innerHTML`实现数据更新。 - **Delete(删除)*...

    html静态读取excel文件

    document.getElementById('excelFile').addEventListener('change', function(e) { var file = e.target.files[0]; // 进行后续处理 }); ``` 接着,我们需要一个JavaScript库来解析Excel文件。常用的库有` Sheet...

    js实现页面展示图片

    document.getElementById('fileInput').addEventListener('change', function(e) { var file = e.target.files[0]; if (file.type.startsWith('image/')) { readImage(file); } }); function readImage(file...

Global site tag (gtag.js) - Google Analytics