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: 

Value in select options not detected

Former Member
0 Kudos

Hi all!

I have a little problem with a field that is informed in my report:

SELECT-OPTIONS: s_bukrs FOR  t001-bukrs        MATCHCODE OBJECT zbukrs,

                              s_hbkid FOR  t012k-hbkid       NO INTERVALS,


First of all, I inform bukrs field on screen. Eg. 1000


Afterwards,In order to enter the hbkid field, I have a matchcode that must be opened with all the values that applies with the bukrs previously selected (1000 in this case).


But, the bukrs is not registed, unless I press Enter or F8 on my select:


SELECT bukrs hbkid

     FROM t012k

     INTO ls_bank

     WHERE bukrs in s_bukrs. ---> This value is empty, unless I press Enter or F8


As you can see, I need that my matchcode displays all values according with the bukrs selected without pressing Enter previously.

Can anyone help me to solve this issue please?

Thanks in advance!

Mario.

1 ACCEPTED SOLUTION

sivaganesh_krishnan
Contributor
0 Kudos

HI mario ,

You can use the FM

DYNP_VALUES_READ

write this FM inside the POV of s_bukrs field.

For displaying the search help use FM  F4IF_INT_TABLE_VALUE_REQUEST .

6 REPLIES 6

sivaganesh_krishnan
Contributor
0 Kudos

HI mario ,

You can use the FM

DYNP_VALUES_READ

write this FM inside the POV of s_bukrs field.

For displaying the search help use FM  F4IF_INT_TABLE_VALUE_REQUEST .

nabheetscn
Active Contributor
0 Kudos


Please read function module DYNPRO_READ_VALUE to get values of select option before the select

former_member212002
Active Contributor
0 Kudos

This message was moderated.

0 Kudos

Hi there,

You have to use AT SELECTION Event for value request.

Try this code it will solve our need.

TABLES: t001, t012k.

TYPES : BEGIN OF ty_f4hbkid,
           bukrs TYPE bukrs,
           hbkid TYPE hbkid,
         END OF ty_f4hbkid.


DATA: lt_iscr    TYPE TABLE OF dynpread ,
       ls_iscr    TYPE dynpread ,
       lt_ireturn TYPE TABLE OF ddshretval,
       ls_ireturn TYPE ddshretval,
       v_repid LIKE sy-repid,
       v_dynnr LIKE sy-dynnr.

DATA: lt_f4hbkid TYPE STANDARD TABLE OF ty_f4hbkid.

SELECT-OPTIONS: s_bukrs FOR t001-bukrs , "MATCHCODE OBJECT zbukrs,
s_hbkid FOR  t012k-hbkid       NO INTERVALS.






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

*Here reading the select option it bit tricky better you use Parameter for Bukrs
   CLEAR lt_iscr.

   ls_iscr-fieldname = 'S_BUKRS-LOW'.
   APPEND ls_iscr TO lt_iscr.
   v_repid = sy-repid.
   v_dynnr = sy-dynnr.


   CALL FUNCTION 'DYNP_VALUES_READ'
     EXPORTING
       dyname               = v_repid
       dynumb               = v_dynnr
     TABLES
       dynpfields           = lt_iscr
     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.
* Implement suitable error handling here
   ENDIF.


   READ TABLE lt_iscr INTO ls_iscr WITH KEY fieldname = 'S_BUKRS-LOW'.

   IF sy-subrc EQ 0.

     SELECT bukrs hbkid
          FROM t012k
          INTO CORRESPONDING FIELDS OF TABLE lt_f4hbkid
          WHERE bukrs = ls_iscr-fieldvalue.
   ENDIF.

** Calling F4 help function module to assign that retrieved value for that select option pernr
   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
       retfield        = 'HBKID'
       dynpprog        = sy-repid    " Program name
       dynpnr          = sy-dynnr    " Screen number
       dynprofield     = 'S_HBKID'   " F4 help need field
       value_org       = 'S'
     TABLES
       value_tab       = lt_f4hbkid  " F4 help values
     EXCEPTIONS
       parameter_error = 1
       no_values_found = 2
       OTHERS          = 3.

thangam_perumal
Contributor
0 Kudos

Hi Mario,

              Please add some little bit modification what done in Rakesh.

TABLES: t001, t012k.

TYPES : BEGIN OF ty_f4hbkid,
           bukrs TYPE bukrs,
           hbkid TYPE hbkid,
         END OF ty_f4hbkid.

DATA: lt_f4hbkid TYPE STANDARD TABLE OF ty_f4hbkid.

SELECT-OPTIONS: s_bukrs FOR  t001-bukrs , "MATCHCODE OBJECT zbukrs,
                 s_hbkid FOR  t012k-hbkid       NO INTERVALS.



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

Perform fetch_data.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_hbkid-high.


Perform fetch_data.


form fetch_data.


   SELECT bukrs hbkid
        FROM t012k
        INTO CORRESPONDING FIELDS OF TABLE lt_f4hbkid
        WHERE bukrs IN s_bukrs.

** Calling F4 help function module to assign that retrieved value for that select option pernr
   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
       retfield        = 'PERNR'
       dynpprog        = sy-repid    " Program name
       dynpnr          = sy-dynnr    " Screen number
       dynprofield     = 'S_PERNR'   " F4 help need field
       value_org       = 'S'
     TABLES
       value_tab       = lt_f4hbkid  " F4 help values
     EXCEPTIONS
       parameter_error = 1
       no_values_found = 2
       OTHERS          = 3.


endform.

Former Member
0 Kudos

Thanks guys!

I've solved this issue by FM dynp_values_read

Regards and thanks again!

Mario