2007 Feb 02 8:31 PM
hi
when i changed my layout and saved some other columns/fields were also getting added which i have not selected and also some blank columns is also getting added upon and when i try to delete all those column by the option of selecting that particular field/column it s not getting deleted
how do i delete all those unwanted columns/fields
2007 Feb 02 8:38 PM
HI,
I believe u r giving the declared internal table to ALV to display. Internal table has extra columns which u dont want to display...
then u have to fill the field catalog manually with respected columns..
**************************
<b>DATA: BEGIN OF gt_final_outtab OCCURS 0,
matnr LIKE mara-matnr,
mtart like mara-mtart,
maktx LIKE makt-maktx,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
per_val TYPE p DECIMALS 4,
werks like mseg-werks,
END OF gt_final_outtab.</b>
<b>FORM get_fieldcat.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: pos TYPE i VALUE 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 18.
ls_fieldcat-seltext_l = 'Material Number'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MAKTX'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_l = 'Product Description'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MENGE'.
ls_fieldcat-outputlen = 15.
ls_fieldcat-seltext_l = 'Lbs Shipped'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MEINS'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-seltext_l = 'QTY'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. " get_fieldcat
----
FORM show_report.
PERFORM get_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
it_fieldcat = gt_fieldcat[]
i_save = 'A'
TABLES
t_outtab = gt_final_outtab.
ENDFORM. " Show_report</b>
Regards
SAB
hey guys thanks for the response i got it resolved
2007 Feb 02 8:38 PM
HI,
I believe u r giving the declared internal table to ALV to display. Internal table has extra columns which u dont want to display...
then u have to fill the field catalog manually with respected columns..
**************************
<b>DATA: BEGIN OF gt_final_outtab OCCURS 0,
matnr LIKE mara-matnr,
mtart like mara-mtart,
maktx LIKE makt-maktx,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
per_val TYPE p DECIMALS 4,
werks like mseg-werks,
END OF gt_final_outtab.</b>
<b>FORM get_fieldcat.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: pos TYPE i VALUE 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 18.
ls_fieldcat-seltext_l = 'Material Number'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MAKTX'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-seltext_l = 'Product Description'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MENGE'.
ls_fieldcat-outputlen = 15.
ls_fieldcat-seltext_l = 'Lbs Shipped'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MEINS'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-seltext_l = 'QTY'.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. " get_fieldcat
----
FORM show_report.
PERFORM get_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
it_fieldcat = gt_fieldcat[]
i_save = 'A'
TABLES
t_outtab = gt_final_outtab.
ENDFORM. " Show_report</b>
Regards
SAB
2007 Feb 02 8:54 PM
Hi Vara,
Can you post the code of the field catalog.
Thanks
Vikranth Khimavath
2007 Feb 02 9:04 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |