ABAP Programs: Converting date fields
* Using the built-in calendar
DATA: RECEIVING_DATE TYPE D,
LAST_ADMISSIBLE_DATE TYPE D.
RECEIVING_DATE = ’19980223′.
LAST_ADMISSIBLE_DATE = RECEIVING_DATE + 10.
WRITE / LAST_ADMISSIBLE_DATE.
RECEIVING_DATE = ’19980305′.
LAST_ADMISSIBLE_DATE = RECEIVING_DATE + 10.
WRITE / LAST_ADMISSIBLE_DATE.
RECEIVING_DATE = ’20000223′.
LAST_ADMISSIBLE_DATE = RECEIVING_DATE + 10.
WRITE / LAST_ADMISSIBLE_DATE.
Type rest of the post here
———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info
If you like this post, you may as well like these too:
- ABAP Programs: Converting character fields REPORT ZSOURCE0703. * Truncating fields or padding with blanksDATA: SHORT_NAME(8), LONG_NAME(16).MOVE ‘Washington’ TO: SHORT_NAME, LONG_NAME.WRITE: / SHORT_NAME, LONG_NAME. * Take care of intermediate stepsLONG_NAME = SHORT_NAME = ‘Washington’.WRITE: / SHORT_NAME,...
- ABAP Programs: Converting number fields * Using numeric texts and packed numbersDATA: NO_EMPLOYEES(4) TYPE N, NO_ROOMS TYPE P, EMPLOYEES_PER_ROOM TYPE P DECIMALS 2.EMPLOYEES_PER_ROOM = NO_EMPLOYEES / NO_ROOMS. * Rounding with integers and packed numbersDATA: INCOME...
- ABAP Programs: Date and Time REPORT ZSOURCE0405. * Date fields are type d with the fixed length 8 and the internal* representation YYYYMMDD (year, month, and day).* The initial value of a date field is...
- ABAP Programs: Using system fields REPORT ZSOURCE0409. WRITE: / ‘Current date’, SY-DATUM, / ‘Current table index’, SY-TABIX, / ‘Loop counter’, SY-INDEX, / ‘System return code’, SY-SUBRC.———————ABAPer, mail: abap.community@gmail.com http://www.erpdb.info...
- ABAP Programs: Copying fields REPORT ZSOURCE0701. * move fieldsDATA: NAME(25), COUNTER TYPE I.DATA: SOURCE LIKE NAME, TARGET LIKE SOURCE.MOVE: ‘Edison’ TO NAME, 17 TO COUNTER.MOVE SOURCE TO TARGET.* Using the compute command (keyword can...
- ABAP Programs: Selecting Single Fields REPORT ZSOURCE1106.* Work area for a database tableTABLES CUSTOMERS.* Selecting single fieldsDATA: CID LIKE CUSTOMERS-ID, CNAME LIKE CUSTOMERS-NAME.SELECT ID NAME INTO (CID,CNAME) FROM CUSTOMERS. WRITE: / CID, CNAME.ENDSELECT. ~~~ end...
- ABAP Programs: Setting the layout position of fields REPORT ZSOURCE0804. DATA: POS TYPE I, LEN TYPE I. WRITE AT 5 ‘position 5′.POS = 20.WRITE AT POS ‘position 20′.POSITION 40.WRITE ‘position 40′. POS = 10. LEN = 20.NEW-LINE.WRITE AT...
- ABAP Programs :Using Field Symbols for variable parts of fields REPORT ZSOURCE2402. DATA: EXTERNAL_RECORD(4000), POSITION TYPE I, LENGTH TYPE N. FIELD-SYMBOLS < ENTRY>. EXTERNAL_RECORD = '0005Smith0007Edwards0005Young'. DO. LENGTH = EXTERNAL_RECORD+POSITION(4). IF LENGTH = 0. EXIT. ENDIF. ADD 4 TO POSITION....
- How to generate a long date like "2 januari 2007" from "20070102". DATA my_date TYPE DATUM.my_date = ’20070502′. DATA wa_dates LIKE TABLE OF T247 WITH HEADER LINE.DATA wa_date LIKE TABLE OF T247 WITH HEADER LINE.DATA long_date TYPE STRING. CALL FUNCTION ‘MONTH_NAMES_GET’ EXPORTING...
- Characteristics and Value Fields In the operating concern two things are basically defined Characteristics Value Fields Characteristics are nothing but those aspects on which we want to break down the profit logically such as...
- SAP System Fields SAP System Fields AlphabeticalSAP System Fields Categorised ~ end of post ~ ———————ABAPer, mail: abap.community@gmail.com http://www.erpdb.info...
- ABAP Source Code: Syntax of ABAP/4 Programs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 * Declaration...
- Add Fields to SAP Table An Append Structure or a customizing include can be used to add fields to the Table. Append structures are created by adding fields to the end of a table while...
- ABAP Programs: Exporting to the ABAP/4 Memory REPORT ZSOURCE1401. * Work areas TABLES: CUSTOMERS, BOOKINGS. * Internal tables which will be exported DATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, ALL_BOOKINGS LIKE BOOKINGS OCCURS 10 WITH...
- Find the Fields or Tables accessed for a Transaction A common way to find the technical data underlying a transaction is to place your cursor in the field, press the key F1, and then click on the button Technical...



















Leave a Reply