`

retrieve asset planned depreciation value

    博客分类:
  • ABAP
阅读更多
REPORT  ztest.

TYPE-POOLS: slis.

TABLES: anla,
        anlb,
        anlc,
        anlz,
        t093d.

*--------------------------------------------------------------------*
*  INTERNAL TABLE DECLARATION
*--------------------------------------------------------------------*
DATA: it_t093d LIKE t093d OCCURS 1 WITH HEADER LINE,
      it_anfm LIKE anfm OCCURS 1 WITH HEADER LINE,
      it_anlb LIKE anlb OCCURS 1 WITH HEADER LINE,
      it_anlc LIKE anlc OCCURS 10 WITH HEADER LINE,
      it_anlp LIKE anlp OCCURS 1 WITH HEADER LINE,
      it_resu LIKE anlp OCCURS 1 WITH HEADER LINE,
      it_anlz LIKE anlz OCCURS 1 WITH HEADER LINE.

DATA: w_peraf LIKE t093d-afblpe,
      w_afblpe LIKE t093d-afblpe.
DATA: wa_anlp LIKE anlp.

*--------------------------------------------------------------------*
*  CONSTANTS
*--------------------------------------------------------------------*
CONSTANTS: c_max TYPE afblpe VALUE '012',
           c_min TYPE afblpe VALUE '001'.
*--------------------------------------------------------------------*
*  SELECTION SCREEN
*--------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs TYPE anlb-bukrs,
            p_anln1 TYPE anlb-anln1,
            p_anln2 TYPE anlb-anln2,
            p_gjahr TYPE anlc-gjahr.
SELECTION-SCREEN END OF BLOCK blk.
*--------------------------------------------------------------------*
*  START-OF-SELECTION
*--------------------------------------------------------------------*
START-OF-SELECTION.
  PERFORM get_data.
  PERFORM display_result.

*&---------------------------------------------------------------------*
*&      Form  GET_DATA
*&---------------------------------------------------------------------*
FORM get_data.
  SELECT SINGLE * FROM anla WHERE bukrs EQ p_bukrs AND
                                  anln1 EQ p_anln1 AND
                                  anln2 EQ p_anln2.
  SELECT * INTO CORRESPONDING FIELDS OF TABLE it_anlb FROM anlb WHERE bukrs EQ p_bukrs AND anln1 EQ p_anln1 AND anln2 EQ p_anln2 AND afabe EQ '01'.
  SELECT * INTO CORRESPONDING FIELDS OF TABLE it_anlc FROM anlc WHERE          bukrs EQ p_bukrs AND anln1 EQ p_anln1 AND anln2 EQ p_anln2 AND gjahr EQ p_gjahr AND afabe EQ '01'.
  SELECT * INTO CORRESPONDING FIELDS OF TABLE it_anlz FROM anlz WHERE bukrs EQ p_bukrs AND anln1 EQ p_anln1 AND anln2 EQ p_anln2.
  SELECT * INTO CORRESPONDING FIELDS OF TABLE it_t093d FROM t093d WHERE bukrs EQ p_bukrs AND afaber EQ '01'.
  READ TABLE it_anlc INDEX 1.
  IF sy-subrc EQ 0.
    w_afblpe = it_anlc-afblpe.
    IF w_afblpe EQ 0.
      READ TABLE it_t093d WITH KEY afblgj = p_gjahr.
      IF sy-subrc EQ 0.
        w_afblpe = it_t093d-afblpe.
      ENDIF.
    ENDIF.
  ENDIF.
  w_peraf = '001' + w_afblpe.
  WHILE w_peraf LE c_max.
    IF w_peraf GT w_afblpe.
      LOOP AT it_t093d.
        IF w_peraf GT c_min.
          it_t093d-afblgj = p_gjahr.
          it_t093d-afblpe = w_peraf - '001'.
          it_t093d-afbanz = '01'.
          it_t093d-status = '2'.
        ELSE.
          it_t093d-afblgj = '0000'.
          it_t093d-afblpe = '000'.
          it_t093d-afbanz = '00'.
          it_t093d-status = '0'.
        ENDIF.
        MODIFY it_t093d.
      ENDLOOP.
    ENDIF.
    CLEAR it_anlp. REFRESH it_anlp.
    CALL FUNCTION 'RA_AFABUCHEN'
      EXPORTING
        i_afbgjr                 = p_gjahr
        i_afbper                 = w_peraf
        i_again                  = space
        i_anla                   = anla
        i_fehler                 = 'X'
        i_nocheck                = 'X'
        i_plansatz               = 'X'
        i_refresh                = 'X'
      TABLES
        t_093d                   = it_t093d
        t_anfm                   = it_anfm
        t_anlb                   = it_anlb
        t_anlc                   = it_anlc
        t_anlp                   = it_anlp
        t_anlz                   = it_anlz
      EXCEPTIONS
        diff_years               = 1
        no_assets_computed       = 2
        no_posting_period        = 3
        period_already_posted    = 4
        period_false             = 5
        posting_period_forgotten = 6
        post_not_posible         = 7
        OTHERS                   = 8.
    IF sy-subrc EQ 0.
      it_resu = it_anlp.
      APPEND it_resu.
    ENDIF.
    ADD 1 TO w_peraf.
  ENDWHILE.
ENDFORM.                    "GET_DATA

*&---------------------------------------------------------------------*
*&      Form  DISPLAY_RESULT
*&---------------------------------------------------------------------*
FORM display_result .
  DATA: l_alv TYPE REF TO cl_salv_table,
        l_oref TYPE REF TO cx_root,
        l_str TYPE string,
        l_grid TYPE REF TO cl_gui_custom_container.
  TRY.
      CALL METHOD cl_salv_table=>factory
        IMPORTING
          r_salv_table = l_alv
        CHANGING
          t_table      = it_resu[].
      l_alv->display( ).

    CATCH cx_salv_msg INTO l_oref.
      l_str = l_oref->get_text( ).
  ENDTRY.
ENDFORM.                    " DISPLAY_RESULT
0
0
分享到:
评论

相关推荐

    PB并发控制与Row changed between retrieve and update详解

    PB并发控制与Row changed between retrieve and update详解 PB并发控制机制是指在多用户同时访问数据库时,防止数据不一致和丢失的机制。PowerBuilder 提供了多种并发控制策略,包括Key Columns、Key and ...

    AutoValue的简单扩展auto-droid.zip

     // indicate that the factory will retrieve the value from shared preferences  @SharedPreference(key = "keyOfMyInt", defaultValue = "8964")  abstract int myIntFromPreference(); ...

    Query Retrieve SCP Emulator

    Query Retrieve SCP Emulator

    an introduction to information retrieve

    标题为“an introduction to information retrieve”的文档,实际上是指《信息检索导论》这本书的介绍。该书由斯坦福大学出版,作者包括 Christopher D. Manning、Prabhakar Raghavan 和 Hinrich Schütze。根据描述...

    retrieve_data.py

    retrieve_data

    PyPI 官网下载 | retrieve-0.0.6.tar.gz

    标题中的"PyPI 官网下载 | retrieve-0.0.6.tar.gz"指的是Python的包索引(PyPI)上发布的名为`retrieve`的软件包的一个特定版本,即0.0.6版。PyPI是Python开发者发布自己编写的模块、库或工具的地方,方便其他用户...

    Knowledge-driven Encode, Retrieve, Paraphrase for MedicalImageReport.pdf

    We propose a novel Knowledge-driven Encode, Retrieve, Paraphrase (KERP) approach which reconciles traditional knowledge- and retrieval-based methods with modern learning-based methods for accurate ...

    Retrieve HttpOnly Session Cookie in WebBrowser

    In order to help mitigate the risk of cross-site scripting, a new feature has been introduced in Microsoft Internet Explorer 6 SP1. This feature is a new attribute for cookies which prevents them from...

    retrieve_sqlite_data.py

    retrieve_sqlite_data

    Retrieve Form for Data Capture (RFD)

    Retrieve Form for Data Capture (RFD)

    PyPI 官网下载 | text-reuse-retrieve-0.1.10.tar.gz

    《PyPI官网下载:text-reuse-retrieve-0.1.10.tar.gz——Python库解析与应用》 PyPI(Python Package Index)是Python开发者的重要资源库,它提供了丰富的Python库供全球开发者下载和使用。本文将详细介绍PyPI官网...

    分布式的Key-Value存储系统Ringo.zip

    In addition to storing, Ringo should be able to retrieve individual or small sets of data items with low latencies () and provide a convenient on-disk format for bulk data access.   标签:...

    This demonstrates how to write and retrieve information from

    标题中的“write and retrieve information from”指的是在计算机的注册表中进行读写操作。注册表是Windows操作系统中存储系统和应用程序设置的关键数据库。通过修改注册表,用户或开发者可以精细控制系统的配置,...

    Basic Save and Retrieve Functions

    标题 "Basic Save and Retrieve Functions" 暗示了这是一个关于在编程环境中保存和恢复数据的基础教程,可能涉及文件操作和程序状态的管理。在描述中没有提供更多的具体信息,但我们可以根据标签 "控件"、"源码"、...

    RLUS:retrieve locate update service

    ### RLUS:Retrieve Locate Update Service 知识点详解 #### 一、RLUS概述 **RLUS(Retrieve Locate Update Service)**是Healthcare Services Specification Project (HSSP) 在OMG(Object Management Group)...

    报错ORA01804解决方法.txt

    使用PL/SQL登录ORACLE数据 报错,error while trying to retrieve text for error ORA-01804,的解决方法,操作步骤,在windows server 2008R2 64位,oracle 12C,PLSQL Developer 12 64位,以上使用环境正常,

    This module demostrates how to retrieve information about a

    This module demostrates how to retrieve information about a joystick. This is a great module for game programmers.

    TILISOFT Internet ActiveX Controls - Retrieve HTML pages fro

    首先,"Retrieve HTML pages from the Net" 指的是该控件能够通过HTTP协议从互联网上下载HTML页面内容,这对于构建需要从网页抓取信息或者实现网页浏览功能的应用程序非常有用。这通常涉及到URL请求、HTTP响应处理...

    NX二次开发UF-CUTTER-retrieve 函数介绍

    NX二次开发UF_CUTTER_retrieve 函数介绍,Ufun提供了一系列丰富的 API 函数,可以帮助用户实现自动化、定制化和扩展 NX 软件的功能。无论您是从事机械设计、制造、模具设计、逆向工程、CAE 分析等领域的专业人士,...

Global site tag (gtag.js) - Google Analytics