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

to stop repeating

hi guys.....i have a requirement as below

my output is as per the database

example:

doc: ' tax1 ' tax2 ' tax3..........'taxn

009 ' 1% ' 0 ' 0............'..

009 ' 0 ' 2% ' 0............'...

009 ' 0 ' 0 ' 3%.........'....

the same document number has three different taxes or even more

so the requirement is to print all the taxes in one row for given document number

example:

<b>docno: tax1 tax2 tax3..........taxn

009 1% 2% 3% ............n%</b>

thank you in advance

Vikram.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2007 at 04:36 PM

    Hi Vikram,

    do like this

    data: wa1 like line of wa,
            lv_lines type i,
            cnt type i.
    descibe table itab lines lv_lines.
    loop at itab into wa.
     cnt = cnt + 1.
     if wa-doc = wa1-doc.
      delete itab from wa.
      modify itab from wa.
     endif.
     if cnt = lv_lines.
      xit.
     endif.
    wa1 = wa.
    endloop.

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 10:12 PM

    Create a table, copy of your itab, and then:

    LOOP AT itab1.
      ON CHANGE OF itab1-doc.
    * // This restart the cycle
         l_counter = 0.
      ENDON.
      l_counter = l_counter + 1.
      CONCATENATE 'TAX' l_counter INTO l_field.
      ASSIGN COMPONENT l_field OF STRUCTURE itab1 TO <field1>.
      IF sy-subrc NE 0.
    * // Lines of DOC finished or components finished.
        APPEND wa TO itab2.
        CONTINUE.    
      ENDIF.
      ASSIGN COMPONENT l_field OF STRUCTURE wa    TO <field2>.
      IF sy-subrc NE 0.
        APPEND wa TO itab2.
        CONTINUE.
      ENDIF.
      IF <field1> IS NOT INITIAL.
        <field2> = <field1>.
      ENDIF.
    ENDLOOP.
    

    Hope this helps.

    R.

    Add a comment
    10|10000 characters needed characters exceeded

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.