简体   繁体   English

单击按钮时,如何使程序返回表中的多个表字段?

[英]How do I make the program return multiple table fields in a table when a button is clicked?

I am trying to create a program that allows a user to input a foodCode in order to receive the Item and Description after the press of a button.我正在尝试创建一个程序,允许用户输入foodCode以便在按下按钮后接收ItemDescription Is there a way the results can be put in a table on the same screen?有没有办法将结果放在同一屏幕上的表格中? How?怎么样?

report demo.
tables food.

SELECTION-SCREEN:

SELECTION-SCREEN BEGIN OF BLOCK SEGMENTVALUE WITH FRAME TITLE A1TITLE.
SELECTION SCREEN BEGIN OF LINE.
PARAMETERS P_INPUT(10) TYPE C OBLIGATORY.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON /2(40) B_RESULT USER-COMMAND BUT1.
SELECTION-SCREEN END OF LINE.

INTIALIZATION.
    PERFORM SELECTION_SCREEN_TEXT.
FORM SELECTION_SCREEN TEXT.
    A1TITLE = 'Please enter food code'.
    B_RESULT = 'Return results'.

示例数据

I hope I got you're question right.我希望我答对了你的问题。

  1. Create a Report with a Dynpro.使用 Dynpro 创建报告。
  2. Add a Subscreen on the top of the Dynpro and a Custom-Container on the Bottom在 Dynpro 顶部添加一个子屏幕,在底部添加一个自定义容器
  3. Mark your Selection-Screen as Subscreen an call the Dynpro-Number from your Selection-Screen in the PBO as Subscreen.将您的选择屏幕标记为子屏幕,然后从 PBO 中的选择屏幕调用 Dynpro 编号作为子屏幕。
  4. Handle the Button click in the PAI处理 PAI 中的按钮点击
  5. Display the Data with an SALV in your CustomContainer在您的 CustomContainer 中显示带有 SALV 的数据

Here's a detailed explanation: http://zevolving.com/2008/10/display-alv-report-output-in-the-same-selection-screen/这里有详细的解释:http: //zevolving.com/2008/10/display-alv-report-output-in-the-same-selection-screen/

I think the easiest way to do that would be yo use a Reusable alv grid that displays the results.我认为最简单的方法是使用可重用的 alv 网格来显示结果。

The function to create that look it as Reusable* alv* grid, it contains some parameters that define the screen in a table.创建看起来像 Reusable* alv* 网格的函数,它包含一些在表格中定义屏幕的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM