In ABAP Workbench, how do I make the program return multiple table fields in a table when a button is clicked?

左心房为你撑大大i 提交于 2019-12-20 01:59:16

问题


I am new to SAP/ABAP Workbench and 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. 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'.


回答1:


I hope I got you're question right.

  1. Create a Report with a Dynpro.
  2. Add a Subscreen on the top of the Dynpro and a Custom-Container on the Bottom
  3. Mark your Selection-Screen as Subscreen an call the Dynpro-Number from your Selection-Screen in the PBO as Subscreen.
  4. Handle the Button click in the PAI
  5. Display the Data with an SALV in your CustomContainer

Here's a detailed explanation: http://zevolving.com/2008/10/display-alv-report-output-in-the-same-selection-screen/




回答2:


I think the easiest way to do that would be yo use a Reusable alv grid that displays the results.

The function to create that look it as Reusable* alv* grid, it contains some parameters that define the screen in a table.



来源:https://stackoverflow.com/questions/38553767/in-abap-workbench-how-do-i-make-the-program-return-multiple-table-fields-in-a-t

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!