Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regd: F4 help..

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Use the FM DYNP_VALUES_UPDATE

Thanks,

Naren

Former Member
0 Kudos

HI

check this..

<b>TABLES: mara, makt.

DATA mat LIKE mara-matnr.

DATA: BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

END OF itab.

DATA : BEGIN OF btab OCCURS 0,

maktx LIKE makt-maktx,

END OF btab.

DATA mak LIKE makt-maktx.

DATA : return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF dynpfields OCCURS 3.

INCLUDE STRUCTURE dynpread.

DATA: END OF dynpfields.

PARAMETERS: p_matnr LIKE mara-matnr,

p_maktx LIKE makt-maktx.

INITIALIZATION.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.

REFRESH itab.

SELECT matnr FROM mara INTO TABLE itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'MATNR '

dynprofield = 'P_MATNR '

dynpprog = sy-repid

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = itab

return_tab = return.

mat = return-fieldval.

UNPACK mat TO mat.

SELECT SINGLE maktx FROM makt INTO mak WHERE matnr = mat AND spras =

sy-langu.

p_matnr = return-fieldval.

REFRESH return.

CLEAR return.

MOVE 'P_MAKTX' TO dynpfields-fieldname.

MOVE mak TO dynpfields-fieldvalue.

APPEND dynpfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = 'SY-REPID'

dynumb = '1000'

TABLES

dynpfields = dynpfields.

REFRESH return.

CLEAR return.</b>

Regards

SAB

Former Member
0 Kudos

Thank you all...