Skip to Content
0
Former Member
Dec 12, 2006 at 01:34 PM

F4 functionality for search help

62 Views

Hi all,

Am having two select options for cost center groups and for cost centers (s_ksgru and s_kostl ). If i give value in cost center group and after that if i press F4 for cost center it has to display the cost centers that comes under the given cost center group.

i wrote code as :

AT SELECTION-SCREEN ON S_KSGRU.

  • Bapi to get list of cost centers for given group

CALL FUNCTION 'BAPI_COSTCENTER_GETLIST'

EXPORTING

CONTROLLINGAREA = 'AFIL'

COSTCENTERGROUP = S_KSGRU-LOW

TABLES

COSTCENTER_LIST = I_COSTCENTER_LIST.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_KOSTL-LOW.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'COSTCENTER'

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = 'X'

TABLES

VALUE_TAB = I_COSTCENTER_LIST1

RETURN_TAB = RET_TAB.

MOVE RET_TAB-FIELDVAL TO S_KOSTL-LOW.

CLEAR RET_TAB-FIELDVAL.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_KOSTL-HIGH.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'COSTCENTER'

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = 'X'

TABLES

VALUE_TAB = I_COSTCENTER_LIST1

RETURN_TAB = RET_TAB.

MOVE RET_TAB-FIELDVAL TO S_KOSTL-HIGH.

CLEAR : RET_TAB-FIELDVAL.

S_KOSTL-SIGN = 'IN'.

S_KOSTL-OPTION = 'EQ'.

APPEND S_KOSTL.

This code is working fine.

But after giving cost center group in select-options

again i have to press enter..and then if i press F4 its displaying all the values..

If i wont press enter its throwing error No inputu values...

But i want to get F4 values without presing enter.

Will u plz tell me where to correct the code.

Its very urgent.

Thanks and Regards,

Ramya