Application Development and Automation 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: 
Read only

Reading table using subroutines.

0 Likes
1,667

Hi Community,

I am using subroutine defined in two different programs. I've been asked to define the tables in form - endform program and then acess them in another program having the perform statement. Can you please help me how i can do that.

Thankyou

5 REPLIES 5
Read only

lenastodal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,568

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with: https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members.

For example, you can:
- outline what steps you took to find answers (and why they weren't helpful)
- share screenshots of what you've seen/done
- make sure you've applied the appropriate tags
- use a more descriptive subject line

The more details you provide, the more likely it is that members will be able to respond. Feel free to also take our Q&A tutorial at: https://developers.sap.com/tutorials/community-qa.html

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your profile you encourage readers to respond: https://www.youtube.com/watch?v=46bt1juWUUM


Join or subscribe to SAP Community Groups to stay up-to-date, including SAP TechEd Group.
Read only

ThorstenHoefer
Active Contributor
0 Likes
1,568

Hi abhig29,

I would consider using ABAP classes. However, you can still put the table definition and the form in an include and import this include into both programs.

Regards

Thorsten

Read only

matt
Active Contributor
0 Likes
1,568

Using includes as a way of sharing code and modularising is not good practice. Includes should only ever be a way of organising code and frankly aren't needed any more, outside of a few exits and the like.

Read only

Sandra_Rossi
Active Contributor
1,568

Subroutines are obsolete. You should use methods.

If for some reason you want to continue with subroutines, PERFORM ... IN PROGRAM ... But it's wrong design (you should use methods from class pools).

Shared includes are also no more recommended. You should use methods from class pools.

Read only

matt
Active Contributor
1,568

Use of PERFORM ... IN PROGRAM ... is actively discouraged - as are shared includes. It's not just wrong design, it's bad design.