<?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: table control problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149959#M1193423</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;Say you have screen 8001 with screen field &lt;STRONG&gt;sc_ebeln&lt;/STRONG&gt; that acts as a parameter to fetch records from database table into table control on screen 8002 and you also have a screen field &lt;STRONG&gt;sc_ebelp&lt;/STRONG&gt; for line item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when &lt;STRONG&gt;data is displayed in table control based on the parameter value of ebeln&lt;/STRONG&gt; and you &lt;STRONG&gt;select a&lt;/STRONG&gt; &lt;STRONG&gt;row and click BACK button&lt;/STRONG&gt; to move to previous screen, then &lt;STRONG&gt;display the selected corresponding&lt;/STRONG&gt; &lt;STRONG&gt;value&lt;/STRONG&gt; of field &lt;STRONG&gt;ebelp&lt;/STRONG&gt; in the previous screen field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code, to use the selection column in the table control, and fetch values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Take selection column name in the table control attributes as wa_ekpo-flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
program  sapmz_tabctrl message-id zmsg.
 
CONTROLS : po_tab TYPE TABLEVIEW USING SCREEN '8002'. "table control
 
TYPES : BEGIN OF t_ekpo,
          ebeln TYPE ekpo-ebeln,
          ebelp TYPE ekpo-ebelp,
          matnr TYPE ekpo-matnr,
          werks TYPE ekpo-werks,
          menge TYPE ekpo-menge,
          netpr TYPE ekpo-netpr,
          flag(1), "flag for selection column in table control
        END OF t_ekpo.
 
"check the select column for the table in attributes and name it as wa_ekpo-flag
 
DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo, "internal table
       wa_ekpo TYPE t_ekpo. "work area
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;At screen flow logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PROCESS BEFORE OUTPUT.
  MODULE status_8002.
 
  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE pass_data. "pass data from internal table into table control on screen
  ENDLOOP.
 
PROCESS AFTER INPUT.
  MODULE user_command_8002.
 
  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE modify_data. "modify data into the internal table from table control
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE status_8002 OUTPUT.
  SET PF-STATUS 'ZTG_SELTB'.
  DATA : line_count TYPE i.
 
  DESCRIBE TABLE it_ekpo
  LINES line_count.
  po_tab-lines = line_count + 5.
ENDMODULE.                 " STATUS_8002  OUTPUT
 
MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAI Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE USER_COMMAND_8002 INPUT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN 'BACK'.
      READ TABLE IT_EKPO INTO WA_EKPO WITH KEY FLAG = 'X'.
      if sy-subrc eq 0.
        wa_ekpo-ebelp = sc_ebelp. "assign value to screen field
      endif.
      LEAVE TO SCREEN 8001.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_8002  INPUT
 
MODULE MODIFY_DATA INPUT.
  MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
