<?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: problem with write statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503632#M232943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One big thing is that you are not allow to use header lines in OO,  just use work areas instead.   Then it should be fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please remember to award points for helpful answers and mark your posta as solved when solved completely.  Thanks.&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, 27 Jul 2006 16:17:05 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-07-27T16:17:05Z</dc:date>
    <item>
      <title>problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503627#M232938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need some help on the following program. when I run this program in debug mode and click on the "it_uct200g" in the select statement, I see the data that was selected. the problem is that the if statement is not working noe is the last write statement. when you click on these fields there is nothing data be displayed. I am not sure why I would see data when I click on the table in the select statement and not when I clicked on the separate  fields within the table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTEST3.&lt;/P&gt;&lt;P&gt;TABLES:&lt;/P&gt;&lt;P&gt;    UCT200G.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:  BEGIN OF ty_uct200g,&lt;/P&gt;&lt;P&gt;        siselid   TYPE uct200g-siselid,&lt;/P&gt;&lt;P&gt;        fieldname TYPE uct200g-fieldname,&lt;/P&gt;&lt;P&gt;        sisel     TYPE uct200g-sisel,&lt;/P&gt;&lt;P&gt;        END   OF ty_uct200g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_uct200g TYPE  STANDARD TABLE OF ty_uct200g with header line.&lt;/P&gt;&lt;P&gt;*&lt;/P&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;*START-OF-SELECTION                                                    *&lt;/P&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select siselid fieldname sisel&lt;/P&gt;&lt;P&gt; FROM UCT200G INTO TABLE it_uct200g&lt;/P&gt;&lt;P&gt; WHERE fieldname = '/BIC/ZVTYPE1                  '&lt;/P&gt;&lt;P&gt; AND sisel = 'PLANNING  '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: / 'process successful return code = ', sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_uct200g-sisel = 'PLANNING  '.&lt;/P&gt;&lt;P&gt;write: / ' the field is filled'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: / '****&lt;STRONG&gt;', it_uct200g-siselid,'&lt;/STRONG&gt;',it_uct200g-fieldname,'*',it_uct200g-sisel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 19:52:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503627#M232938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T19:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503628#M232939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's probably because you are looking at the header line.  You may want to loop at the table and then write, or read the table with an index of 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 19:58:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503628#M232939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T19:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503629#M232940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason is that you need to read the table, or loop at it to put something in the header line of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT ZTEST3.
TABLES:
UCT200G.

TYPES: BEGIN OF ty_uct200g,
siselid TYPE uct200g-siselid,
fieldname TYPE uct200g-fieldname,
sisel TYPE uct200g-sisel,
END OF ty_uct200g.



data: it_uct200g TYPE STANDARD TABLE OF ty_uct200g with header line.
*
*-------------------------------------------------------*
*START-OF-SELECTION *
*-------------------------------------------------------*
START-OF-SELECTION.

select siselid fieldname sisel
FROM UCT200G INTO TABLE it_uct200g
WHERE fieldname = '/BIC/ZVTYPE1 '
AND sisel = 'PLANNING '.

write: / 'process successful return code = ', sy-subrc.

&amp;lt;b&amp;gt;loop at it_uct200g.&amp;lt;/b&amp;gt;

if it_uct200g-sisel = 'PLANNING '.
write: / ' the field is filled'.
endif.

