Posts

Showing posts with the label SAP FM for date conversion

ABAP Date Conversion - YYYYMMDD to DD.MM.YYYY - SAP Function Module

Image
There are two function modules available in SAP. 1. CONVERSION_EXIT_PDATE_OUTPUT 2. CONVERSION_EXIT_SDATE_OUTPUT In SAP both function module shows to be doing the same thing. CONVERSION_EXIT_PDATE_OUTPUT This FM should be used where there is a need to convert the date from YYYYMMDD to DD.MM.YYYY . CONVERSION_EXIT_SDATE_OUTPUT This is the correct function module for date conversion from  YYYYMMDD to DD.MMM.YYYY (For example: 20180305 to 05.MAR.2018)

ABAP Date Conversion - DD.MM.YYYY to YYYYMMDD - SAP Function Module

Image
There are two function modules available in SAP but don't get confused. 1. CONVERSION_EXIT_PDATE_INPUT 2. CONVERSION_EXIT_SDATE_INPUT In SAP both function module shows to be doing the same thing but that's not the case. CONVERSION_EXIT_PDATE_INPUT This FM should be used where there is a need to  validate Date of Birth. So this function module will no doubt convert the date from DD.MM.YYYY to YYYYMMDD, but only for past date. CONVERSION_EXIT_SDATE_INPUT This is the correct function module for date conversion from DD.MM.YYYY to YYYYMMDD. Syntax:  DATA: lv_dd_mm_yyyy(10) type c,             lv_yyyymmdd type sy-datum. CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'         EXPORTING           input  = lv_dd_mm_yyyy         IMPORTING           output = lv_yyyymmdd.