2007 Mar 13 9:42 AM
Hi,
I m working on ALV. I have to show the few colums in first display, then the user will select the column from the list and then iwill display the other columns.
I m using 'no_output' for hiding the few columns, but when user selects from the list then the values in those column is incorrect. In some cases it is repeating the earlier values.
Field sequence and the internal field table sequence is correct.
Also in debugging I can see correct values in the all fields.
So is there any other way to hide and then display with correct content ?
Many thanks.
- Umesh.
Hi,
I m working on ALV. I have to show the few colums in first display, then the user will select the column from the list and then iwill display the other columns.
I m using 'no_output' for hiding the few columns, but when user selects from the list then the values in those column is incorrect. In some cases it is repeating the earlier values.
Field sequence and the internal field table sequence is correct.
Also in debugging I can see correct values in the all fields.
So is there any other way to hide and then display with correct content ?
Many thanks.
- Umesh.
2007 Mar 13 9:46 AM
Hi Umesh,
Good!!!
These are usefule links which should your problem.
http://www.erpgenie.com/sapgenie/docs/Using%20ALV.pdf
http://help.sap.com/saphelp_erp2004/helpdata/en/17/102896f24311d2b487006094192fe3/content.htm
Good luck and reward points for the same
Thanks
AK
2007 Mar 13 9:47 AM
Hello Umesh,
The way u r doing to hide the fields is correct <b>NO_OUT = 'X'</b>.
Check the itab before u r passing to ALV FM whether u r filling data again to the table.
Otherwise u can make the option of using the Display Variant so that the user can change the layout as if he wants.
USe this code
DATA : g_r_disp_variant TYPE disvariant.
SELECTION-SCREEN BEGIN OF BLOCK variant WITH FRAME TITLE text-003.
PARAMETERS: p_varian LIKE disvariant-variant DEFAULT '/STANDARD'.
SELECTION-SCREEN END OF BLOCK variant.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varian.
PERFORM show_existing_display_variants.
*&---------------------------------------------------------------------
*
*& Form SHOW_EXISTING_DISPLAY_VARIANTS
*&---------------------------------------------------------------------
*
* text
*----------------------------------------------------------------------
*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------
*
FORM show_existing_display_variants.
g_r_disp_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_r_disp_variant
i_save = 'A'
IMPORTING
es_variant = g_r_disp_variant
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
p_varian = g_r_disp_variant-variant.
ENDIF.
ENDFORM. " SHOW_EXISTING_DISPLAY_VARIANTS
*form get_output
g_repid = sy-repid.
* display variant
g_r_disp_variant-report = sy-repid.
IF NOT p_varian IS INITIAL.
g_r_disp_variant-variant = p_varian.
ENDIF.
*get_output
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_grid_title = 'PRICE COMPARISON REPORT:'
is_layout = it_layout
it_fieldcat = it_fldcat
is_variant = g_r_disp_variant
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = g_t_itab_alv
EXCEPTIONS
program_error = 1
OTHERS = 2.
Please reward if helps.
Thanks,
Vasanth
2007 Mar 13 9:56 AM
Hi...
Thanks for the quick replies.
I have already used the display layout variant.
But still it is not working.
Even in the internal table which is finally i m passing populated correctly.
Thanks...
Umesh
2007 Mar 13 10:03 AM
2007 Mar 13 10:09 AM
Hello Umesh Lohar,
If you want to remove the field permanently, even user should not be able to see while changing layout
use tech field of fieldcatalog and it should be 'X' in order to not to display it to user even while changing layout.
Hope that helps.
Regards
Kapadia
***Assigning points is the way to say thanks in SDN.***
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |