2009 Feb 02 7:40 AM
Hi Experts,
I have created custom table control, and I want to search in custom table control through text field mantioned and after search I want to select the search text line, can any one help me how i can achive that?
Rajneesh Gupta
2009 Feb 02 7:47 AM
2009 Feb 02 7:48 AM
Hello,
This is the sample code.
MODULE GET_F4_HELP INPUT.
TYPES : BEGIN OF EMPLOYEE,
EMPNO TYPE ZTG_EMP-EMPNO,
END OF EMPLOYEE.
DATA : EMPTAB TYPE STANDARD TABLE OF EMPLOYEE WITH HEADER LINE,
TB_DYNPFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
PLAN_ID TYPE ZTG_HEALTH-PLAN_ID.
CLEAR: TB_DYNPFIELDS.
REFRESH: TB_DYNPFIELDS.
MOVE 'ZTG_EMP-HLTH_PLAN' TO TB_DYNPFIELDS-FIELDNAME.
APPEND TB_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = 'SAPMZTG01'
DYNUMB = '1010'
* TRANSLATE_TO_UPPER = ' '
* REQUEST = ' '
* PERFORM_CONVERSION_EXITS = ' '
* PERFORM_INPUT_CONVERSION = ' '
* DETERMINE_LOOP_INDEX = ' '
* START_SEARCH_IN_CURRENT_SCREEN = ' '
* START_SEARCH_IN_MAIN_SCREEN = ' '
* START_SEARCH_IN_STACKED_SCREEN = ' '
* START_SEARCH_ON_SCR_STACKPOS = ' '
* SEARCH_OWN_SUBSCREENS_FIRST = ' '
* SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
DYNPFIELDS = TB_DYNPFIELDS
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* INVALID_PARAMETER = 7
* UNDEFIND_ERROR = 8
* DOUBLE_CONVERSION = 9
* STEPL_NOT_FOUND = 10
* OTHERS = 11
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE TB_DYNPFIELDS INDEX 1.
IF SY-SUBRC EQ 0.
PLAN_ID = TB_DYNPFIELDS-FIELDVALUE.
ENDIF.
SELECT EMPNO FROM ZTG_EMP
INTO TABLE EMPTAB
WHERE HLTH_PLAN = PLAN_ID.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'EMPNO'
* PVALKEY = ' '
DYNPPROG = 'SAPMZTG01'
DYNPNR = '1010'
DYNPROFIELD = 'TB1'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = EMPTAB
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " GET_F4_HELP INPUT
Hope it will solve your Requirment
Thanks
Arun Kayal
2009 Feb 02 7:58 AM
Hi
In the flow logic of your screen, In PAI
PROCESS ON VALUE-REQUEST
fields itab-fname module module_name.
in program
build the search help values by using a Function Module: * F4IF_INT_TABLE_VALUE_REQUEST*
Hope it helps you
Regards
Mansi