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

Former Member
0 Likes
443

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
423

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.

3 REPLIES 3
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
423

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

Read only

Former Member
0 Likes
424

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.

Read only

varma_narayana
Active Contributor
0 Likes
423

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>