2007 Feb 26 4:11 PM
Dear Experts,
Please see the below report. While Debugging,after select query select query the control passes to the <b>CALL FUNCTION 'CONTROL_CHECK_WARNING_STATUS'</b> which is not used in my program and the message at status bar is <b>'the specified table name not</b> <b>recognised'</b> and also internal table (ig_ek)contains values after select query.When it has been executed the ALV doesn't contains any values.
REPORT zreport .
TYPES : BEGIN OF ig_ekt,
c1 TYPE zinfo6-zcol1,
c2 TYPE zinfo9-zcol2,
END OF ig_ekt.
data ig_ek type ig_ekt occurs 0.
DATA alv_list1 TYPE REF TO cl_gui_alv_grid.
SELECT zcol1 zcol2 FROM zinfo6 INTO TABLE ig_ek.
CREATE OBJECT alv_list1
EXPORTING i_parent = cl_gui_container=>screen0.
CALL METHOD alv_list1->set_table_for_first_display
EXPORTING
i_structure_name = 'ZInfo6'
CHANGING
it_outtab = ig_ek[].
CALL SCREEN 221.
I suspect the error has occured at declaration part of structure and internal table.
If it is so,Can any one write down the syntax for declaring an internal table which is of type structure.The structure contains fields come from more than one tables in abap objects programming?
Hope to get answers from SAP community,
Thanks,
Raj
2007 Feb 26 4:24 PM
Hello,
If the structure of ZINFO9 is same as IG_EKT1, then declare IG_EK as:-
DATA ig_ek type table of ZINFO9.
If the structure is different, then you need to create a FIELD CATALOG with same fields as your TYPE IG_EKT1. And pass this FIELD CATALOG to the Method to create ALV and not the structure name ZINFO9.
Regards,
Beejal
**reward if this helps
2007 Feb 26 4:16 PM
Hi,
Give structure name in capital letters
i_structure_name = 'ZINFO6'
Thanks,
Naren
2007 Feb 26 4:20 PM
Hi Naren,
Thanks for ur reply.
Even after changing the case of zinfo6, the problem is same.
Regards,
Raj
2007 Feb 26 4:24 PM
Hello,
If the structure of ZINFO9 is same as IG_EKT1, then declare IG_EK as:-
DATA ig_ek type table of ZINFO9.
If the structure is different, then you need to create a FIELD CATALOG with same fields as your TYPE IG_EKT1. And pass this FIELD CATALOG to the Method to create ALV and not the structure name ZINFO9.
Regards,
Beejal
**reward if this helps
2007 Feb 26 4:30 PM
2007 Feb 26 6:17 PM
Hi Beejal,
Below is the modified program as u said.
REPORT ZREPORT .
DATA: G_CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
alv_list1 TYPE REF TO cl_gui_alv_grid,
G_FCAT TYPE LVC_T_FCAT,
W_FCAT TYPE LVC_S_FCAT.
TYPES : BEGIN OF ig_ekt1,
c1 TYPE zinfo6-zcol1,
c2 TYPE zinfo9-zcol2,
END OF ig_ekt1.
data ig_ek type ig_ekt1 occurs 0.
start-of-selection.
SELECT zcol1 zcol2 FROM zinfo6 INTO TABLE ig_ek.
W_FCAT-FIELDNAME = 'zcol1'.
W_FCAT-TABNAME = 'zinfo6'.
W_FCAT-COLTEXT = 'COLUMN1'.
W_FCAT-OUTPUTLEN = '20'.
APPEND W_FCAT TO G_FCAT.
W_FCAT-FIELDNAME = 'zcol2'.
W_FCAT-TABNAME = 'zinfo6'.
W_FCAT-COLTEXT = 'COLUMN2'.
W_FCAT-OUTPUTLEN = '20'.
APPEND W_FCAT TO G_FCAT.
CREATE OBJECT alv_list1
EXPORTING i_parent = cl_gui_container=>screen0.
CALL METHOD alv_list1->set_table_for_first_display
CHANGING
it_outtab = ig_ek[]
IT_FIELDCATALOG = G_FCAT.
CALL SCREEN 221.
Still the final ALV shows empty fields.
Can u pls check it out?
I would be much happy if get back reply from u soon.
Thanks,
Raj bala
2007 Feb 26 6:29 PM
Hi
Try this:
W_FCAT-FIELDNAME = 'C1'.
W_FCAT-TABNAME = 'IG_EK'.
W_FCAT-REF_FIELD = 'ZCOL1'.
W_FCAT-REF_TABLE = 'ZINFO6'.
W_FCAT-COLTEXT = 'COLUMN1'.
W_FCAT-OUTPUTLEN = '20'.
APPEND W_FCAT TO G_FCAT.
W_FCAT-FIELDNAME = 'C2'.
W_FCAT-TABNAME = 'IG_EK'.
W_FCAT-REF_FIELD = 'ZCOL2'.
W_FCAT-REF_TABLE = 'ZINFO6'.
W_FCAT-COLTEXT = 'COLUMN2'.
W_FCAT-OUTPUTLEN = '20'.
APPEND W_FCAT TO G_FCAT.Max
2007 Feb 27 4:19 AM
Dear Max Bianchi,
Hearty thanks for ur reply.
This works good.
Thanks and Regards,
Raj Bala
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |