Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API docs and seqences #3

Open
sbcgua opened this issue Apr 1, 2019 · 4 comments
Open

API docs and seqences #3

sbcgua opened this issue Apr 1, 2019 · 4 comments

Comments

@sbcgua
Copy link

sbcgua commented Apr 1, 2019

Hi, great library ! Big potential 👍
One question (maybe stupid one) - is there any docs on ADT API ? I mean .e.g I want to create a program or transaction - how do I find which sequence of API calls (in ADT in general and in abap-adt-api in particular) should I call ?

@marcellourbani
Copy link
Owner

marcellourbani commented Apr 2, 2019 via email

@marcellourbani
Copy link
Owner

For instance, test "Create and delete" in disruptive.test.ts hsows the sequence of calls to create an object in a local package.
For non local ones transport management needs to be added, as in "save with transport"

@sbcgua
Copy link
Author

sbcgua commented Apr 2, 2019

Does it mean you've reverse engineered all the current functionality? Wow ! Cool !!

Yeah, the docs could be very helpful :) I found that test, it actually solves my intent for the moment, thanks ! Just wanted to have some broader outlook. E.g. in the code below how do I know the suffix for object type and that I have to append source/main to get the code. But yes, the tests helps anyway, and then debugging and logging will do the rest :) Thanks again for the great library !

    const nodes = await client.nodeContents("DEVC/K", "$ERDL");
    const code = await client.getObjectSource('/sap/bc/adt/programs/programs/zsomeprog/source/main

@sbcgua sbcgua closed this as completed Apr 2, 2019
@marcellourbani
Copy link
Owner

marcellourbani commented Apr 2, 2019

the Right Way(tm) to do that is using ADTClient.mainInclude() after getting the object structure with objectStructure()

const nodes = await client.nodeContents("DEVC/K", "$ERDL");
const node = nodes.nodes.find(...)
const structure = await client.objectStructure(node.OBJECT_URI)
const code = await client.getObjectSource(client.mainInclude(structure))

But you almost always end up with /source/main anyway

BTW, eclipse logs every call, so RI is quite easy
Will leave this open as I do think it's needed, I just don't have time to sort it

@marcellourbani marcellourbani reopened this Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants