Quantcast
Channel: SCN : Popular Discussions - ABAP for SAP HANA
Viewing all articles
Browse latest Browse all 1246

Alternate to Loops and Read Statements in HANA procedures

$
0
0

Hi Experts,

 

We have a client upgrading to HANA so there are many reports that we would like to code pushdown.

 

There are certain challenges that we are facing while creating procedures like:

The existing report has many loops and read statements inside so we are planning to bring that logic down inside Procedures.

 

As of now all the Select Queries have been incorporated via CE Functions inside the Procedures but the main challenge now is how to code for loop and read statements inside procedures.

 

I would like to put a loop on the output parameters below:

 

ZPC_MSC.PNG

 

Also,Is it a good practice to remove all the loops and read statements and writing them in Procuderes or just leave them as it is and just put the Select Queries inside Procedures.

 

Below is the code that we want to have inside our procedures:

     LOOP AT i_vbfa INTO w_vbfa WHERE vbelv = w_vbak-vbeln.

       READ TABLE i_vbrk INTO w_vbrk WITH KEY vbeln = w_vbfa-vbeln

                                              fkart = 'ZRBC'.

       IF sy-subrc = 0.

         v_fkdat w_vbrk-fkdat.

         IF w_vbrk-zzbelnr IS INITIAL.

           lv_rbc = 'X'.

         ENDIF.

       ENDIF.


       READ TABLE i_vbrk INTO w_vbrk WITH KEY vbeln = w_vbfa-vbeln

                                                fkart = 'ZRBM'.

       IF sy-subrc = 0.

         lv_rbm = 'X'.

       ENDIF.

 

 

       CLEAR: w_vbfa,

              w_vbrk.

 

     ENDLOOP.

 

I guess we would have to use For and Cursor Statements but never used them.

 

Thanks,
Gaurav


Viewing all articles
Browse latest Browse all 1246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>