Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

REFRESH OF TABLE CONTROL.

Former Member
0 Likes
1,400

HI GURUS,

I AM USING TWO TABLE CONTROLS AND WANT TO SHOW THE SELECTED RECORDS IN THE SECOND TABLE CONTROL,

ACTUALLY FOR THE FIRST TIME IF I SELECT RECORDS IT IS SHOWING CORRECTLY IN THE SECOND TABLE CONTROL BUT

WHEN I AM BACK TO FIRST TABLE CONTROL AND AGAIN SELECT THE RECORDS,AFTER CLICK OK BUTTON THE SECOND

TABLE CONTROL IS NOT SHOWING THE FRESH ONE,EVERY TIME IT REQUIRES TO EXIT FROM THE PROGRAM,THEN IT WORKS PROPERLY.

I AM GIVING THE CODE FROM FLOW LOGIC OF TWO SCREENS AND INTERNAL TABLE USED FOR TABLE CONTROL.

<< Moderator message - please do not use ALL CAPS when posting - it makes your question harder to read. >>

FLOW LOGIC OF FIRST SCREEN

PROCESS BEFORE OUTPUT.

MODULE STATUS_2500.

LOOP AT x_ekpo WITH CONTROL tabcon CURSOR

tabcon-current_line.

ENDLOOP.

PROCESS AFTER INPUT.

MODULE select_material.

loop at x_ekpo .

MODULE UPDATE_TAB.

endloop.

MODULE USER_COMMAND_2500.

IN SE38

MODULE user_command_2500 INPUT.

WHEN 'OKAY'.

LOOP AT x_ekpo WHERE check = 'X'.

APPEND x_ekpo TO x_ekpo3.

ENDLOOP.

ENDMODULE.

MODULE update_tab INPUT.

  • LOOP AT x_ekpo.

IF x_ekpo-check = 'X'.

MODIFY x_ekpo INDEX sy-stepl TRANSPORTING check.

ENDIF.

  • ENDLOOP.

ENDMODULE. " UPDATE_TAB INPUT

FLOW LOGIC FOR SECOND SCREEN.

PROCESS BEFORE OUTPUT.

MODULE STATUS_2501.

LOOP AT x_ekpo3 WITH CONTROL tabcon2501 CURSOR

tabcon2501-current_line.

endloop.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_2501.

LOOP.

ENDLOOP.

Edited by: Rob Burbank on Jan 2, 2010 5:08 PM

3 REPLIES 3
Read only

Former Member
0 Likes
994

Hi,

As per my understanding, you need to display the 2nd Table Control with fresh data every time you click the OK Command Button. So, you need to REFRESH the Table Control in the 2nd screen every time the PBO is triggered based on the OK Command Button. You can use the following code to Refresh the Table Control.

Syntax :

REFRESH CONTROL contrl FROM SCREEN dynnr.

Have a look at the following link from SAP HELP.

http://help.sap.com/abapdocu_70/en/ABAPREFRESH_CONTROL.htm

Hope this helps.

Thanks,

Samantak.

Read only

former_member182371
Active Contributor
0 Likes
994

Hi,

check this blog:

/people/rich.heilman/blog/2008/05/20/using-multiple-table-controls-in-one-screen

Best regards.

Read only

SureshRa
Active Participant
0 Likes
994

Hi,

The problem is not with refreshing the table control. It is with refreshing your internal table.

You are not clearing the internal table x_ekpo3. Insert the REFRESH statement as below in your code:


MODULE user_command_2500 INPUT.

WHEN 'OKAY'.

*{BEGIN of insert
*Clear the x_ekpo3 internal table
REFRESH x_ekpo3.
*}END of insert

LOOP AT x_ekpo WHERE check = 'X'.
APPEND x_ekpo TO x_ekpo3.
ENDLOOP.

Cheers

Suresh