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

SELECT-OPTIONS & SRCH HELP EXIT

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Likes
481

Hi,

I have the following UI:

Field a ___________

Field b ___________ to __________ ->

- I have associated some F4 help to Field a.

- User selects some value say 'abc' in Field a.

- Field b has multi select behaviour (select-options) and has MATCHCODE OBJECT associating it to SRCH HELP (say TEST_SRCH).

- Now TEST_SRCH has reference to Search Help Exit = F4_FNC_MOD (function module).

- Now in Function Module F4_FNC_MOD I want to pass the value of Field a.

Not able to achieve sending field a value to F4_FNC_MOD function module.

Please help.

Regards,

Arpit

3 REPLIES 3
Read only

Former Member
0 Likes
449

I think you are not able to catch the Value of A at runtime.It usually happens that in selection screen event on value-request value of selection-screen parameters are not identified.

Just use:

DATA: tb_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE.
  MOVE 'A' TO
            tb_dynpfields-fieldname.
  CALL FUNCTION 'DYNP_VALUES_READ'
       EXPORTING
            dyname               = <field Name>
            dynumb               = <Screen Number>
       TABLES
            dynpfields           = tb_dynpfields
       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.
*    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
*           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
* Read the tbale tb_dynpfields to read the dynamic value of pa_werks
  READ TABLE tb_dynpfields INDEX 1.
  IF sy-subrc = 0.
    W_A = tb_dynpfields-fieldvalue.
  ENDIF.

Pass W_A to Function Module

Regards,

Gurpreet

Read only

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Likes
449

Never worked with Dynpro UIs. Isn't it possible with simple parameter and select-option code.

I just need a report for the same.

Regards,

Arpit

Read only

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Likes
449

Got it worked on my own.