11-02-2007 7:21 AM
Hi Experts,
I have created search help for a textbox .my problem is when i will select a serach help id then need to display related text into another textbox.
please help.
Thank you.
Regards,
prasad.
11-02-2007 7:25 AM
REPORT ZTEST
parameters:
p_matnr type mara-matnr,
p_matKl type mara-matkl.
data:
begin of itab occurs 0,
matnr type mara-matnr,
matkl type mara-matkl,
end of itab,
t_ret_tab LIKE STANDARD TABLE OF DDSHRETVAL,
t_dyn_map LIKE STANDARD TABLE OF DSELC,
fs_ret_tab TYPE DDSHRETVAL,
fs_dyn_map TYPE DSELC,
w_repid type sy-repid,
w_dynnr TYPE sy-dynnr.
at selection-screen on value-request for p_matnr.
select matnr
matkl
from mara
into table itab
up to 10 rows.
fs_dyn_map-fldname = 'F0002'.
fs_dyn_map-dyfldname = 'P_MATKL'.
APPEND fs_dyn_map TO t_dyn_map.
w_repid = sy-repid.
w_dynnr = sy-dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'MATNR'
PVALKEY = ' '
DYNPPROG = w_repid
DYNPNR = w_dynnr
DYNPROFIELD = 'P_MATNR'
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 =
RETURN_TAB = t_ret_tab
DYNPFLD_MAPPING = t_dyn_map
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.
*tables:
likp.
*
*select-options:
so_vstel for likp-vstel.
*
*INITIALIZATION.
so_vstel-low = '1000'.
APPEND so_vstel.
so_vstel-low = '2000'.
APPEND so_vstel.
DATA : BEGIN OF ITAB OCCURS 0,
TEMP(1500) TYPE C,
END OF ITAB.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\TEST.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = ITAB[]
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
11-04-2007 10:28 AM
Hi Rajesh,
Thank you given reply.
you are given example on reports, but i need to write in module pool program.my requirement is :
when i select a value of search help then the corresponding id of text will be display in to another textbox. pls help me.
thank you.
regards,
prasad
11-04-2007 10:50 AM
Hi
Use the following
For F4 Values on Screen:
PROCESS ON VALUE_REQUEST
using module call starting with FIELD i.e FIELD field MODULE module
There are number of function modules that can be used for the purpose, but these
can fullfill the task easily or combination of them.
DYNP_VALUE_READ
F4IF_FIELD_VALUE_REQUEST
POPUP_WITH_TABLE_DISPLAY
DYNP_VALUE_READ
This function module is used to read values in the screen fields. Use of this
FM causes forced transfer of data from screen fields to ABAP fields.
There are 3 exporting parameters
DYNAME = program name = SY-CPROG
DYNUMB = Screen number = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
and one importing TABLE parameter
DYNPFIELDS = Table of TYPE DYNPREAD
The DYNPFIELDS parameter is used to pass internal table of type DYNPREAD
to this FM and the values read from the screen will be stored in this table.This
table consists of two fields:
FIELDNAME : Used to pass the name of screen field for which the value is to
be read.
FIELDVALUE : Used to read the value of the field in the screen.
e.g.
DATA: SCREEN_VALUES TYPE TABLE OF DYNPREAD ,
SCREEN_VALUE LIKE LINE OF SCREEN_VALUES.
SCREEN_VALUE-FIELDNAME = 'KUNNR' . * Field to be read
APPEND SCREEN_VALUE TO SCREEN_VALUES. * Fill the table
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = SCREEN_VALUES.
READ TABLE SCREEN_VALUES INDEX 1 INTO SCREEN_VALUE.Now the screen value for field KUNNR is in the SCREEN_VALUE-FIELDVALUE and can be used for further processing like using it to fill the internal table to be used as parameter in F4IF_INT_TABLE_VALUE_REQUEST ETC.
F4IF_FIELD_VALUE_REQUEST
This FM is used to display value help or input from ABAP dictionary.We have to pass the name of the structure or table(TABNAME) along with the field name(FIELDNAME) . The selection can be returned to the specified screen field if three
parameters DYNPNR,DYNPPROG,DYNPROFIELD are also specified or to a table if RETRN_TAB is specified.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = table/structure
FIELDNAME = 'field name'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNR
DYNPROFIELD = 'screen field'
IMPORTING
RETURN_TAB = table of type DYNPREAD
.
Regards
Anji