2019 Dec 12 2:49 PM
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
2019 Dec 12 7:44 PM
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
2019 Dec 12 7:44 PM
2019 Dec 12 8:50 PM
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.
2019 Dec 16 9:06 AM
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.
HT
2019 Dec 16 1:30 PM
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.
2019 Dec 19 9:43 AM
2019 Dec 19 2:33 PM
Can you just give a hint for future visitors how it was solved?