Skip to Content
0
Former Member
Apr 22, 2009 at 03:57 AM

Read line and delete line

29 Views

Hi Experts ,

I am doing a report on material history where I need to find out open orders....if suppose a matnr does'nt have Po then also I need to display as it will have open PR.

Now I want to delete the line where ebeln eq space but I can't put the condition as:

delete it_first where ebeln = space as single lines will also get deleted.

My condition should be if a matnr is displayed in more than 1 line and if ebeln eq space

delete it_first.

loop at it_first.                              " I facing problem with this code
  if it_first-wemng GE it_first-menge.
    move '   '  to it_first-ebeln.
    move '   '  to it_first-menge
    move '   '  to it_first-wenge
 modify it_first.
endif.
endloop.

after the above statement my O/P is as below

 werks   ,   matnr   ,     ebeln        ,  menge  , wemng
 UNIT1   ,    ABCD   ,   450025612       ,    256       ,   125
 UNIT1   ,    ABCD   ,   450012345       ,    756       ,   456
 UNIT1   ,    ABCD   ,  --SPACE--         ,   0.00       ,  0.00     "Need to delete this line 
 UNIT1   ,    ABCD   ,  --SPACE--         ,   0.00       ,  0.00     "Need to delete this line 
  
 UNIT2   ,  BEDF     ,   --SPACE--        ,   0.00       ,  0.00    " this needs to be displayed (just 4 matnr)

Please advice

Karthik