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: 

Use of SAP templates in Object Oriented Approach

Former Member
0 Kudos

Hi Colleagues

I have a template ( a report containing commented code which categorizes different abap statements ) . This report contains dynamic select query .
By this categorization i mean

"DATA  BEGIN OF P_REAC OCCURS 20.

"        INCLUDE STRUCTURE &TABNAME                                  .

"DATA  END   OF P_REAC.

( " for data declarations )

**FIELDCAT AND gv_redet-&FIELDNAME = up_bedf-&FIELDNAME

( ** for dynamic select query )

This report is uncommented , filled with actual data and compiled at runtime using the code like

*-  generate subroutine pool ------------------------------------------*

   generate subroutine pool h_codetab name g_report

     message h_codetab_message

     include h_codetab_include

     line    h_codetab_line

     word    h_codetab_word.

This generates a report (gv_determination-report) .

Now this report is used in a subroutine like :

PERFORM rereg_determination IN PROGRAM (gv_determination-report)

                                              USING    im_bedf

                                                          gv_determination-table

                                                          im_bedf-j_3aresgy

                                           CHANGING ex_rereg.



I am trying to achieve all of this using OOPS approach .

Please let me know whether this is possible .

Kindly give your inputs.

Thanks and Best Regards

Varsha




.

3 REPLIES 3

former_member392866
Active Participant
0 Kudos

Hi Varsha,

Possible --> only if you want write code in local methods

Not possible --> screen decoration is not possible by using dynamic programming (like when using

generate subroutine pool  concept)

Hope this will give you an idea .  Thank you .

Regards,

Balaji.

0 Kudos

Hi Balaji

Thank You for your answer

Could you explain what did you mean by screen decoration here ?

I will be writing all my code in local methods only . In this case , generation of actual report from the template report should not be a problem right ??

Thanks

Varsha

0 Kudos

Hi Varsha,

Hopefully should not be a problem...

screen means like dialog programming... (ex: CALL SCREEN 100)

Thanks,

Balaji