adt

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADT_PROGRAMS_ENDPOINT         = "/programs/programs/%s/source/main"
	ADT_CLASSES_ENDPOINT          = "/oo/classes/%s/source/main"
	ADT_FUNCTION_GROUPS_ENDPOINT  = "/functions/groups/%s/source/main"
	ADT_FUNCTIONS_ENDPOINT        = "/functions/groups/%s/fmodules/%s/source/main"
	ADT_TABLES_ENDPOINT           = "/ddic/tables/%s/source/main"
	ADT_STRUCTURES_ENDPOINT       = "/ddic/structures/%s/source/main"
	ADT_INCLUDES_ENDPOINT         = "/programs/includes/%s/source/main"
	ADT_INTERFACES_ENDPOINT       = "/oo/interfaces/%s/source/main"
	ADT_DOMAINS_ENDPOINT          = "/ddic/domains/%s/source/main"
	ADT_DATA_ELEMENTS_ENDPOINT    = "/ddic/dataelements/%s"
	ADT_PACKAGE_CONTENTS_ENDPOINT = "/repository/informationsystem/nodecontents"
	ADT_SEARCH_ENDPOINT           = "/repository/informationsystem/search"
	ADT_TRANSACTION_ENDPOINT      = "/repository/informationsystem/objectproperties/values"
	ADT_PROGRAMS_CREATE_ENDPOINT  = "/programs/programs"
	ADT_CLASSES_CREATE_ENDPOINT   = "/oo/classes"
	ADT_TABLE_CONTENTS_ENDPOINT   = "/z_mcp_abap_adt/z_tablecontent/%s" // Custom service required
)

ADT Endpoint Constants

Variables

This section is empty.

Functions

func NewADTClient

func NewADTClient(config *types.ADTConfig) types.ADTClient

NewADTClient creates a new ADT client with improved configuration

Types

type ADTClientImpl

type ADTClientImpl struct {
	// contains filtered or unexported fields
}

ADTClientImpl implements the ADTClient interface using shared types

func (*ADTClientImpl) ActivateObject added in v0.1.0

func (c *ADTClientImpl) ActivateObject(objectType, objectName string) (*types.ActivationResult, error)

ActivateObject activates an ABAP object (program, class, interface, etc.)

func (*ADTClientImpl) Authenticate

func (c *ADTClientImpl) Authenticate() error

Authenticate performs comprehensive authentication with SAP system

func (*ADTClientImpl) CheckObjectExists

func (c *ADTClientImpl) CheckObjectExists(objectType, objectName string) (bool, error)

CheckObjectExists checks if an object exists (using GetObjectSource internally)

func (*ADTClientImpl) CreateClass

func (c *ADTClientImpl) CreateClass(name, description, packageName, source string) error

CreateClass creates a new ABAP class - enhanced with working atomic approach

func (*ADTClientImpl) CreateClassWithOptions

func (c *ADTClientImpl) CreateClassWithOptions(opts CreateClassOptions) error

CreateClassWithOptions creates a class with full options support

func (*ADTClientImpl) CreateClassWithSource

func (c *ADTClientImpl) CreateClassWithSource(name, description, packageName, source string) error

CreateClassWithSource is a convenience method that creates a class with source code

func (*ADTClientImpl) CreateFunctionGroup

func (c *ADTClientImpl) CreateFunctionGroup(name, description, source string) error

CreateFunctionGroup creates a new ABAP function group

func (*ADTClientImpl) CreateInclude

func (c *ADTClientImpl) CreateInclude(name, description, source string) error

CreateInclude creates a new ABAP include

func (*ADTClientImpl) CreateInterface

func (c *ADTClientImpl) CreateInterface(name, description, source string) error

CreateInterface creates a new ABAP interface

func (*ADTClientImpl) CreateProgram

func (c *ADTClientImpl) CreateProgram(name, description, packageName, source string) error

CreateProgram creates a new ABAP program - now with working atomic approach

func (*ADTClientImpl) CreateProgramWithOptions

func (c *ADTClientImpl) CreateProgramWithOptions(opts CreateProgramOptions) error

Enhanced CreateProgram with options support

