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

F4 help

former_member508729
Active Participant
0 Likes
714

Hi

I need same f4 help from same table for 2 fields in an alv grid but when i am assigning this to both the fields

i am not able to pass the value to the fields.

Pls let me know whether same f4 help can be given to 2 fields at same time or not?

Or ther is some other procedure to do the same.

5 REPLIES 5
Read only

Former Member
0 Likes
645

Hai ashutosh

Check the following code

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ldf_tabname " Structure of VALUE_TAB

RETFIELD = LDF_FLDNAME "Name of return field in FIELD_TAB

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = LCF_VAL "Value return

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = TAB_TEMP " Table of Values

FIELD_TAB = LDT_FLDTAB " Fileds of the Hit list

RETURN_TAB = LDT_RETTAB " return the selected value

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

READ TABLE LDT_RETTAB INDEX 1.

DATA: LDT_DFIES LIKE DFIES OCCURS 0 WITH HEADER LINE.

CLEAR LDT_DFIES.

CALL FUNCTION 'DDIF_FIELDINFO_GET'

EXPORTING

TABNAME = LDF_TABNANME

FIELDNAME = LDF_FLDNAME

  • LANGU = SY-LANGU

  • LFIELDNAME = ' '

  • ALL_TYPES = ' '

  • GROUP_NAMES = ' '

  • UCLEN =

  • IMPORTING

  • X030L_WA =

  • DDOBJTYPE =

  • DFIES_WA =

  • LINES_DESCR =

TABLES

DFIES_TAB = LDT_DFIES " Field List

  • FIXED_VALUES =

EXCEPTIONS

NOT_FOUND = 1

INTERNAL_ERROR = 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.

Thanks & regards

Sreenivasulu P

Read only

Former Member
0 Likes
645

hi Ashutosh,

Plz check the following function module

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

hope this will solve your problem.

Regards,

Ankit.

Read only

Former Member
0 Likes
645

Hi,

use fieldcat option ref_field, and ref_table

for first one give fieldcat-ref_field = 'FIELD1'.

fieldcat-ref_table = 'VBAK'.

similarly for the other..

fieldcat-ref_field = 'FIELD2'.

fieldcat-ref_table = 'VBAK'.

so you will get different F4helps provided if those fields are with F4help.

Regards

vijay

Read only

Former Member
0 Likes
645

Hi Ashutosh,

Refer the link below.

<a href="http://www.sapsuperusers.com/forums/showthread.php?t=4885">http://www.sapsuperusers.com/forums/showthread.php?t=4885</a>

<b>Please reward points if it helps.</b>

Regards,

Amit Mishra

Read only

Former Member
0 Likes
645

Hi Ashutosh,

The FM "CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST" returns only one value .. If you have one unique field in 2 fields you were refering then you can capture the unique field and read your internal table to get the second field also.

For example, look at this code

=====================================================

parameter: p_lname like zmd-lname.

tables: zmd.

DATA: BEGIN OF itab_details OCCURS 0,

ID like zmd-id,

lname like zmd-lname.

DATA: END OF itab_details.

DATA it_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

SELECT * FROM zmd INTO CORRESPONDING FIELDS OF

itab_details WHERE fname eq p_lname.

APPEND itab_details.

ENDSELECT.

SORT itab_details BY ID.

CLEAR itab_details.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ID'

window_title = 'Physicians details'

value_org = 'S'

TABLES

value_tab = itab_details

return_tab = it_return

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

CLEAR itab_details.

READ TABLE it_return INDEX 1.

itab_details-ID = it_return-fieldval.

READ TABLE itab_details WITH KEY ID = itab_details-ID.

if sy-subrc eq 0.

<b>ID</b> = itab_details-ID.

<b>LAST_NAME</b> = itab_details-lname.

endif.

ENDIF.

REFRESH itab_details. CLEAR: itab_details.

======================================================

In this case, ID is unique and you are extracting last name based on ID.

Hope this will be of some help to you.

Regards,

Vicky

PS: Award points if helpful