abapgit-agent 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +1 -0
  2. package/abap/guidelines/00_index.md +36 -0
  3. package/abap/guidelines/01_sql.md +88 -0
  4. package/abap/guidelines/02_exceptions.md +176 -0
  5. package/abap/guidelines/03_testing.md +269 -0
  6. package/abap/guidelines/04_cds.md +136 -0
  7. package/abap/guidelines/05_classes.md +58 -0
  8. package/abap/guidelines/06_objects.md +110 -0
  9. package/abap/guidelines/07_json.md +24 -0
  10. package/abap/guidelines/08_abapgit.md +222 -0
  11. package/abap/guidelines/09_unit_testable_code.md +568 -0
  12. package/bin/abapgit-agent +513 -38
  13. package/bin/abgagt +24 -0
  14. package/package.json +8 -2
  15. package/src/abap-client.js +65 -2
  16. package/src/agent.js +57 -3
  17. package/src/config.js +1 -1
  18. package/src/ref-search.js +1037 -0
  19. package/.abapGitAgent.example +0 -11
  20. package/.github/workflows/release.yml +0 -60
  21. package/API.md +0 -710
  22. package/CLAUDE.md +0 -1058
  23. package/CLAUDE_MEM.md +0 -88
  24. package/ERROR_HANDLING.md +0 -30
  25. package/INSTALL.md +0 -155
  26. package/RELEASE_NOTES.md +0 -143
  27. package/abap/CLAUDE.md +0 -1010
  28. package/abap/copilot-instructions.md +0 -79
  29. package/abap/package.devc.xml +0 -10
  30. package/abap/zcl_abgagt_agent.clas.abap +0 -420
  31. package/abap/zcl_abgagt_agent.clas.xml +0 -15
  32. package/abap/zcl_abgagt_cmd_factory.clas.abap +0 -48
  33. package/abap/zcl_abgagt_cmd_factory.clas.xml +0 -15
  34. package/abap/zcl_abgagt_command_create.clas.abap +0 -95
  35. package/abap/zcl_abgagt_command_create.clas.xml +0 -15
  36. package/abap/zcl_abgagt_command_import.clas.abap +0 -138
  37. package/abap/zcl_abgagt_command_import.clas.xml +0 -15
  38. package/abap/zcl_abgagt_command_inspect.clas.abap +0 -456
  39. package/abap/zcl_abgagt_command_inspect.clas.testclasses.abap +0 -121
  40. package/abap/zcl_abgagt_command_inspect.clas.xml +0 -16
  41. package/abap/zcl_abgagt_command_preview.clas.abap +0 -386
  42. package/abap/zcl_abgagt_command_preview.clas.xml +0 -15
  43. package/abap/zcl_abgagt_command_pull.clas.abap +0 -80
  44. package/abap/zcl_abgagt_command_pull.clas.testclasses.abap +0 -87
  45. package/abap/zcl_abgagt_command_pull.clas.xml +0 -16
  46. package/abap/zcl_abgagt_command_tree.clas.abap +0 -237
  47. package/abap/zcl_abgagt_command_tree.clas.xml +0 -15
  48. package/abap/zcl_abgagt_command_unit.clas.abap +0 -297
  49. package/abap/zcl_abgagt_command_unit.clas.xml +0 -15
  50. package/abap/zcl_abgagt_command_view.clas.abap +0 -240
  51. package/abap/zcl_abgagt_command_view.clas.xml +0 -15
  52. package/abap/zcl_abgagt_resource_create.clas.abap +0 -71
  53. package/abap/zcl_abgagt_resource_create.clas.xml +0 -15
  54. package/abap/zcl_abgagt_resource_health.clas.abap +0 -25
  55. package/abap/zcl_abgagt_resource_health.clas.xml +0 -15
  56. package/abap/zcl_abgagt_resource_import.clas.abap +0 -66
  57. package/abap/zcl_abgagt_resource_import.clas.xml +0 -15
  58. package/abap/zcl_abgagt_resource_inspect.clas.abap +0 -63
  59. package/abap/zcl_abgagt_resource_inspect.clas.xml +0 -15
  60. package/abap/zcl_abgagt_resource_preview.clas.abap +0 -67
  61. package/abap/zcl_abgagt_resource_preview.clas.xml +0 -15
  62. package/abap/zcl_abgagt_resource_pull.clas.abap +0 -71
  63. package/abap/zcl_abgagt_resource_pull.clas.xml +0 -15
  64. package/abap/zcl_abgagt_resource_tree.clas.abap +0 -70
  65. package/abap/zcl_abgagt_resource_tree.clas.xml +0 -15
  66. package/abap/zcl_abgagt_resource_unit.clas.abap +0 -64
  67. package/abap/zcl_abgagt_resource_unit.clas.xml +0 -15
  68. package/abap/zcl_abgagt_resource_view.clas.abap +0 -68
  69. package/abap/zcl_abgagt_resource_view.clas.xml +0 -15
  70. package/abap/zcl_abgagt_rest_handler.clas.abap +0 -32
  71. package/abap/zcl_abgagt_rest_handler.clas.xml +0 -15
  72. package/abap/zcl_abgagt_util.clas.abap +0 -93
  73. package/abap/zcl_abgagt_util.clas.testclasses.abap +0 -84
  74. package/abap/zcl_abgagt_util.clas.xml +0 -16
  75. package/abap/zcl_abgagt_viewer_clas.clas.abap +0 -58
  76. package/abap/zcl_abgagt_viewer_clas.clas.xml +0 -15
  77. package/abap/zcl_abgagt_viewer_ddls.clas.abap +0 -83
  78. package/abap/zcl_abgagt_viewer_ddls.clas.xml +0 -15
  79. package/abap/zcl_abgagt_viewer_dtel.clas.abap +0 -98
  80. package/abap/zcl_abgagt_viewer_dtel.clas.xml +0 -15
  81. package/abap/zcl_abgagt_viewer_factory.clas.abap +0 -41
  82. package/abap/zcl_abgagt_viewer_factory.clas.xml +0 -15
  83. package/abap/zcl_abgagt_viewer_intf.clas.abap +0 -58
  84. package/abap/zcl_abgagt_viewer_intf.clas.xml +0 -15
  85. package/abap/zcl_abgagt_viewer_stru.clas.abap +0 -59
  86. package/abap/zcl_abgagt_viewer_stru.clas.xml +0 -15
  87. package/abap/zcl_abgagt_viewer_tabl.clas.abap +0 -59
  88. package/abap/zcl_abgagt_viewer_tabl.clas.xml +0 -15
  89. package/abap/zcl_abgagt_viewer_ttyp.clas.abap +0 -93
  90. package/abap/zcl_abgagt_viewer_ttyp.clas.xml +0 -15
  91. package/abap/zif_abgagt_agent.intf.abap +0 -53
  92. package/abap/zif_abgagt_agent.intf.xml +0 -15
  93. package/abap/zif_abgagt_cmd_factory.intf.abap +0 -7
  94. package/abap/zif_abgagt_cmd_factory.intf.xml +0 -15
  95. package/abap/zif_abgagt_command.intf.abap +0 -26
  96. package/abap/zif_abgagt_command.intf.xml +0 -15
  97. package/abap/zif_abgagt_util.intf.abap +0 -28
  98. package/abap/zif_abgagt_util.intf.xml +0 -15
  99. package/abap/zif_abgagt_viewer.intf.abap +0 -12
  100. package/abap/zif_abgagt_viewer.intf.xml +0 -15
  101. package/docs/commands.md +0 -142
  102. package/docs/create-command.md +0 -129
  103. package/docs/health-command.md +0 -89
  104. package/docs/import-command.md +0 -195
  105. package/docs/init-command.md +0 -189
  106. package/docs/inspect-command.md +0 -169
  107. package/docs/list-command.md +0 -289
  108. package/docs/preview-command.md +0 -528
  109. package/docs/pull-command.md +0 -202
  110. package/docs/status-command.md +0 -68
  111. package/docs/tree-command.md +0 -303
  112. package/docs/unit-command.md +0 -167
  113. package/docs/view-command.md +0 -501
  114. package/img/claude.png +0 -0
  115. package/scripts/claude-integration.js +0 -351
  116. package/scripts/release.js +0 -298
  117. package/scripts/release.sh +0 -60
  118. package/scripts/test-integration.js +0 -139
  119. package/scripts/unrelease.js +0 -277
