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 pass value from screen to search help

Former Member
0 Kudos

Hello

How can I pass values from a screen when the user click on matchcode. The user does not use enter before the click on matchcode.

Thank you

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

U should manage it in POV process or (for selection-screen) AT SELECTION-SCREEN event.

Here use fm DYNP_VALUES_READ to read the value from the screen and then pass it to matchcode. You can use fm F4IF_FIELD_VALUE_REQUEST to call match code.

You can obtain the same risult building a particular structre in dictionary, this structure has to have those two fields and you have to assign the search help.

After you have to use this structure to build your screen.

Max

2 REPLIES 2

Former Member
0 Kudos

Hi

U should manage it in POV process or (for selection-screen) AT SELECTION-SCREEN event.

Here use fm DYNP_VALUES_READ to read the value from the screen and then pass it to matchcode. You can use fm F4IF_FIELD_VALUE_REQUEST to call match code.

You can obtain the same risult building a particular structre in dictionary, this structure has to have those two fields and you have to assign the search help.

After you have to use this structure to build your screen.

Max

0 Kudos

Here is a good example program, you enter a sales document number and do F4 help on the line number, search help will give you the line number and materials for that sales document number




report zrich_0002 .

parameters: p_vbeln type vbak-vbeln,
            p_posnr type vbap-posnr.

at selection-screen on value-request for p_posnr.


  data: begin of help_item occurs 0,
          posnr type vbap-posnr,
          matnr type vbap-matnr,
          arktx type vbap-arktx,
        end of help_item.

  data: dynfields type table of dynpread with header line.


  dynfields-fieldname = 'P_VBELN'.
  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_VBELN'.

  p_vbeln = dynfields-fieldvalue.


  call function 'CONVERSION_EXIT_ALPHA_INPUT'
       exporting
            input  = p_vbeln
       importing
            output = p_vbeln.

  select posnr matnr arktx into table help_item
                 from vbap
                      where vbeln = p_vbeln.



  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'POSNR'
            dynprofield = 'P_POSNR'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = help_item.

Regards,

Rich Heilman