ENDMODULE.                 " MODIFY_DATA  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2009 07:50:05 GMT</pubDate>
    <dc:creator>I355602</dc:creator>
    <dc:date>2009-02-06T07:50:05Z</dc:date>
    <item>
      <title>table control problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149955#M1193419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam doing table control programming, where iam populating the internal tbale entries to table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it working table control is populting the internal table entries, in those table table control entries am &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select one entry it shoild copy screen .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am unable copy to screen from table control, in my problem the cusrsor is not going user command module in PAI..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My screen code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;P&gt;  MODULE status_0500.&lt;/P&gt;&lt;P&gt;  LOOP AT icustomer WITH CONTROL tctrl_custlist&lt;/P&gt;&lt;P&gt;                 CURSOR tctrl_custlist-current_line.&lt;/P&gt;&lt;P&gt;    MODULE fill_table_control.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;  MODULE exit AT EXIT-COMMAND.&lt;/P&gt;&lt;P&gt;  LOOP AT icustomer.&lt;/P&gt;&lt;P&gt;    MODULE read_table_control.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  MODULE user_command_0500.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jagadeesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 15:02:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149955#M1193419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: table control problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149956#M1193420</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;Can you please explain your requirement in detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 15:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149956#M1193420</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-02-05T15:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: table control problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149957#M1193421</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;Are you trying to copy the entire screen in the Table Control? Can you explain the requirement a bit more clearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Samantak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 03:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149957#M1193421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T03:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: table control problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149958#M1193422</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;Let me explain my requirement in more detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have screen 200 in which there is one screen field End_customer.&lt;/P&gt;&lt;P&gt;I have another screen 500 in which i have a table control, in table control i am able to see the populated&lt;/P&gt;&lt;P&gt;entries from internal table, now when i select a particular entry in the table control, the same should come be populated in screen 200 in field End_customer. for this i have a push button in table control,&lt;/P&gt;&lt;P&gt;after selecting an entry in table control and pressing the push button, I am not getting the value to field End_customer in screen 200. It is giving an error saying that 'Invalid field format(screen error).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 07:35:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149958#M1193422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T07:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: table control problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149959#M1193423</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;Say you have screen 8001 with screen field &lt;STRONG&gt;sc_ebeln&lt;/STRONG&gt; that acts as a parameter to fetch records from database table into table control on screen 8002 and you also have a screen field &lt;STRONG&gt;sc_ebelp&lt;/STRONG&gt; for line item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when &lt;STRONG&gt;data is displayed in table control based on the parameter value of ebeln&lt;/STRONG&gt; and you &lt;STRONG&gt;select a&lt;/STRONG&gt; &lt;STRONG&gt;row and click BACK button&lt;/STRONG&gt; to move to previous screen, then &lt;STRONG&gt;display the selected corresponding&lt;/STRONG&gt; &lt;STRONG&gt;value&lt;/STRONG&gt; of field &lt;STRONG&gt;ebelp&lt;/STRONG&gt; in the previous screen field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code, to use the selection column in the table control, and fetch values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Take selection column name in the table control attributes as wa_ekpo-flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
program  sapmz_tabctrl message-id zmsg.
 
CONTROLS : po_tab TYPE TABLEVIEW USING SCREEN '8002'. "table control
 
TYPES : BEGIN OF t_ekpo,
          ebeln TYPE ekpo-ebeln,
          ebelp TYPE ekpo-ebelp,
          matnr TYPE ekpo-matnr,
          werks TYPE ekpo-werks,
          menge TYPE ekpo-menge,
          netpr TYPE ekpo-netpr,
          flag(1), "flag for selection column in table control
        END OF t_ekpo.
 
"check the select column for the table in attributes and name it as wa_ekpo-flag
 
DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo, "internal table
       wa_ekpo TYPE t_ekpo. "work area
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;At screen flow logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PROCESS BEFORE OUTPUT.
  MODULE status_8002.
 
  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE pass_data. "pass data from internal table into table control on screen
  ENDLOOP.
 
PROCESS AFTER INPUT.
  MODULE user_command_8002.
 
  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE modify_data. "modify data into the internal table from table control
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE status_8002 OUTPUT.
  SET PF-STATUS 'ZTG_SELTB'.
  DATA : line_count TYPE i.
 
  DESCRIBE TABLE it_ekpo
  LINES line_count.
  po_tab-lines = line_count + 5.
ENDMODULE.                 " STATUS_8002  OUTPUT
 
MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAI Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE USER_COMMAND_8002 INPUT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN 'BACK'.
      READ TABLE IT_EKPO INTO WA_EKPO WITH KEY FLAG = 'X'.
      if sy-subrc eq 0.
        wa_ekpo-ebelp = sc_ebelp. "assign value to screen field
      endif.
      LEAVE TO SCREEN 8001.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_8002  INPUT
 
MODULE MODIFY_DATA INPUT.
  MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
ENDMODULE.                 " MODIFY_DATA  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 07:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149959#M1193423</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-02-06T07:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: table control problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149960#M1193424</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;if you need a single field value from table control then try this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PAI..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;case ok_code.
when 'GET'.
      GET CURSOR FIELD fname VALUE value.
      MOVE : value TO mara-matnr.   -----&amp;gt;  here mara-matnr is the field in screen 200.
      CALL SCREEN 200.
endcase.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here you need to place the cursor on that perticular field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sathish Reddy on Feb 6, 2009 3:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 10:01:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149960#M1193424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T10:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: table control problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149961#M1193425</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;Invalid field format error occurs because of type mismatch problem. Try making the TYPE of END_CUSTOMER as 'C' or 'N'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 04:54:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-problem/m-p/5149961#M1193425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T04:54:32Z</dc:date>
    </item>
  </channel>
</rss>

