2009 Jul 02 4:36 AM
May be it is a bit silly,
but i want like to ask whether I can create self reference type
other than using objects
TYPES: BEGIN OF sub_struc,
col1 TYPE c LENGTH 10,
col2 TYPE c LENGTH 10,
col3 TYPE sub_struc,
END OF sub_struc.
Thanks in advance
Edited by: David Tai on Jul 2, 2009 5:36 AM
2009 Jul 02 4:41 AM
Hi
This is allowed in ABAP .
2009 Jul 02 4:41 AM
2009 Jul 02 4:50 AM
Thx first, Martina
But may i know the actual coding.
for the above sample code,
TYPES: BEGIN OF sub_struc,
col1 TYPE c LENGTH 10,
col2 TYPE c LENGTH 10,
col3 TYPE sub_struc,
END OF sub_struc.
i will get a error on col3 said type is unknown
Thx
2009 Jul 02 5:01 AM
Hi
I jus copied the same code . Its not showing any error for me .
Can you send the code and error msg as it is in the report ?
2009 Jul 02 5:13 AM
Thanks. It works.
Originally my code is
TYPES: BEGIN OF TY_ORG_UNIT,
OBJID TYPE HROBJID,
SUB_ORG TYPE TY_ORG_UNIT,
END OF TY_ORG_UNIT.
But once, i change the name TY_ORG_UNIT to ORG_UNIT, it pass the check
So i still don't know why is failed when the name is TY_ORG_UNIT
and i also try to change the name to ORGUNIT , it also failed...
Edited by: David Tai on Jul 2, 2009 6:14 AM
2009 Jul 02 5:37 AM
Hi David,
I checked the code what you have given it will not give any syntax error in ECC6.0 but if you use the same in the ECC5 then the syntax error occurs as you said TYPE SUB_STRUC unknown , so i think this is implemented in ECC6.0 but not in the older version of SAP.
when you are changing the code of the report program structure to org_unit it is a dictiionary type which is allowed but when you change it to the structure which is not declared completely it is not working in ECC5 just try to check in dictionary whether the type org_unit is existing or not?
Regards
Sarves
2009 Jul 02 5:41 AM
Hi David
Actually if u give org_unit in se12 in dataelement u can see its there .But ty_org_unit is not a data element / table or its nothing in sap. So it shows error .
Whereas both org_unit (data elemnt ) and sub_struc (structure) are componenets of data dictionary .
hope u get my point
2009 Jul 02 5:47 AM
Really thanks both of you !
I got it. Thanks for your explanations
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |