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

Help For Module pool application for ALV

Former Member
0 Likes
433

Hi All

I have a requirement of displaying an ALV grid on a module pool screen. The selection for the data is based on period (e.g. Jan-2013 to June-2013, etc), material number, plant and customer number. In case the user wishes to execute the report without the customer number then the report should display the data for all customers.

At the output, it is required to have a total for all customers at the first three rows and following this a split up per customer.

Partner No.

Name

Country

Plant

  1. charact.

Totals

period1

period2

period3

period4

period5

period6

period7

period8

period9

period10

period11

period12

Total FC

Total Sales

total open Qty

10053

xyz

UK

UK01

Total FC

Total Sales

total open Qty

The data is fetched into the internal table from database depending upon the material plant and customer. The structure of the internal table is:

GT_S712

VRSIO

SPMON

KUNNR

MATNR

WERKS

CS

OAUWE

A00

201101

10053

100256

AB01

500

0

000

201101

10053

100256

AB01

1000

560

000

201102

10053

100256

AB01

250

0

A00

201103

10053

100256

AB01

750

0

000

201104

10054

100256

AB01

700

500

000

201105

10054

100256

AB01

100

0

User can execute the report for any duration of time (e.g. 01-Jan-2011 to 31-Dec-2011, 01-June-2011 to 31-Dec-2011, 01-Jan-2011 to 31-Dec-2012, etc).

I am currently having 2 issues.

Issue 1: when the user executes the report for the period of Jan to Dec of the year.

In this case the internal table GT_S722 i get the data for the period of 12 months. To display this at output, Total FC is sum of CS field for the customer for that particular material for the period where version is 000. Total Actual sales is sum of CS field for the customer for that particular material for the period where version is A00. And total Open Qty. is sum of OAUWE field in similar manner.

The issue I am facing is how to transfer the data from this internal table to the final internal table for display? In case the user executes the report from Jan to Dec then the value for month of Jan goes into the perion01, feb value goes into period02 and so on. In case user executes the report from June to Dec then the value of June goes into period01, July in period02 and so on.

The problem is how do i achieve this?

Issue 2: When user executes the report for a period of Jan-2011 to Dec-2012 (i.e. more than 12 months span).

In this case it is required that I provide buttons for scrolling. 3 buttons for scrolling ahead and 3 buttons for scrolling back.

Initially we are required to display for only 12 one month. If the user one new period then the first column data is removed and the data of 13th month appears at the last and so on.

How do i do this?

Thanks in advance!!

Gaurav Gupta

2 REPLIES 2
Read only

Former Member
0 Likes
391

Hi Gaurav,

Please search before posting....

This can be achieved by Dynamic programming of ALV an processing the data in right manner.

For month based posting there is a very nicely explained blog by 

have alook I hope it helps

Read only

Former Member
0 Likes
391

Hi Gaurav,

As Mohammad said,dynamic ALV will achieve it.

For your second issue,make

Partner No.

Name

Country

Plant

  1. charact.

Totals

as key fields while preparing field catalog.Now,scrolling functionality will achieve it.You don't need to add 3 buttons n all....

Regards,

Abdul.