‎2006 Aug 28 12:12 PM
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
‎2006 Aug 28 12:15 PM
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,
‎2006 Aug 28 12:17 PM
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
‎2006 Aug 28 12:28 PM
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
‎2006 Aug 28 12:42 PM
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
‎2006 Aug 28 12:52 PM
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
‎2006 Aug 28 1:04 PM