Application Development 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: 

FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

0 Kudos

Hi,,

This my lines of code

TYPES: BEGIN OF struct,

name TYPE zpt_packslip_spg-PACK_TYPE,

txt TYPE zpt_packslip_spg-WERKS,

END OF struct.

DATA:wa_zpt_packslip_spg TYPE zpt_packslip_spg.

DATA: ifields TYPE help_value OCCURS 0 WITH HEADER LINE.

DATA: ivalues TYPE struct OCCURS 0 WITH HEADER LINE.

DATA: wa_itab TYPE zpt_packslip_spg.

ifields-tabname = 'ZPT_PACKSLIP_SPG'.

ifields-fieldname = 'PACK_TYPE'.

ifields-selectflag = 'X'.

APPEND ifields.

*-- Fill values

SELECT PACK_TYPE INTO CORRESPONDING FIELDS OF wa_zpt_packslip_SPG

FROM zpt_packslip_spg WHERE werks = pr_werks.

ivalues-name = wa_zpt_packslip_spg-PACK_TYPE.

ivalues-txt = wa_zpt_packslip_spg-WERKS.

APPEND ivalues.

ENDSELECT.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'PACK_TYPE'

tabname = 'ZPT_PACKSLIP_SPG'

title_in_values_list = 'Select a value'

IMPORTING

select_value = wa_zpt_packslip_spg-PACK_TYPE

TABLES

fields = ifields

valuetab = ivalues

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

IF sy-subrc = 0.

p_outno = wa_zpt_packslip_spg-PACK_TYPE.

ENDIF.

ENDFORM.

it show the possible inputs but when i select the input it doesn't copy....

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please find bellow code which will help you in getting some idea in resolving your issue.

REPORT ZTAB_SHELP.

parameters: p_ebeln type ekko-ebeln.

TYPES: BEGIN OF t_ekko,

ebeln TYPE ekpo-ebeln,

ebelp TYPE ekpo-ebelp,

statu TYPE ekpo-statu,

aedat TYPE ekpo-aedat,

matnr TYPE ekpo-matnr,

menge TYPE ekpo-menge,

meins TYPE ekpo-meins,

netpr TYPE ekpo-netpr,

peinh TYPE ekpo-peinh,

END OF t_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,

wa_ekko TYPE t_ekko,

it_return type STANDARD TABLE OF DDSHRETVAL,

wa_return like line of it_return.

**************************************************************

*at selection-screen

at selection-screen on value-request for p_ebeln.

select *

up to 10 rows

from ekko

into CORRESPONDING FIELDS OF TABLE it_ekko.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'EKKO'

RETFIELD = 'EBELN'

  • PVALKEY = ' '

  • DYNPPROG = sy-repid

  • DYNPNR = sy-dynnr

  • DYNPROFIELD = 'EBELN'

  • STEPL = 0

WINDOW_TITLE = 'Ekko Records'

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = 'X' "allows you select multiple entries from the popup

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET = ld_ret

TABLES

VALUE_TAB = it_ekko

  • FIELD_TAB = lt_field

RETURN_TAB = it_return

  • DYNPFLD_MAPPING =

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

READ TABLE it_return into wa_return index 1.

p_ebeln = wa_return-fieldval.

Or check wether you are passing all the parameters

Regards,

Goutam Kolluru.

5 REPLIES 5

Former Member
0 Kudos

Hi,

Use this function module for F4 help.

DATA :RETURN_TAB TYPE TABLE OF DDSHRETVAL.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR empid.

select * from ztest_11 into TABLE itab UP TO 2 rows.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'EMPID' *******Pass your field name for which you want F4

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

RETURN_TAB = RETURN_TAB.

If any queries revert me back.

Regards,

Aditya

0 Kudos

Hi Aditya....

i change my code like this

TYPES : BEGIN OF str_zpt_packslip_spg,

pack_type TYPE zpt_packslip_spg-pack_type,

END OF str_zpt_packslip_spg.

DATA :RETURN_TAB TYPE TABLE OF DDSHRETVAL.

DATA: ITAB_zpt_packslip_spg TYPE TABLE OF str_zpt_packslip_spg.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_PACK.

SELECT PACK_TYPE INTO CORRESPONDING FIELDS OF table itab_zpt_packslip_SPG

FROM zpt_packslip_spg WHERE werks = pr_werks.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'PACK_TYPE'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB_zpt_packslip_spg

RETURN_TAB = RETURN_TAB.

it show the possible input values but when i am selecting the input from the displayed list it doesn't copy to my input field.... please rectify my problem ..but please take your time

Edited by: Thomas Zloch on Feb 1, 2012

Former Member
0 Kudos

Hi,

Please find bellow code which will help you in getting some idea in resolving your issue.

REPORT ZTAB_SHELP.

parameters: p_ebeln type ekko-ebeln.

TYPES: BEGIN OF t_ekko,

ebeln TYPE ekpo-ebeln,

ebelp TYPE ekpo-ebelp,

statu TYPE ekpo-statu,

aedat TYPE ekpo-aedat,

matnr TYPE ekpo-matnr,

menge TYPE ekpo-menge,

meins TYPE ekpo-meins,

netpr TYPE ekpo-netpr,

peinh TYPE ekpo-peinh,

END OF t_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,

wa_ekko TYPE t_ekko,

it_return type STANDARD TABLE OF DDSHRETVAL,

wa_return like line of it_return.

**************************************************************

*at selection-screen

at selection-screen on value-request for p_ebeln.

select *

up to 10 rows

from ekko

into CORRESPONDING FIELDS OF TABLE it_ekko.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'EKKO'

RETFIELD = 'EBELN'

  • PVALKEY = ' '

  • DYNPPROG = sy-repid

  • DYNPNR = sy-dynnr

  • DYNPROFIELD = 'EBELN'

  • STEPL = 0

WINDOW_TITLE = 'Ekko Records'

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = 'X' "allows you select multiple entries from the popup

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET = ld_ret

TABLES

VALUE_TAB = it_ekko

  • FIELD_TAB = lt_field

RETURN_TAB = it_return

  • DYNPFLD_MAPPING =

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

READ TABLE it_return into wa_return index 1.

p_ebeln = wa_return-fieldval.

Or check wether you are passing all the parameters

Regards,

Goutam Kolluru.

Former Member
0 Kudos

Hi Aneesh,

I want to add some basic things.

For using search help ( F4 help ) is to follow these Function Module calls

1 .Use F4IF_INT_TABLE_VALUE_REQUEST for fetching the request value.

2. Then use DYNP_VALUES_READ for reading the selected input from the table ( search help table).

3. Then use DYNP_VALUES_UPDATE for updating your field with the selected input from search help.

I am not explaing how to use as you can refer to the above experts reply. You can google these FMs and get sample codes as well. If you need any more clarification, please do post.

Thanks,

Benson.

Edited by: benson_10 on Feb 1, 2012 5:34 AM

0 Kudos

Hi,

Thanks for all ... my problem solved