<?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 Failure in implementing search help in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/failure-in-implementing-search-help/m-p/6095128#M1359362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear forumers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to implement a search help function in my selection screen but it's not working (for program name, TADIR-OBJ_NAME). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could possibly be wrong and how can I fix the problem (kindly refer to the codes below - I_TADIR is always empty without any records, so it is impossible to have data for search help)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ydt_abap.

TABLES: tadir.

TYPES: BEGIN OF t_tadir,
         obj_name  TYPE tadir-obj_name,
       END OF t_tadir.

CONSTANTS: c_program(4) TYPE c VALUE 'PROG'.

DATA: i_tadir     TYPE STANDARD TABLE OF t_tadir.
DATA: i_f4_result TYPE STANDARD TABLE OF ddshretval.

DATA: w_f4_result TYPE ddshretval.

PARAMETERS: p_dclass TYPE tadir-devclass.
PARAMETERS: p_author TYPE tadir-author.
PARAMETERS: p_prog   TYPE tadir-obj_name OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prog.
  CLEAR: i_tadir,
         i_f4_result,
         w_f4_result.

" Retrieve program names
  SELECT obj_name 
    FROM tadir
    INTO TABLE i_tadir
    WHERE object   = c_program
      AND author   = p_author    " Debug mode: P_AUTHOR is always empty eventho a valid value has been entered
      AND devclass = p_dclass.   " Debug mode: P_DCLASS is always empty eventho a valid value has been entered

  IF i_tadir IS NOT INITIAL.     " Debug mode: I_TADIR is always empty here
" Customize search help
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        retfield        = 'P_PROG'
        value_org       = 'S'
      TABLES
        value_tab       = i_tadir
        return_tab      = i_f4_result
      EXCEPTIONS
        parameter_error = 1
        no_values_found = 2
        OTHERS          = 3.

" Check return code
    IF sy-subrc EQ 0.
      READ TABLE i_f4_result INTO w_f4_result INDEX 1.

      IF sy-subrc EQ 0.
        p_prog = w_f4_result-fieldval.
      ENDIF.
    ELSE.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
  ENDIF.

START-OF-SELECTION.

...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2009 06:31:35 GMT</pubDate>
    <dc:creator>former_member367551</dc:creator>
    <dc:date>2009-09-15T06:31:35Z</dc:date>
    <item>
      <title>Failure in implementing search help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/failure-in-implementing-search-help/m-p/6095128#M1359362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear forumers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to implement a search help function in my selection screen but it's not working (for program name, TADIR-OBJ_NAME). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could possibly be wrong and how can I fix the problem (kindly refer to the codes below - I_TADIR is always empty without any records, so it is impossible to have data for search help)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ydt_abap.

TABLES: tadir.

TYPES: BEGIN OF t_tadir,
         obj_name  TYPE tadir-obj_name,
       END OF t_tadir.

CONSTANTS: c_program(4) TYPE c VALUE 'PROG'.

DATA: i_tadir     TYPE STANDARD TABLE OF t_tadir.
DATA: i_f4_result TYPE STANDARD TABLE OF ddshretval.

DATA: w_f4_result TYPE ddshretval.

PARAMETERS: p_dclass TYPE tadir-devclass.
PARAMETERS: p_author TYPE tadir-author.
PARAMETERS: p_prog   TYPE tadir-obj_name OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prog.
  CLEAR: i_tadir,
         i_f4_result,
         w_f4_result.

" Retrieve program names
  SELECT obj_name 
    FROM tadir
    INTO TABLE i_tadir
    WHERE object   = c_program
      AND author   = p_author    " Debug mode: P_AUTHOR is always empty eventho a valid value has been entered
      AND devclass = p_dclass.   " Debug mode: P_DCLASS is always empty eventho a valid value has been entered

  IF i_tadir IS NOT INITIAL.     " Debug mode: I_TADIR is always empty here
" Customize search help
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        retfield        = 'P_PROG'
        value_org       = 'S'
      TABLES
        value_tab       = i_tadir
        return_tab      = i_f4_result
      EXCEPTIONS
        parameter_error = 1
        no_values_found = 2
        OTHERS          = 3.

" Check return code
    IF sy-subrc EQ 0.
      READ TABLE i_f4_result INTO w_f4_result INDEX 1.

      IF sy-subrc EQ 0.
        p_prog = w_f4_result-fieldval.
      ENDIF.
    ELSE.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
  ENDIF.

START-OF-SELECTION.

...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 06:31:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/failure-in-implementing-search-help/m-p/6095128#M1359362</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2009-09-15T06:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Failure in implementing search help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/failure-in-implementing-search-help/m-p/6095129#M1359363</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;insert this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: BEGIN OF DYNPFIELDS OCCURS 0.
          INCLUDE STRUCTURE DYNPREAD.
  DATA: END   OF DYNPFIELDS.
*
  DYNPFIELDS-FIELDNAME = 'P_AUTHOR'. APPEND DYNPFIELDS.
*
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME               = SY-REPID
      DYNUMB               = SY-DYNNR
    TABLES
      DYNPFIELDS           = 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.
    READ TABLE DYNPFIELDS WITH KEY FIELDNAME = 'P_AUTHOR'.
    P_AUTHOR = DYNPFIELDS-FIELDVALUE.
  ELSE.
    EXIT.
  ENDIF.
*
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;befor   SELECT obj_name &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 07:00:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/failure-in-implementing-search-help/m-p/6095129#M1359363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T07:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Failure in implementing search help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/failure-in-implementing-search-help/m-p/6095130#M1359364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot, Dieter. I've tried this and the FM works perfectly. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 07:48:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/failure-in-implementing-search-help/m-p/6095130#M1359364</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2009-09-15T07:48:45Z</dc:date>
    </item>
  </channel>
</rss>

