<?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: How to do dynamic filtering on a parameter? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768562#M1584343</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If user has not pressed ENTER or executed any other function code, you wont get the current value of the other field in the F4 processing. e.g if user has input P_MAGNI and immediatelly press F4 on  P_CORRES, the value of P_MAGNI in the program is the value before the screen display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you must begin the F4 processing of either filed by reading the current screen value of the other field, for this purpose use FM [DYNP_VALUES_READ|http://www.sdn.sap.com/irj/scn/advancedsearch?query=dynp_values_read].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Apr 2011 13:43:51 GMT</pubDate>
    <dc:creator>RaymondGiuseppi</dc:creator>
    <dc:date>2011-04-08T13:43:51Z</dc:date>
    <item>
      <title>How to do dynamic filtering on a parameter?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768556#M1584337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to do a dynamic filtering with the matchcode of two parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My program will be used to do the correspondence between two types of account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;If the first parameter is "BA000000" the second matchcode will only allow to choose between account who are like "BP000000"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've done this but the filtering is not dynamic:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: TAB_SKA1 TYPE TABLE OF SKA1,
      WA_SKA1  LIKE SKA1,
      TAB_TEMP TYPE TABLE OF SKA1.

SELECTION-SCREEN BEGIN OF BLOCK S_VARIABLE WITH FRAME TITLE TEXT-000.
PARAMETERS:
           P_MAGNI  LIKE SKA1-BILKT OBLIGATORY,
           P_CORRES LIKE SKA1-BILKT OBLIGATORY.
SELECTION-SCREEN END OF BLOCK S_VARIABLE.

*Extracting Magnitude account
  SELECT * FROM SKA1 INTO TABLE TAB_SKA1
    WHERE KTOPL = 'PCBP'
    AND KTOKS &amp;lt;&amp;gt; 'SG' AND KTOKS &amp;lt;&amp;gt; 'CG' AND KTOKS &amp;lt;&amp;gt; 'TI' AND KTOKS &amp;lt;&amp;gt; 'BQ'
    ORDER BY SAKNR.

*Matchcode for P_MAGNI
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MAGNI.
  IF P_CORRES IS INITIAL.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        DDIC_STRUCTURE = 'SKA1'
        RETFIELD       = 'SAKNR'
        DYNPPROG       = SY-REPID
        DYNPNR         = SY-DYNNR
        DYNPROFIELD    = 'P_MAGNI'
        STEPL          = 0
        WINDOW_TITLE   = 'Comptes Magnitude'
        VALUE_ORG      = 'S'
      TABLES
        VALUE_TAB      = TAB_SKA1.
  ELSEIF P_CORRES+0(2) EQ 'BA'.
    LOOP AT TAB_SKA1 INTO WA_SKA1.
      IF WA_SKA1-SAKNR+0(2) EQ 'BP'.
        APPEND WA_SKA1 TO TAB_TEMP.
      ENDIF.
    ENDLOOP.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        DDIC_STRUCTURE = 'SKA1'
        RETFIELD       = 'SAKNR'
        DYNPPROG       = SY-REPID
        DYNPNR         = SY-DYNNR
        DYNPROFIELD    = 'P_MAGNI'
        STEPL          = 0
        WINDOW_TITLE   = 'Comptes Magnitude'
        VALUE_ORG      = 'S'
      TABLES
        VALUE_TAB      = TAB_TEMP.
    CLEAR TAB_TEMP.
  ELSEIF P_CORRES+0(2) EQ 'BP'.
    LOOP AT TAB_SKA1 INTO WA_SKA1.
      IF WA_SKA1-SAKNR+0(2) EQ 'BA'.
        APPEND WA_SKA1 TO TAB_TEMP.
      ENDIF.
    ENDLOOP.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        DDIC_STRUCTURE = 'SKA1'
        RETFIELD       = 'SAKNR'
        DYNPPROG       = SY-REPID
        DYNPNR         = SY-DYNNR
        DYNPROFIELD    = 'P_MAGNI'
        STEPL          = 0
        WINDOW_TITLE   = 'Comptes Magnitude'
        VALUE_ORG      = 'S'
      TABLES
        VALUE_TAB      = TAB_TEMP.
    CLEAR TAB_TEMP.
  ENDIF.

*Matchcode for P_CORRES
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CORRES.
  IF P_MAGNI IS INITIAL.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        DDIC_STRUCTURE = 'SKA1'
        RETFIELD       = 'SAKNR'
        DYNPPROG       = SY-REPID
        DYNPNR         = SY-DYNNR
        DYNPROFIELD    = 'P_CORRES'
        STEPL          = 0
        WINDOW_TITLE   = 'Comptes Magnitude'
        VALUE_ORG      = 'S'
      TABLES
        VALUE_TAB      = TAB_SKA1.
  ELSEIF P_MAGNI+0(2) EQ 'BA'.
    LOOP AT TAB_SKA1 INTO WA_SKA1.
      IF WA_SKA1-SAKNR+0(2) EQ 'BP'.
        APPEND WA_SKA1 TO TAB_TEMP.
      ENDIF.
    ENDLOOP.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        DDIC_STRUCTURE = 'SKA1'
        RETFIELD       = 'SAKNR'
        DYNPPROG       = SY-REPID
        DYNPNR         = SY-DYNNR
        DYNPROFIELD    = 'P_CORRES'
        STEPL          = 0
        WINDOW_TITLE   = 'Comptes Magnitude'
        VALUE_ORG      = 'S'
      TABLES
        VALUE_TAB      = TAB_TEMP.
    CLEAR TAB_TEMP.
  ELSEIF P_MAGNI+0(2) EQ 'BP'.
    LOOP AT TAB_SKA1 INTO WA_SKA1.
      IF WA_SKA1-SAKNR+0(2) EQ 'BP'.
        APPEND WA_SKA1 TO TAB_TEMP.
      ENDIF.
    ENDLOOP.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        DDIC_STRUCTURE = 'SKA1'
        RETFIELD       = 'SAKNR'
        DYNPPROG       = SY-REPID
        DYNPNR         = SY-DYNNR
        DYNPROFIELD    = 'P_CORRES'
        STEPL          = 0
        WINDOW_TITLE   = 'Comptes Magnitude'
        VALUE_ORG      = 'S'
      TABLES
        VALUE_TAB      = TAB_TEMP.
    CLEAR TAB_TEMP.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how to do a dynamic filtering?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 15:03:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768556#M1584337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-07T15:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to do dynamic filtering on a parameter?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768557#M1584338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where is that relationship between accounts maintained?  You simply need to read that table and check the condition before building your internal table.  It doesn't look like you're actually using the group account functionality but if you are just check the value of the field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 15:26:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768557#M1584338</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-04-07T15:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to do dynamic filtering on a parameter?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768558#M1584339</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;Its SELECT is not being executed and its internal table (TAB_SKA1) is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...

INITIALIZATION.
*Extracting Magnitude account
  SELECT * FROM SKA1 INTO TABLE TAB_SKA1
    WHERE KTOPL = 'PCBP'
    AND KTOKS  'SG' AND KTOKS  'CG' AND KTOKS  'TI' AND KTOKS  'BQ'
    ORDER BY SAKNR.

...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ ]'s&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Douglas Sant'Ana Santos&lt;/STRONG&gt; | SAP ABAP&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Company:&lt;/STRONG&gt; Linkup&lt;/P&gt;&lt;P&gt;[Business Card|http://www.sdn.sap.com/irj/scn/bc?u=qshtq78wnzc%3d]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 18:17:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768558#M1584339</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-07T18:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to do dynamic filtering on a parameter?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768559#M1584340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt; Where is that relationship between accounts maintained?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, this program will be used by clients to fill the relationship table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Its SELECT is not being executed&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That is because some char are not copied, the "NE" are missing, I will edit my first post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't edit the first post, so here is the good SELECT:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM SKA1 INTO TABLE TAB_SKA1
    WHERE KTOPL = 'PCBP'
    AND KTOKS NE 'SG' AND KTOKS NE 'CG' AND KTOKS NE 'TI' AND KTOKS NE 'BQ'
    ORDER BY SAKNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: yohann.fourre on Apr 8, 2011 9:35 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 07:33:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768559#M1584340</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-08T07:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to do dynamic filtering on a parameter?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768560#M1584341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Appologies, I accidentaly post my answer to different thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marcin Pciak on Apr 8, 2011 9:45 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 07:44:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768560#M1584341</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-04-08T07:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to do dynamic filtering on a parameter?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768561#M1584342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fourre.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;That is because some char are not copied, the "NE" are missing, I will edit my first post.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You didn't understand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's missing the event: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INITIALIZATION&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code sample: [ABAP Program to Read or Populate Selection Screen Parameters Dynamically|http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP&lt;EM&gt;Program&lt;/EM&gt;to&lt;EM&gt;Read&lt;/EM&gt;or&lt;EM&gt;Populate&lt;/EM&gt;Selection&lt;EM&gt;Screen&lt;/EM&gt;Parameters+Dynamically]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ ]'s&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Douglas Sant'Ana Santos&lt;/STRONG&gt; | SAP ABAP&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Company:&lt;/STRONG&gt; Linkup&lt;/P&gt;&lt;P&gt;[Business Card|http://www.sdn.sap.com/irj/scn/bc?u=qshtq78wnzc%3d]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 13:25:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768561#M1584342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-08T13:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to do dynamic filtering on a parameter?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768562#M1584343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If user has not pressed ENTER or executed any other function code, you wont get the current value of the other field in the F4 processing. e.g if user has input P_MAGNI and immediatelly press F4 on  P_CORRES, the value of P_MAGNI in the program is the value before the screen display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you must begin the F4 processing of either filed by reading the current screen value of the other field, for this purpose use FM [DYNP_VALUES_READ|http://www.sdn.sap.com/irj/scn/advancedsearch?query=dynp_values_read].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 13:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-dynamic-filtering-on-a-parameter/m-p/7768562#M1584343</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2011-04-08T13:43:51Z</dc:date>
    </item>
  </channel>
</rss>

