2008 Dec 07 5:24 AM
Hi All,
I am developing an ALV report which consists of few fields of a database table.
I am using the LVC_FIELDCATALOG_MERGE function to build the field structure of the ALV report.
I have declared an internal table in my program of type lvc_t_fcat. I call the LVC_FIELDCATALOG_MERGE function and pass the database table name to this function module. I build the output structure of this table in my internal table of type lvc_t_fcat.
I have another internal table of type lvc_t_fcat to which I pass the fields that are to be deleted.
Now when I use the delete statement to delete the fields from internal table1 with the fields that are in internal table2, I am getting a short dump.
Please could someone help me out with this.
I do not want to create another structure in the database and pass it to LVC_FIELDCATALOG_MERGE as it will create an additional load on the database.
Regards,
Sushanth H.S.
2008 Dec 07 6:51 AM
Hi Sushanth,
You cannot use the Delete statement in this way ...DELETE Itab from Itab1...it gives you the Short Dump.
Either loop the Fieldcat table and delete the rows which you don't want to display in the ALV...
Or
Set the NO_OUT = 'X' for the coloums in the Fieldcat whch you don't want to display in the ALV...
Hi All,
I am developing an ALV report which consists of few fields of a database table.
I am using the LVC_FIELDCATALOG_MERGE function to build the field structure of the ALV report.
I have declared an internal table in my program of type lvc_t_fcat. I call the LVC_FIELDCATALOG_MERGE function and pass the database table name to this function module. I build the output structure of this table in my internal table of type lvc_t_fcat.
I have another internal table of type lvc_t_fcat to which I pass the fields that are to be deleted.
Now when I use the delete statement to delete the fields from internal table1 with the fields that are in internal table2, I am getting a short dump.
Please could someone help me out with this.
I do not want to create another structure in the database and pass it to LVC_FIELDCATALOG_MERGE as it will create an additional load on the database.
Regards,
Sushanth H.S.
2008 Dec 07 6:35 AM
Hi Sushanth
Instead of doing this you can directly remove the fields which you don`t want in your Fieclcat .
Suppose all your fields are in it_fielcat ,then you directly delete and add more fields in your fieldcatlog
by looping or using delete itab where condition.
Regards
Neha
2008 Dec 07 6:51 AM
Hi Sushanth,
You cannot use the Delete statement in this way ...DELETE Itab from Itab1...it gives you the Short Dump.
Either loop the Fieldcat table and delete the rows which you don't want to display in the ALV...
Or
Set the NO_OUT = 'X' for the coloums in the Fieldcat whch you don't want to display in the ALV...
2008 Dec 07 10:32 AM
Hi Neha .& Avinash,
I do not want to loop at my field-catalog internal table and delete the fields based on the where condition because there are around 10 fields that have to be deleted and if the delete statement has to be executed 10 times for 10 fields that have to be deleted, the performance of the program will be affected considerably .
By setting NO_OUT = 'X' in the field-catalog, the fields will not be displayed in the ALV but they will be available in the field list, so the user can always bring these fields back to the ALV. So I want to delete these fields from the ALV fieldcatalog itself.
So please do let me know if there is any other solution for the problem.Thanks for your help.
Regards,
Sushanth H.S.
Edited by: Sushanth Srinivas on Dec 7, 2008 11:32 AM
2008 Dec 07 10:40 AM
Than use FM GET_COMPONENT_LIST and get all field in internal table and delete the filed with looping the table with where condition.
For sample code do where-used-list for FM.
2008 Dec 07 4:07 PM
Hi Amit,
I do not want to loop at every field of an internal table and delete it because that will affect the performance of the program.
Please suggest me an alternate solution for the same.
Regards,
Sushanth H.S.
2008 Dec 07 4:58 PM
Okay,
Than use FM which i suggest you and get All field name i internal table and for deleting use Read itab with key COMPNAME = '<Fieldname>'.
if sy-subrc = 0.
Delete itab index sy-tabix.
endif.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |