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

Read Selcet Options using DYNP_VALUES_READ

Former Member
0 Likes
2,527

Hi friends,

I have declared a Select option with no intervals, Multiple values can be entered

I am trying to Read the Select options using DYNP_VALUES_READ in AT ...ON HELP REQUEST for another field on selection screen

I am able to read only one value of the selection option using the above FM, Any inputs on how to read the multiple values

Thanks

Chandra

10 REPLIES 10
Read only

Former Member
0 Likes
1,662

Hello,

We need to append 2 things

1) dynpfields-fieldname = 'S_WERKS-LOW'.

APPEND dynpfields.

Call the DYNP_VALUES_READ

2) dynpfields-fieldname = 'S_WERKS-HIGH'.

APPEND dynpfields

For LOW and HIGH we need to call the FM 2 times.

DYNP_VALUES_READ

See this example Program

BALV1F01

BCALV_GRID_11

BCALV_GRID_VERIFY

BCALV_GRID_VERIFY_OLD

BCALV_TREE_VERIFY

BCALV_VERIFY_DTYPES_F01

BC_SCR_FORMS

Read only

former_member188827
Active Contributor
0 Likes
1,662

send part of code where you are calling the function

Read only

Former Member
0 Likes
1,662

Hi friends,

I have declared a Select option with no intervals, Multiple values can be entered

I am trying to Read the Select options using DYNP_VALUES_READ in AT ...ON HELP REQUEST for another field on selection screen

I am able to read only one value of the selection option using the above FM, Any inputs on how to read the multiple values

Thanks

Chandra

*----


*

  • FORM VARIANTEN_AUSWAHL *

*----


*

  • Auswahl einer ALV Variante für die Liste (F4) *

*----


*

  • --> pvari : Variantenname *

*----


*

FORM varianten_auswahl CHANGING p_vari LIKE disvariant-variant.

**commented by ajay_05/13/2008

    • DATA: x_exit(1) TYPE c,

    • x_variant LIKE disvariant,

    • x_variant2 LIKE disvariant.

DATA: fieldvalues TYPE dynpread OCCURS 1 WITH HEADER LINE,

crepid like sy-repid,

summb LIKE fieldvalues-fieldvalue.

crepid = sy-repid.

  • Feld SUMMB vom Dynpro einlesen.

  • (Da der PAI noch nicht durchlaufen ist!)

CLEAR fieldvalues.

REFRESH fieldvalues.

MOVE: 'SUMMB' TO fieldvalues-fieldname.

APPEND fieldvalues.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = crepid

dynumb = '1000'

TABLES

dynpfields = fieldvalues

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.

if sy-subrc = 0.

READ TABLE fieldvalues INDEX 1.

summb = fieldvalues-fieldvalue.

else.

clear summb.

endif.

  • Aktueller Reportname

x_variant-report = sy-repid.

  • ... Variantenname

x_variant-variant = p_vari.

  • Anzeigevarianten für (Nicht)Summenbericht unterschiedlich!

IF summb = 'X'.

x_variant-handle = 'SUMX'.

ELSE.

x_variant-handle = ''.

ENDIF.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = x_variant

i_save = 'A'

IMPORTING

e_exit = x_exit

es_variant = x_variant2

EXCEPTIONS

not_found = 2.

IF sy-subrc = 2.

  • Keine Varianten für den Report vorhanden

MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

IF x_exit = space.

  • Augewählten Variantennamen übernehmen

p_vari = x_variant2-variant.

ENDIF.

ENDIF.

ENDFORM. "varianten_auswahl

Edited by: Ajay kumar on May 11, 2009 8:03 AM

Edited by: Ajay kumar on May 11, 2009 8:04 AM

Read only

0 Likes
1,662

Hi Santosh,

I dont have a High value, i have only low value

@Ajay, can you format your code and post it so that its easy to understand

Read only

former_member188827
Active Contributor
0 Likes
1,662

try setting following exportig parameter

DETERMINE_LOOP_INDEX = 'X'

Read only

0 Likes
1,662

@abapuse, I tried with LOOP index , its not working

Read only

Former Member
0 Likes
1,662

Hello,

You have to write the event in this way

example

Try this

AT SELECTION-SCREEN ON VALUE-REQUEST FOR y_p_list-low.

Read only

Former Member
0 Likes
1,662

Hi Chandrashekar,

Get the values of your first Select Option into another temporary internal table ex: t_temp, and then for using these values as F4 help for another Select Option use the below FM:

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ISTAT'

dynprofield = 'S_STAT'

dynpprog = sy-cprog

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = t_temp.

where S_STAT is the Select option for which you want the F4 help.

ISTAT is the Type of that selectoption and T_TEMP is the values from the previous select option.

Regards,

Amit.

Read only

Former Member
0 Likes
1,662

Hi,

At selection-screen on help request for p_kunnr-low.

call the function module dypn_value_read.

At selection-screen on help request for p_kunnr-high.

call the function module dypn_value_read.

Regards,

Naveen M.

Read only

Former Member
0 Likes
1,662

Hi Chandrasekhar,

If your requirement is to check whether a particular value is present in the sel-option (with no-intervals), then you can very well use the 'READ' statement.

READ TABLE s_sel WITH KEY low = '<VALUE TO BE FOUND>'.

IF sy-subrc = 0.

<SUCCESS>.

ENDIF.

The above logic is to check whether a particular value is present in select-option. Note that this logic also checks for the values entered in extension.

Regards,

Rajesh