SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

deleteting repeated record in same document no...



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
pranaypanchbhai
Участник
Участник



Joined: 26 Mar 2010
Posts: 9

PostPosted: Sat Jul 03, 2010 4:04 pm    Post subject: deleteting repeated record in same document no... Reply with quote

hiiiiiii to all ,

i have some problem regarding eliminating the repeated entries


for example

field 1 field2 field3 field4 field5
5100000245 46,506.80 3,160.00 154,496.80 18729521
5100000248 5,940.00 *290,604.28 132410 18729001*
5100000248 5,940.00 *290,604.28 132410 18729001*

in this case i want only this type of record
__________________________________________________________
field 1 field2 field3 field4 field5
________________________________________________________
5100000245 46,506.80 3,160.00 154,496.80 18729521
_________________________________________________________
5100000248 5,940.00 *290,604.28 132410 18729001*
5100000248 5,940.00
_________________________________________________________


so what can i do plz tell me any solution
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 47
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Sat Jul 03, 2010 8:19 pm    Post subject: Reply with quote

Code:
DELETE ADJACENT DUPLICATES FROM gt_data COMPARING field_1 ... field_n.

An internal table gt_data must be sorted, see more in help (DELETE ABAP statement).

_________________
ABAP/4 You
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 47
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Sat Jul 03, 2010 8:37 pm    Post subject: Reply with quote

http://help.sap.com/abapdocu_70/en/ABAPDELETE_DUPLICATES.htm
_________________
ABAP/4 You
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 180
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Sun Jul 04, 2010 1:32 am    Post subject: Reply with quote

Code:
*&---------------------------------------------------------------------*
*& Report  ZDEMO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zdemo.

DATA: BEGIN OF lt OCCURS 0,
      field1(10) TYPE c,
      field2(10) TYPE c,
      field3(10) TYPE c,
      field4(10) TYPE c,
      field5(10) TYPE c,
      END OF lt.

DATA: l_tabix TYPE sy-tabix.

FIELD-SYMBOLS: <fs1> LIKE LINE OF lt,
               <fs2> LIKE LINE OF lt.

lt-field1 = '5100000245'.
lt-field2 = '46,506.80'.
lt-field3 = '3,160.00'.
lt-field4 = '154,496.80'.
lt-field5 = '18729521'.
APPEND lt.

lt-field1 = '5100000248'.
lt-field2 = '5,940.00'.
lt-field3 = '*290,604.28'.
lt-field4 = '132410'.
lt-field5 = '18729001*'.
APPEND lt.

lt-field1 = '5100000248'.
lt-field2 = '5,940.00'.
lt-field3 = '*290,604.28'.
lt-field4 = '132410'.
lt-field5 = '18729001*'.
APPEND lt.

SORT lt BY field1 field2 field3 field4 field5.

LOOP AT lt ASSIGNING <fs1>.
  IF l_tabix > sy-tabix.
    CONTINUE.
  ENDIF.
  l_tabix = sy-tabix + 1.
  LOOP AT lt ASSIGNING <fs2> FROM l_tabix.
    IF <fs2> EQ <fs1>.
       CLEAR: <fs2>-field3, <fs2>-field4, <fs2>-field5.
    ELSE.
      l_tabix = sy-tabix.
      EXIT.
    ENDIF.
  ENDLOOP.
ENDLOOP.

LOOP AT lt ASSIGNING <fs1>.
  WRITE: / <fs1>-field1, <fs1>-field2, <fs1>-field3, <fs1>-field4, <fs1>-field5.
ENDLOOP.

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
Dmitriy
Аналитик
Аналитик


Age: 47
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Mon Jul 05, 2010 2:01 pm    Post subject: Reply with quote

vga wrote:
<код>

Это я совсем плох стал - не понял вопроса, или ты заранее, на всякий случай?.. Wink

_________________
ABAP/4 You
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 180
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Mon Jul 05, 2010 2:06 pm    Post subject: Reply with quote

Да фиг их индусов поймешь, че они хотят. Я понял, что он так хочет вывести, как нарисовал.
_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
Dmitriy
Аналитик
Аналитик


Age: 47
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Mon Jul 05, 2010 2:09 pm    Post subject: Reply with quote

vga wrote:
Да фиг их индусов поймешь, че они хотят.

Ясно. Как там раньше говорили? В мемориз! Laughing
offtop off

_________________
ABAP/4 You
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.