cancel
Showing results for 
Search instead for 
Did you mean: 

How get all rows of a table with a BAPI

Former Member
0 Kudos

Hi,

how is it possible to get more then one row by calling a BAPI from the WD. In my Application I need the rows of a Table coming from the r/3 System. How is it possible to get all the rows after the first call? What is the logic behind it? My purpose is also to create an own BAPI.

regards,

Sharam

null

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pourmir,

Once you execute the RFC the result will be available to you. It will return all the rows of table if there are any.You just have to bind the Table UI element to structure which is available to you. While executing the RFC make sure that you are passing all mandatory parameters.

You can get the size of Table by:

wdContext.node<nodeName>.size();

Regards,

Jhansi

Former Member
0 Kudos

Hi,

Thanks for your replay. My purpose is to save the values getting from the

Back-End-System in my array, so I don't need a UI-Table. How is it possible? My next question is, if I create a RFC in my Back-End-System (R/3), which type of Export-Parameter or Table-Parameter should I use, an internal Table or a structure which was embedded in a LOOP? Could you please post me an example?

regards,

sharam

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

If I understand, you don't want display the result into a Web Dynpro Table. If so, after the execution, the result of your request is stored into the context. Then you don't really need to transfert the data from your context to an Java Array.

But if you want to do it, here is the code :

guess your result node called

nodeResult

Vector myVector = new Vector();

for (int i = 0; i < wdContext.nodeResult().size(); i++){
   myVector.put(wdContext.nodeResult().getElementAt(i));
}

I hope this will answer to your question.

Regards

Former Member
0 Kudos

Hi Berthe,

Thanks for your replay. Could you also answer my second question?

>if I create a RFC in my Back-End-System (R/3), which type of Export-Parameter or >Table-Parameter should I use, an internal Table or a structure which was embedded in a >LOOP?

regards,

Sharam

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

I donc't really get your second question

But to create a BAPI, the good manner to do, it is to create one with only table for input and/or output parameters. It is for optimizing the performences. But of course it works well with the other type of parameters.

A good stuff to know is, whatever you set as SAP's type for your BAPI's parameters because after importing the model, NWDS will cast all SAP's types to String or BigDecimal java type.

Regards,

Answers (2)

Answers (2)

Former Member
0 Kudos
Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

Actually, it is automatic. If the result of your BAPI is plenty of rows, then your WD table will be fill as well. But you have to bind the BAPI's node to yout WD table.

Regards,