<?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 internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838912#M923047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since cdhrd is transparent and cdpos is pool table, I suppose I cannot cary out a join, then how do I get the following fields into an internal table record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chhrd-changenr&lt;/P&gt;&lt;P&gt;cdhrd-udate&lt;/P&gt;&lt;P&gt;cdhrd-utime&lt;/P&gt;&lt;P&gt;cdpos-fname&lt;/P&gt;&lt;P&gt;cdpos-value_new&lt;/P&gt;&lt;P&gt;cdpos_value_old&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from cdhrd and cdpos for a given &lt;/P&gt;&lt;P&gt;object class&lt;/P&gt;&lt;P&gt;objact value&lt;/P&gt;&lt;P&gt;field name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I need to sord the records as follows&lt;/P&gt;&lt;P&gt;change doc no      time      date &lt;/P&gt;&lt;P&gt;01                        5:30     19.05.2008 &lt;/P&gt;&lt;P&gt;02                        4:30     01.02.2008&lt;/P&gt;&lt;P&gt;03                        2:00     01.10.2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then for the sorted records above I need to carry out the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;record no from_date from_time to_date to_time&lt;/P&gt;&lt;P&gt;01           19.05.2008    5:30     Today  Now&lt;/P&gt;&lt;P&gt;02           01.02.2008    4:30     19.05.2008 5:30  &lt;/P&gt;&lt;P&gt;03           01.10.2007    2:00     01.02.2008 4:30&lt;/P&gt;&lt;P&gt;04           ..........................     01.10.2007 2:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is like a series, where from_date in record 1 becomes to_date in record 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 May 2008 08:14:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-20T08:14:25Z</dc:date>
    <item>
      <title>internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838912#M923047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since cdhrd is transparent and cdpos is pool table, I suppose I cannot cary out a join, then how do I get the following fields into an internal table record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chhrd-changenr&lt;/P&gt;&lt;P&gt;cdhrd-udate&lt;/P&gt;&lt;P&gt;cdhrd-utime&lt;/P&gt;&lt;P&gt;cdpos-fname&lt;/P&gt;&lt;P&gt;cdpos-value_new&lt;/P&gt;&lt;P&gt;cdpos_value_old&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from cdhrd and cdpos for a given &lt;/P&gt;&lt;P&gt;object class&lt;/P&gt;&lt;P&gt;objact value&lt;/P&gt;&lt;P&gt;field name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I need to sord the records as follows&lt;/P&gt;&lt;P&gt;change doc no      time      date &lt;/P&gt;&lt;P&gt;01                        5:30     19.05.2008 &lt;/P&gt;&lt;P&gt;02                        4:30     01.02.2008&lt;/P&gt;&lt;P&gt;03                        2:00     01.10.2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then for the sorted records above I need to carry out the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;record no from_date from_time to_date to_time&lt;/P&gt;&lt;P&gt;01           19.05.2008    5:30     Today  Now&lt;/P&gt;&lt;P&gt;02           01.02.2008    4:30     19.05.2008 5:30  &lt;/P&gt;&lt;P&gt;03           01.10.2007    2:00     01.02.2008 4:30&lt;/P&gt;&lt;P&gt;04           ..........................     01.10.2007 2:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is like a series, where from_date in record 1 becomes to_date in record 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 08:14:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838912#M923047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T08:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838913#M923048</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;You can collect data from CDHDR table in internal table then loop at CDHDR internal table. call function module CHANGEDOCUMENT_READ_POSITIONS. pass cdhdr-changenr to FM and get values from CDPOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check below logic.&lt;/P&gt;&lt;P&gt;SELECT objectid "Object value&lt;/P&gt;&lt;P&gt;changenr "Document change number&lt;/P&gt;&lt;P&gt;udate "Creation date of the change document&lt;/P&gt;&lt;P&gt;utime "Time changed&lt;/P&gt;&lt;P&gt;username "Name of the person responsible in change document&lt;/P&gt;&lt;P&gt;INTO TABLE lt_cdhdr&lt;/P&gt;&lt;P&gt;FROM cdhdr&lt;/P&gt;&lt;P&gt;WHERE condition.&lt;/P&gt;&lt;P&gt;LOOP AT lt_cdhdr INTO ls_cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling FM to get values from CDPOS &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;changenumber = ls_cdhdr-changenr&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;editpos_with_header = lt_cdred&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;no_position_found = 1&lt;/P&gt;&lt;P&gt;wrong_access_to_archive = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;LOOP AT lt_cdred INTO ls_cdred.&lt;/P&gt;&lt;P&gt;*collect following information from ls_cdhdr &amp;amp; ls_cdred.&lt;/P&gt;&lt;P&gt;*chhrd-changenr&lt;/P&gt;&lt;P&gt;*cdhrd-udate&lt;/P&gt;&lt;P&gt;*cdhrd-utime&lt;/P&gt;&lt;P&gt;*cdpos-fname&lt;/P&gt;&lt;P&gt;*cdpos-value_new&lt;/P&gt;&lt;P&gt;*cdpos_value_old&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP. "loop at lt_cdred&lt;/P&gt;&lt;P&gt;ENDLOOP. "loop at Lt_cdhdr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;N M Poojari.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 08:41:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838913#M923048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T08:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838914#M923049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;      You these following function modules to get the details in two internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_HEADERS    Change document: Read change document header&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_POSITIONS  Change document: Read change document items&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then sort both by the required fileds and then loop across and assign from_date and to_date to next record by keeping a copy of earlier internal table and reading based on index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 08:43:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838914#M923049</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T08:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838915#M923050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;types: begin of ty_cdhdr,&lt;/P&gt;&lt;P&gt;objectclas type CDOBJECTCL,&lt;/P&gt;&lt;P&gt;objectid type CDOBJECTV,&lt;/P&gt;&lt;P&gt;changenr type CHANGENR,&lt;/P&gt;&lt;P&gt;udate type CDDATUM,&lt;/P&gt;&lt;P&gt;utime type CDUZEIT,&lt;/P&gt;&lt;P&gt;end of ty_cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begi of ty_cdpos,&lt;/P&gt;&lt;P&gt;objectclas type CDOBJECTCL,&lt;/P&gt;&lt;P&gt;objectid type CDOBJECTV,&lt;/P&gt;&lt;P&gt;fname type FIELDNAME,&lt;/P&gt;&lt;P&gt;value_new type CDFLDVALN,&lt;/P&gt;&lt;P&gt;value_old type CDFLDVALO,&lt;/P&gt;&lt;P&gt;end of ty_cdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_final,&lt;/P&gt;&lt;P&gt;changenr type CHANGENR,&lt;/P&gt;&lt;P&gt;udate type CDDATUM,&lt;/P&gt;&lt;P&gt;utime type CDUZEIT,&lt;/P&gt;&lt;P&gt;fname type FIELDNAME,&lt;/P&gt;&lt;P&gt;value_new type CDFLDVALN,&lt;/P&gt;&lt;P&gt;value_old type CDFLDVALO,&lt;/P&gt;&lt;P&gt;end of ty_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_cdhdr type table of ty_cdhdr,&lt;/P&gt;&lt;P&gt;        i_cdpos type table of ty_cdpos,&lt;/P&gt;&lt;P&gt;        i_final type table of ty_final,&lt;/P&gt;&lt;P&gt;        w_cdhdr type ty_cdhdr,&lt;/P&gt;&lt;P&gt;        w_cdpos type ty_cdpos,&lt;/P&gt;&lt;P&gt;       w_final type ty_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_objectclas type cdhdr-objectclas,&lt;/P&gt;&lt;P&gt;                  p_objectid type cdhdr-objectid,&lt;/P&gt;&lt;P&gt;                  p_fname type cdpos-fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select OBJECTCLAS OBJECTID CHANGENR UDATE UTIME from cdhdr into table i_cdhdr where OBJECTCLAS = p_OBJECTCLAS and OBJECTID = p_OBJECTID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select FNAME OBJECTCLAS OBJECTID FNAME  VALUE_NEW VALUE_OLD FROM CDPOS FOR ALL ENTRIES IN I_CDHDR WHERE OBJECTCLAS = I_CDHDR-OBJECTCLAS and OBJECTID = I_CDHDR-OBJECTID AND FNAME = p_fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_cdpos into w_cdpos.&lt;/P&gt;&lt;P&gt;read table i_cdhdr into w_cdhdr with key OBJECTCLAS =  w_CDPOS-OBJECTCLAS  OBJECTID = W_CDPOS-OBJECTID.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;w_final-changenr = w_cdhdr-changenr.&lt;/P&gt;&lt;P&gt;w_final-udate = w_cdhdr-udate.&lt;/P&gt;&lt;P&gt;w_final-utime = w_cdhdr-utime.&lt;/P&gt;&lt;P&gt;w_final-fname = w_cdpos-fname.&lt;/P&gt;&lt;P&gt;w_final-value_new = w_cdhdr-value_new.&lt;/P&gt;&lt;P&gt;w_final-value_old = w_cdhdr-value_old.&lt;/P&gt;&lt;P&gt;append w_final to i_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it is useful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it is helpful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Deepika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 09:00:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838915#M923050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838916#M923051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to do this based on tablename-fieldname, hoe can I do it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 09:13:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3838916#M923051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T09:13:50Z</dc:date>
    </item>
  </channel>
</rss>

