Application Development and Automation 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: 
Read only

problems with ALV report

Former Member
0 Likes
555

Hello,

I have a report that is showing data by company code and vendor number. I have the file sorted by company code and vendor number. when I run the report for 1 company, the company code prints on the first line.all of the other lines have the company code blank. but about halfway down the report, the same company code prints again on 1 line and from there to the end the company code is blank. I would expect that only the first line would have the company code and all others would be blank. Also for the total line on a vendor break, the vendor number is appearing in 1 of the total lines. all of the other total lines have blanks in the vendor number field. When I run the report with different parameters, the 2 issues appear on different lines. I did line counts and vendor counts to see if there was a pattern but I could not find any. I have looked at my code and I am not sure what is causing this printing problem.

thanks in advance for the help

5 REPLIES 5
Read only

Former Member
0 Likes
530

perhaps put you'r code here otherwise it's hard guessing

does the company code perhaps exists more than once in the system. so for example the company 1000 is first shows for salesorg 1100 and after the second line for another salesorg ??

Message was edited by:

A. de Smidt

Read only

0 Likes
530

I am fine with the blanks appearing on the report. I want to know why the same company code appears further down in the report. I would think that the company code would blank until a new company code appears in the output file.

Read only

Former Member
0 Likes
530

Do you have a subtotal defined for a field that is not output?

Rob

Read only

0 Likes
530

I am attaching the code that I used. I think that this is the only place where you define subtotals.

c_check = 'X'.

FORM sort_output CHANGING p_it_alv_sort TYPE slis_t_sortinfo_alv.

  • Local data declaration

DATA: wa_alv_sort TYPE slis_sortinfo_alv.

  • First Sorting Parameters for Company.

wa_alv_sort-spos = 1.

wa_alv_sort-fieldname = 'BUKRS'.

wa_alv_sort-tabname = 'IT_OUTDATA'.

wa_alv_sort-up = c_check.

<b>wa_alv_sort-subtot = c_check.</b> APPEND wa_alv_sort TO p_it_alv_sort.

CLEAR wa_alv_sort.

  • Second Sorting Parameters for Vendor No.

wa_alv_sort-spos = 2.

wa_alv_sort-fieldname = 'LIFNR'.

wa_alv_sort-tabname = 'IT_OUTDATA'.

wa_alv_sort-up = c_check.

<b>wa_alv_sort-subtot = c_check</b>.

APPEND wa_alv_sort TO p_it_alv_sort.

CLEAR wa_alv_sort.

ENDFORM. "sort_output

Read only

0 Likes
530

sorry for the typ-o . the append line in the first group should be on the next line. similar to the second group.