Application Development and Automation 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: 
Read only

at selection-screen on value-request

Former Member
0 Likes
665

Hi experts,

Pls see the below code.

When ever plant is enterd in screen i have to get material no. and material group based on that plant dynamically.

I am getting F4 list of values for the first one.But For the second one i am not getting.

What may be teh problem?

&----


*& Report ZRA_SELECTIONSCTREEN *

*& *

&----


*& *

*& *

&----


REPORT ZRA_SELECTIONSCTREEN .

tables: mara,marc.

parameters: p_werks like marc-werks,

p_matnr like marC-matnr,

p_matkl like mara-matkl.

data: begin of it_matnr occurs 0,

matnr like mara-matnr,

end of it_matnr.

data: begin of it_matkl occurs 0,

matkl like mara-matkl,

end of it_matkl.

at selection-screen on value-request for p_matnr.

select matnr into table it_matnr from marc where werks = p_werks.

if not it_matnr[] is initial.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MATNR'

  • PVALKEY = ' '

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'p_matnr'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = it_matnr

  • 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.

ENDIF.

select matkl from mara into table it_matkl for all entries IN it_matnr

WHERE MATNR = IT_MATNR-MATNR.

if not it_matkl[] is INITIAL.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MATKL'

  • PVALKEY = ' '

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'p_matkl'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_MATKL

  • 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.

ENDIF.

Regards

Ravi.

5 REPLIES 5
Read only

Former Member
0 Likes
636

I got it...

Read only

Former Member
0 Likes
636

Hi ravi,

1. give DYNPROFIELD = 'p_matnr'

in CAPITAL.

2. like this.

DYNPROFIELD = 'P_MATNR'

regards,

amit m.

Read only

Former Member
0 Likes
636

Hi for the matchcode you have to use the "on value request" additionbal statement.

For selecting in MARA or MARC depending on the parameters the user entered, you have to do the select after 'at selection-screen output.'

Regards,

Erwan

Read only

Former Member
0 Likes
636

i checked its working the thing is u may not have selected material in tht material group.

check ur database and give correct input .

Read only

Former Member
0 Likes
636

hi

good

i tried your report, f4 help is coming for all the fields but dynamic field selection is ot coming because ther eis a prob with your select statment,

you select the data from the database table for the another two fields as the value you r entering for werks(plant).

thanks

mrutyun^