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

Input help for a field

Former Member
0 Likes
765

Hi,

i need a posible values for a field of ztable in a report. here i used for AT SELECTION-SCREEN ON VALUE-REQUEST FOR z table field and FM ie F4IF_INT_TABLE_VALUE_REQUEST used to retrive the value. but that is not getting. c this code.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR parameter1.

select zfield from ztable into table int_tab_ztable.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'zfield'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = int_tab_ztable

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

when i press F4 that is displaing all fields of Ztable and when i select one value that is not returning back to parameter.

regards,

vijay

<b>int_tab_ztable</b>

DATA: BEGIN OF int_tab_ztable,

FIELD (ONLY WHICH U REQUIRED IN SEARCH HELP),

END OF ITAB.

now it fetch only field.

for return....

DATA : iT_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE

<b>RETURN_TAB = it_return.</b>

6 REPLIES 6
Read only

Former Member
0 Likes
736

Hai Vijay

Check the following COde

TABLES : MARD.

DATA: BEGIN OF IT_MARD OCCURS 0,

WERKS LIKE MARD-WERKS,

END OF IT_MARD.

DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.

parameters : P_WERKS LIKE MARD-WERKS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.

SELECT WERKS FROM MARD UP TO 10 ROWS INTO table IT_MARD.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'WERKS'

DYNPPROG = SY-REPID

DYNPNR = '1000'

DYNPROFIELD = 'P_WERKS'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_MARD

RETURN_TAB = T_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

Thanks & regards

Sreenivasulu P

Read only

0 Likes
736

<b>int_tab_ztable</b>

DATA: BEGIN OF int_tab_ztable,

FIELD (ONLY WHICH U REQUIRED IN SEARCH HELP),

END OF ITAB.

now it fetch only field.

for return....

DATA : iT_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE

<b>RETURN_TAB = it_return.</b>

Read only

Former Member
0 Likes
736

Hi vijay,

1. U have not given proper parameters

while calling the FM.

2. have a look at this (just copy paste)

3.

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.

Read only

Former Member
0 Likes
736

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'zfield'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = int_tab_ztable

<b>* FIELD_TAB =</b>

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

the table return tab has to be passed so as to fetch value from the selection

read the documentation for this FM<

Regards,

Harish

Reward if useful

Read only

Former Member
0 Likes
736

Hi Vijay,

For custom defined tables, I think it will be better if you go with listboxes.

You can include all those values in the internal table and pass the internal table to the FM VRM_SET_VALUES.

Just go through this link for more details.

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

Just go through this SDN Link also..It also has the same requirement.

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

Regards,

SP.

Read only

Former Member
0 Likes
736

Hi Vijay,

Lets take scenario where a field whose type is ztrg_table-shop_code has to be provided input help.

<b>

Following steps should be followed for implementing

Input(F4) help for a field :-

</b>


AT SELECTION-SCREEN ON VALUE-REQUEST FOR <INPUT-FIELD NAME>('shop_code' field of table 'ztrg_table')
<b>
* Populate internal table with value(s) that you want on request.
</b>

SELECT * FROM [Table](i.e,ztrg_table) 
       INTO TABLE t_int1 .

LOOP AT t_int1 INTO wa_area1.
    wa_area = wa_area1-shop_code.
    APPEND  wa_area TO t_int.
    CLEAR wa_area.
ENDLOOP.
<b>
* Building the Structure of the Seach Help.
</b>
  tab-tabname =    'ZTRG_TABLE'. (Name of the table)  
  tab-fieldname =  'SHOP_CODE'.  (Name of the field)
  APPEND tab.                    ('tab' of type dfies )
<b>
* Function Used to provide Search Help.
</b>
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
    retfield = 'SHOP_CODE'
    dynpprog = sy-repid
    dynpnr =   sy-dynnr
    window_title = 'Function'              (Window Title)
  TABLES
    value_tab = t_int
    field_tab = tab.

Hope this helps you.

Regards,

Anirban.