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

Search Help Problem

leonardo_pavia
Participant
0 Likes
458

I have a selection screen with 2 parameters, param2 has a search help exit for filter data depending of param1 value, the problem is i don't know how to get the input value of param1 in the exit function module. The search help has an input param of same data element por param1. Can anybody help me please.

Thank you

Leonardo

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
440

If I understand you correctly, then this sample should help you. This is a sample only. These two fields actually have this functionality built in, but is being overriden in this sample.



report zrich_0002 .

parameters: p_werks type t001w-werks,
            p_lgort type t001l-lgort.

at selection-screen on value-request for p_lgort.

* Internal Table for storage location help
  data: begin of help_char occurs 0,
         lgort type t001l-lgort,
         LGOBE type t001l-LGOBE,
        end of help_char.

  data: dynfields type table of dynpread with header line.


  dynfields-fieldname = 'P_WERKS'.
  append dynfields.

  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.


  read table dynfields with key fieldname = 'P_WERKS'.

  select * into corresponding fields of table help_char
               from t001l
                     where werks = dynfields-fieldvalue.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'LGORT'
            dynprofield = 'P_LGORT'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = help_char.


Regards,

Rich Heilman

3 REPLIES 3
Read only

Former Member
0 Likes
440

you can use function module DYNP_VALUE_READ for getting the value of the parameters in the same program.

Hope this helps.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
441

If I understand you correctly, then this sample should help you. This is a sample only. These two fields actually have this functionality built in, but is being overriden in this sample.



report zrich_0002 .

parameters: p_werks type t001w-werks,
            p_lgort type t001l-lgort.

at selection-screen on value-request for p_lgort.

* Internal Table for storage location help
  data: begin of help_char occurs 0,
         lgort type t001l-lgort,
         LGOBE type t001l-LGOBE,
        end of help_char.

  data: dynfields type table of dynpread with header line.


  dynfields-fieldname = 'P_WERKS'.
  append dynfields.

  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.


  read table dynfields with key fieldname = 'P_WERKS'.

  select * into corresponding fields of table help_char
               from t001l
                     where werks = dynfields-fieldvalue.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'LGORT'
            dynprofield = 'P_LGORT'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = help_char.


Regards,

Rich Heilman

Read only

0 Likes
440

Thank you friends, my problem was solved. function module DYNP_VALUES_READ was very helpful.

Thanks..

Leonardo