<?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: Call Fields Dynamically  in PBO Screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174839#M124084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My understanding is that your ZTABLE will have a record for each label.  Label1 thru Label75,  if this is the case,  get all of the records at one shot, instead of doing 75 hits to the db.  Then you can loop at your internal table and do what I've suggest above.  This way, the "Z" table is driving, not the program.  Make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So really all you need in your PBO is something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: ilabel type table of ztable with header line.
field-symbols: &amp;lt;fs&amp;gt;.

select * into table ilabel from ZTABLE.

  loop at ilabel.
    assign (ilabel-label) to &amp;lt;fs&amp;gt;.
    &amp;lt;fs&amp;gt; = ilabel-descr.
  endloop.

&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2006 17:00:54 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-02-09T17:00:54Z</dc:date>
    <item>
      <title>Call Fields Dynamically  in PBO Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174836#M124081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks &lt;/P&gt;&lt;P&gt;             I have question regarding module programming. I have made up the screen in which I have defined 75 fields. I am changing the screen label dynamically in PBO. I have also maintained a table in which I have screen field name and its description. Now I want that I read the description from table and change the filed dynamically. I am looking for your suggestion input. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Screen fields are&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Label1       ( input/output field ) : but its output only !!!&lt;/P&gt;&lt;P&gt;Label2 &lt;/P&gt;&lt;P&gt;Label3 &lt;/P&gt;&lt;P&gt;Label4 &lt;/P&gt;&lt;P&gt;Label5 &lt;/P&gt;&lt;P&gt;Label6 &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Label75 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Z Table Fields&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt; &lt;/P&gt;&lt;P&gt;Field           Description Maintained in Z table &lt;/P&gt;&lt;P&gt;Label1          Absent &lt;/P&gt;&lt;P&gt;Label2          Late &lt;/P&gt;&lt;P&gt;Label3          Sick &lt;/P&gt;&lt;P&gt;Label4          &lt;/P&gt;&lt;P&gt;Label5 &lt;/P&gt;&lt;P&gt;Label6 &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Label75         Last &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;How I code it in PBO, so it&amp;#146;ll call up the fields Dynamically assign text to my Labels on screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advanced...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 16:23:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174836#M124081</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-02-09T16:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Call Fields Dynamically  in PBO Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174837#M124082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this sample program.  Maybe it will show you how to do this using field symbols.   The ILABEL internal table is suppose to illistate your "Z" table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001.

data: begin of ilabel occurs 0,
      label(30) type c,
      descr(30) type c,
      end of ilabel.


data: label1(30) type c.  " Labels on the screen
data: label2(30) type c.
data: label3(30) type c.    ^ 
data: label4(30) type c.    |
data: label5(30) type c.  " Labels on the screen

field-symbols: &amp;lt;fs&amp;gt;.

start-of-selection.

* Get the data from the custom table which is storing
* the screen fields and the description(labels)
  ilabel-label = 'LABEL1'. ilabel-descr = 'Text 1'. append ilabel.
  ilabel-label = 'LABEL2'. ilabel-descr = 'Text 2'. append ilabel.
  ilabel-label = 'LABEL3'. ilabel-descr = 'Text 3'. append ilabel.
  ilabel-label = 'LABEL4'. ilabel-descr = 'Text 4'. append ilabel.
  ilabel-label = 'LABEL5'. ilabel-descr = 'Text 5'. append ilabel.

* Assign those descriptions from the table to the 
* screen field labels.
  loop at ilabel.
    assign (ilabel-label) to &amp;lt;fs&amp;gt;.
    &amp;lt;fs&amp;gt; = ilabel-descr.
  endloop.


* Write out the labels.
  write:/ label1.
  write:/ label2.
  write:/ label3.
  write:/ label4.
  write:/ label5.

&lt;/CODE&gt;&lt;/PRE&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>Thu, 09 Feb 2006 16:43:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174837#M124082</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-09T16:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Call Fields Dynamically  in PBO Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174838#M124083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer, you are always very help full ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That&amp;#146;s means I have to define all screen labels .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am thinking In PBO.. I should get something ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;counter type i value '0'.&lt;/P&gt;&lt;P&gt;counter1(c)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Lable' counter1 into label  ( counter increase till 75 ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from Ztable where field = label ( screen field ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;screen-lable = ztable-description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do some thing here  (  What )   ?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;counter = counter + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move counter to counter1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try your code.&lt;/P&gt;&lt;P&gt;Once again Thanks a lot..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 16:55:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174838#M124083</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-02-09T16:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Call Fields Dynamically  in PBO Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174839#M124084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My understanding is that your ZTABLE will have a record for each label.  Label1 thru Label75,  if this is the case,  get all of the records at one shot, instead of doing 75 hits to the db.  Then you can loop at your internal table and do what I've suggest above.  This way, the "Z" table is driving, not the program.  Make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So really all you need in your PBO is something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: ilabel type table of ztable with header line.
field-symbols: &amp;lt;fs&amp;gt;.

select * into table ilabel from ZTABLE.

  loop at ilabel.
    assign (ilabel-label) to &amp;lt;fs&amp;gt;.
    &amp;lt;fs&amp;gt; = ilabel-descr.
  endloop.

&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 17:00:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174839#M124084</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-09T17:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Call Fields Dynamically  in PBO Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174840#M124085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yup , it makes sense thanks a lot ...&lt;/P&gt;&lt;P&gt;Let me try the code and get back to you ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting an error message "Field symbol has not yet been assigned.  "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into table ilabel from ZTABLE.&lt;/P&gt;&lt;P&gt;  loop at ilabel.&lt;/P&gt;&lt;P&gt;  assign (ilabel-ZFIELD) to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;-&amp;gt;&amp;lt;fs&amp;gt; = ilabel-DESCRP. ( ERROR MESSAGE ) &lt;/P&gt;&lt;P&gt;  endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Saquib Khan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 17:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174840#M124085</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-02-09T17:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Call Fields Dynamically  in PBO Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174841#M124086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course the values that are in ILABEL-ZFIELD, must have a corresponding DATA statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data: LABEL1(30) type c,
      LABEL2(30) type c,
   etc....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have these fields defined?   Please refer to the code in my first post.  &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>Thu, 09 Feb 2006 17:16:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-fields-dynamically-in-pbo-screen/m-p/1174841#M124086</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-09T17:16:30Z</dc:date>
    </item>
  </channel>
</rss>

