‎2007 Jan 06 4:43 AM
Hi Everybody,
using Describe statement i can easily find No.of.line's of the internal table. But using Describe how to find out the No.of.colomns in the Internal Table.
thanks in advance..
‎2007 Jan 06 5:14 AM
TRY TO USE FM
DATA : BEGIN OF ITAB OCCURS 0,
CHK(1),
AUFNR LIKE AFKO-AUFNR,
END OF ITAB.
DATA ITAB3 LIKE RSTRUCINFO OCCURS 0 WITH HEADER LINE.
DATA : COL TYPE I.
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
PROGRAM = SY-REPID
FIELDNAME = 'ITAB'
TABLES
COMPONENTS = ITAB3
.
<NOW ITAB3 CONTAINS THE FIELD NAMES>
DESCRIBE TABLE ITAB3 LINES COL.
NOW COL CONTAINS THE NO OF COLUMN.
REGARDS
SHIBA DUTTA
‎2007 Jan 06 5:09 AM
Hi,
use describe field..
You can use the work area of the internal table to determine the number of columns..
Example
-
DATA: BEGIN OF WA,
MATNR,
WERKS,
KUNNR,
END OF WA.
DATA: V_COLUMNS TYPE INT4.
DESCRIBE FIELD wa COMPONENTS v_columns.
WRITE: / V_COLUMNS.
You can also check this link..
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3145358411d1829f0000e829fbfe/content.htm
Thanks,
Naren
‎2007 Jan 08 3:57 AM
Thanks Naren, But the code sends the following error.
Between "WA" and "COMPONENTS", "TYPE ..." is missing . (see HELP
COMPUTE). (see HELP COMPUTE). (see HELP COMPUTE). (see HELP COMPUTE).
(see HELP COMPUTE).
thanks in advance.
‎2007 Jan 06 5:14 AM
TRY TO USE FM
DATA : BEGIN OF ITAB OCCURS 0,
CHK(1),
AUFNR LIKE AFKO-AUFNR,
END OF ITAB.
DATA ITAB3 LIKE RSTRUCINFO OCCURS 0 WITH HEADER LINE.
DATA : COL TYPE I.
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
PROGRAM = SY-REPID
FIELDNAME = 'ITAB'
TABLES
COMPONENTS = ITAB3
.
<NOW ITAB3 CONTAINS THE FIELD NAMES>
DESCRIBE TABLE ITAB3 LINES COL.
NOW COL CONTAINS THE NO OF COLUMN.
REGARDS
SHIBA DUTTA
‎2007 Jan 08 4:10 AM
‎2007 Jan 06 7:54 AM
Dear Vijay,
Please go through the sample code in the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
Regards,
Abir
************************************
Don't forget to award Points *
‎2007 Jan 08 4:12 AM
data : ctype.
DESCRIBE field wa type ctype components LINE.
line must be int type.
try this
regards
shiba dutta