write: / '*****', it_uct200g-siselid,'*',it_uct200g-fieldname,'*',it_uct200g-sisel.
&amp;lt;b&amp;gt;
endloop.&amp;lt;/b&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are doing an array fetch, which means that you are getting all of the data into the internal table all at one shot.  You have to then loop at the table to read the records or use the READ TABLE statement to read records directly.  This puts the data into the header line where you can access the data.&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>Wed, 26 Jul 2006 19:59:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503629#M232940</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-26T19:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503630#M232941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ur write statement is not in loop so it checks the last record present in headerline ... if the last record is not the record in if statement then u dont fetch record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or write select statement like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select fields from dbtable into itab where ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if field = 'PLANNING'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: / 'UR STATEMENT'.&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;or as rich told put it in loop at itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 20:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503630#M232941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T20:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503631#M232942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the program working and it is doing everything that I want it to do. I created this as a program to be able to test it. I now want to copy this code into a method and I am getting a lot of errors on the tables relating to OO context.  Is it possible to turn this code into a finction and call this function from the method or do I have to re-code all of the tables to make them conform to OO standards.&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>Thu, 27 Jul 2006 16:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503631#M232942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-27T16:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503632#M232943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One big thing is that you are not allow to use header lines in OO,  just use work areas instead.   Then it should be fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please remember to award points for helpful answers and mark your posta as solved when solved completely.  Thanks.&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, 27 Jul 2006 16:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503632#M232943</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-27T16:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503633#M232944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can I use the work areas in my test program and after it is tested and correct, copy the code to the method? it is much easier to test the program than the method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2006 16:35:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503633#M232944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-27T16:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503634#M232945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having problems setting up the program to use work areas. I have included part of the program. would it be possible for someone to fix what I have coded to have the work aresa properly defined. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTEST3.&lt;/P&gt;&lt;P&gt;TYPES:  BEGIN OF ty_uct200g,&lt;/P&gt;&lt;P&gt;        siselid   TYPE uct200g-siselid,&lt;/P&gt;&lt;P&gt;        fieldname TYPE uct200g-fieldname,&lt;/P&gt;&lt;P&gt;        sisel     TYPE uct200g-sisel,&lt;/P&gt;&lt;P&gt;        END   OF ty_uct200g.&lt;/P&gt;&lt;P&gt;data: it_uct200g type ty_uct200g.&lt;/P&gt;&lt;P&gt;data: wa_200g type ty_uct200g.&lt;/P&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;*START-OF-SELECTION                                                    *&lt;/P&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select siselid fieldname sisel&lt;/P&gt;&lt;P&gt;   FROM UCT200G INTO wa_200g&lt;/P&gt;&lt;P&gt;   WHERE fieldname = '/BIC/ZVTYPE1                  '&lt;/P&gt;&lt;P&gt;   AND sisel = 'PLANNING  '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; write: / 'process successful return code = ', sy-subrc.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at ty_uct200g into wa_200g.&lt;/P&gt;&lt;P&gt;    write: / 'uct200g****&lt;STRONG&gt;', wa_200g-siselid,'&lt;/STRONG&gt;',wa_200g-fieldname,'*',wa_200g-sisel.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2006 20:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503634#M232945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-27T20:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503635#M232946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim. change like so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report ztest3.
types: begin of ty_uct200g,
       siselid type uct200g-siselid,
       fieldname type uct200g-fieldname,
       sisel type uct200g-sisel,
       end of ty_uct200g.
&amp;lt;b&amp;gt;data: it_uct200g type table of ty_uct200g.
data: wa_200g like line of it_uct200g.&amp;lt;/b&amp;gt;
*----------------------------------------------------------------------*
*START-OF-SELECTION *
*----------------------------------------------------------------------*
start-of-selection.

  select siselid fieldname sisel
  from uct200g into wa_200g
  where fieldname = '/BIC/ZVTYPE1 '
  and sisel = 'PLANNING '.
* write: / 'process successful return code = ', sy-subrc.
    loop at ty_uct200g into wa_200g.
     write: / 'uct200g*****', wa_200g-siselid,'*',wa_200g-fieldname,'*',
       wa_200g-sisel.
    endloop.
*

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure to award points for helpful answers and mark your post as solved when you question has been ansewred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&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, 27 Jul 2006 20:03:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503635#M232946</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-27T20:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503636#M232947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Just try to change the definition of your internal table as without header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;data: it_uct200g TYPE STANDARD TABLE OF ty_uct200g with header line.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;TO&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data: it_uct200g TYPE STANDARD TABLE OF ty_uct200g.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and loop thru the table or read the table whenever you want to access the contents of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2006 20:05:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503636#M232947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-27T20:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503637#M232948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich, &lt;/P&gt;&lt;P&gt; I tried your suggestion and receive the following&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;"the field "TY_UCT200G" is unknown, but there is a field with the similar name "IT_UCT200G".&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2006 20:11:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503637#M232948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-27T20:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with write statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503638#M232949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have since edited the post.   Make sure that you work area is defined like this.  Like line of the itab not the type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: wa_200g like line of &amp;lt;b&amp;gt;it_&amp;lt;/b&amp;gt;uct200g.&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, 27 Jul 2006 20:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-write-statement/m-p/1503638#M232949</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-27T20:30:31Z</dc:date>
    </item>
  </channel>
</rss>

