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: 

How to retrieve value of Select-option without pressing ENTER.

Former Member
0 Kudos

Hi Experts,

On selection screen , ihave two select-options LOCATION and RESOURCE both have f4 help.

i want to filter Resource F4 help based on the value in f4 help of location without pressing ENTER,Or manually entering Location

and not pressing Enter. Pls tell if their is any function module which can extract select-screen values without pressing enter.

Thanks

Surbhi Dhingra

11 REPLIES 11

Former Member
0 Kudos

please use Fm DYNP_VALUES_READ

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = SY-CPROG

dynumb = SY-DYNNR

TRANSLATE_TO_UPPER = 'X'

tables

dynpfields = DYNFIELDS

EXCEPTIONS

INVALID_ABAPWORKAREA = 1

INVALID_DYNPROFIELD = 2

INVALID_DYNPRONAME = 3

INVALID_DYNPRONUMMER = 4

INVALID_REQUEST = 5

NO_FIELDDESCRIPTION = 6

INVALID_PARAMETER = 7

UNDEFIND_ERROR = 8

DOUBLE_CONVERSION = 9

STEPL_NOT_FOUND = 10

OTHERS = 11

.

hope it solves your problem....

regards,

kushagra

Former Member
0 Kudos

Hi kushagra,

I am using SELECT-OPTION for LOCATION,for paramters I have used this function module.

Is it possible to read SELECT-OPTION with multiple values through this funtion module.

thanx

Surbhi Dhingra

Former Member
0 Kudos

Hi Surbhi

You can use Function module F4IF_INT_TABLE_VALUE_REQUEST . This FM is used to program our own custom help if no such input help exists in ABAP dictionary for a particular field. The parameter VALUE_TAB is used to pass the internal table containing input values.

The parameter RETFIELD is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB. If DYNPNR, DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.

below is a sample program for reference.

DATA: it_t399i TYPE t399i OCCURS 0.
DATA: it_return_tab TYPE ddshretval OCCURS 0,
      wa_return LIKE LINE OF it_return_tab.

PARAMETER : p_swerk TYPE iloa-swerk.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_swerk.
  IF it_t399i[] IS INITIAL.
    SELECT * FROM t399i INTO TABLE it_t399i.
  ENDIF.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'IWERK'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'P_SWERK'
      value_org   = 'S'
    TABLES
      value_tab   = it_t399i
      return_tab  = it_return_tab.
  IF sy-subrc EQ 0.
    READ TABLE it_return_tab INTO wa_return INDEX 1.
    IF sy-subrc EQ 0.
      p_swerk = wa_return-fieldval.
    ENDIF.
  ENDIF.

You have to first read all the values from the select options using a loop and then use these values in the where condition of the select query in order to get f4 help for other select option.

Thanks

Anshul

Former Member
0 Kudos

Do like

DATA : it_dynp TYPE STANDARD TABLE OF dynpread,

wa_dynp TYPE dynpread.

wa_dynp-fieldname = 'SELECT-OPTION-LOW'.

APPEND wa_dynp TO it_dynp.

CLEAR wa_dynp.

wa_dynp-fieldname = 'SELECT-OPTION-HIGH'.

APPEND wa_dynp TO it_dynp.

CLEAR wa_dynp.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

TABLES

dynpfields = it_dynp.

0 Kudos

Hi Sachin

your code would be fine only for two values which are- Select option -low and high. What about the values between these??

You have to use loop for this.

After that you have to use FM DYNP_VALUES_READ and then F4IF_INT_TABLE_VALUE_REQUEST.

check this also..

[;

Regards

Anshul

Former Member
0 Kudos

Thanx Sachin,

but I have select-option with multiple selection as well.

I already applied this logic but it doesn't work for multiple selection values.pls reply soon

thanx

Surbhi.

0 Kudos

you have two select-options LOCATION and RESOURCE

and want resiurce based on location right?

then read value from the code i mentioned and write

AT SELECTION_SCREEN ON VALUE REQUEST ON VALUE-REQUEST SELECT-RES_HIGH

your quesy to get resoruse where loca eq SELECT-RES_HIGH.

AT SELECTION_SCREEN ON VALUE REQUEST ON VALUE-REQUEST SELECT-RES_LOW.

your quesy to get resoruse where loca eq SELECT-RES_LOW.

Former Member
0 Kudos

Hi Sachin,

This is fine for only LOCATION-LOW AND LOCATION-HIGH.

but I have select Option with MULTIPLE SELECTIONS .IF i am entering values in MULTIPLE-SELECTION for LOCATION as 16,28,37.

By this function module i am getting only 16 not 28 and 37.

HOw will it work for MULTIPLE SELECTION.

Thanx

Surbhi

0 Kudos

Hello,

May be this discussion will help you :

Former Member
0 Kudos

sorry

please do like

TYPES: BEGIN OF TY_VALUE_TAB ,

NAME(18) TYPE C,

END OF TY_VALUE_TAB.

DATA: VALUE_TAB TYPE TABLE OF TY_VALUE_TAB.

DATA :FIELD_TAB TYPE STANDARD TABLE OF DFIES,

WA_FIELD_TAB TYPE DFIES.

*DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA : RETURN_TAB TYPE STANDARD TABLE OF DDSHRETVAL,

WA_RETURN_TAB TYPE DDSHRETVAL.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_RESOURCE.

REFRESH VALUE_TAB[].

REFRESH FIELD_TAB[].

REFRESH RETURN_TAB[].

WA_FIELD_TAB-FIELDNAME = 'FIELD NAME'. " YOur Field Name

WA_FIELD_TAB-TABNAME = 'TABLE NAME'. " Your Table name

APPEND WA_FIELD_TAB TO FIELD_TAB.

SELECT DISTINCT RESOURCE INTO TABLE VALUE_TAB FROM TABLE NAME

WHERE LOC IN SELECT-OPTION..

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = WA_FIELD_TAB-FIELDNAME

TABLES

VALUE_TAB = VALUE_TAB

FIELD_TAB = FIELD_TAB

RETURN_TAB = RETURN_TAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC = 0.

READ TABLE RETURN_TAB INTO WA_RETURN_TAB INDEX 1.

IF SY-SUBRC IS INITIAL.

P_RESOURCE = WA_RETURN_TAB-FIELDVAL.

ENDIF.

ENDIF.

former_member213277
Active Participant
0 Kudos

Hi Surabhi,

I am also facing the same problem,

kindly can you please let me know how did you resolve the issue

you can mail me the resolution to below mentioned mail or reply here only

email: hst1597@gmail.com

Thanks in advance for your effort

Regards,

Nagaraj