SUBTRACT ( SAP ABAP Keyword)

SUBTRACT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.

SUBTRACT


Basic form
SUBTRACT n1 FROM n2.

Effect
Subtracts the contents of n1 from the contents of n2 and stores the result in n2 .

This is equivalent to: n2 = n2 - n1.

Example

DATA NUMBER TYPE P VALUE 3,
RESULT TYPE I VALUE 7.
SUBTRACT NUMBER FROM RESULT.


The field RESULT now contains 4; the value of NUMBER remains unchanged at 3.

Note
Performance
The remarks about conversions and performance under COMPUTE apply equally to SUBTRACT .
The runtime required to subtract two numbers of type I or F is approx. 2 msn (standardized microseconds). For numbers of type P, about 9 msn are needed.

Note
Runtime errors

BCD_BADDATA : P field contains no correct BCD format
BCD_FIELD_OVERFLOW : Result field is too small (type P )
BCD_OVERFLOW : Overflow with arithmetic operation (type P )
COMPUTE_INT_MINUS_OVERFLOW : Whole number overflow during subtraction

Most readed SAP Tutorials

Latest Added SAP documents

Custom Search
ABAP Tutorials ABAP Syntax BAPI SAP Jobs SAP Glossary SAP Netweaver SAP XI SAP Download SAP Interview questions

Complete SAP Study materials | SAP JOBS | PDF Tutorials   List of SAP Companies India

Google-Translate-Chinese (Simplified) BETA Google-Translate-English to French Google-Translate-English to German Google-Translate-English to Italian Google-Translate-English to Japanese BETA Google-Translate-English to Korean BETA Google-Translate-English to Russian BETA Google-Translate-English to Spanish

All of the product names here are trademarks of their respective companies. The site sapbrainsonline.com no way affiliated with SAP AG. Use information on this site at your own risk. Information furnished in the site is collected from various sites and posts from users. This site does not host any files on its server. If any compliants about the posts please contact us at sapbrain.support@gmail.com

Sitemap
web counter