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

Module pool : Refresh table control

Former Member
0 Likes
3,481

I am using two table controls that  fetch data as per input entered in the header

HDR - Field F1,F2,F3,F4

TB1 - Detail based on HDR

TB2 - Detail based on  TB1.

My requirement is to provide a refresh button that triggers everytime the refresh process.

At present if i change something on header and revert back same theni can see refresh

action happening.But i want on click of button,everytime TB1,TB2 must get refreshed.

Tried this code but in vain in usercommand include.

   WHEN 'REFRESH'.


  SET USER-COMMAND 'REFRESH'.
data: oldlifnr type lfa1-lifnr.
DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.

oldlifnr = p_lifnr.
clear: dynfields[],dynfields.
dynfields-fieldname   = 'P_LIFNR'.
dynfields-fieldvalue = '0000000001'.
append DYNFIELDS.
    call function 'DYNP_VALUES_UPDATE'
    exporting
      dyname                     = sy-repid
      dynumb                     = sy-dynnr
    tables
      dynpfields                 = dynfields.
set cursor field 'P_LIFNR'.


    CLEAR: dynfields[],dynfields.
dynfields-fieldname   = 'P_LIFNR'.
dynfields-fieldvalue oldlifnr.
append DYNFIELDS.

    call function 'DYNP_VALUES_UPDATE'
    exporting
      dyname                     = sy-repid
      dynumb                     = sy-dynnr
    tables
      dynpfields                 = dynfields.
P_LIFNR = OLDLIFNR.
SUPPRESS DIALOG.
  REFRESH CONTROL 'TB1' FROM SCREEN 9001.

1 ACCEPTED SOLUTION
Read only

0 Likes
1,567

Hi Aditya,

In past also tumble with same situation, i done little change & it worked

WHEN 'REFRESH'.

REFRESH : Clear all Internal table

CLEAR: Clear all Work area

You have to set data to internal table ( Call your select query form)

LEAVE TO SCREEN <SCREEN NO BELONG TO TABLE CONTROL>

Please let me know if it worked.

Thanks & Regards.

Jyoti

4 REPLIES 4
Read only

0 Likes
1,568

Hi Aditya,

In past also tumble with same situation, i done little change & it worked

WHEN 'REFRESH'.

REFRESH : Clear all Internal table

CLEAR: Clear all Work area

You have to set data to internal table ( Call your select query form)

LEAVE TO SCREEN <SCREEN NO BELONG TO TABLE CONTROL>

Please let me know if it worked.

Thanks & Regards.

Jyoti

Read only

0 Likes
1,567

when all data is to be set again,that will be rework.

Read only

0 Likes
1,567

Jyotir,eventually your trick worked.Same routine for populating itab was called.Giving you points for that,

Read only

0 Likes
1,567

This message was moderated.