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

Find (Ctrl-F) in table control

Bharath84
Participant
0 Likes
3,304

Hi All,

In my module pool program, I have 5 tabs and I am displaying data in my table control and I have added a Find(Ctrl-F) icon and when I click on it has to give a popup to enter some text and the cursor should be placed in that particular cell value. Does any one tried this Find functionality in table control please provide me some inputs. I tried FM: POPUP_GET_VALUES but it is returning SY-SUBRC = 1 and not getting the popup. Below is my code.

TAB-TABNAME = 'TC_MARA'.-->>TC_MARA is my table control name(I tried by giving internal table also)
TAB-FIELDNAME = 'MATNR'.
TAB-VALUE = ''.
APPEND TAB.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
POPUP_TITLE = 'FIND'
START_COLUMN = '5'
START_ROW = '5'
TABLES
FIELDS = TAB.

Thanks,

HT

1 ACCEPTED SOLUTION
Read only

Nawanandana
Active Contributor
2,527

Hi,

FM POPUP_GET_VALUES will work . Kindly try this answer.

Hi All,

In my module pool program, I have 5 tabs and I am displaying data in my table control and I have added a Find(Ctrl-F) icon and when I click on it has to give a popup to enter some text and the cursor should be placed in that particular cell value. Does any one tried this Find functionality in table control please provide me some inputs. I tried FM: POPUP_GET_VALUES but it is returning SY-SUBRC = 1 and not getting the popup. Below is my code.

TAB-TABNAME = 'TC_MARA'.-->>TC_MARA is my table control name(I tried by giving internal table also)
TAB-FIELDNAME = 'MATNR'.
TAB-VALUE = ''.
APPEND TAB.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
POPUP_TITLE = 'FIND'
START_COLUMN = '5'
START_ROW = '5'
TABLES
FIELDS = TAB.

Thanks,

HT

6 REPLIES 6
Read only

Nawanandana
Active Contributor
2,528

Hi,

FM POPUP_GET_VALUES will work . Kindly try this answer.

Read only

Sandra_Rossi
Active Contributor
2,527

If you don't define the EXCEPTIONS in your CALL FUNCTION, then SY-SUBRC will not be changed, as explained in the ABAP documentation. You see SY-SUBRC = 1, but it could have been anything, the value has been set by one of the latest statements executed in the function module POPUP_GET_VALUES.

Read only

Bharath84
Participant
0 Likes
2,527

Hi,

I have tried the above link provided but I am not getting the pop-up to provide the search text. Also, I have uncommented the exceptions and getting sy-subrc = 1.

Am I missing anything here. Please suggest me.

t_fields-tabname = 'TC_MARA'. -->>(TC_MARA is table control name. I also tried with internal table name GT_MARA)
t_fields-fieldname = 'MATNR'.
t_fields-fieldname = 'MATNR'.
t_fields-field_attr = ' '.
t_fields-field_obl = 'X'.
APPEND t_fields.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
no_value_check = 'X'
popup_title = 'Input'
start_column = '5'
start_row = '5'
IMPORTING
returncode = returncode
TABLES
fields = t_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF returncode = ' '.
SORT gt_mara BY matnr.
READ TABLE gt_maraWITH KEY matnr = t_fields-value TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
tc_mara-top_line = sy-tabix.
DATA(v_curr_line) = sy-tabix.
DATA(v_tot_line) = tc_mara-lines.
REFRESH t_fields.
CLEAR returncode.
ENDIF.
ENDIF.

Thanks,

HT

Read only

2,527

The parameter TABNAME of function module POPUP_GET_VALUES must be the name of a DDIC structure or table (not table control, not internal table).

NB: now that you have defined the exception "error_in_fields = 1" and you get SY-SUBRC = 1, you are sure that it's because the exception ERROR_IN_FIELDS has been raised.

Read only

Bharath84
Participant
0 Likes
2,527

Thanks you all for your valuable inputs. Issue resolved.

Read only

0 Likes
2,527

Can you just give a hint for future visitors how it was solved?