Skip to Content
0
Dec 24, 2020 at 12:46 PM

Store webservice response as xml attachment

41 Views

Hello all,

I am trying to store a webservice response as xml attachment.

I checked out these two (and subsequent) answers:

https://answers.sap.com/questions/84438/how-to-create-attachment-folder-in-sap-cloud-appli.html

https://answers.sap.com/questions/65146/storing-string-data-in-binary-object---need-to-sto.html

Unfortunately I dont manage to create an attachment.

So basically this is my process:

1. I take invoice item UUID and get the xml output from webservice QueryDocumentOutputIn.

2. I turn the xml output into string so I can verify in debugger that I actually got the right thing (attached screenshots form debugger values)

So I know that my webservice call returned what I needed.

Now I want to save that XML as an XML attachment. Here is my code.

BODL

ABSL

The content I want to save is in the outputxml variable.

When this line is executed -> this.Privitak.CreateFile(docType, docName, docAltName, docDesc, datoteka);

this is the message I get in debugger

When I debug the action again, I set a holder variable up to check its content but it is not set either so the file wasnt created I guess.

So Im doing something wrong, but as usual Im not sure what it is.

Can someone help ?

Thank you.

J

Attachments

xmloutput.png (30.3 kB)
bodl.png (27.9 kB)
absl.png (28.1 kB)
debugermsg.png (19.5 kB)
notset.png (20.2 kB)