SAP COSPA_KEY Key fields from COSPA Table data and field list

COSPA_KEY is a standard SAP Structure so does not store data like a database table does. It can be used to define the fields of other actual tables or to process "Key fields from COSPA" Information within sap ABAP programs.

This is done by declaring abap internal tables, work areas or database tables based on this Structure. These can then be used to store and process the required data appropriately.

i.e. DATA: wa_COSPA_KEY TYPE COSPA_KEY.

The COSPA_KEY table consists of various fields, each holding specific information or linking keys about Key fields from COSPA data available in SAP. These include OBJNR (Object number), GJAHR (Fiscal Year), WRTTP (Value Type), VERSN (Version)... See below for full list along with technical details, documentation, text table, check tables, foreign key relationships, conversion routines, relevant tcodes and example ABAP select code etc. .

COSPA_KEY structure Technical Details:

Delivery Class:
Display/Maintenance via tcode SM30: Display/Maintenance Allowed but with Restrictions
SAP enhancement categories: Can be enhanced (character-type)


SAP COSPA_KEY structure fields - Full list of fields found in SAP data dictionary

Looking for S/4HANA specific information? Click here to explore the details, fields and extensibility available for this table in the SAP S/4HANA version of the COSPA_KEY table. Also check whether the table still exists or has been transformed into a CDS view as part of the HANA simplifications.
Field Description Data Element Data Type length (Dec) Check table Conversion Routine Domain Name MemoryID SHLP
LEDNRLedger for Controlling objects LEDNRCHAR2ALPHALEDNR
OBJNRObject number J_OBJNRCHAR22Assigned to domainJ_OBJNRONR
GJAHRFiscal Year GJAHRNUMC4GJAHRGJAHRGJR
WRTTPValue Type CO_WRTTPCHAR2CO_WRTTP
VERSNVersion VERSNCHAR3Assigned to domainALPHACOVERSIKVS
KSTARCost Element KSTARCHAR10Assigned to domainALPHAKSTARKAT
HRKFTCO key subnumber CO_SUBKEYCHAR14Assigned to domainCO_SUBKEY
VRGNGCO Business Transaction CO_VORGANGCHAR4Assigned to domainJ_VORGANG
VBUNDCompany ID of trading partner RASSCCHAR6Assigned to domainALPHARCOMPPGS
PARGBTrading partner's business area PARGBCHAR4Assigned to domainGSBERGSB
BEKNZDebit/credit indicator BEKNZCHAR1BEKNZBEKNZ
TWAERTransaction Currency TWAERCUKY5Assigned to domainWAERSFWS

Key field Non-key field



How do I retrieve data from SAP structure COSPA_KEY using ABAP code?

As COSPA_KEY is a database structure and not a table it does not store any data in the SAP data dictionary. The ABAP SELECT statement is therefore not appropriate and can not be performed on COSPA_KEY as there is no data to select.

How to access SAP table COSPA_KEY

Within an ECC or HANA version of SAP you can also view further information about COSPA_KEY and the data within it using relevant transactions such as

SE11 (ABAP Dictionary Maintenance)
SM30 (Maintain Table Data)
SE80 (Object Navigator)
SE16 (Data Browser).