<?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 Listbox with Function code in Table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/listbox-with-function-code-in-table-control/m-p/2987010#M705379</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have a table control with a column as a listbox. On the basis of what the user selects from the list, it should accordingly populate some data to show in the F4 help implemented through POV . For this I assigned  Fctcode to the listbox .&lt;/P&gt;&lt;P&gt;But whenever I select a value from the list, that particular value does not stay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have coded the following in PBO:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_zmattb into zmattb  with control tbcontrol .&lt;/P&gt;&lt;P&gt;MODULE INITIALISE.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  INITIALISE  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE initialise OUTPUT.&lt;/P&gt;&lt;P&gt;if g_list[] is initial. "SO THAT LIST does not contain repeating values .&lt;/P&gt;&lt;P&gt;    value-key = 1.&lt;/P&gt;&lt;P&gt;    value-text = 'Material'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append value to g_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    value-key = 2.&lt;/P&gt;&lt;P&gt;    value-text = 'Plant'.&lt;/P&gt;&lt;P&gt;append value to g_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'VRM_SET_VALUES'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        id     = 'ZMATTB-TEXT'&lt;/P&gt;&lt;P&gt;        values = g_list.&lt;/P&gt;&lt;P&gt;MODIFY IT_ZMATTB FROM ZMATTB INDEX SY-TABIX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " INITIALISE  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide how to implement dynamic values in F4 on a second column  according to value selected from Listbox in first column.&lt;/P&gt;&lt;P&gt;Note that I want to use only listbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2007 12:22:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-14T12:22:20Z</dc:date>
    <item>
      <title>Listbox with Function code in Table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/listbox-with-function-code-in-table-control/m-p/2987010#M705379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have a table control with a column as a listbox. On the basis of what the user selects from the list, it should accordingly populate some data to show in the F4 help implemented through POV . For this I assigned  Fctcode to the listbox .&lt;/P&gt;&lt;P&gt;But whenever I select a value from the list, that particular value does not stay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have coded the following in PBO:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_zmattb into zmattb  with control tbcontrol .&lt;/P&gt;&lt;P&gt;MODULE INITIALISE.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  INITIALISE  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE initialise OUTPUT.&lt;/P&gt;&lt;P&gt;if g_list[] is initial. "SO THAT LIST does not contain repeating values .&lt;/P&gt;&lt;P&gt;    value-key = 1.&lt;/P&gt;&lt;P&gt;    value-text = 'Material'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append value to g_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    value-key = 2.&lt;/P&gt;&lt;P&gt;    value-text = 'Plant'.&lt;/P&gt;&lt;P&gt;append value to g_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'VRM_SET_VALUES'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        id     = 'ZMATTB-TEXT'&lt;/P&gt;&lt;P&gt;        values = g_list.&lt;/P&gt;&lt;P&gt;MODIFY IT_ZMATTB FROM ZMATTB INDEX SY-TABIX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " INITIALISE  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide how to implement dynamic values in F4 on a second column  according to value selected from Listbox in first column.&lt;/P&gt;&lt;P&gt;Note that I want to use only listbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 12:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/listbox-with-function-code-in-table-control/m-p/2987010#M705379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T12:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox with Function code in Table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/listbox-with-function-code-in-table-control/m-p/2987011#M705380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to do it, but you will probably need to assign the listbox a command, so that you can tell the user has selected a new value... I've put in a report example below but the principal should be able to be applied to a table control in a dynpro just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report zlocal_jc_sdn_listbox_link.
type-pools:
  vrm.

parameters:
  p_bukrs1             like t001-bukrs as listbox visible length 15
                         user-command zcc01 obligatory,
  p_bukrs2             like t001-bukrs as listbox visible length 15
                         user-command zcc02.

initialization.
  perform listbox1_fill.

at selection-screen output.
  perform at_selection_screen_output.

at selection-screen.
  perform at_selection_screen.

start-of-selection.
  format reset.
  write: / 'Listbox 1 - you chose:', p_bukrs1.
  write: / 'Listbox 2 - you chose:', p_bukrs2.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  at_selection_screen_output
*&amp;amp;---------------------------------------------------------------------*
form at_selection_screen_output.
  perform listbox2_fill.
endform.                    "at_selection_screen_output

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  at_selection_screen
*&amp;amp;---------------------------------------------------------------------*
form at_selection_screen.

  case sy-ucomm.
    when 'ZCC01'.  "CC 1 changed
      clear: p_bukrs2.  "as it won't be valid now
    when 'ZCC02'.  "CC 2 changed
  endcase.

endform.                    "at_selection_screen

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  listbox1_fill
*&amp;amp;---------------------------------------------------------------------*
form listbox1_fill.

  data:
    l_id                type vrm_id,
    lt_value            type vrm_values,
    l_value             like line of lt_value.

* Listbox 1:
  l_id = 'P_BUKRS1'. "name of variable in screen

  l_value-key = '1000'.
  l_value-text = 'Australia'.
  append l_value to lt_value.

  l_value-key = '2000'.
  l_value-text = 'England'.
  append l_value to lt_value.

  call function 'VRM_SET_VALUES'
    exporting
      id     = l_id
      values = lt_value.

  p_bukrs1 = '1000'. "initial default

endform.                    "listbox1_fill

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  listbox2_fill
*&amp;amp;---------------------------------------------------------------------*
form listbox2_fill.

  data:
    l_id                type vrm_id,
    lt_value            type vrm_values,
    l_value             like line of lt_value.

* Listbox 2:
  l_id = 'P_BUKRS2'. "name of variable in screen

  case p_bukrs1.

    when '1000'.  "Australia

      l_value-key = '1100'.
      l_value-text = 'Canberra'.
      append l_value to lt_value.

      l_value-key = '1200'.
      l_value-text = 'Sydney'.
      append l_value to lt_value.

    when '2000'.  "England

      l_value-key = '2100'.
      l_value-text = 'Manchaster'.
      append l_value to lt_value.

      l_value-key = '2200'.
      l_value-text = 'London'.
      append l_value to lt_value.

  endcase.

  call function 'VRM_SET_VALUES'
    exporting
      id     = l_id
      values = lt_value.

endform.                    "listbox2_fill&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 01:50:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/listbox-with-function-code-in-table-control/m-p/2987011#M705380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T01:50:31Z</dc:date>
    </item>
  </channel>
</rss>

