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: 

on Value Request

Former Member
0 Kudos

Hi,

i have one internal table having one field . in selection screen if i press f4 on particular field it should give the internal value.

i have tried with F4IF_INT_TABLE_VALUE_REQUEST. But im not got the actual values. kindly help me out with one example.

my need as follows.

data begin of tb occurs 0,

field like char100,

end of tb.

select-options : field for char100.

start-of-selection:

select field into table tb.

at selection-screen on value request for field.

here what function module how to pass???

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi prakash,

1. sample code (just copy paste)

2.

REPORT ABC.

*----


DATA : BEGIN OF ITAB OCCURS 0,

UNAME LIKE USR01-BNAME,

END OF ITAB.

data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .

data : RETURN_wa LIKE DDSHRETVAL .

*----


PARAMETERS : A(12) TYPE C.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.

ITAB-UNAME = 'U01'. APPEND ITAB.

ITAB-UNAME = 'U02'. APPEND ITAB.

ITAB-UNAME = 'U03'. APPEND ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ITAB-UNAME'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'A'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = ITAB

  • FIELD_TAB = FTAB

RETURN_TAB = return_tab

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

break-point.

regards,

amit m.

7 REPLIES 7

Former Member
0 Kudos
the following example may be of some help to you:

DATA: lf_repid LIKE sy-repid, 
lf_dynnr LIKE sy-dynnr, 
lf_dynprofield LIKE help_info-dynprofld,
lf_retfield LIKE dfies-fieldname. 

MOVE sy-repid TO lf_repid. 
MOVE sy-dynnr TO lf_dynnr. 
MOVE 'PA_DPROF' TO lf_dynprofield. 
MOVE 'PROFILNAME' TO lf_retfield. 

PERFORM prepare_gt_value_tab. 

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' 
EXPORTING 
retfield = lf_retfield 
dynpprog = lf_repid 
dynpnr = lf_dynnr 
dynprofield = lf_dynprofield 
value_org = 'S' 
TABLES 
value_tab = it_value_tab 
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.

Now to retrieve the selected field , 
READ TABLE it_value_tab INDEX 1 .
IF sy-subrc = 0 .
<field_to_get_Fvalue> = it_value_tab-fieldval .
ENDIF .
[code]

[/code]

Former Member
0 Kudos

Hi prakash,

1. sample code (just copy paste)

2.

REPORT ABC.

*----


DATA : BEGIN OF ITAB OCCURS 0,

UNAME LIKE USR01-BNAME,

END OF ITAB.

data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .

data : RETURN_wa LIKE DDSHRETVAL .

*----


PARAMETERS : A(12) TYPE C.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.

ITAB-UNAME = 'U01'. APPEND ITAB.

ITAB-UNAME = 'U02'. APPEND ITAB.

ITAB-UNAME = 'U03'. APPEND ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ITAB-UNAME'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'A'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = ITAB

  • FIELD_TAB = FTAB

RETURN_TAB = return_tab

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

break-point.

regards,

amit m.

Former Member
0 Kudos

Hello Prakash,

U have the fill the int.table in the at selection screen event not at start-ofseelection event.

Fill th eitab in the at seelection event and call the fm.

Reward the points if it is useful,

Regrads,

Vasanth

dani_mn
Active Contributor
0 Kudos

Hi try this code.

data: value_tab like seahlpres occurs 0

with header line.

data: progname like sy-repid,

dynnum like sy-dynnr.

progname = sy-repid.

dynnum = sy-dynnr.

clear value_tab.

refresh value_tab.

  • Filling the Value_tab internal table by itab2 internal table.

*----


loop at itab_desc.

write itab_desc-description to value_tab.

append value_tab.

endloop.

*----


prog = sy-repid.

no = 1000.

clear tab.

refresh tab.

*----


  • Building the Structure of the Seach Help.

tab-tabname = 'FMFCTRT'.

tab-fieldname = 'BESCHR'.

collect tab.

  • Function Used to provide Search Help.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BESCHR'

dynpprog = prog

dynpnr = no

dynprofield = 'SOURCE'

window_title = 'Function'

TABLES

value_tab = value_tab

field_tab = tab.

Regards,

Wasim Ahmed

Former Member
0 Kudos

Thank amit and all , amit ur code ok for me.

Former Member
0 Kudos

Hi,

Sample code:

REPORT ZTEST_F4HELP .

PARAMETERS P_ERNAM LIKE MARA-ERNAM.

DATA:BEGIN OF ITAB OCCURS 0,

ERNAM LIKE MARA-ERNAM,

END OF ITAB.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ERNAM.

SELECT ERNAM FROM MARA INTO TABLE ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'ERNAM'

  • PVALKEY = ' '

DYNPPROG = 'ZTEST_F4HELP'

DYNPNR = '1000'

DYNPROFIELD = 'P_ERNAM '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

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.

Former Member
0 Kudos

Hi Prakash,

You can create a parameter instead of select-options and do it.. The FM for filling the search help with values is <b>F4IF_FIELD_VALUE_REQUEST</b>...

Call the FM in the event AT SELECTION-SCREEN ON VALUE REQUEST ...

After filling the values with search help, you can display the selected value by assigning the selected value to the parameter( In your case , the name is <b>field</b>)...

You can go through this link for more details..

http://www.sap-img.com/abap/value-request-for-parameter.htm

<b>Close the thread once the problem is resolved.</b>

Regards,

SP.