‎2006 Jul 10 11:14 PM
Hi everybody!
I'll apreciate so much a code for generate a search button like (Position button) on a table control.
Regards,
DanielM
‎2006 Jul 10 11:33 PM
Refer main prog :SAPL0H10
<b> Prog = LSVIMIXX line # 187</b>
CASE function. 'POSI'<b>
PERFORM popup_positionieren.</b>
<i><u><b>in source code :LSVIMF3I</b></u></i>
Hope thisll give you idea!!
<b>Pl... award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise"
‎2006 Jul 10 11:36 PM
Logic
1. Put a position button and entry text field (search content) under the table control. Position button should have one function code 'PBUT' (set in button arrtibute). Set the name of text field as 'POSITION_VAL'.
2. Content of table control will be in an internal table. The field field will be used for positioning.
3. Enter the search (key) field in text field. Click position button.
4. Write code for this button click in PAI event (Module user_command) of that screen.
Case sy_ucomm.
When 'PBUT'.
Write code here to bring the row as selected in table control.
Endcase.
Bala
‎2009 Feb 23 2:39 PM
FORM search_element TABLES itab CHANGING tc TYPE cxtab_control.
DATA: l_action,
l_value TYPE kcd_value2,
l_cols LIKE LINE OF tc1-cols,
l_table_name(20),
l_find_by(20).
CALL FUNCTION 'POPUP_TO_SEARCH_VALUE'
EXPORTING
textline1 = text-106
titel = text-107
valuelength = '20'
IMPORTING
action = l_action
value = l_value
EXCEPTIONS
titel_too_long = 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 l_action = 'J'.
READ TABLE tc-cols INTO l_cols WITH KEY selected = 'X'.
IF sy-subrc <> 0.
MESSAGE ...
ENDIF.
SPLIT l_cols-screen-name AT '-' INTO l_table_name l_find_by.
READ TABLE itab WITH KEY (l_find_by) = l_value.
IF sy-subrc = 0.
tc-top_line = sy-tabix.
ELSE.
MESSAGE ...
ENDIF.
ENDIF.
ENDFORM. " SEARCH_ELEMENT