zoukankan      html  css  js  c++  java
  • 如何取得选择画面字段中的输入值[RS_REFRESH_FROM_SELECTOPTIONS]

    函数RS_REFRESH_FROM_SELECTOPTIONS可以取得选择画面中的select-option和parameters的输入值。

    代码如下

    REPORT ztest_get_select_value.
    
    *&---------------------------------------------------------------------*
    *& Data Declaration
    *&---------------------------------------------------------------------*
    TABLES: mara.
    DATA:git_params TYPE TABLE OF rsparams.
    DATA:gwa_params TYPE rsparams.
    *&---------------------------------------------------------------------*
    *& Selection Screen
    *&---------------------------------------------------------------------*
    
    SELECT-OPTIONS:s_matnr FOR mara-matnr.
    PARAMETERS:p_mtart TYPE mara-mtart.
    PARAMETERS:p_matkl TYPE mara-matkl.
    
    *&---------------------------------------------------------------------*
    
    *& Start of Selection
    
    *&---------------------------------------------------------------------*
    
    START-OF-SELECTION.
    
      CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
        EXPORTING
          curr_report     = sy-repid
        TABLES
          selection_table = git_params[].
    
      SORT git_params BY kind.
    
      WRITE:/ 'Parameters'.
      WRITE:/ 'Name' ,20 'Value' .
    
      LOOP AT git_params INTO gwa_params WHERE kind = 'P'.
    
        WRITE:/ gwa_params-selname ,20 gwa_params-low.
    
      ENDLOOP.
    
      SKIP.
    
      WRITE:/ 'Select-Options'.
      WRITE:/ 'Name' ,20 'Sign' ,25 'Option',32 'Low',52 'High'.
    
      LOOP AT git_params INTO gwa_params WHERE kind = 'S'.
    
        WRITE:/ gwa_params-selname ,20 gwa_params-sign ,
        25 gwa_params-option, 32 gwa_params-low,
        52 gwa_params-high.
    
      ENDLOOP.

    测试:

    选择画面中输入需要的值:

    运行结果:

    以上。

  • 相关阅读:
    phpMyAdmin 尝试连接到 MySQL 服务器,但服务器拒绝连接 解决办法
    MySQL意外关闭, 导致软件崩溃而无法启动的解决办法
    !function 笔记
    C++中四种类型转换方式
    SpringCloud面试题及答案
    Spring Boot面试题
    javaWeb常用面试题
    mysql行转列 问题 SUM(IF(条件,列值,0))
    mysql行列转换
    C++面试常见题
  • 原文地址:https://www.cnblogs.com/datie/p/11433821.html
Copyright © 2011-2022 走看看