05-08-2008 11:00 AM
I collected the datas from the function module. and the internal table is populated.
the internal table contains manny fields.
among these fields i need to take only one field and this field value to be used for F4 help in the selection screen ( not a dynpro)
for example : in the selection screen
I have to select the PO.
based on the user i have filtered the PO. (determined dynamically by using the user name this i have done it)
then i have to assign the PO the selection screen.
which FM will be better to use for this type of scenario and help me out with some example codes particularly for my req
Thanks
05-08-2008 11:03 AM
Hi,
PARAMETER : s_matnr TYPE mara-matnr.
TYPES: BEGIN OF ts_mara,
matnr TYPE matnr,
ersda TYPE ersda,
ernam TYPE ernam,
END OF ts_mara.
DATA : lt_mara TYPE TABLE OF ts_mara.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_matnr.
SELECT matnr ersda ernam FROM mara INTO TABLE lt_mara UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'MATNR'
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_MATNR'
value_org = 'S'
display = ' '
TABLES
value_tab = lt_mara.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thank you.
Reward points if found useful.
05-08-2008 11:06 AM
05-08-2008 11:09 AM
Hi ,
use the FM 'F4IF_INT_TABLE_VALUE_REQUEST'
This example is for search help for material type .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_mtart-low .
select all material types you want to display in search help into table i_mtart.
PERFORM select_material_type.
PERFORM help_material_type.
&----
*& Form help_material_type
&----
text
-
--> p1 text
<-- p2 text
-
FORM help_material_type .
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'MTART'
PVALKEY = ' '
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'S_MTART-LOW'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = i_mtart
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.
ENDFORM. " help_material_type
Regards,
Balaji.
05-08-2008 11:10 AM
REPORT Z183753_2.
TABLES: T001.
TYPES:
BEGIN OF T_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MENGE LIKE EKPO-MENGE,
NETPR LIKE EKPO-NETPR,
END OF T_EKPO,
BEGIN OF T_VALTAB,
BUKRS LIKE T001-BUKRS,
END OF T_VALTAB.
DATA: I_EKKO TYPE STANDARD TABLE OF EKKO,
I_EKPO TYPE STANDARD TABLE OF T_EKPO,
I_VALTAB TYPE STANDARD TABLE OF T_VALTAB.
SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECT-OPTIONS: S_BUKRS FOR T001-BUKRS.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON S_BUKRS.
IF S_BUKRS IS INITIAL.
MESSAGE E000(ZZ) WITH TEXT-001.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_BUKRS-LOW.
PERFORM VALUE_REQ USING S_BUKRS-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_BUKRS-HIGH.
PERFORM VALUE_REQ USING S_BUKRS-HIGH.
START-OF-SELECTION.
* Fetch POs from EKKO table
SELECT *
FROM EKKO
INTO TABLE I_EKKO
WHERE BUKRS IN S_BUKRS.
IF SY-SUBRC = 0.
SORT I_EKKO.
ENDIF.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form VALUE_REQ
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM VALUE_REQ USING P_BUKRS.
I_FIELDTAB-TABNAME = 'T001'.
I_FIELDTAB-FIELDNAME = 'BUKRS'.
APPEND I_FIELDTAB.
SELECT BUKRS
FROM T001
INTO TABLE I_VALTAB.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = I_FIELDTAB-FIELDNAME
TABLES
VALUE_TAB = I_VALTAB
FIELD_TAB = I_FIELDTAB
RETURN_TAB = I_RETTAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC = 0.
P_BUKRS = I_RETTAB-FIELDVAL.
ENDIF.
ENDFORM. " VALUE_REQ
05-08-2008 11:30 AM
hello experts,
My datas are in internal table ( which i got populated from the FM) and not from the tables.
I have to keep only one of the field from internal table as f4 help in the selection screen.
if not clear please write to me
thanks
05-08-2008 11:33 AM
HI,
VALUE_TAB = I_VALTAB <--- pass ur internal table here in that FM.
regards,
madhumitha
05-08-2008 11:23 AM
hi
good
check this function module
HELP_VALUES_GET_WITH_TABLE
thanks
mrutyun^