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

populating selection screen values automatically

Former Member
0 Likes
3,343

Hi

i have a matnr and mtart in a selection screen

after selecting matnr i need to populate mtart automatically without pressing enter button

i tried this one

tables : mara.

parameter : p_matnr like mara-matnr.

parameter : p_mtart like mara-mtart.

at selection-screen output.

select single mtart from mara into p_mtart where matnr eq p_matnr.

but this need enter button, i tried through search helps it is executing in se11 perfectly but if i attach that one in program it is not comming

thanks,

9 REPLIES 9
Read only

former_member194152
Contributor
0 Likes
1,577

hi,

instead of at selection-screen output you should choose initialization event for the same

Read only

Former Member
0 Likes
1,577

hi

good

This is a sample program.

TABLES: trdir.

PARAMETERS: name TYPE trdir-name.

SELECT-OPTIONS: subc FOR trdir-subc NO INTERVALS.

AT SELECTION-SCREEN.

DATA: subc1 TYPE trdir-subc.

SELECT SINGLE subc FROM trdir INTO subc1 WHERE name = name.

subc-sign = 'I'.

subc-option = 'EQ'.

subc-low = subc1.

APPEND subc.

After entering a program name in parameter and press enter the value will be updated in the select-option.

thanks

mrutyun^

Read only

0 Likes
1,577

i dont want to press enter button

after selecting a value in a parameter then immediatley i want to populate second para value without any interaction

Read only

0 Likes
1,577

Have a search through SDN for function 'DYNP_VALUES_UPDATE' e.g. towards the end of the thread:

I have provided an example of doing this i.e. writing to a second field after F4 on the first field.

Jonathan

Read only

0 Likes
1,577

 Hi

 Maybe you can use the class of cl_gui_timer .

Read only

0 Likes
1,577

Hi,

this is my idea:

at selection-screen on value-request for NAME.
*Here you can use without PAI/PBO (Enter) the FMs:
*DYNP_VALUES_READ to read the NAME value from the screen
*and
*DYNP_VALUES_UPDATE to write your new values to the other field 

Hope it can help a little bit..

Regards,

Gianpietro

Read only

Former Member
0 Likes
1,577

Hi,

You can write your own F4 for the Material code field and when assigning the selected Material code back to the field, you can also select the material type for the selected material code and assign it back to the screen field.

Read only

Former Member
0 Likes
1,577

Hi

AT SELECTION-SCREEN

events will be triggered after any action you do on the screen

so with out pressing enter it won't take any value

or elase you can do one thing

enter the values

and click on execute button then automatically that next field value will be inserted and executes perfectly

AT SELECTION-SCREEN events will be triggered only when some perticular action to be done on the selection screen

reward if usefull

Read only

Former Member
0 Likes
1,577

REPORT ztest.

DATA:

t_ret_table LIKE STANDARD TABLE OF ddshretval,

fs_ret_table TYPE ddshretval,

t_dynp_fields LIKE STANDARD TABLE OF dynpread,

fs_dynp_fields TYPE dynpread.

PARAMETER : p_matnr LIKE mara-matnr.

PARAMETER : p_mtart LIKE mara-mtart MEMORY ID mta.

AT SELECTION-SCREEN OUTPUT.

*select single mtart from mara into p_mtart where matnr eq p_matnr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = 'MARA'

fieldname = 'MATNR'

searchhelp = 'MAT1'

  • SHLPPARAM = ' '

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_MATNR'

  • STEPL = 0

  • VALUE = ' '

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • SUPPRESS_RECORDLIST = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • SELECTION_SCREEN = ' '

  • IMPORTING

  • USER_RESET =

TABLES

return_tab = t_ret_table

  • EXCEPTIONS

  • FIELD_NOT_FOUND = 1

  • NO_HELP_FOR_FIELD = 2

  • INCONSISTENT_HELP = 3

  • NO_VALUES_FOUND = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ TABLE t_ret_table INTO fs_ret_table INDEX 1.

CLEAR t_dynp_fields.

fs_dynp_fields-fieldname = 'P_MATNR'.

fs_dynp_fields-fieldvalue = fs_ret_table-fieldval.

APPEND fs_dynp_fields TO t_dynp_fields.

clear fs_dynp_fields.

fs_dynp_fields-fieldname = 'P_MTART'.

SELECT SINGLE mtart FROM mara INTO fs_dynp_fields-fieldvalue WHERE matnr EQ fs_ret_table-fieldval.

  • fs_dynp_fields-fieldvalue =

APPEND fs_dynp_fields TO t_dynp_fields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

TABLES

dynpfields = t_dynp_fields

  • EXCEPTIONS

  • INVALID_ABAPWORKAREA = 1

  • INVALID_DYNPROFIELD = 2

  • INVALID_DYNPRONAME = 3

  • INVALID_DYNPRONUMMER = 4

  • INVALID_REQUEST = 5

  • NO_FIELDDESCRIPTION = 6

  • UNDEFIND_ERROR = 7

  • OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

AT SELECTION-SCREEN.

START-OF-SELECTION.