<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using a function module in a search help. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530478#M242482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Carlos,  Please see the following program. It is working well in my system.  The only difference is that I've implemented you function module as a subroutine instead of in a FM.   You can see that it will return the selected value back to the screen field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0002 .


data: setname type setheader-setname.

parameters: p_val type setheader-setname.


data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.

at selection-screen on value-request for p_val.

  perform f4_help.

  p_val = setname.

start-of-selection.


*---------------------------------------------------------------------*
*       FORM f4_help                                                  *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form f4_help.
  constants: class  type setclass value '0103',
             field_name    type rgsbs-field  value '*',
             kokrs  type tka01-kokrs  value 'BPPR',
             ktopl  type  tka01-ktopl value 'CAPI'.

  call function 'K_GROUP_SELECT'
       exporting
            buttons            = 'X'
            class              = class
            cruser             = '*'
            field_name         = field_name
            searchfld          = '    '
            searchfld_input    = 'X'
            searchfld_required = 'X'
            set                = '*'
            start_column       = 10
            start_row          = 5
            table              = 'CCSS'
            typelist           = 'BS'
            upduser            = '*'
            kokrs              = kokrs
            ktopl              = ktopl
       importing
            set_name           = setname
       exceptions
            no_set_picked      = 1
            others             = 2.

endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Aug 2006 21:33:51 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-08-01T21:33:51Z</dc:date>
    <item>
      <title>Using a function module in a search help.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530472#M242476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;People,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I make a function module for a search help. Into the function module I call a function 'K_GROUP_SELECT' that show me a screen to make another search but I don't know how can I put the value that this function return me in the field that the user click the button of the search help in my program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code that I put in the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION Z_GROUP_SELECT_ZFINCOKOH1_B.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      SHLP_TAB TYPE  SHLP_DESCT
*"      RECORD_TAB STRUCTURE  SEAHLPRES
*"  CHANGING
*"     VALUE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL
*"     VALUE(SHLP) TYPE  SHLP_DESCR
*"----------------------------------------------------------------------
tables: setheader.

data: setname type setheader-setname.

  CONSTANTS:
              CLASS         TYPE SETCLASS VALUE '0103',
              FIELD_NAME    TYPE RGSBS-FIELD  VALUE '*',
              KOKRS         TYPE TKA01-KOKRS  VALUE 'BPPR',
              KTOPL         TYPE TKA01-Ktopl VALUE 'CAPI'.


IF callcontrol-step = 'SELECT'.

*PERFORM k_group_select USING: CLASS, FIELD_NAME, KOKRS, KTOPL.

CALL FUNCTION 'K_GROUP_SELECT'
  EXPORTING
   BUTTONS                  = 'X'
   CLASS                    = CLASS
   CRUSER                   = '*'
   field_name               = FIELD_NAME
   SEARCHFLD                = '    '
   SEARCHFLD_INPUT          = 'X'
   SEARCHFLD_REQUIRED       = 'X'
   SET                      = '*'
   START_COLUMN             = 10
   START_ROW                = 5
   TABLE                    = 'CCSS'
   TYPELIST                 = 'BS'
   UPDUSER                  = '*'
   KOKRS                    = KOKRS
   KTOPL                    = KTOPL

 IMPORTING
   SET_NAME                 = setname

EXCEPTIONS
   NO_SET_PICKED            = 1
   OTHERS                   = 2
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

endif.

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 20:43:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530472#M242476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-01T20:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function module in a search help.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530473#M242477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the function module F4UT_RESULTS_MAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     call function 'F4UT_RESULTS_MAP'&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      shlp_tab          = shlp_tab&lt;/P&gt;&lt;P&gt;      record_tab        = record_tab&lt;/P&gt;&lt;P&gt;      source_tab        = lt_rec&lt;/P&gt;&lt;P&gt;    changing&lt;/P&gt;&lt;P&gt;      shlp              = shlp&lt;/P&gt;&lt;P&gt;      callcontrol       = callcontrol&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      illegal_structure = 1&lt;/P&gt;&lt;P&gt;      others            = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  check sy-subrc is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  callcontrol-step = 'DISP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to function module ACTEXP_F4_FUNCTION_PARAMETERS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if helpfull.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 20:50:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530473#M242477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-01T20:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function module in a search help.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530474#M242478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wait a minute !!  you mean that FM 'K_GROUP_SELECT' calls a screen, where the user has to enter a value and press a button for continuing the process in this module ??? I´m not sure if this is gonna work; probably you´re gonna cause a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you can expand the import interface of the search help with a new field, so that the user enters the value before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 20:55:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530474#M242478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-01T20:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function module in a search help.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530475#M242479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function that I call 'K_GROUP_SELECT' return me only a field not a table and I run the program and I don't receive any dump. The thing that I only need is put in the field of the search help the value that I receive from the function: 'K_GROUP_SELECT'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 21:15:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530475#M242479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-01T21:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function module in a search help.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530476#M242480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Carlos, if you are getting a value back from your function module, then all you need to do is move the value to your screen field at the right time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here P_VALUE is the name of the screen field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


at selection-screen on value-request for p_value.

Call function 'Z_GROUP_SELECT_ZFINCOKOH1_B'
     .....
        .....
            ....

p_value = value_from_FM.
 


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 21:18:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530476#M242480</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-01T21:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function module in a search help.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530477#M242481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you may have to do a DYNP_VALUES_UPDATE as well to update the field on the screen.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 21:19:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530477#M242481</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-01T21:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function module in a search help.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530478#M242482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Carlos,  Please see the following program. It is working well in my system.  The only difference is that I've implemented you function module as a subroutine instead of in a FM.   You can see that it will return the selected value back to the screen field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0002 .


data: setname type setheader-setname.

parameters: p_val type setheader-setname.


data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.

at selection-screen on value-request for p_val.

  perform f4_help.

  p_val = setname.

start-of-selection.


*---------------------------------------------------------------------*
*       FORM f4_help                                                  *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form f4_help.
  constants: class  type setclass value '0103',
             field_name    type rgsbs-field  value '*',
             kokrs  type tka01-kokrs  value 'BPPR',
             ktopl  type  tka01-ktopl value 'CAPI'.

  call function 'K_GROUP_SELECT'
       exporting
            buttons            = 'X'
            class              = class
            cruser             = '*'
            field_name         = field_name
            searchfld          = '    '
            searchfld_input    = 'X'
            searchfld_required = 'X'
            set                = '*'
            start_column       = 10
            start_row          = 5
            table              = 'CCSS'
            typelist           = 'BS'
            upduser            = '*'
            kokrs              = kokrs
            ktopl              = ktopl
       importing
            set_name           = setname
       exceptions
            no_set_picked      = 1
            others             = 2.

endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 21:33:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-a-function-module-in-a-search-help/m-p/1530478#M242482</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-01T21:33:51Z</dc:date>
    </item>
  </channel>
</rss>

