Application Development 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: 

Report - Selection Screen

Former Member
0 Kudos

Hi Experts,

I have a report whose selection has pernr, which has got F4 value search help.

There are other two selection - parameters Employee Name & Designation,

User requirement is that he wants to fill up these to selection parameters once the personnel number is selected from the F4 help.

Could you please advice.

Thanks In Advance,

Regards,

Iff

1 ACCEPTED SOLUTION

former_member194152
Contributor
0 Kudos

hi,

You can fill those entry by code using at selection-screen output event

try following code..

tables mara.
select-options  matnr for mara-matnr.
parameter : empid(30) type c.
parameter : empno(10) type n.

at selection-screen output.

loop at screen.
if not matnr is initial.
if matnr-low = '000000000000190102'.
empno = '1234567890'.
empid = 'Gagan Choudha'.
endif.
endif.
modify screen.
endloop.

Rewards if helpful.

Regards

Gagan

2 REPLIES 2

Former Member
0 Kudos

Hi

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.

and

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.

<b>Reward if usefull</b>

former_member194152
Contributor
0 Kudos

hi,

You can fill those entry by code using at selection-screen output event

try following code..

tables mara.
select-options  matnr for mara-matnr.
parameter : empid(30) type c.
parameter : empno(10) type n.

at selection-screen output.

loop at screen.
if not matnr is initial.
if matnr-low = '000000000000190102'.
empno = '1234567890'.
empid = 'Gagan Choudha'.
endif.
endif.
modify screen.
endloop.

Rewards if helpful.

Regards

Gagan