Skip to Content
0

Exposing TextCollection field in Webservice WSDL possible?

Feb 06 at 09:52 AM

124

avatar image

Hi Gurus,

1) I have declared the following fields in Custom BO.

import AP.Common.GDT as apCommonGDT;
businessobject TestBO {

[AlternativeKey]  element ID : ID;
[Label("Section")]			element Section : LANGUAGEINDEPENDENT_EXTENDED_Text;
[Label("First Level")]		element FirstLevel : LANGUAGEINDEPENDENT_EXTENDED_Text;
[Label("Second Level")]		element SecondLevel	: LANGUAGEINDEPENDENT_EXTENDED_Text;

[Label("Information")]		element Information	: LANGUAGEINDEPENDENT_EXTENDED_Text;
[Label("Information 2")]	element Information2: LANGUAGEINDEPENDENT_EXTENDED_Text;

[DependentObject(TextCollection)] [LanguageIndependent] node TextCollection;
}

2) Right Click the BO and Create Service Integration -> Type = "WebService"

3) Selected the fields (including the TextCollection)

4) And, created an QueryByElements and Read operation in the WebService. Both of them does not return the TextCollection dependentobject field.

5) Since i need to store more than 255 characters in the field and In order to overcome this limitation (of not able to expose Textcollection field - not sure it is still a limitation or there is a way to expose a textcollection), I have to write logic in BeforeSave to split the TextCollection into two fields "Information" and "Information2" each of 255 chars.

Request

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<soap:Header/>
<soap:Body>
<glob:TestBOQueryByIDByIDQuery_sync>
<TestBO>
<ID>123</ID>
</

TestBO>
</glob:TestBOQueryByIDByIDQuery_sync>
</soap:Body>
</soap:Envelope>

Response

<SAP_UUID>00163e0f-zzzzz-xxxx-aaaa-2e670590e162</SAP_UUID>
<ID>123</ID>
<Section>My Team</Section>
<FirstLevel>FirstLevel</FirstLevel>
<SecondLevel>SecondLevel</SecondLevel>
<Information>Please provide the information below to help us to progress your enquiry:

Please attach any document(s) that will further support your enquiry.

If you are filling this out on behalf of someone</Information>
<Information2>please include their name and personnel number.</Information2>

Note - Response does not seem to be having the TextCollection field. Rather only the "Information" and "Information2" fields - which are of 255 char limit each.

Appreciate your early response and help with this issue.

Thanks

Sampath Kumar N

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Horst Schaude
Feb 07 at 10:04 AM
0

Hello Samapth,

If you know that roughly 500 chars are enough for your business case and you are not disturbed by the name you can also use the GDT

LANGUAGEINDEPENDENT_ENCRYPTED_EXTENDED_Name.
This data type can carry up to 765 chars.

HTH,
. Horst

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thanks Horst for getting back on this query. This is the exact workaround I have implemented now (with field of type LANGUAGEINDEPENDENT_ENCRYPTED_EXTENDED_Name) and able to successfully consume the new field in Webservice WSDL as well.

Wondering - are you aware of any inherent limitation in exposing TextCollection field to the WebService (though this blog mentions it can be exposed successfully-

https://blogs.sap.com/2017/10/03/step-by-step-to-enable-text-collection-for-your-custom-bo/comment-page-1/#comments#comment-409801).

Wondering is there anything I could be doing wrong now?

Thanks and Regards

Sampath Kumar N

0
Sampath Kumar Narayanan

Hello Sampath,

Let's see what Jerry is answering as he managed to do it successfully.

Bye,
. Horst

0

Hello Horst,

No updates from Jerry yet. Keeping my fingers crossed.

Thanks

Sampath

0
Jerry Wang
Feb 24 at 01:24 AM
0

Hello Samapth,

You can check my blog Expose TextCollection data belonging to a Custom BO via OData service.

Best regards,

Jerry

Share
10 |10000 characters needed characters left characters exceeded