2010 Feb 19 9:49 AM
Hello everyone,
I'm having trouble with my ALV grid.
In my functiongroup i have a screen, in the PAI of that screen i have 3 flagvariables to display 3 different types of data.
In my PBO i check those flags and display the desired data.
Now, in each if statement i have:
IF container IS INITIAL.
CREATE OBJECT container
EXPORTING
container_name = 'CONTROL_AREA'.
CREATE OBJECT grid
EXPORTING
i_parent = container.
get fieldcatalog
PERFORM create_workitem_fieldcatalog.
CALL METHOD grid->set_table_for_first_display
EXPORTING
i_default = 'X'
CHANGING
it_outtab = lt_wrkitm
it_fieldcatalog = lt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
ELSE.
CALL METHOD grid->refresh_table_display.
ENDIF.
Now, my question is: is it possible to change the data and fieldcatalog in the alv during runtime.
I have twice the same structure, so that ain't the problem. But the third one has another structure and another fieldcatalog.
When i run the program, all the code works fine, but the output is still the initial one.
I tried to FREE container and grid and create a new alv to display the third option, still no luck.
I will give another overview of the problem.
Situation A: (1 and 2 has the same structure)
Option 1
option 2
option 3
chosing 1: display correct data
chosing 2: display correct data
chosing 3: display data of option 2
chosing 1:display correct data
Situation B: : (1 and 2 has the same structure)
Option 1
option 2
option 3
chosing 3: display correct data
chosing 2: display data of option 3
chosing 1: display data of option 3.
Hope you understand my problem and you're able to help me.
Greetings
Merijn.
Hello everyone,
I'm having trouble with my ALV grid.
In my functiongroup i have a screen, in the PAI of that screen i have 3 flagvariables to display 3 different types of data.
In my PBO i check those flags and display the desired data.
Now, in each if statement i have:
IF container IS INITIAL.
CREATE OBJECT container
EXPORTING
container_name = 'CONTROL_AREA'.
CREATE OBJECT grid
EXPORTING
i_parent = container.
get fieldcatalog
PERFORM create_workitem_fieldcatalog.
CALL METHOD grid->set_table_for_first_display
EXPORTING
i_default = 'X'
CHANGING
it_outtab = lt_wrkitm
it_fieldcatalog = lt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
ELSE.
CALL METHOD grid->refresh_table_display.
ENDIF.
Now, my question is: is it possible to change the data and fieldcatalog in the alv during runtime.
I have twice the same structure, so that ain't the problem. But the third one has another structure and another fieldcatalog.
When i run the program, all the code works fine, but the output is still the initial one.
I tried to FREE container and grid and create a new alv to display the third option, still no luck.
I will give another overview of the problem.
Situation A: (1 and 2 has the same structure)
Option 1
option 2
option 3
chosing 1: display correct data
chosing 2: display correct data
chosing 3: display data of option 2
chosing 1:display correct data
Situation B: : (1 and 2 has the same structure)
Option 1
option 2
option 3
chosing 3: display correct data
chosing 2: display data of option 3
chosing 1: display data of option 3.
Hope you understand my problem and you're able to help me.
Greetings
Merijn.
2010 Feb 19 10:30 AM
Hi,
i think we need ot create the field catalog also dynamically depending on the selections.
thanks,
teja.
2010 Feb 19 10:37 AM
Well, I found the solution...
I just didn't use the grid->refresh_table_display.
So i created the container and the grid object once and just used the set_table_for_first_display whenever i wanted to display the alv.
Hopefully my solution can help others.
Thanks anyway Teja
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |