Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

about collect, sy-uline, colors and new-page.

Hello experts,

I just have a couple of questions for my report. Below is my code to display the results of the report that I am doing. I just did this manually instead of ALV since I think this cannot be done in ALV display. Now, here are my questions:

1. I want to use collect statement rather that add. How can I do this?

2. How can I limit the size of sy-uline?

3. what are the 'standard colors' that you guys use for results?

4. in my code, I want to seperate display for every new functional location. Is my declaration of new-page right?

SORT it_finaltab BY funcloc asset_dum DESCENDING

asset DESCENDING parent DESCENDING.

DATA: v_color TYPE i VALUE 1,

v_subtot(1),

v_total(1),

subtot LIKE anlc-kansw,

total LIKE anlc-kansw,

v_old LIKE iloa-tplnr,

v_new LIKE iloa-tplnr.

LOOP AT it_finaltab.

AT END OF asset_dum.

v_subtot = 1.

ENDAT.

AT END OF funcloc.

v_total = 1.

ENDAT.

v_new = it_finaltab-funcloc.

IF v_new <> v_old AND NOT v_old IS INITIAL.

NEW-PAGE.

ENDIF.

v_old = v_new.

IF v_color = 1.

v_color = 2.

ELSE.

v_color = 1.

ENDIF.

FORMAT INTENSIFIED OFF COLOR = v_color.

WRITE: / sy-vline,

(12) it_finaltab-asset CENTERED,

(12) it_finaltab-parent CENTERED,

(40) it_finaltab-description CENTERED,

(40) it_finaltab-location CENTERED,

(20) it_finaltab-asset_book_val CENTERED, sy-vline.

ADD: it_finaltab-asset_book_val TO subtot,

it_finaltab-asset_book_val TO total.

IF v_subtot = 1.

CLEAR v_subtot.

FORMAT COLOR COL_TOTAL.

WRITE: / sy-vline,

'*Subtotal', AT 111(20) subtot CENTERED,

sy-vline.

CLEAR subtot.

FORMAT COLOR OFF.

ENDIF.

IF v_total = 1.

CLEAR v_total.

FORMAT COLOR COL_TOTAL INTENSIFIED ON.

WRITE: / sy-vline,

'**total', AT 111(20) total CENTERED,

sy-vline,

sy-uline.

CLEAR total.

FORMAT COLOR OFF.

ENDIF.

FORMAT COLOR OFF.

ENDLOOP.

Again, thank you guys and have a nice day!

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question