Tip: How to Read BAPIRET2 Structure Easily

Today I tried the great UiPath SAP BAPI activity. I stumbled a little bit to handle the BAPIRET2 return structure, but it is very easy to handle that. It is a list of structure BAPIRET2. With a For Each activity you can loop over the records. To get access to the single entries of the structure you can use the VBdotNET CType command, to convert the object type to BapiRet2.

CType(Msg, BapiRet2)

image

With this step you have easy access to any element of the structure.

image

4 Likes

@StefanSchnell, again nice and useful tutorial :slight_smile: Well deserved FAQ section.

1 Like

@Pablito

Thank you very much Pawel :+1:

1 Like