Skip to Content
0
Former Member
Feb 06, 2007 at 10:07 PM

Regd: F4 help..

21 Views

Hi ,

I have a requirement that i populate the selection list for one field on F4 , based on the entry in the other field prior. I have been able to get this functionality done. But right now it is working only when i press enter after the prior field is filled. Now i want it to happen with out

pressing enter too.

Here is code:

DATA: BEGIN OF T_VKORG OCCURS 0,

VKORG TYPE ZPK-VKORG,

VTWEG TYPE ZPK-VTWEG,

END OF T_VKORG.

SELECTION-SCREEN BEGIN OF BLOCK ITEMS WITH FRAME TITLE TEXT-007.

PARAMETER: P_EKORG TYPE T024E-EKORG .

PARAMETER: P_MATKL TYPE MARA-MATKL .

PARAMETER: P_SZN TYPE STKO-ZZSEASON .

PARAMETER: P_VKORG TYPE ZPK-VKORG .

PARAMETER: P_VTWEG TYPE ZPK-VTWEG .

SELECT-OPTIONS: P_GEND FOR MARA-J_3AGEND DEFAULT '%' OBLIGATORY.

SELECT-OPTIONS: P_BSTAT FOR STKO-ZZBOMSTAT,

SO_VMSTA FOR MVKE-VMSTA. " Added for Eur org.structure

SELECTION-SCREEN END OF BLOCK ITEMS.

----


INITIALIZATION.

CALL-REPID = SY-REPID.

  • PERFORM INITIALIZE_SELECTIONS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VKORG.

REFRESH: T_VKORG.

IF NOT P_EKORG IS INITIAL.

SELECT VKORG VTWEG INTO TABLE T_VKORG FROM ZPK

WHERE EKORG = P_EKORG.

ELSE .

SELECT VKORG VTWEG INTO TABLE T_VKORG FROM ZPK.

ENDIF.

SORT T_VKORG.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

PVALKEY = ' '

retfield = 'VKORG'

dynpprog = CALL-REPID

DYNPNR = sy-dynnr

dynprofield = 'P_VKORG'

callback_program = CALL-REPID

value_org = 'S'

TABLES

value_tab = T_VKORG

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.

Please suggest how to achieve this.

Thanks,

Das.