func (*ADTClientImpl) CreateProgramWithSource

func (c *ADTClientImpl) CreateProgramWithSource(name, description, packageName, source string) error

CreateProgramWithSource is a convenience method that creates a program with source code

func (*ADTClientImpl) CreateStructure

func (c *ADTClientImpl) CreateStructure(name, description, source string) error

CreateStructure creates a new ABAP structure

func (*ADTClientImpl) CreateTable

func (c *ADTClientImpl) CreateTable(name, description, source string) error

CreateTable creates a new ABAP table

func (*ADTClientImpl) GetClass

func (c *ADTClientImpl) GetClass(className string) (*types.ADTSourceCode, error)

GetClass retrieves ABAP class source code with enhanced error handling

func (*ADTClientImpl) GetCompletionProposals added in v0.1.0

func (c *ADTClientImpl) GetCompletionProposals(objectType, objectName, source string, line, column int) ([]types.CompletionProposal, error)

GetCompletionProposals retrieves code completion proposals from ADT. POST /sap/bc/adt/abapsource/codecompletion/proposal

func (*ADTClientImpl) GetFunction

func (c *ADTClientImpl) GetFunction(functionName, functionGroup string) (*types.ADTSourceCode, error)

GetFunction retrieves ABAP function module source code

func (*ADTClientImpl) GetFunctionGroup

func (c *ADTClientImpl) GetFunctionGroup(functionGroup string) (*types.ADTSourceCode, error)

GetFunctionGroup retrieves ABAP function group source code

func (*ADTClientImpl) GetInclude

func (c *ADTClientImpl) GetInclude(includeName string) (*types.ADTSourceCode, error)

GetInclude retrieves ABAP include source code

func (*ADTClientImpl) GetInterface

func (c *ADTClientImpl) GetInterface(interfaceName string) (*types.ADTSourceCode, error)

GetInterface retrieves ABAP interface source code

func (*ADTClientImpl) GetNavigationTarget added in v0.1.0

func (c *ADTClientImpl) GetNavigationTarget(objectType, objectName, source string, line, column int) (*types.NavigationTarget, error)

GetNavigationTarget retrieves the go-to-definition target from ADT. POST /sap/bc/adt/navigation/target

func (*ADTClientImpl) GetObjectSource

func (c *ADTClientImpl) GetObjectSource(objectType, objectName string) (string, error)

GetObjectSource retrieves the source code of an object (following reference API pattern)

func (*ADTClientImpl) GetPackageContents

func (c *ADTClientImpl) GetPackageContents(packageName string) (*types.ADTPackage, error)

GetPackageContents retrieves package contents

func (*ADTClientImpl) GetProgram

func (c *ADTClientImpl) GetProgram(programName string) (*types.ADTSourceCode, error)

GetProgram retrieves ABAP program source code with enhanced error handling

func (*ADTClientImpl) GetStructure

func (c *ADTClientImpl) GetStructure(structureName string) (*types.ADTSourceCode, error)

GetStructure retrieves ABAP structure definition

func (*ADTClientImpl) GetTable

func (c *ADTClientImpl) GetTable(tableName string) (*types.ADTSourceCode, error)

GetTable retrieves ABAP table structure

func (*ADTClientImpl) GetTableContents

func (c *ADTClientImpl) GetTableContents(tableName string, maxRows int) (*types.ADTTableData, error)

func (*ADTClientImpl) GetTransaction

func (c *ADTClientImpl) GetTransaction(transactionName string) (*types.ADTTransactionInfo, error)

func (*ADTClientImpl) GetTransports

func (c *ADTClientImpl) GetTransports() ([]types.ADTTransport, error)

func (*ADTClientImpl) GetTypeInfo

func (c *ADTClientImpl) GetTypeInfo(typeName string) (*types.ADTTypeInfo, error)

Extended methods (optional implementations)

func (*ADTClientImpl) IsAuthenticated

func (c *ADTClientImpl) IsAuthenticated() bool

IsAuthenticated returns authentication status

func (*ADTClientImpl) ListPackages

func (c *ADTClientImpl) ListPackages(pattern string) ([]types.ADTPackage, error)

ListPackages lists packages matching a pattern

