cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Structure - Table (name for line type)

Former Member
0 Kudos

Hi Abaper,

I created a simple web service with function module (remote enabled).

The WS works great but ...

I would like to adapt my XML structure (request).

Actually :

<REQ>

     <USERS>

          <item>

               <USERID>?</USERID>

          </item>

     </USERS>

</REQ>

What I would like :

<REQ>

     <USERS>

          <USER>

               <USERID>

          </USER>

     </USER>

</REQ>

In SE11 i have :

- ZWS_USERS (Structure)

-- USERS (Table type - ZTT_USERS)

--- ??? (Line type - ZLT_USER)

How to name the line ?

I want to replace <item> by <USER>

I can't find how to do that ... This is probably simple but ...

Thanks,

Youri

Accepted Solutions (1)

Accepted Solutions (1)

GrahamRobbo
Active Contributor
0 Kudos

Hi Youri,

Roland makes a relevant point when he talks about "contract first" - which of course is exactly NOT what generating a service from an existing backend function in the way you have is. That is inside-out development as opposed to outside-in. (BTW - SE80 has support for outside-in development, as does SAP NW Gateway, so maybe you might like to look at that sometime?)

Anyway, you might like to take a look at a blog post I did years ago called . Ignore the main subject of this post - the key thing is that when generating a web service in this way some Simple Transformations are created that actually do the transformation of ABAP data to XML and vice versa. So this would logically mean that is where the <item> tag is hardcoded.


In theory you could replace the relevant transformation with your own.


Cheers

Graham Robbo

Answers (1)

Answers (1)

Jelena
Active Contributor
0 Kudos

Have to admit I'm utterly confused by the question (SE11 does not allow you to name a structure?), but take a look at the structure LEDLV_DELNOTE, for example - it's rather complex and includes both structure and table types.

You might want to post some screenshots - most likely I'm not the only one confused.

Former Member
0 Kudos

It's not easy to explain sorry ...

I have a Function Module (web service) with Import Data :

  • Req - type ZWS_USERS (structure).

Structure ZWS_USERS is defined by a table type ZTT_USERS.

Table type ZTT_USERS is defined by a line type ZLT_USER.

With my web service i generated a WSDL.

When i consume this web service my XML structure looks :

<REQ>

     <USERS>

          <item>

               <USERID>?</USERID>

          </item>

     </USERS>

</REQ>

I would like to change <item> by <USER>

This tags are added by SAP.

How can i change that ?

Not possible in SE11 ? in the line type definition ?

esti1
Participant
0 Kudos

I don't think anything you can change in SE11 will influence that tag - it's generated by SAP along with the web service.

If it is possible at all you may be able to change the interface in the actual web-service.  (However it's likely that if you have to regenerate the web-service your changes will be overwritten again).

Sorry I don't have access to a system where I can check this at the moment.

If you can post some screenshots of the web service interface in SE80 someone else may be able to help.

Former Member
0 Kudos

This is indeed not possible with SE11 ...

This tag is generated by SAP.

Imo it cannot be changed.

I had already searched in SE80 Service Definitions.

I had found the XML generation (transformation) for my Web Service but i could not edit it.

SAP add the tag <item> during this transformation.

SE80

Entreprise Services

--- Service Definition

------ External View

--------- Func.ST

--------- Param.ST

Former Member
0 Kudos

I think there should be a way for what you want to do.

There is a common strategy in webservice development called "contract first". That means you can first create the wsdl an then implement the service, consistent with the wsdl.

If we want to have a webservice, someone has to program in ABAP, then we first do the service definition in our PI (enterprise services builder). At the ECC backend the ABAP programmer can import the service definition into the abap programming environment an start from this the code development.

I can't say how this has to be done, because I'm not an ABAP programmer.

I would suppose, that "contract first" strategy should work without PI too. Perhaps there is an "Import WSDL" function in the ABAP programming environment.

Jelena
Active Contributor
0 Kudos

Usually we don't really develop web services in ABAP but just create a function module and then use SOAMANAGER transaction that by some magic creates a web services. Not saying it's not feasible, but for what appears to be merely a cosmetic issue it would seem like an overkill to do some completely custom program.

@OP - it does seem here that we get what we get from SAP web service, so I guess we'll just have to live with it, sorry! Also this never came up as an issue in any web service implementations that I've created, so not sure what the significance is, to be honest.