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

Report Display Issue

Hi All,

I have a problem in displaying the output which matl no,matl desc and qty.here for the same matl the qty are 10,20,20,40,50,60,70,80 etc.But i want to display theout put like MATL NO MATL DESC 10 20 30 40 50 and in the next line 60 70 80 90 53

65 43 82 79 25 like this.pls give me solution for this.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 08:56 AM

    Hi Rajendra

    Have taken Naren's Code to enable for 50 entries and split in 10 lines of 5 entries each. Please check the below code.

    DATA: BEGIN OF ITAB OCCURS 0,
            MATNR TYPE CHAR4,
            QTY TYPE INT4,
          END OF ITAB.
    
    DATA: WA LIKE ITAB.
    
    ITAB-MATNR = 'ABC'.
    
    DO 50 TIMES.
    
      ITAB-QTY = SY-INDEX.
    
      APPEND ITAB.
    
    ENDDO.
    
    ITAB-MATNR = 'ABC1'.
    
    DO 50 TIMES.
    
      ITAB-QTY = SY-INDEX * 2.
    
      APPEND ITAB.
    
    ENDDO.
    
    
    SORT ITAB BY MATNR.
    
    DATA: V_INT TYPE INT4.
    
    LOOP AT ITAB.
    
      WA = ITAB.
    
      AT NEW MATNR.
    
        V_INT = 1.
        WRITE:/ WA-MATNR.
    
      ENDAT.
    
      IF V_INT >= 1 AND V_INT < 6.
    
        WRITE: WA-QTY.
    
      ELSE.
    
        WRITE: /5 WA-QTY.
    
        V_INT = 1.
    
      ENDIF.
    
      V_INT = V_INT + 1.
    
    ENDLOOP.

    You can try copying the above code to a temporary program for having a better feel and see that your program incorporates similar kinda logic.

    If you still face problem, maybe you can post your code, which can help identifying if there is any problem.

    Hope Naren wouldnt mind using his code.

    Kind Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 04:25 AM

    Hi,

    Check this sample code..I tested it..

    DATA: BEGIN OF ITAB OCCURS 0,

    MATNR TYPE CHAR4,

    QTY TYPE INT4,

    END OF ITAB.

    DATA: WA LIKE ITAB.

    ITAB-MATNR = 'ABC'.

    DO 16 TIMES.

    ITAB-QTY = SY-INDEX.

    APPEND ITAB.

    ENDDO.

    ITAB-MATNR = 'ABC1'.

    DO 16 TIMES.

    ITAB-QTY = SY-INDEX.

    APPEND ITAB.

    ENDDO.

    SORT ITAB BY MATNR.

    DATA: V_INT TYPE INT4.

    LOOP AT ITAB.

    WA = ITAB.

    AT NEW MATNR.

    WRITE:/ WA-MATNR.

    ENDAT.

    V_INT = V_INT + 1.

    IF V_INT >= 1 AND V_INT < 6.

    WRITE: WA-QTY.

    ELSE.

    WRITE: /5 WA-QTY.

    CLEAR: V_INT.

    ENDIF.

    AT END OF MATNR.

    CLEAR: V_INT.

    ENDAT.

    ENDLOOP.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 04:12 AM

    Hi,

    Check this..

    Assuming your internal table declaration is like this..

    DATA: BEGIN OF ITAB OCCURS 0,

    MATNR TYPE MATNR,

    MAKTX TYPE MAKTX,

    QTY TYPE MENGE,

    END OF ITAB.

    SORT ITAB BY MATNR.

    DATA: WA LIKE ITAB.

    LOOP AT ITAB.

    WA = ITAB.

    AT NEW MATNR.

    WRITE:/ WA-MATNR, WA-MAKTX.

    ENDAT.

    V_INT = V_INT + 1.

    IF V_INT > 1 AND V_INT < 6.

    WRITE: WA-QTY.

    ELSE.

    WRITE: / WA-QTY.

    CLEAR: V_INT.

    ENDIF.

    AT END OF MATNR.

    CLEAR: V_INT.

    ENDAT.

    ENDLOOP.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 07:01 AM

    Hi Naren,

    My Problem is solved almost still i want to display the second,third,fourth line below the qty only but now it is displaying under the matl no,matl desc( Means the second line starts under the first coulm it suppose to be starts at 3rd colum ie)under qty) and is it possible to do in ALV method if possible pls revert back me.

    Thanks,

    Raj.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      For me the first line is ok with qty display in 5 colum,but in the second line the qty is more than 5,so it is not displaying in the third line after 5th colum.suppose the qty is 50 then the qty should display in 10 lines with each line should have only five qtys only.pls help me to solve.

      Thanks,

      Raj.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 08:36 AM

    Hi,

    For me the first line is ok with qty display in 5 colum,but in the second line the qty is more than 5,but it is not displaying in the third line after 5th colum.suppose the qty is 50 then the qty should display in 10 lines with each line should have only five qtys only.pls help me to solve.

    Thanks,

    Raj.

    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.