Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting line on output screen that is written by Write statement....

Former Member
0 Kudos

Hello Gurus,

In my case there is data written on output screen. When I double click on line on ABAP report execution output screen, I want that line to be deleted from output screen.

I know I will have to write the logic at line-selection but how can I delete line that is written on screen using write statement ?

Regards,

Jainam.

Edited by: Jainam Shah on Nov 12, 2009 4:47 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I assume output list does not have duplicate entries :


REPORT abc.

PARAMETERS  check AS CHECKBOX .
types :
begin of ty_text,
  matnr type matnr,
  text(10) type c,
  end of ty_text.

data: wa_text type ty_text,
  i_text type standard TABLE OF ty_text.

wa_text-matnr = '13214214'.
wa_text-text = 'hhhhh'.
append wa_text to i_text.

wa_text-matnr = '2343432'.
wa_text-text = 'ggggggggg'.
append wa_text to i_text.

wa_text-matnr = '53445'.
wa_text-text = 'ffffffff'.
append wa_text to i_text.

loop at i_text into wa_text.
  write 😕 wa_text-text , wa_text-matnr.
  hide : wa_text-text , wa_text-matnr.
  endloop.
  clear wa_text.
at LINE-SELECTION.
  break-point.
sy-lsind = 0.
  delete table i_text from wa_text.

  loop at i_text into wa_text.
  write 😕 wa_text-text , wa_text-matnr.
  hide : wa_text-text , wa_text-matnr.
  endloop.
  clear wa_text.
  if i_text[] is INITIAL.
    write : 'no output'.
    endif.

8 REPLIES 8

Former Member
0 Kudos

Hi Jainam,

Why do you want to delete. If it is an intercative list. it is not possible. Because everytime you execute the report it will fetch the data from the database & make it available to your output list screen.

Hope you got it.

Please set to resolved if it helps you.

Regards

Abhii...

0 Kudos

Its not an interactive list. They are just simple lines written on output screen using write statement. I want to delete that line

0 Kudos

Hi Jainam,

When you say AT LINE-SELECTION. It is an intercative list only.

This is not possible to delete when you double click on a record.

However I have created a small code snippet for you. But to display something on the secondary list, you have to write a WRITE statement...The code as below :-

TABLES MARA.

DATA: BEGIN OF itab OCCURS 1,

MATNR like MARA-MATNR,

MEINS LIKE MARA-MEINS,

END OF itab.

SELECT MATNR MEINS FROM MARA INTO TABLE itab.

sort itab by MATNR.

LOOP AT itab.

WRITE:/ itab-MATNR.

HIDE itab-MATNR.

ENDLOOP.

AT LINE-SELECTION.

IF sy-lsind = 1.

CLEAR itab-MATNR.

write : sy-lilli.

ENDIF.

Kindly set to resolved, if this clears you question.

Regards

Abhii...

Clemenss
Active Contributor
0 Kudos

Jainam,

it's about time for you to use an ALV grid and delete the line from there.

Might be some learning experience if not effort.

Regards,

Clemens

Former Member
0 Kudos

Thanks Clemens. I understand that. The lcinet for whom I am working is on 45B so there is no other option...

Former Member
0 Kudos

>

> ... is on 45B so there is no other option...

I think a better solution is to read the report and delete the lines you don't want and then re-write the report. The proposed solution will have a hard time if more than one internal table is used to create the report.

Rob

Former Member
0 Kudos

I assume output list does not have duplicate entries :


REPORT abc.

PARAMETERS  check AS CHECKBOX .
types :
begin of ty_text,
  matnr type matnr,
  text(10) type c,
  end of ty_text.

data: wa_text type ty_text,
  i_text type standard TABLE OF ty_text.

wa_text-matnr = '13214214'.
wa_text-text = 'hhhhh'.
append wa_text to i_text.

wa_text-matnr = '2343432'.
wa_text-text = 'ggggggggg'.
append wa_text to i_text.

wa_text-matnr = '53445'.
wa_text-text = 'ffffffff'.
append wa_text to i_text.

loop at i_text into wa_text.
  write 😕 wa_text-text , wa_text-matnr.
  hide : wa_text-text , wa_text-matnr.
  endloop.
  clear wa_text.
at LINE-SELECTION.
  break-point.
sy-lsind = 0.
  delete table i_text from wa_text.

  loop at i_text into wa_text.
  write 😕 wa_text-text , wa_text-matnr.
  hide : wa_text-text , wa_text-matnr.
  endloop.
  clear wa_text.
  if i_text[] is INITIAL.
    write : 'no output'.
    endif.

0 Kudos

May be there are better ways ..but above code may be used as a substitute if you do not find better one