Refresh table control after action

断了今生、忘了曾经 提交于 2019-12-05 18:53:05

You have to make sure that the data that you want to display is actually in the internal table that is displayed by the screen.

  • You can reread the database table or
  • append the line generated by the pop-up form to the internal table (If the line types aren't identical you will have to move the fields to a similar structure first).

If the internal table has all the data, but it still does not display in the table control, make sure that the field in the table control that has the number of lines is updated to reflect the extra line.

Just because your table refers to database fields does not mean it will be updated/populated automatically to reflect the state of the database. You need to programmatically populate the table during the PBO (Process Before Output) event that occurs before the screen is displayed.

To gain an understanding of how this works, you may need to spend some time understanding table controls in ABAP dynpros (screens). Here is a good place to get started:

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm

Be sure to update the lines variable of your tableview after adding the new line.

CONTROLS: gr_table TYPE TABLEVIEW USING SCREEN <your_screen_here>.
DATA: gt_data TYPE STANDARD TABLE OF <your_type_here>,
      gs_data LIKE LINE OF gt_data.

PROCESS BEFORE OUTPUT.
DESCRIBE TABLE gt_data LINES gr_table-lines.
LOOP AT gt_data INTO gs_data 
        WITH CONTROL gr_table 
              CURSOR gr_table-current_line.
ENDLOOP.


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