There will be instances where you need to read tables dynamically. For a example when you work with access sequences in SAP, you will need to read data using this method.
In the below example, program is defined in such a way that the table which it needs to fetch data from is determined only at run-time.
User have the option of reading data from either EKKO (Purchasing Document Header) or EKPO (Purchasing Document Item) tables. Selection parameters which can be used to read each table is different. Selection parameters Purchasing document number and company code can read can filter entries in EKKO, where Purchasing document, line item and material can filter the result of EKPO.
For option EKKO.
For Option EKPO.
Selection Screen Definition:
Enable and disable selection screen parameters at PBO.
Logic to determine the table and where conditions at run-time.
Hi, I am Isuru Fernando, Senior SAP Integration Consultant with 10 years of SAP full-cycle implementation and support project experience.From the early days, I had a passion for coding, software development, and everything tech-related. I started my carrier as an ABAP developer and soon found my love for system integration when I learned SAP XI 3.0 in 2008. Playing a variety of roles from an offshore technical consultant (ABAP, PI/PO, BW, BOBJ) at the beginning of my career to a technical lead managing a team of consultants in different countries, I have gained immense experience in SAP project implementation life cycle.Having the opportunity to work on SAP implementation projects in USA, EU, and Asia, I learned valuable ins and outs of global business processors in Sales and Distribution (SD), Material Management, Retail, Customer Relationship Management (CRM), and Finance and Controlling (FICO).Through this blog, I want to share my expertise in SAP technical areas such as SAP ABAP, PI/PO, AIF, and Basis. I also want to provide a platform for others with similar ambitions who would like to share their SAP technical expertise with the world!