‎2007 Aug 17 8:51 AM
Hi abap experts,
I need to make it possible to show the contents of an internal table at parameters or select-options as an f4 help.
I mean I want to fill an internal table with programmatically assigned data and then make it possible entries at parameters.The data does not come from db table.
I think it would be clear with such an example:
Assume we want to do a simple calculation program, the operands such as +,-,*,/ could be provided as an input help.
Thanks.
‎2007 Aug 17 8:57 AM
Hi
Use the function module F4IF_INT_TABLE_VALUE_REQUEST in the AT SELECTION-SCREEN ON VALUE-REQUEST event
demo program for F4 help is below :
REPORT ZGILL_VALUE_REQUEST .
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.
Parameters : ECODE like zgill_main-PERNR.
*parameters: pernr like pa0001-pernr .
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 = 'ECODE'
dynpprog = sy-repid
dynpnr = no_dyn
dynprofield = 'ECODE'
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 ECODE.
YOU CAN FILL THE INTERNAL TABLES WITH ANY DATA.
REGARDS
GAURAV
*REWARD POINTS IF HELPFUL
‎2007 Aug 17 8:55 AM
Hi Deniz
use f4_if_int_table_display Function Module
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_chain.
*
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'ZKSRSPCMAIL'
fieldname = 'CHAIN_ID'
searchhelp = 'ZK_RSPC_ZV_ZKSRSPCMAIL'
SHLPPARAM = ' '
dynpprog = 'ZKRSPCMAIL'
dynpnr = '1000'
dynprofield = 'P_CHAIN'
STEPL = 0
VALUE = ' '
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
SUPPRESS_RECORDLIST = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
SELECTION_SCREEN = ' '
IMPORTING
USER_RESET =
TABLES
return_tab = it_return_tab
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.
reward points to all helpful answers
kiran.M
‎2007 Aug 17 8:57 AM
Data : r_oper for mara-matnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_OPER.
r_oper-sign = 'I'.
r_oper-option = 'EQ'.
r_oper-low = '+'.
append r_oper.
r_oper-low = '-'.
append r_oper.
r_oper-low = '*'.
append r_oper.
r_oper-low = '/'.
append r_oper.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'LOW'
PVALKEY = ' '
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_OPER'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'P'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = r_opr
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.
‎2007 Aug 17 8:57 AM
Hi
Use the function module F4IF_INT_TABLE_VALUE_REQUEST in the AT SELECTION-SCREEN ON VALUE-REQUEST event
demo program for F4 help is below :
REPORT ZGILL_VALUE_REQUEST .
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.
Parameters : ECODE like zgill_main-PERNR.
*parameters: pernr like pa0001-pernr .
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 = 'ECODE'
dynpprog = sy-repid
dynpnr = no_dyn
dynprofield = 'ECODE'
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 ECODE.
YOU CAN FILL THE INTERNAL TABLES WITH ANY DATA.
REGARDS
GAURAV
*REWARD POINTS IF HELPFUL
‎2007 Aug 17 8:58 AM
Hi,
You can use the FM 'F4IF_INT_TABLE_VALUE_REQUEST' for giving F4 help to the parameters or select options.