‎2007 Aug 24 10:30 AM
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?
Can anyone help me?
‎2007 Aug 24 10:33 AM
Yo can use a kind of search help which import the plant mat no and than fetch the material group.You have to declare the select-option varriable from the same structure field in which the matarial no. has the search help attached. In case if no standard search help exist than you can always create your own search help and attach it with the field in the structure.
‎2007 Aug 24 10:33 AM
Hi,
You can do this on
AT SELECTIOn-SCREEN ON VALUE-REQUEST FOR plant.
Here once the value of plant is selected get the value of other two fileds and assign them to the paramters.
Regards,
Sesh
‎2007 Aug 24 10:33 AM
Yo can use a kind of search help which import the plant mat no and than fetch the material group.You have to declare the select-option varriable from the same structure field in which the matarial no. has the search help attached. In case if no standard search help exist than you can always create your own search help and attach it with the field in the structure.
‎2007 Aug 24 10:35 AM
Hi..
The Table which you have to use is MARC.
Check the Code below and Convert it as per ur req:
use the AT SELECTION-SCREEN ON VALUE-REQUEST event for this.
REPORT zsel_f4help .
*---Report with selection screen and to display the list of
possible entries for field 'B' as per the value in field 'A'.
PARAMETERS: p_vbeln TYPE vbak-vbeln,
p_posnr TYPE vbap-posnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
DATA: BEGIN OF help_item OCCURS 0,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
arktx TYPE vbap-arktx,
END OF help_item.
DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
dynfields-fieldname = 'P_VBELN'.
APPEND dynfields.
**Read the Values of the SCREEN FIELDs
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = dynfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
**Find out the Value of P_VBELN
READ TABLE dynfields WITH KEY fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
**Convert the Value into internal format
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_vbeln
IMPORTING
output = p_vbeln.
**Fetch the correponding itemnos from VBAP
SELECT posnr matnr arktx INTO TABLE help_item
FROM vbap
WHERE vbeln = p_vbeln.
**Generate the F4 help with internal table values
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = help_item.
<b>Reward if Helpful</b>