cancel
Showing results for 
Search instead for 
Did you mean: 

Work with Data from BAPI Function Call

Former Member
0 Kudos

Hi everyone,

I'm working with the BAPI_USER_GETLIST method with WebDynpro. I've created a model, added the context mapping and all is working fine.

If I create a binding on a table to the node "UserList_Input -> Output -> Userlist -> Username" all is working and the table lists to me all users available.

So far so god.

But if I want to work with the result from the call manually (for example stock all users to an array for working with it) with the following code:


String test = wdThis.wdGetContext().currentUserlistElement().getUsername();

the test String represents only the first result (1 user).

How can I access all the data?!? (all users from the result)

I've also tried to work with the corresponding Object from the Node

 
Object testObject = wdThis.wdGetContext().currentUserlistElement().getAttributeValue("Username");
   String testString = testObject.toString();

but it has only the method toString an this String is also only the first element...

Any sugestions?

Thanks in advance,

regards ivi

Accepted Solutions (1)

Accepted Solutions (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Get the size of the node Userlist.

Using the for loop

int size=wdContest.nodeUserList.size();

wdContest.nodeUserList.MoveFirst();

for(int i=0;i<size;i++){

String test=wdGetContext().currentUserlistElement().getUsername();

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("User Name:"+test);

wdContest.nodeUserList.MoveNext();

}

Regards,

Vijayakhanna

Former Member
0 Kudos

Hi Raman,

thx a lot, that's was exactly I asked for!!

regards,

ivi

Answers (0)