@@ -0,0 +1,136 @@
1
+ # Creating CDS Views
2
+
3
+ **Searchable keywords**: CDS, DDL, DDLS, CDS view, @AbapCatalog, @AccessControl, association, projection, consumption
4
+
5
+ ## TOPICS IN THIS FILE
6
+ 1. File Naming - line 7
7
+ 2. DDL Source (.ddls.asddls) - line 18
8
+ 3. Annotations - line 50
9
+ 4. Associations - line 75
10
+ 5. CDS Test Doubles - see 03_testing.md
11
+
12
+ ## Creating CDS Views (DDLS)
13
+
14
+ CDS views (Data Definition Language Source) require specific file naming and structure for abapGit.
15
+
16
+ ### File Naming
17
+
18
+ CDS views require **two files**:
19
+
20
+ | File | Description |
21
+ |------|-------------|
22
+ | `zc_my_view.ddls.asddls` | DDL source code |
23
+ | `zc_my_view.ddls.xml` | XML metadata |
24
+
25
+ **Important:** Do NOT use `.ddls.abap` extension - use `.ddls.asddls` for the source.
26
+
27
+ ### DDL Source File (`.ddls.asddls`)
28
+
29
+ ```abap
30
+ @AbapCatalog.sqlViewName: 'ZCMYVIEW'
31
+ @AbapCatalog.compiler.compareFilter: true
32
+ @AccessControl.authorizationCheck: #NOT_REQUIRED
33
+ @EndUserText.label: 'My CDS View'
34
+ define view ZC_My_View as select from tdevc
35
+ {
36
+ key devclass as Devclass,
37
+ parentcl as ParentPackage,
38
+ ctext as Description
39
+ }
40
+ where devclass not like '$%'
41
+ ```
42
+
43
+ ### XML Metadata File (`.ddls.xml`)
44
+
45
+ ```xml
46
+ <?xml version="1.0" encoding="utf-8"?>
47
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_DDLS" serializer_version="v1.0.0">
48
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
49
+ <asx:values>
50
+ <DDLS>
51
+ <DDLNAME>ZC_MY_VIEW</DDLNAME>
52
+ <DDLANGUAGE>E</DDLANGUAGE>
53
+ <DDTEXT>My CDS View</DDTEXT>
54
+ </DDLS>
55
+ </asx:values>
56
+ </asx:abap>
57
+ </abapGit>
58
+ ```
59
+
60
+ ### Key Points
61
+
62
+ 1. **Avoid reserved words** - Field names like `PACKAGE`, `CLASS`, `INTERFACE` are reserved in CDS. Use alternatives like `PackageName`, `ClassName`.
63
+
64
+ 2. **Pull all files to activate** - When activating CDS views, use `abapgit-agent pull` (not single file) to ensure proper activation:
65
+ ```bash
66
+ abapgit-agent pull # Pull all files
67
+ ```
68
+
69
+ 3. **System support** - CDS views require SAP systems with CDS capability (S/4HANA, SAP BW/4HANA, or ABAP 7.51+). Older systems will show error: "Object type DDLS is not supported by this system"
70
+
71
+ ### Debugging Activation Errors
72
+
73
+ When pull shows generic errors like "Activation cancelled. Check the inactive objects":
74
+
75
+ 1. **Check in ADT/Eclipse** - Open the DDL source in ADT and run syntax check for detailed errors
76
+ 2. **Pull all files** - Sometimes `abapgit-agent pull` (all files) works better than single file for CDS views
77
+
78
+ ## Creating CDS View Entities
79
+
80
+ CDS View Entities (`define view entity`) are the modern replacement for CDS Views with additional features like **associations for OData navigation**.
81
+
82
+ ### Differences from CDS Views
83
+
84
+ | Aspect | CDS View | View Entity |
85
+ |--------|----------|-------------|
86
+ | Syntax | `define view` | `define view entity` |
87
+ | Associations | No | Yes (exposed for navigation) |
88
+ | OData/Navigation | Requires separate service | Auto-exposes associations |
89
+ | ABAP Version | 7.40+ | 7.55+ / S/4HANA Cloud |
90
+
91
+ ### DDL Source File with Association
92
+
93
+ ```abap
94
+ @EndUserText.label: 'Package Hierarchy'
95
+ @AccessControl.authorizationCheck: #NOT_REQUIRED
96
+ define view entity ZC_Pkg_Hierarchy_VE
97
+ as select from tdevc
98
+ association [0..1] to tdevc as _Parent
99
+ on _Parent.devclass = $projection.ParentPackage
100
+ {
101
+ key devclass as PackageName,
102
+ parentcl as ParentPackage,
103
+ ctext as Description,
104
+ dlvunit as SoftwareComponent,
105
+
106
+ // Exposed associations
107
+ _Parent
108
+ }
109
+ where devclass not like '$%'
110
+ ```
111
+
112
+ ### Key Points for View Entities
113
+
114
+ 1. **Association syntax**: Use `$projection` to reference fields in the current entity
115
+ 2. **Association cardinality**: `[0..1]`, `[1..1]`, `[0..n]`, `[1..n]`
116
+ 3. **Expose associations**: Add the association name at the end of the SELECT to expose it for OData navigation
117
+ 4. **Activation warnings**: Search help warnings are informational and don't block activation
118
+
119
+ ## CDS Syntax Reference
120
+
121
+ When working with CDS view syntax (arithmetic, built-in functions, aggregations, etc.):
122
+
123
+ 1. Run `abapgit-agent ref --topic cds` to see available topics and example files
124
+ 2. Check the example files in `abap-cheat-sheets/src/`:
125
+ - `zdemo_abap_cds_ve_sel.ddls.asddls` - Arithmetic expressions, built-in functions (division, cast, etc.)
126
+ - `zdemo_abap_cds_ve_agg_exp.ddls.asddls` - Aggregate expressions (SUM, AVG, COUNT)
127
+ - `zdemo_abap_cds_ve_assoc.ddls.asddls` - Associations
128
+
129
+ **Note**: This requires `abap-cheat-sheets` to be in the reference folder (configured in `.abapGitAgent`).
130
+
131
+ ---
132
+
133
+ ## See Also
134
+ - **Unit Testing** (03_testing.md) - for CDS Test Double Framework
135
+ - **abapGit** (08_abapgit.md) - for CDS XML metadata templates
136
+ - **ABAP SQL** (01_sql.md) - for SQL functions used in CDS
@@ -0,0 +1,58 @@
1
+ # ABAP Classes and Objects
2
+
3
+ **Searchable keywords**: CLASS, DEFINITION, PUBLIC, CREATE OBJECT, NEW, METHOD, INTERFACES, inheritance, FINAL, ABSTRACT
4
+
5
+ ## TOPICS IN THIS FILE
6
+ 1. Class Definition (PUBLIC) - line 3
7
+ 2. Constructor - line 20
8
+ 3. Interfaces - line 35
9
+ 4. Inline Declaration - line 50
10
+
11
+ ## ABAP Class Definition - Must Use PUBLIC
12
+
13
+ **CRITICAL**: Global ABAP classes MUST use `PUBLIC` in the class definition:
14
+
15
+ ```abap
16
+ " Correct - global class
17
+ CLASS zcl_my_class DEFINITION PUBLIC.
18
+ ...
19
+ ENDCLASS.
20
+
21
+ " Wrong - treated as local class, will fail activation
22
+ CLASS zcl_my_class DEFINITION.
23
+ ...
24
+ ENDCLASS.
25
+ ```
26
+
27
+ **Error symptom**: `Error updating where-used list for CLAS ZCL_MY_CLASS`
28
+
29
+ **Fix**: Add `PUBLIC` keyword:
30
+ ```abap
31
+ CLASS zcl_my_class DEFINITION PUBLIC. " <- PUBLIC required
32
+ ```
33
+
34
+ ## Interface Method Implementation
35
+
36
+ When implementing interface methods in ABAP classes, use the interface prefix:
37
+
38
+ ```abap
39
+ " Interface definition
40
+ INTERFACE zif_my_interface PUBLIC.
41
+ METHODS do_something IMPORTING iv_param TYPE string.
42
+ ENDINTERFACE.
43
+
44
+ " Class implementation - use interface prefix
45
+ CLASS zcl_my_class DEFINITION PUBLIC.
46
+ PUBLIC SECTION.
47
+ INTERFACES zif_my_interface.
48
+ ENDCLASS.
49
+
50
+ CLASS zcl_my_class IMPLEMENTATION.
51
+ METHOD zif_my_interface~do_something. " <- Use interface prefix
52
+ " Implementation here
53
+ ENDMETHOD.
54
+ ENDCLASS.
55
+ ```
56
+
57
+ **Wrong**: `METHOD do_something.` - parameter `iv_param` will be unknown
58
+ **Correct**: `METHOD zif_my_interface~do_something.` - parameters recognized
@@ -0,0 +1,110 @@
1
+ # ABAP Objects
2
+
3
+ **Searchable keywords**: naming convention, Z prefix, namespace, object type, CLAS, INTF, PROG, TABL, DDLS, XML metadata, .abapGit.xml
4
+
5
+ ## TOPICS IN THIS FILE
6
+ 1. XML Metadata Required - line 3
7
+ 2. Naming Conventions - line 30
8
+ 3. Object Types - line 60
9
+
10
+ ## Creating New ABAP Objects - XML Metadata Required
11
+
12
+ **CRITICAL CHECKLIST - Never Forget!**
13
+
14
+ When creating ANY new ABAP object file, you MUST also create its XML metadata file:
15
+
16
+ | ABAP File | Required XML File |
17
+ |-----------|------------------|
18
+ | `zcl_my_class.clas.abap` | `zcl_my_class.clas.xml` |
19
+ | `zif_my_intf.intf.abap` | `zif_my_intf.intf.xml` |
20
+
21
+ **Without XML files**, abapGit will NOT recognize the objects during pull, and they won't be activated.
22
+
23
+ ### XML Metadata Format for CLAS
24
+
25
+ For `zcl_abgagt_util.clas.abap`, create `zcl_abgagt_util.clas.xml`:
26
+
27
+ ```xml
28
+ <?xml version="1.0" encoding="utf-8"?>
29
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
30
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
31
+ <asx:values>
32
+ <VSEOCLASS>
33
+ <CLSNAME>ZCL_ABGAGT_UTIL</CLSNAME>
34
+ <LANGU>E</LANGU>
35
+ <DESCRIPT>Description</DESCRIPT>
36
+ <EXPOSURE>2</EXPOSURE>
37
+ <STATE>1</STATE>
38
+ <UNICODE>X</UNICODE>
39
+ </VSEOCLASS>
40
+ </asx:values>
41
+ </asx:abap>
42
+ </abapGit>
43
+ ```
44
+
45
+ ### XML Metadata Format for INTF
46
+
47
+ For `zif_abgagt_util.intf.abap`, create `zif_abgagt_util.intf.xml`:
48
+
49
+ ```xml
50
+ <?xml version="1.0" encoding="utf-8"?>
51
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_INTF" serializer_version="v1.0.0">
52
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
53
+ <asx:values>
54
+ <VSEOINTERF>
55
+ <CLSNAME>ZIF_ABGAGT_UTIL</CLSNAME>
56
+ <LANGU>E</LANGU>
57
+ <DESCRIPT>Description</DESCRIPT>
58
+ <EXPOSURE>2</EXPOSURE>
59
+ <STATE>1</STATE>
60
+ <UNICODE>X</UNICODE>
61
+ </VSEOINTERF>
62
+ </asx:values>
63
+ </asx:abap>
64
+ </abapGit>
65
+ ```
66
+
67
+ ### Important Notes
68
+
69
+ 1. **CRITICAL: Push to git BEFORE pulling into ABAP**
70
+ - Always commit and push ABAP files to git first
71
+ - Then run `abapgit-agent pull` to activate in ABAP
72
+ - Never run `abapgit-agent pull` without pushing changes first
73
+
74
+ 2. **Only pull ABAP files** - The XML metadata stays in git:
75
+ ```bash
76
+ abapgit-agent pull --files zcl_my_class.clas.abap
77
+ ```
78
+ 3. abapGit reads the XML from git to deserialize the ABAP code
79
+ 4. XML files are NOT activated in ABAP - they are only for abapGit
80
+
81
+ ```bash
82
+ # After making changes to ABAP files
83
+ git add .
84
+ git commit -m "Describe changes"
85
+ git push # CRITICAL: Push BEFORE pulling
86
+
87
+ # Then validate in ABAP system (single file - fast)
88
+ abapgit-agent pull --files abap/zcl_my_class.clas.abap
89
+
90
+ # Or validate all files
91
+ abapgit-agent pull
92
+ ```
93
+
94
+ ## Naming Conventions
95
+
96
+ - Use `Z_` or `Y_` prefix for custom objects
97
+ - Class names: `ZCL_<NAME>`
98
+ - Interface names: `ZIF_<NAME>`
99
+ - Programs: `Z<NAME>`
100
+ - Package: `$<PROJECT_NAME>`
101
+
102
+ ## ABAP Object Types
103
+
104
+ Common object types in this project:
105
+ - `CLAS` - Classes
106
+ - `PROG` - Programs
107
+ - `FUGR` - Function Groups
108
+ - `INTF` - Interfaces
109
+ - `TABL` - Tables
110
+ - `DDLS` - Data Definitions
@@ -0,0 +1,24 @@
1
+ # JSON Handling
2
+
3
+ **Searchable keywords**: JSON, serialize, deserialize, /ui2/cl_json, REST API, API response
4
+
5
+ **CRITICAL**: Always use `/ui2/cl_json` for JSON serialization and deserialization.
6
+
7
+ ## Correct Usage
8
+
9
+ ```abap
10
+ " Deserialize JSON to ABAP structure
11
+ DATA ls_data TYPE ty_request.
12
+ ls_data = /ui2/cl_json=>deserialize( json = lv_json ).
13
+
14
+ " Serialize ABAP structure to JSON
15
+ lv_json = /ui2/cl_json=>serialize( data = ls_response ).
16
+ ```
17
+
18
+ ## Never Use
19
+
20
+ - Manual string operations (CONCATENATE, SPLIT, etc.)
21
+ - String templates for complex structures
22
+ - Direct assignment without /ui2/cl_json
23
+
24
+ This is enforced by ABAP - manual string operations for JSON parsing will cause type conflicts.
@@ -0,0 +1,222 @@
1
+ # abapGit Object XML Metadata
2
+
3
+ Each ABAP object requires an XML metadata file for abapGit to understand how to serialize/deserialize it. This guide provides templates for common object types.
4
+
5
+ ## QUICK REFERENCE
6
+
7
+ ```
8
+ File Type | ABAP File | XML File
9
+ -------------------|------------------------------|-------------------
10
+ Class | zcl_*.clas.abap | zcl_*.clas.xml
11
+ Test Class | zcl_*.clas.testclasses.abap | zcl_*.clas.xml
12
+ Interface | zif_*.intf.abap | zif_*.intf.xml
13
+ Program | z*.prog.abap | z*.prog.xml
14
+ Table | z*.tabl.abap | z*.tabl.xml
15
+ CDS View | zc_*.ddls.asddls | zc_*.ddls.xml
16
+ CDS Entity | ze_*.ddlx.asddlx | ze_*.ddlx.xml
17
+ Data Element | z*.dtel.abap | z*.dtel.xml
18
+ Structure | z*.stru.abap | z*.stru.xml
19
+ Table Type | z*.ttyp.abap | z*.ttyp.xml
20
+ ```
21
+
22
+ ```
23
+ Key XML Settings:
24
+ Class EXPOSURE: 2=Public, 3=Protected, 4=Private
25
+ Class STATE: 1=Active
26
+ Table TABCLASS: TRANSP, POOL, CLUSTER
27
+ Table DELIVERY: A=Application, C=Customizing
28
+ CDS SOURCE_TYPE: V=View, C=Consumption
29
+ Test Class XML: <WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>
30
+ ```
31
+
32
+ **Searchable keywords**: class xml, interface xml, table xml, cds xml, test class, exposure, serializer, abapgit
33
+
34
+ ## Why XML Metadata?
35
+
36
+ abapGit needs XML files to:
37
+ - Know the object type and serializer to use
38
+ - Store object attributes (description, exposure, state, etc.)
39
+ - Handle object-specific configurations
40
+
41
+ ## Object Types and XML Templates
42
+
43
+ ### Class (CLAS)
44
+
45
+ **Filename**: `src/zcl_my_class.clas.xml`
46
+
47
+ ```xml
48
+ <?xml version="1.0" encoding="utf-8"?>
49
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
50
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
51
+ <asx:values>
52
+ <VSEOCLASS>
53
+ <CLSNAME>ZCL_MY_CLASS</CLSNAME>
54
+ <LANGU>E</LANGU>
55
+ <DESCRIPT>Description of the class</DESCRIPT>
56
+ <EXPOSURE>2</EXPOSURE>
57
+ <STATE>1</STATE>
58
+ <UNICODE>X</UNICODE>
59
+ </VSEOCLASS>
60
+ </asx:values>
61
+ </asx:abap>
62
+ </abapGit>
63
+ ```
64
+
65
+ **Key Fields**:
66
+ - `CLSNAME`: Class name (must match filename)
67
+ - `DESCRIPT`: Class description
68
+ - `EXPOSURE`: Exposure (2 = Public, 3 = Protected, 4 = Private)
69
+ - `STATE`: State (1 = Active)
70
+ - `UNICODE`: Unicode encoding (X = Yes)
71
+
72
+ ---
73
+
74
+ ### Interface (INTF)
75
+
76
+ **Filename**: `src/zif_my_interface.intf.xml`
77
+
78
+ ```xml
79
+ <?xml version="1.0" encoding="utf-8"?>
80
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_INTF" serializer_version="v1.0.0">
81
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
82
+ <asx:values>
83
+ <VSEOINTERF>
84
+ <CLSNAME>ZIF_MY_INTERFACE</CLSNAME>
85
+ <LANGU>E</LANGU>
86
+ <DESCRIPT>Description of the interface</DESCRIPT>
87
+ <EXPOSURE>2</EXPOSURE>
88
+ <STATE>1</STATE>
89
+ <UNICODE>X</UNICODE>
90
+ </VSEOINTERF>
91
+ </asx:values>
92
+ </asx:abap>
93
+ </abapGit>
94
+ ```
95
+
96
+ ---
97
+
98
+ ### Program (PROG)
99
+
100
+ **Filename**: `src/zmy_program.prog.xml`
101
+
102
+ ```xml
103
+ <?xml version="1.0" encoding="utf-8"?>
104
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
105
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
106
+ <asx:values>
107
+ <PROGDIR>
108
+ <NAME>ZMY_PROGRAM</NAME>
109
+ <SUBC>I</SUBC>
110
+ <RLOAD>E</RLOAD>
111
+ <FIXPT>X</FIXPT>
112
+ <UCCHECK>X</UCCHECK>
113
+ </PROGDIR>
114
+ </asx:values>
115
+ </asx:abap>
116
+ </abapGit>
117
+ ```
118
+
119
+ **Key Fields**:
120
+ - `NAME`: Program name
121
+ - `SUBC`: Subc (I = Include, 1 = Executable, F = Function Group, M = Module Pool, S = Subroutine Pool)
122
+ - `RLOAD`: Rload (E = External, I = Internal)
123
+
124
+ ---
125
+
126
+ ### Table (TABL)
127
+
128
+ **Filename**: `src/zmy_table.tabl.xml`
129
+
130
+ ```xml
131
+ <?xml version="1.0" encoding="utf-8"?>
132
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_TABL" serializer_version="v1.0.0">
133
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
134
+ <asx:values>
135
+ <DD02V>
136
+ <TABNAME>ZMY_TABLE</TABNAME>
137
+ <DDLANGUAGE>E</DDLANGUAGE>
138
+ <TABCLASS>TRANSP</TABCLASS>
139
+ <DDTEXT>Description of the table</DDTEXT>
140
+ <CONTFLAG>A</CONTFLAG>
141
+ </DD02V>
142
+ </asx:values>
143
+ </asx:abap>
144
+ </abapGit>
145
+ ```
146
+
147
+ **Key Fields**:
148
+ - `TABNAME`: Table name
149
+ - `DDTEXT`: Description (NOT DESCRIPT)
150
+ - `TABCLASS`: Table class (TRANSP = Transparent)
151
+ - `CONTFLAG`: Delivery class (A = Application table)
152
+
153
+ ---
154
+
155
+ ### CDS View (DDLS)
156
+
157
+ **Filename**: `src/zc_my_view.ddls.xml`
158
+
159
+ ```xml
160
+ <?xml version="1.0" encoding="utf-8"?>
161
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_DDLS" serializer_version="v1.0.0">
162
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
163
+ <asx:values>
164
+ <DDLS>
165
+ <DDLNAME>ZC_MY_VIEW</DDLNAME>
166
+ <DDLANGUAGE>E</DDLANGUAGE>
167
+ <DDTEXT>My CDS View</DDTEXT>
168
+ <SOURCE_TYPE>V</SOURCE_TYPE>
169
+ </DDLS>
170
+ </asx:values>
171
+ </asx:abap>
172
+ </abapGit>
173
+ ```
174
+
175
+ **Key Points for CDS Views**:
176
+ 1. **ABAP file extension**: Use `.ddls.asddls` (NOT `.ddls.abap`)
177
+ 2. **XML file**: Use `.ddls.xml`
178
+ 3. **DDLNAME**: Must match the CDS view name in the source
179
+ 4. **SOURCE_TYPE**: V = View, C = Consumption
180
+ 5. **Serializer**: Use `LCL_OBJECT_DDLS`
181
+
182
+ ---
183
+
184
+ ### Data Element (DTEL)
185
+
186
+ **Filename**: `src/zmy_dtel.dtel.xml`
187
+
188
+ ```xml
189
+ <?xml version="1.0" encoding="utf-8"?>
190
+ <abapGit version="v1.0.0" serializer="LCL_OBJECT_DTEL" serializer_version="v1.0.0">
191
+ <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
192
+ <asx:values>
193
+ <DD04V>
194
+ <ROLLNAME>ZMY_DTEL</ROLLNAME>
195
+ <DDLANGUAGE>E</DDLANGUAGE>
196
+ <DDTEXT>Description of data element</DDTEXT>
197
+ <REPTEXT>Description</REPTEXT>
198
+ <SCRTEXT_S>Short</SCRTEXT_S>
199
+ <SCRTEXT_M>Medium</SCRTEXT_M>
200
+ <SCRTEXT_L>Long Description</SCRTEXT_L>
201
+ <DTELMASTER>E</DTELMASTER>
202
+ <DATATYPE>CHAR</DATATYPE>
203
+ <LENG>000010</LENG>
204
+ </DD04V>
205
+ </asx:values>
206
+ </asx:abap>
207
+ </abapGit>
208
+ ```
209
+
210
+ **Key Fields**:
211
+ - `ROLLNAME`: Data element name
212
+ - `DDTEXT`: Description (NOT DESCRIPT)
213
+ - `DATATYPE`: Data type (CHAR, NUMC, etc.)
214
+ - `LENG`: Length (e.g., 000010 for 10 characters)
215
+
216
+ ---
217
+
218
+ ## Important Notes
219
+
220
+ 1. **ALWAYS push to git BEFORE running pull** - abapGit reads from git
221
+ 2. **Check pull output** to verify objects were recognized by abapGit
222
+ 3. **Use inspect AFTER pull** to check syntax on objects in ABAP