func (*ADTClientImpl) RunUnitTests added in v0.1.0

func (c *ADTClientImpl) RunUnitTests(objectType, objectName string) (*types.UnitTestResult, error)

RunUnitTests runs ABAP unit tests for the given object

func (*ADTClientImpl) SearchObjects

func (c *ADTClientImpl) SearchObjects(pattern string, objectTypes []string) (*types.ADTSearchResult, error)

SearchObjects searches for ABAP objects

func (*ADTClientImpl) SetSessionType

func (c *ADTClientImpl) SetSessionType(sessionType types.SessionType)

SetSessionType sets the session type (stateful/stateless)

func (*ADTClientImpl) SyntaxCheck added in v0.1.0

func (c *ADTClientImpl) SyntaxCheck(objectType, objectName, source string) (*types.SyntaxCheckResult, error)

SyntaxCheck performs a syntax check on ABAP source via ADT checkruns endpoint. POST /sap/bc/adt/checkruns?reporters=abapCheckRun

func (*ADTClientImpl) TestConnection

func (c *ADTClientImpl) TestConnection() error

TestConnection tests the ADT connection with comprehensive diagnostics

func (*ADTClientImpl) UpdateClass

func (c *ADTClientImpl) UpdateClass(name, source string) error

UpdateClass updates an existing ABAP class's source code

func (*ADTClientImpl) UpdateInclude

func (c *ADTClientImpl) UpdateInclude(name, source string) error

UpdateInclude updates an existing ABAP include's source code

func (*ADTClientImpl) UpdateInterface

func (c *ADTClientImpl) UpdateInterface(name, source string) error

UpdateInterface updates an existing ABAP interface's source code

func (*ADTClientImpl) UpdateProgram

func (c *ADTClientImpl) UpdateProgram(name, source string) error

UpdateProgram updates an existing ABAP program's source code

type ActivationMsgEntry added in v0.1.0

type ActivationMsgEntry struct {
	Severity string `xml:"severity,attr"`
	Text     string `xml:",chardata"`
	Href     string `xml:"href,attr,omitempty"`
}

type ActivationRef

type ActivationRef struct {
	URI  string `xml:"uri,attr"`
	Name string `xml:"name,attr"`
}

type ActivationRequest

type ActivationRequest struct {
	XMLName   xml.Name      `xml:"objectReferences"`
	Namespace string        `xml:"xmlns,attr"`
	ObjectRef ActivationRef `xml:"objectReference"`
}

ActivationRequest represents the activation request structure

type ActivationResponse added in v0.1.0

type ActivationResponse struct {
	XMLName  xml.Name             `xml:"messages"`
	Messages []ActivationMsgEntry `xml:"msg"`
}

ActivationResponse XML structures for parsing activation results

type CreateClassOptions

type CreateClassOptions struct {
	Name         string
	Description  string
	Source       string
	Package      string
	Responsible  string
	Transport    string
	Activate     bool
	InsertSource bool
}

CreateClassOptions holds the options for creating a class

type CreateProgramOptions

type CreateProgramOptions struct {
	Name         string
	Description  string
	Source       string
	Package      string
	Responsible  string
	Transport    string
	Activate     bool
	InsertSource bool
}

CreateProgramOptions holds the options for creating a program

type LockResponse

type LockResponse struct {
	XMLName xml.Name `xml:"abap"`
	Values  struct {
		Data struct {
			LockHandle string `xml:"LOCK_HANDLE"`
			CorrNr     string `xml:"CORR_NR"`
		} `xml:"DATA"`
	} `xml:"values"`
}

LockResponse represents the response from a lock operation (ABAP XML format)

type ObjectRef

type ObjectRef struct {
	LockHandle string `xml:"LOCK_HANDLE"`
	CorrNr     string `xml:"CORR_NR"`
	URI        string `xml:"uri,attr"`
	Name       string `xml:"name,attr"`
}

type ObjectRefsLockResponse

type ObjectRefsLockResponse struct {
	XMLName   xml.Name  `xml:"objectReferences"`
	ObjectRef ObjectRef `xml:"objectReference"`
}

ObjectRefsLockResponse represents the alternative objectReferences format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL