• 在一个程序中调用另一个程序并且传输数据到选择屏幕执行这个程序


    *&---------------------------------------------------------------------*
    *&  Include           ZMM_GETDATA
    *&---------------------------------------------------------------------*
    REPORT zmm_getdata.
    TABLES:
          eina,eine.
    
    DATA: gs_infnr TYPE eina-infnr.
    
    DATA gt_infnr LIKE TABLE OF gs_infnr.
    
    
    DATA r_infnr TYPE RANGE OF eina-infnr.
    
    DATA wa_infnr LIKE LINE OF r_infnr .
    
     DATA:rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab.
    
    
    SELECT DISTINCT eina~infnr INTO TABLE gt_infnr
    
             FROM eina
             INNER JOIN eine ON eina~infnr = eine~infnr.
    *         WHERE eina~loekz = ''
    *         AND   eine~loekz = ''
    *         AND   eine~werks <> ''
    *         AND   eine~prdat < sy-datum.
    
    SORT gt_infnr ASCENDING.
    
    
    LOOP AT gt_infnr INTO gs_infnr FROM 1 TO 2.
      rspar_line-selname =  'S_INFNR'.
      rspar_line-kind    = 'S'.
      rspar_line-sign = 'I'.
      rspar_line-option = 'EQ'.
      rspar_line-low = gs_infnr.
      APPEND rspar_line TO rspar_tab.
      CLEAR:  gs_infnr, rspar_line.
    ENDLOOP.
    
    LOOP AT gt_infnr INTO gs_infnr FROM 3 TO 3.
      rspar_line-selname =  'S_INFNR1'.
      rspar_line-kind    = 'S'.
      rspar_line-sign = 'I'.
      rspar_line-option = 'EQ'.
      rspar_line-low = gs_infnr.
      APPEND rspar_line TO rspar_tab.
      CLEAR:  gs_infnr, rspar_line.
    ENDLOOP.
    
    
    *
    *export r_infnr to MEMORY id 'T_OUT'.
    *submit ZMM_TEST and RETURN.
    
    BREAK-POINT.
    
    SUBMIT zmm_test WITH SELECTION-TABLE rspar_tab.
                   "AND RETURN.
    View Code

    被调用的程序:

    *&---------------------------------------------------------------------*
    *& Report  ZMM_TEST
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    REPORT  ZMM_TEST.
    
    tables:eina.
    
    *SELECTION-SCREEN BEGIN OF BLOCK blk2.
    select-options: s_infnr for eina-infnr .
    select-options: s_infnr1 for eina-infnr .
    *SELECTION-SCREEN END OF BLOCK blk2.
    
    
    
    
    *DATA r_infnr TYPE RANGE OF eina-infnr.
    
    
    
    *import r_infnr from MEMORY id 'T_OUT'.
    
    
    start-of-selection.
    IF s_infnr IS NOT INITIAL.
      WRITE / s_infnr-LOW.
    
       WRITE / s_infnr1-LOW.
    ENDIF.
    break-point.
    View Code
  • 相关阅读:
    数据库连接池、事务
    JDBC、单元测试、DAO模式
    归并排序
    插入排序
    MySQL数据库
    JQuery
    JavaScript
    算法训练 连续正整数的和
    算法提高 寻找三位数
    算法训练 学做菜
  • 原文地址:https://www.cnblogs.com/caizjian/p/3443558.html
Copyright © 2020-2023  润新知