ERP Database - The Unofficial ERP Knowledge Base

Facebook Twitter del.icio.us Digg it
ERP Database contains a huge collection of articles related to ERP System and Software. Many of the articles are specifically related to SAP. All these ERP/SAP articles are freely available to everyone.

If you would like to submit an article or share any document related to ERP or any specific ERP software. Please mail it to support@erpdb.info. Please make sure that the documents are not copyrighted.
Social Bookmarks:

ABAP Programs: Modifying multiple entries in a database table

Print This Post Email This Post Written by admin on Dec 10th, 2007 | Filed under: ABAP Programs

REPORT ZSOURCE1306.
* Work area
TABLES CUSTOMERS.
* Internal table for changed entries
DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 50
WITH HEADER LINE.

* Filling the internal table
SELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS
WHERE CITY = SPACE.
ALL_CUSTOMERS-ID = ’04295119′.
ALL_CUSTOMERS-NAME = ‘Gray’.
APPEND ALL_CUSTOMERS.
LOOP AT ALL_CUSTOMERS.
ALL_CUSTOMERS-CITY = ‘City unknown’.
MODIFY ALL_CUSTOMERS.
ENDLOOP.
* Modifying the database table with values from the internal table
MODIFY CUSTOMERS FROM TABLE ALL_CUSTOMERS.

———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info

Share

If you like this post, you may as well like these too:

  1. ABAP Programs: Modifying single entries in a database table REPORT ZSOURCE1305.* Work areaTABLES CUSTOMERS.* Modifying an entryCUSTOMERS-ID = ’12345678′.CUSTOMERS-CITY = ‘Village’.MODIFY CUSTOMERS. ~ end of post ~ ———————ABAPer, mail: abap.community@gmail.com http://www.erpdb.info...
  2. ABAP Programs: Updating multiple entries in a database table REPORT ZSOURCE1304.* Work areaTABLES CUSTOMERS.* Internal table for changed entriesDATA CHANGED_CUSTOMERS LIKE CUSTOMERS OCCURS 50 WITH HEADER LINE.* Filling the internal tableSELECT * FROM CUSTOMERS INTO TABLE CHANGED_CUSTOMERS WHERE CITY...
  3. ABAP Programs : Inserting multiple entries in a database table REPORT ZSOURCE1302.* Work areaTABLES CUSTOMERS.* Internal table for new entriesDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Filling the internal tableALL_CUSTOMERS-ID = ’12345678′.ALL_CUSTOMERS-NAME = ‘Brown’.APPEND ALL_CUSTOMERS.ALL_CUSTOMERS-ID = ’11111111′.ALL_CUSTOMERS-NAME =...
  4. ABAP Programs: Deleting multiple entries from a database table REPORT ZSOURCE1308.* Work areaTABLES CUSTOMERS.* Internal table for deleted entriesDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 50 WITH HEADER LINE.* Filling the internal tableSELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS WHERE CITY...
  5. ABAP Programs: Inserting single entries in a database table REPORT ZSOURCE1301.* Work areaTABLES CUSTOMERS.* Record used as alternative work areaDATA MY_CUSTOMER LIKE CUSTOMERS.* Inserting one entry from the work areaCUSTOMERS-ID = ’12345678′.CUSTOMERS-NAME = ‘Brown’.INSERT CUSTOMERS.IF SY-SUBRC 0. WRITE: /...
  6. ABAP Programs: Deleting single entries from a database table REPORT ZSOURCE1307.* Work areaTABLES CUSTOMERS.* Deleting an entryCUSTOMERS-ID = ’12345678′.DELETE CUSTOMERS. ~ end of post ~ ———————ABAPer, mail: abap.community@gmail.com http://www.erpdb.info...
  7. ABAP Programs: Updating single entries in a database table REPORT ZSOURCE1303.* Work areaTABLES CUSTOMERS.* Record used as alternative work areaDATA MY_CUSTOMER LIKE CUSTOMERS.* Updating one entry from the work areaCUSTOMERS-ID = ’12345678′.CUSTOMERS-CITY = ‘Village’.UPDATE CUSTOMERS.IF SY-SUBRC 0. WRITE: ‘Entry...
  8. ABAP Programs: Filling an internal table from a database table REPORT ZSOURCE1203.* Work area for a database tableTABLES CUSTOMERS.* Defining an internal table with header lineDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Filling the internal table (previous content...
  9. ABAP Programs: Reading single entries REPORT ZSOURCE1105.* Work area for a database tableTABLES CUSTOMERS.* Reading a single entrySELECT SINGLE * FROM CUSTOMERS WHERE ID = ’87654321′.IF SY-SUBRC = 0. WRITE CUSTOMERS-NAME.ELSE. WRITE ‘Customer not found.’.ENDIF.~~~...
  10. ABAP Programs: Appending multiple lines REPORT ZSOURCE1205.* Work area for a database tableTABLES CUSTOMERS.* Defining internal tablesDATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, OLD_CUSTOMERS LIKE CUSTOMERS OCCURS 10 WITH HEADER LINE.* Filling both...
  11. ABAP Programs: Using a Logical Database REPORT ZSOURCE1502. * Work areas TABLES: CUSTOMERS, BOOKINGS. * Reading data GET CUSTOMERS. WRITE / CUSTOMERS-NAME. GET BOOKINGS. WRITE: AT /3 BOOKINGS-FLDATE....
  12. ABAP Programs: Using table parameters REPORT ZSOURCE1006. * Work area of database table and internal table for later useTABLES CUSTOMERS.DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 50 WITH HEADER LINE.* Calling a form with a table parameterPERFORM...
  13. ABAP Programs: Using a dynamic table name REPORT ZSOURCE1110.* Variables for later useDATA: TABLENAME(10), COUNT_ROWS TYPE I.* Setting the table name dynamicallyMOVE ‘CUSTOMERS’ TO TABLENAME.* Selecting dataSELECT COUNT( * ) FROM (TABLENAME) INTO COUNT_ROWS.WRITE: TABLENAME, COUNT_ROWS. ~...
  14. ABAP Programs: A simple internal table REPORT ZSOURCE1201.* Work area for a database tableTABLES CUSTOMERS.* Defining an internal tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100.* Reading all entries of the database table into the internal tableSELECT *...
  15. Fieldinfo & Values for download for any database table as input Sample code with screen shots where User enters a table name and gets in ALV the list of all the fields in table with their salient characteristics and the key...



Leave a Reply