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

Selection-Screen doubt?

Former Member
0 Likes
564

Hi

In selection screen I have three fields, plant mat no and material group. If I input plant how do I get the mat no and material group based on plant dynamically?

Thanks

6 REPLIES 6
Read only

dani_mn
Active Contributor
0 Likes
532

HI,

you have to query based on plant.

At selection-screen output.

IF NOT plant is initial.

SELECT mat_no mat_group from <table>

INTO mat_no mat_grupo

WHER plant = plant.

ENDIF.

REgard,

Read only

former_member628175
Active Participant
0 Likes
532

Hi ,

If you are working on module pool program , create a module in PROCESS ON VALUE-REQUEST . see the example below .

*****************************************

PROCESS ON VALUE-REQUEST .

FIELD zrtpm_agrmnt_typ-dis_channel

MODULE create_f4_distr_chan.

******************************************

module create_f4_distr_chan input.

TYPES : ls_ret_tab Type ddshretval ,

ls_dynpfields Type dynpread .

Types : BEGIN OF ls_dischan ,

dis_channel type CRMT_DISTRIBUTION_CHANNEL ,

desc type CRMT_DESCRIPTION ,

END OF ls_dischan.

DATA: li_dischan TYPE STANDARD TABLE OF ls_dischan ,

wa_dischan TYPE ls_dischan .

DATA : lc_E VALUE 'E' ,

lc_S VALUE 'S' .

DATA: li_ret_tab Type STANDARD TABLE OF ls_ret_tab ,

wa_ret_tab Type ls_ret_tab .

DATA: lt_dynpfields Type STANDARD TABLE OF ls_dynpfields ,

wa_dynpfields TYPE ls_dynpfields .

CLEAR : li_dischan ,

li_ret_tab.

Refresh : li_dischan ,

li_ret_tab.

SELECT DISTCHAN DESCRIPTION into table li_dischan

FROM CRMC_DISTCHAN_T

WHERE LANGU = lc_e .

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'DIS_CHANNEL'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'DIS_CHANNEL'

value_org = lc_s

TABLES

value_tab = li_dischan

  • return_tab = li_ret_tab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

endmodule. " create_f4_distr_chan INPUT

************************************************

Hope this helps

Read only

Former Member
0 Likes
532

hi,

AT SELECTION-SCREEN ON FIELD WERKS.

IF WERKS IS NOT INITIAL.

        • CHECK FOR THE EXISTENCE OF THE PLANT.

SELECT SINGLE MATNR .... FROM ....INTO CORRESPONDING FIELDS OF IT_MATERIAL.

ENDIF.

The above code is only a sample..kindly fill-in appropriate table and field names accordingly.

Reward if helpful.

Regards

Read only

Former Member
0 Likes
532

Hi,

For a plant there may be many matno an material group. If i understand your question correctly, if u input a plant, the related matno and material group will fetch when u press a F4 help. In this case use FM DYNP_VALUES_READ.

Reward if useful.

Regards,

Senthil

Read only

Former Member
0 Likes
532

hi

good

using select statement you can get the the material group on plant and you can , display them in your selection screen or where ever you want.

thanks

mrutyun

Read only

rahulkavuri
Active Contributor
0 Likes
532

Hi there was a similar post some days back check this link and please award points if found helpful