<?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: regarding Data into the table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-data-into-the-table/m-p/3415871#M820419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although I am not completely convinced you are using the concept of sequence number correctly, I will try and answer your requirement here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the latest Sequence Number in the Z table (called say ZTAB) do as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT seqnr FROM ZTAB INTO v_max_seqnr
ORDER BY seqnr DESCENDING.
ENDSELECT.
v_max_seqnr = v_max_seqnr + 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the file that you have uploaded into an internal table compatible with ZTAB for the update, just modify it to update the Sequence number field (in internal table) with v_max_seqnr as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
wa-seqnr = v_max_seqnr.
MODIFY itab FROM wa 
TRANSPORTING seqnr
WHERE seqnr IS INITIAL.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODIFY ztab FROM TABLE itab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally how I believe the sequence number should be used is, say currently your Z table has two primary key fields. Now the sequence number should be started from 1 for each new combination of the existing primary key combination and incremented every time this combination repeats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Feb 2008 18:15:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-18T18:15:12Z</dc:date>
    <item>
      <title>regarding Data into the table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-data-into-the-table/m-p/3415870#M820418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi frnds,&lt;/P&gt;&lt;P&gt;               I have a ztable having 5 fields and i m updating data into these fields from a file in the application server , but i have a requirement where i have added one more key field (Seq no)&lt;/P&gt;&lt;P&gt;in the table but i dont have data for that field in the File present in the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;so i have been given a logic to update data into that field as like :While inserting generate a running number for inserting into SEQNO field . This is to ensure unique records in the table. Whenever a table insert is first initiated max( seqno) from ZACT should be picked and the new number will be max number + 1 , for next set of data it will be last number + 1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me regarding this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sanjay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: sanjay jaju on Feb 18, 2008 7:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 17:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-data-into-the-table/m-p/3415870#M820418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T17:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: regarding Data into the table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-data-into-the-table/m-p/3415871#M820419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although I am not completely convinced you are using the concept of sequence number correctly, I will try and answer your requirement here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the latest Sequence Number in the Z table (called say ZTAB) do as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT seqnr FROM ZTAB INTO v_max_seqnr
ORDER BY seqnr DESCENDING.
ENDSELECT.
v_max_seqnr = v_max_seqnr + 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the file that you have uploaded into an internal table compatible with ZTAB for the update, just modify it to update the Sequence number field (in internal table) with v_max_seqnr as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
wa-seqnr = v_max_seqnr.
MODIFY itab FROM wa 
TRANSPORTING seqnr
WHERE seqnr IS INITIAL.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODIFY ztab FROM TABLE itab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally how I believe the sequence number should be used is, say currently your Z table has two primary key fields. Now the sequence number should be started from 1 for each new combination of the existing primary key combination and incremented every time this combination repeats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 18:15:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-data-into-the-table/m-p/3415871#M820419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T18:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: regarding Data into the table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-data-into-the-table/m-p/3415872#M820420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_count TYPE zact-seqno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT MAX( seqno ) INTO w_count FROM zact.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_count has the max value of seqno in ur Ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can increment this by 1 and insert in new records. Hope this will solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 15:06:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-data-into-the-table/m-p/3415872#M820420</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-02-19T15:06:33Z</dc:date>
    </item>
  </channel>
</rss>

