<?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: Dynamically clearing fields using field symbols in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518003#M1424642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Amit/ ilesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the suggestions. I got the hint now. Now i will be able to proceed according to my requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Dec 2009 13:00:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-18T13:00:12Z</dc:date>
    <item>
      <title>Dynamically clearing fields using field symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518000#M1424639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider i have a internal table itab1 defined as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of itab1 occurs 0,
         fid type string,
         end of itab1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another internal table itab2 defined as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of itab2 occurs 0,
        f1 type string,
        f2 type string,
        f3 type string,
       end of itab2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here itab1-fid will only hold fieldnames of itab2. i.e f1, f2, f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i have to clear itab2 fields based on the content of itab1-fid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at itab1.
"here if itab1-fid holds the value 'f1',
"i have to clear the value of  itab2-f1.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible using filed symbols?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2009 11:56:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518000#M1424639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-18T11:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically clearing fields using field symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518001#M1424640</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;I just tried the same and it is working. Just copy paste the program and  see in debugging ITAB2 to get the feel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report abc.


*--------------------------------------------
data: begin of itab1 occurs 0,
         fid type string,
         end of itab1.


data: begin of itab2 occurs 0,
        f1 type string,
        f2 type string,
        f3 type string,
       end of itab2.

*--------------------------------------------

field-symbols : &amp;lt;FS&amp;gt; type any.
data : fieldname(35) type c.

*--------------------------------------------

itab1-fid = 'F2'.
append itab1.

itab1-fid = 'F3'.
append itab1.


*--------------------------------------------


itab2-f1 = 'This is f1'.
itab2-f2 = 'This is f2'.
itab2-f3 = 'This is f3'.

append itab2.
append itab2.

*--------------------------------------------

loop at itab2.

  loop at itab1.

    concatenate 'ITAB2-' itab1-fid into fieldname.
    assign (fieldname) to &amp;lt;FS&amp;gt; .
    clear &amp;lt;FS&amp;gt;.

  endloop.
modify itab2.
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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2009 12:30:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518001#M1424640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-18T12:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically clearing fields using field symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518002#M1424641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikranth Reddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you must be knowing the number of fields in itab2.. you can do it in this way too.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZTEST_1.

DATA: BEGIN OF ITAB1 OCCURS 0,
         FID TYPE STRING,
         END OF ITAB1.


DATA: BEGIN OF ITAB2 OCCURS 0,
        F1 TYPE STRING,
        F2 TYPE STRING,
        F3 TYPE STRING,
       END OF ITAB2.

FIELD-SYMBOLS : &amp;lt;FS&amp;gt; TYPE ANY.
FIELD-SYMBOLS : &amp;lt;FS2&amp;gt; TYPE ANY.
FIELD-SYMBOLS : &amp;lt;FS3&amp;gt; TYPE ANY.

DATA : FIELDNAME(35) TYPE C.
DATA : FIELDNAME2(35) TYPE C.

ITAB1-FID = 'F1'.
APPEND ITAB1.

ITAB1-FID = 'F3'.
APPEND ITAB1.

ITAB2-F1 = 'abcd'.
ITAB2-F2 = 'efgh'.
ITAB2-F3 = 'ijkl'.
APPEND ITAB2.

ITAB2-F1 = '1234'.
ITAB2-F2 = 'efdf'.
ITAB2-F3 = 'ijkl'.
APPEND ITAB2.


ITAB2-F1 = 'rewr'.
ITAB2-F2 = 'efgh'.
ITAB2-F3 = 'ijkl'.
APPEND ITAB2.

LOOP AT ITAB1.
  CASE SY-TABIX.

    WHEN 1.
      CONCATENATE 'ITAB2-' ITAB1-FID INTO FIELDNAME.
      ASSIGN (FIELDNAME) TO &amp;lt;FS&amp;gt; .
    WHEN 2.
      CONCATENATE 'ITAB2-' ITAB1-FID INTO FIELDNAME2.
      ASSIGN (FIELDNAME2) TO &amp;lt;FS2&amp;gt; .
    WHEN OTHERS.
  ENDCASE.

ENDLOOP.

LOOP AT ITAB2.
  CLEAR &amp;lt;FS&amp;gt;.
  CLEAR &amp;lt;FS2&amp;gt;.
  MODIFY ITAB2.
  WRITE : / SY-VLINE, ITAB2-F1 , SY-VLINE, ITAB2-F2, SY-VLINE, ITAB2-F3, SY-VLINE.
ENDLOOP.

WRITE : 'Test by ilesh'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope it will solve your problem..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;ilesh 24x7&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ilesh Nandaniya&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2009 12:55:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518002#M1424641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-18T12:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically clearing fields using field symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518003#M1424642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Amit/ ilesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the suggestions. I got the hint now. Now i will be able to proceed according to my requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2009 13:00:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-clearing-fields-using-field-symbols/m-p/6518003#M1424642</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-18T13:00:12Z</dc:date>
    </item>
  </channel>
</rss>

