You are on page 1of 1

Examples Update discount for all customers (in the current client) to 3 percent: TABLES SCUSTOM.

UPDATE SCUSTOM SET DISCOUNT = 003'. Note The colon and comma logic in the program fragment UPDATE SCUSTOM SET: DISCOUNT = 003', TELEPHONE = 0621/444444' WHERE ID = 00017777'. defines record chains, not through a single statement which updates the discount and the telephone number o f the customer with the customer number 00017777', but by means of two statements where the first updates the discount for all customers and the second changes the telephone number of the customer with the c ustomer number 00017777'. Addition 1 WHERE condition Effect Updates only those lines which satisfy the WHERE clause condition . Example Increase the number of occupied seats on Lufthansa flight 0400 on 28.02.1995 by 3 (in the current client): TABLES SFLIGHT. UPDATE SFLIGHT SET SEATSOCC = SEATSOCC + 3 WHERE CARRID = LH AND CONNID = 0400' AND FLDATE = 19950228'. Addition 2 CLIENT SPECIFIED Effect Switches off automatic client handling. This allows you to update across all clients when using client-specific tables. The client field is treated like a normal table f ield, for which you can formulate suitable conditions in the WHERE clause. This addition must immediately follow the database table name. Example Increase the number of occupied seats on Lufthansa flight 0400 on 28.02.1995 by 3 in client 2: TABLES SFLIGHT. UPDATE SFLIGHT CLIENT SPECIFIED SET SEATSOCC = SEATSOCC + 3 WHERE MANDT = 002' AND WHERE CARRID = LH AND CONNID = 0400' AND FLDATE = 19950228'. Variant 2 UPDATE dbtab. or UPDATE *dbtab. or UPDATE (dbtabname) . Additions 1. FROM wa 2. CLIENT SPECIFIED Effect These are SAP-specific short forms which update one single line of a database table. T he primary key for identifying the line to be updated and the values to be chang ed when specifying the database table name in the program are taken from the table work area dbtab or *dbtab . If the database tab le name is determined at runtime, you need to use the addition FROM wa .

You might also like