Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Data not getting fetched into Flex from SAP backend

Former Member
0 Kudos
117

Hello....

I have tried fetching data from SAP into Flex for simple BAPIs. For Ex; there would be 2 to 3 fields and we enter some values in it and these values are wrapped into an object and sent to SAP to fetch the details. This works fine.

But now, my problem is, I want to pass a list of data, as the one of the table parameter in the BAPI is mandatory to be passed. For this I created a arraycollection with same field names as in SAP:

<mx:ArrayCollection id="sel">

<mx:Array>

<mx:Object FIELD_NAME="RENTAL_OBJECT" SIGN="I" OPTION="EQ" FIELD_VALUE_LOW="1" FIELD_VALUE_HIGH="9999999"/>

</mx:Array>

</mx:ArrayCollection>

var inp:Object = new Object();

inp.SELOPTION = sel.source; //parameter name in SAP is SELOPTION

operation.arguments = inp;

operation.send();

I get the result back with this. But it will have only the table\structure names. It is not fetching any records, as it does in SAP when BAPI is executed.

You can have a look at the screen shot of it here:

This is the result that I'm getting in Flex:

http://img43.imageshack.us/img43/1477/screenshotgp.jpg

This is the result I get in SAP when I execute the BAPI directly:

http://img340.imageshack.us/img340/3796/screenshot2wa.jpg

Can someone who have come across this please help me out?

Thanx.

Deepak

1 ACCEPTED SOLUTION

Former Member
0 Kudos
62

Hi Deepak,

To send multiple entries to a table your code should be like this only.

var dateRangeRow:Object = new Object();

input.DATE_RANGE = new Array();

dateRangeRow.SIGN = "I";

dateRangeRow.OPTION = "EQ";

dateRangeRow.LOW = "2002-12-20";

dateRangeRow.HIGH = "";

input.DATE_RANGE.push(dateRangeRow);

Check the below link for details.

http://blog.danmcweeney.com/57

Regards

Basheer

3 REPLIES 3

Former Member
0 Kudos
63

Hi Deepak,

To send multiple entries to a table your code should be like this only.

var dateRangeRow:Object = new Object();

input.DATE_RANGE = new Array();

dateRangeRow.SIGN = "I";

dateRangeRow.OPTION = "EQ";

dateRangeRow.LOW = "2002-12-20";

dateRangeRow.HIGH = "";

input.DATE_RANGE.push(dateRangeRow);

Check the below link for details.

http://blog.danmcweeney.com/57

Regards

Basheer

0 Kudos
62

Hi Basheer,

I tried your code, but I still get the same result as in that flex screen shot.... : (

0 Kudos
62

Hi Basheer,

I tried that link which you had mentioned, which uses Flight List as an example. It worked well for me, I'll try that for my BAPI too, hope it works out for me this time.... : )