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

'PROCESS ON VALUE-REQUEST'

Former Member
0 Likes
554

Hi All,

I have one screen field as search help( F4 help), that field have check table, in this check table have number of records, if you press F4 function key to display the total check table record, but i want to display the particular records.

Regards

Mahesh.

5 REPLIES 5
Read only

Former Member
0 Likes
520

Use FM 'F4IF_INT_TABLE_VALUE_REQUEST' and try

Read only

Former Member
0 Likes
520

write ur code as follows -

PROCESS ON VALUE-REQUEST.

FIELD ITAB-PERNR MODULE F4_HELP.

module F4_HELP input.

data: begin of lt_all occurs 0.

include structure DYNPREAD.

data end of lt_all.

data: begin of lt_selected occurs 0.

include structure DDSHRETVAL.

data: end of lt_selected.

DATA: BEGIN OF lt_code OCCURS 0,

code LIKE zgill_main-PERNR,

END OF lt_code.

data no_dyn like sy-dynnr.

no_dyn = sy-dynnr. "give the scren no directly or sy-dynnr in case of report.

*At selection-screen on value-request for ECODE.

select PERNR into table lt_code from zgill_main.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ITAB-PERNR'

dynpprog = sy-repid

dynpnr = no_dyn

dynprofield = 'ITAB-PERNR'

window_title = 'Employee Details'

value_org = 'S'

DISPLAY = 'F'

TABLES

value_tab = lt_code

RETURN_TAB = lt_selected.

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

*if sy-subrc eq '0' .

  • write: 'success'.

*endif.

read table lt_selected index sy-tabix.

move lt_selected-fieldval to ITAB-PERNR.

endmodule. " F4_HELP INPUT

u caN MODIFY LT_SELECTED INTERNAL table as per your wish and delete irrelevent entries from it.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
520

Hi,

Check this code.

tables kna1.

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

select-options s_begru for kna1-begru.

at selection-screen on value-request for s_begru-low.

refresh t_values.

t_values = 'PAR*'.

append t_values.

t_values = 'UGG'.

append t_values.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

s_begru-low = t_return-fieldval.

endif.

Read only

Former Member
0 Likes
520

Hi <b>Mahesh</b>,

You can use the following logic and change the code accordingly.

I am sending you the code where I have implemented the same.

&----


*& Form get_value_help

&----


  • This is where i get the F4 help for scenario/action type

----


FORM get_value_help USing p_sc_typ type any.

Data: l_tabix type sy-tabix.

Select auswirkx

from tq81_t

into table i_desc

where spras = sy-langu.

If sy-subrc = 0.

COMMIT WORK.

Endif.

*-- Function module which gives a popup F4 help.

CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = '60'

ENDPOS_ROW = '18'

STARTPOS_COL = '20'

STARTPOS_ROW = '3'

TITLETEXT = TEXT-001 "Notification Scenarios

IMPORTING

CHOISE = l_TABIX

TABLES

VALUETAB = i_desc

EXCEPTIONS

BREAK_OFF = 0

OTHERS = 0.

IF SY-SUBRC <> 0.

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

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

ENDIF.

Describe table i_desc.

IF l_TABIX > 0 AND l_TABIX <= SY-TFILL.

READ TABLE i_desc INDEX l_TABIX.

If sy-subrc = 0.

If p_sc_typ = 'S_SC_TYP-LOW'.

S_SC_TYP-LOW = i_desc-auswirkx.

ELSEIF p_sc_typ = 'S_SC_TYP-HIGH'.

S_SC_TYP-HIGH = i_desc-auswirkx.

ENDIF.

Endif.

Endif.

ENDFORM. " get_value_help

You can pass all the values you want to i_desc and it will pop up when you press F4. S_SC_TYP is the field name. and TEXT-001 is the text that you want to be displayed on the top of the F4 help window.

Regards,

Ishaq.

Read only

Former Member
0 Likes
520

Hi,

use the code as follows:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERK-HIGH.

REFRESH ITEMP.

CLEAR ITEMP.

<b> SELECT WERKS

NAME1

FROM T001W

INTO TABLE ITEMP

WHERE IWERK = 'M011'.</b>

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'WERKS'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = ITEMP

  • FIELD_TAB =

RETURN_TAB = T_RETURN

  • 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.

S_WERK-HIGH = T_RETURN-FIELDVAL.

Hope this helps.

Reward if helpful.

Regards,

Sipra