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: 

value request

Former Member
0 Kudos

Hi experts,

i have 2 parameters in selection screen.in the first one i entered user ID and in second one if i press f4 i need to get the roles of the user according to parameter one.i know that i need to code in at selection screen on value request for role.in that how to do.plz give some coding.thank you.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Babita,

Use F4_IF_INT_TABLE_VALUE_REQUEST.

Thanks & Regards,

Murali K

11 REPLIES 11

Former Member
0 Kudos

Hi Babita,

Use F4_IF_INT_TABLE_VALUE_REQUEST.

Thanks & Regards,

Murali K

0 Kudos

hi im not able to find the fm u had given.

and how to pass the values ,plz help me with soem coding

0 Kudos

Hi Babita Please check the program which i have given before..

Abdul

0 Kudos

Here the sample code,

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = progname

dynumb = dynnum

translate_to_upper = 'X'

TABLES

dynpfields = dynpro_values.

READ TABLE dynpro_values INDEX 1 INTO field_value.

SELECT carrid connid

FROM spfli

INTO CORRESPONDING FIELDS OF TABLE values_tab

WHERE carrid = field_value-fieldvalue.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CONNID'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'CONNECTION'

value_org = 'S'

TABLES

value_tab = values_tab.

abdul_hakim
Active Contributor
0 Kudos

Hi

Check the Program DEMO_DYNPRO_F4_HELP_MODULE

Abdul

former_member181962
Active Contributor
0 Kudos

Hi Babita,

In the at selection on value request event,

use the FM DYNP Values read for the screen '1000' and program sy-cprog.

YOu will get the value of the parameter entered.

You can use that value in the select statement to get the roles for that user.

then you can pass that internal table(Having the roles for user) to the FM F4IF_INT_TABLE_VALUE_REQUEST.

Regards,

Ravi

Former Member
0 Kudos

Hi Babitha,

You can hit a select to the table AGR_USERS by passing the username, valid from and valid to. And can use the FM F'4_IF_INT_TABLE_VALUE_REQUEST' mentioned above and retrieve all the roles that the user have.

Regards,

Srikanth

Message was edited by: Srikanth Lodd

Former Member
0 Kudos

Hi

You have to use the event AT SELECTION-SCREEN ON VALUE-REQUEST:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR <P_PARAM>.

In this step your program can't see the other parameter, so you have to use fm DYNP_VALUES_READ to get out it

DATA: DYNAME LIKE D020S-PROG,

DYNUMB LIKE D020S-DNUM.

DATA DYNPFIELDS LIKE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.

DYNAME = SY-REPID,

DYNUMB = SY-DYNNR.

DYNPFIELDS-FIELDNAME = < the name of the parameter you need to find out>

APPEND DYNPFIELDS.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = DYNAME

dynumb = DYNUMB

tables

dynpfields = DYNPFIELDS.

READ DYNPFIELDS INDEX 1.

MOVE DYNPFIELDS-VALUE TO <PARAMETER>.

Here you insert the code to run the search help, and it depends on which search help you need.

Max

0 Kudos

hi,

plz check this below code for value request.

the select command is not getting the values into internal table,plz tell me what went wrong.

tables:agr_users.

parameters:user like agr_users-uname,

role like agr_users-agr_name.

data:begin of itab occurs 0,

user like agr_users-uname,

role like agr_users-agr_name,

end of itab.

at selection-screen on value-request for role.

data:progname type sy-repid,

dynnum TYPE sy-dynnr,

dynpro_values TYPE TABLE OF dynpread,

field_value LIKE LINE OF dynpro_values.

progname = sy-repid.

dynnum = sy-dynnr.

CLEAR: field_value,dynpro_values.

field_value-fieldname = 'USER'.

APPEND field_value to dynpro_values.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = progname

DYNUMB = dynnum

  • TRANSLATE_TO_UPPER = ' '

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

TABLES

DYNPFIELDS = dynpro_values

  • 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

.

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 dynpro_values INDEX 1 INTO field_value.

move field_value-fieldvalue to user.

select agr_name from agr_users into table itab

where uname = user.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'AGR_NAME'

  • PVALKEY = ' '

DYNPPROG = progname

DYNPNR = dynnum

DYNPROFIELD = 'ROLE '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

  • VALUE_ORG = 'C'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = itab

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

0 Kudos

Change your itab declaration.. the field names should match when you use into table..

****

data:begin of itab occurs 0,

agr_name like agr_users-uname,

role like agr_users-agr_name,

end of itab.

***

Suresh

hymavathi_oruganti
Active Contributor
0 Kudos

u select the required values into an itab.

data : ret_tab like ddshretval occurs 0 with header line.

now pass that itab into

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = parameter VALUE_ORG = 'S'

CALLBACK_PROGRAM = V_REPID

TABLES

VALUE_TAB = IT_PVAL

RETURN_TAB = RET_TAB.

read table ret_tab index 1.

IF SY-SUBRC = 0.

move ret_tab-fieldval to parameter.

ENDIF.