Converting date into internal date type

As already mentioned, regular expressions are useful for converting data into the required format. One good example is the conversion of a date stored in internal format into display format, and vice versa. For example, a date may be available as 20120101 and we need to format it in the form 01/01/2012, and so on. In this recipe, we will see how a single statement of replace may be used to carry out this task. For this recipe, we assum that input date is in the correct internal format.

How to do it...

For carrying out the previously mentioned conversion, proceed as follows:

  1. First, declare a variable mydate having a length of 10 characters. A date having the internal format date is then assigned to this variable. ...

Get SAP ABAP Advanced Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.