Skip to Content
author's profile photo Former Member
Former Member

How to delete a written line...

I have written a line which includes matnr, description etc.. After writing that , i come to know that due to some conditions specified in the requirement, that matnr need not be displayed in the report. So, i wnat to delete whatever i have written in the current line .. How can i do that ...

I mean ..

matnr1 descr1 242 EA sfs

matnr2 descr2 345 M gjhgj

matnr3 descr3 <Oops ! i dont want this line>

Now, how will i delete the line which contains matnr3 and descr3

I cannot delete the line before writing it. Its difficult for me to explain the situation. Please give a solution for this .

Hope u understood my problem

Thanking you

Shankar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2005 at 04:08 AM

    Hello Shankar,

    I guess you want to delete the line from the list directly, am I correct?

    If yes, then you can have a button on the toolbar in the list. When the user selects a line and clicks that button, the line will get deleted.

    Now, what has to be known is, do you want the line to be deleted only from the list, or from the internal table in the program also?

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Shankar,

      I have also given you a code for that. The first one that have given you will leave those blank lines on the output and it doesn't look all that <i>neat</i>, as you would call it.

      But please refer to my next post, hwere the blank lines will no longer be visible.

      Regards,

      Anand Mandalika.

  • Posted on Feb 01, 2005 at 07:32 AM

    Great solution Anand !

    -skip <b>to</b>- (never heard), we all can learn from you !

    My solution for such a problem is different:

    I'll try to filter data, which is not required before output / appending table.

    e.g.

    Loop at itab1.

    If itab1-qty = 0.

    Delete itab1.

    else.

    Append sth to itab2.

    Endif.

    Endloop.

    regards Andreas

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Andreas,

      Firstly, I must thank you that you have liked the SKIP TO method.

      Secondly, your solution , I'm afraid is not exactly appropriate in this case. I shall try to explain it to you.

      Let us say you have two internal tables, one with (Material, Material Type) and the other with (Material, Material Description). You want to have a list with three fields : Material , Material Type , Material Description.

      Now obviously, this is some kind of a join operation that we want on the <i>internal tables</i>. Here, you would have to fill another internal table by looping at these two internal tables. Then you will loop at the final internal table and display the entries.

      The point here is performance: You have to loop at the two internal tables anyways. Why do we need to fill another internal table in the process and then use that to display the data? Especially when the entries get large, this might be significant.

      Moreover, when the user does not have to change anything on the list, we do not even have to worry about deleting the entries in the internal table, since they are not going to be used further in the program.

      But there is the other side to it as well. Your solution, I must admit, is more intuitive than mine. The logic is fairly simple to understand. If a programmer is not comfortable with the SKIP statement, then he's going to have a very difficult time debugging in case there are any errors :-).

      Regards,

      Anand Mandalika.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.