zoukankan      html  css  js  c++  java
  • abap程序之间调用

    1、submit方式-标准

     FIELD-SYMBOLS  : <LT_PAY_DATA>   TYPE ANY TABLE .
      FIELD-SYMBOLS : <LT_TEST> TYPE ANY . "LIKE LINE OF  it_tab .
      DATA LR_PAY_DATA  TYPE REF TO DATA.
    CL_SALV_BS_RUNTIME_INFO=>SET( EXPORTING DISPLAY = ABAP_FALSE   METADATA = ABAP_FALSE DATA = ABAP_TRUE ).
      SUBMIT ZMMRP070
      WITH P_IMPORT = '' "radiobutton 传参要用‘’
      WITH P_QUERY = ''
      WITH P_DATA = 'X'
      WITH S_MATNR IN S_MATNR
      EXPORTING LIST TO MEMORY AND RETURN.
      IF SY-SUBRC = 0.
        TRY.
            CL_SALV_BS_RUNTIME_INFO=>GET_DATA_REF( IMPORTING R_DATA = LR_PAY_DATA ).
            ASSIGN LR_PAY_DATA->* TO <LT_PAY_DATA>.
          CATCH CX_SALV_BS_SC_RUNTIME_INFO.
            MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
        ENDTRY.
      ENDIF.
      CL_SALV_BS_RUNTIME_INFO=>CLEAR_ALL( ).
      CL_DEMO_OUTPUT=>DISPLAY_DATA( <LT_PAY_DATA> ).

    2、使用memory

    FIELD-SYMBOLS: <LT_DATA> TYPE TABLE,
                   <L_DATA>  TYPE DATA.
    DATA BEGIN OF ITAB_LIST OCCURS 0.
    INCLUDE STRUCTURE ABAPLIST.
    DATA END OF ITAB_LIST.
    DATA:BEGIN OF T_STR OCCURS 0,
           STR(20) TYPE C,
         END OF T_STR.
    DATA: BEGIN OF VLIST OCCURS 0, "这个调用程序ALV输出的长度要根据实际长度来确认
            FILLER1(100) TYPE C,
            FIELD1(50)   TYPE C,
            FILLER(50)   TYPE C,
            FIELD2(50)   TYPE C,
            FILLER3(50)  TYPE C,
          END OF VLIST.
    DATA: STR1(100) TYPE C,
          STR2(100) TYPE C.
    
     CL_SALV_BS_RUNTIME_INFO=>SET(
      DISPLAY = ABAP_FALSE
      METADATA = ABAP_FALSE
      DATA = ABAP_TRUE ).
      SUBMIT RM07MLBD WITH WERKS IN S_WERKS WITH MATNR IN S_MATNR WITH DATUM IN S_BUDAT WITH LGBST = 'X' AND RETURN EXPORTING LIST TO MEMORY."TCODE:MB5B
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          LISTOBJECT = ITAB_LIST
        EXCEPTIONS
          NOT_FOUND  = 4
          OTHERS     = 8.
      CALL FUNCTION 'LIST_TO_ASCI'
        EXPORTING
          LIST_INDEX         = -1
        TABLES
          LISTASCI           = VLIST
          LISTOBJECT         = ITAB_LIST
        EXCEPTIONS
          EMPTY_LIST         = 1
          LIST_INDEX_INVALID = 2
          OTHERS             = 3.
      IF SY-SUBRC = 0.
        READ TABLE VLIST INDEX 5.
        IF SY-SUBRC = 0 .
          SPLIT VLIST-FILLER1 AT '' INTO TABLE T_STR . "根据空格拆分
        ENDIF.
      ENDIF.
      DELETE T_STR WHERE STR = ''. "删除空行
      READ TABLE T_STR INDEX 3.
      IF SY-SUBRC = 0.
        WRITE: T_STR-STR.
      ENDIF.
    * TRY.
    * cl_salv_bs_runtime_info=>get_data_ref(
    * IMPORTING r_data = ls_data ).
    * ASSIGN ls_data->* TO <lt_data>.
    * CATCH cx_salv_bs_sc_runtime_info.
    * MESSAGE '无法读取ALV数据' TYPE 'E'.
    * ENDTRY.
    * cl_salv_bs_runtime_info=>clear_all( ).
    * IF <lt_data> IS ASSIGNED.
    * LOOP AT <lt_data> ASSIGNING <l_data>.
    ** MOVE-CORRESPONDING <l_data> TO gt_tab.
    ** APPEND gt_tab.
    * ENDLOOP.
    * ENDIF.

    3、perform调用

    待续。。。

     

  • 相关阅读:
    MySQL性能指标及计算方法(go)
    Flashback for MySQL 5.7
    oracle_外部表的两种实现方式oracle_loader[datapump]
    oracle数据库内存调整之增加内存
    Leetcode: Binary Tree Paths
    Leetcode: Verify Preorder Sequence in Binary Search Tree
    Leetcode: Meeting Rooms II
    Leetcode: Meeting Rooms
    Leetcode: Flatten 2D Vector
    Leetcode: Count Univalue Subtrees
  • 原文地址:https://www.cnblogs.com/BruceKing/p/14510225.html
Copyright © 2011-2022 走看看