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

Grouping the fields

Dsk
Active Contributor
0 Likes
863

1. I have the below fields in my internal table

SAles order no

Sales order item no

Billing no

Billing item no

sample data

Sales order Sales order item billing NO Billing item

100 10 12 1

2

3

2.My requirement :

2.1 - i am displaying in an ALV Output

2.2 - when i display the output i see the values for sales order 100 in all the line items

2.3 - i need to know if we can use some group feature..

this is a sample test case ..if i get the logic i can apply on my real report..

Note :I am new to ABAP

reg

dsk

7 REPLIES 7
Read only

Former Member
0 Likes
831

Hi,

You have two options:

1) Take another internal table with a similar structure to that of your final ALV o/p table and delete duplicates comparing sales order no. Then a third internal table to populate your values comparing these both tables.

2) Sort the report & subtotal it on order value or invoice value so that you see order number only in the 1st line item and others for the same order remain blank.

In both cases there's a hitch. In scenarios like multiple deliveries & invoices pls test the report as compared to normal scenarios we have one sales order with one delivery & one invoice.

Regards,

Amit

Read only

Dsk
Active Contributor
0 Likes
831

SAMPLE DATA IN DETAIL:

1. Actually i noticed the sample data has collapsed..

2. The real strucuture is like below

Sales order Sales orderitem billing NO Billing item

100 xxxxxxxx10xxxxxxxxxxx 12xxxxxxxx 1

100 xxxxxxxx10xxxxxxxxxxx 12xxxxxxxx 2

100 xxxxxxxx10xxxxxxxxxxx 12xxxxxxxx 3

100 xxxxxxxx10xxxxxxxxxxx 12xxxxxxxx 4

Note: 'x' is onlyfor representing the space

3. In this case in my output i dont want to show the sales order / item and billing no ..for all lines i want to show it only

in my first line.

sorry for the trouble

reg

dsk

Edited by: Dhandapani Satheeshkumar on Jul 28, 2009 11:49 AM

Read only

Former Member
0 Likes
831

In this case, say you have these data in Internal Table IT1. First Sort these data in ascendig order by Sales order, Sales orderitem, billing NO. Now Loop at these table and use the concept of ON CHANGE ON billing NO ..... else ... ENDON. Inside the ON CHANGE ON loop, append the records the in other internal table say IT2 having same structure IT1 and pass it the ALV to display.

Hope this will solve your problem.

Read only

Dsk
Active Contributor
0 Likes
831

sumesh,

1. Thanks for your response.

2. I will try the ON CHANGE ON - concept and will update you the results.

Thanks in advance.

Satheesh

Read only

Former Member
0 Likes
831

Hi,

Please use separate internals tables to fetch order & Billing data for header as well line items details respectively.

like I_VBAK, I_VBAP, I_VBRK, I_VBRP.

For final output create a final table with all the fields you want to display like I_FINAL.

Finally within the loop for I_VBAK, you can read all other internals tables and append the required values into I_FINAL table.

Thats it.

Hope it is clear to you.

Regds,

Anil

Read only

Dsk
Active Contributor
0 Likes
831

Anil and amit.

1. thanks for your reply.

2.Currently also i am doing the same "logic" but what happens in the output i am seeing my order no and few other fields for all the lines of billing lines..

3. My requirement is to show the sales order no, customer no etc only in my first line..i need your expertise in the final display in the output.

tahnks in advance

sathees

Read only

Dsk
Active Contributor
0 Likes
831

closed