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

ALV Question

Former Member
0 Likes
1,197

Hey All,

I am trying to develop a report to display the planned order requirements for a few weeks and then the subsequent months after that. The output is in ALV grid format. Now the problem is that the number of weeks to displayed varies and it is dependent on the date on which the report is run, so that it end before the subsequent month starts.

I am using:

CALL METHOD v_alv_tree->set_table_for_first_display

EXPORTING

is_variant = wa_variant

i_save = c_save

is_hierarchy_header = wa_hierarchy_header

it_list_commentary = i_list_commentary

i_logo = c_pepsico_logo

CHANGING

it_outtab = i_output1[]

it_fieldcatalog = i_fieldcat[].

Say for example if the total columns is 30, depending on the date columns 12 or/and 13 or/and 14 should not be displayed.

I have added a logic to change the field catalog based on the date.

But the output still shows all the data as i am not changing the output tab.

How can i acheive this? Do I have to use dynamic tables, or is there a easier way?

Thanks

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,077

In field catalog don't use NO_OUT field but activate TECH field for the week not to display to insure the column are hidden and not displayable through a variant action. You may also bypass ALV buffer.

Regards

9 REPLIES 9
Read only

Former Member
0 Likes
1,077

You can do that using fieldcatalog. may be some where you are doing the mistake in building the fieldcatalog.

you can do that using Dynamic Tables also.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,078

In field catalog don't use NO_OUT field but activate TECH field for the week not to display to insure the column are hidden and not displayable through a variant action. You may also bypass ALV buffer.

Regards

Read only

0 Likes
1,077

Thank you for your suggestions.

Raymond, How do i use the TECH field to not display the column, Maybe i am taking the wrong approch here. The modification i did was to not populate the particular week columns in the field catalog which should not be displayed.

I am doing something like this:

form f_build_field catalog.

Loop for week

if date > v_date

exit.

fill the field catalog

Endloop.

Loop for month

fill the field catalog

Endloop.

How do we create dynamic field catalog??

Read only

0 Likes
1,077
Loop for month

fill the field catalog

Endloop.

how many months you are looping and...what is the condition to exclude them from layout.

Read only

0 Likes
1,077

The total display is for one year.

So if i run the report on 1st jan it should show sixteen weeks and the 8 months

but if i run on 7th it should show 15 weeks and 8 months

and like wise....

Months are fixed. ie I have to show 8 months of requirement

Read only

0 Likes
1,077

Keep each and every field in the catalog, just set fieldcat-tech = 'X' for field you don't want to be displayed.

ALV do some buffering, not referencing field in fieldcatalog may be insufficient, in peculiar if user select a ALV display variant, use also parameter I_BYPASSING_BUFFER to 'X'.

Regards.

Read only

0 Likes
1,077

Hi Aparna,

Below is the sample code for the dynamic field catalog.


    concatenate:
                  'KST00' c_count  into l_field_qty.
 assign:
                component l_field_qty of structure w_keph to <fs>.
              w_keph-kst001 = w_keph-kst001 + <fs>.

&*******Reward Point if helpful**********&

Read only

Former Member
0 Likes
1,077

Hi Aparna,

Create a dynamic field catalog . It will solve your problem

Read only

Former Member
0 Likes
1,077

Closing Thread