2009 May 07 9:22 PM
In my table maintenance generator,
I have one field called sequence number which increments by '1', each time user enters a new record in my table maintenance generator(have coded in such a way).
now the internal table, under sequence column if some records get deleted,
then the numbering of that column should be adjusted automatically.
Like
1st record - 1 A B D
2nd record - 2 A B C
3rd record - 3 A B D
4th record - 4 A B C
5th record - 5 E D F
If some user deletes 3rd record , then instead of showing the TMG as below
1st record - 1 A B D
2nd record - 2 A B C
3th record - 4 A B C
4th record - 5 E D F
the TMG should should show as
(I need that to be sequence column adjusted as )
1st record - 1 A B D
2nd record - 2 A B C
3th record - 3 A B C
4th record - 4 E D F
My thought is to write on new module in PAI,
and buils the logic in case of syst-ucomm = 'DELE'.
Please suggest me any function module availble or any good logic for this
.
Thanks in ADV.
2009 May 07 9:32 PM
If multiple records
say
1st
3rd
7th
11th
50th records gets deleted, the logic won't work . thanks.
2009 May 07 9:26 PM
Loop at the IT where sequence > deleted_sequence, substract 1 from sequence and modify the it.
2009 May 07 9:32 PM
If multiple records
say
1st
3rd
7th
11th
50th records gets deleted, the logic won't work . thanks.
2009 May 07 9:34 PM
2009 May 07 9:34 PM
Sort the deleted records in inverse order, with the higher sequences first, loop through them and do the main loop with the where for each.
2009 May 07 9:43 PM
2009 May 07 9:51 PM
This really isn't the way the TMG was meant to be used. Normally, one just uses it to manually add change or remove individual records, not a number of records based on some logic. It would probably be simpler to build a simple dynpro to take care of this.
Rob
2009 May 07 10:11 PM
In TMG, say the user creates 10 records in wrong way ...or to test some thing .
then if they don't want some records or all the 10 records ..then they can select those records and delete them in bunch. Am I right ?
2009 May 08 4:50 PM
Yes, but the user has to manually select the records to be deleted. This logic will work on any record.
Rob