Hi Guys,
I have a requirement.
When data is loaded from Generic Data source created using FM ---> DSO, My load is getting failed due to Invalid date or time format entered by users in ECC. To avoid the load failures we are maintaining an exception table so that whenever a record with invalid date or time comes below code will handle that and write to an exception table instead of passing to DSO.
Some how same kind of code works for wrong time format but not working for wrong date format. Can you please help me out on priority
IF strlen( lv_d1 ) EQ 8.
wa_data-zzp2_gsdt = lv_d1.
ELSE.
DATA : wa_zexception_load TYPE zexception_load.
DATA : wa_dtfm TYPE xudatfm.
DATA : wa_dtrc TYPE abap_bool.
wa_dtfm = wa_ausp-/bic/zp2_atwrt.
TRY.
CALL METHOD cl_abap_datfm=>check_date_format
EXPORTING
im_datfm = wa_dtfm
RECEIVING
re_is_valid = wa_dtrc.
CATCH cx_abap_datfm_format_unknown.
wa_zexception_load-aufnr = wa_ausp-/bic/zp2_aufnr.
wa_zexception_load-qmnum = wa_ausp-/bic/zp2_qmnum.
wa_zexception_load-fenum = '0'.
wa_zexception_load-class = 'BRCC_REPAIR_RIGS'.
wa_zexception_load-fmname = 'ZBW_P2_EM_WORK_CHARACTERISTICS'.
wa_zexception_load-update_date = sy-datum.
wa_zexception_load-woeqflag = 'E'.
wa_zexception_load-fieldvalue = wa_ausp-/bic/zp2_atwrt.
wa_zexception_load-fieldname = 'AUSVN '.
MODIFY zexception_load FROM wa_zexception_load.
CLEAR: wa_ausp, wa_zexception_load, wa_data.
* if abort is not equal zero, the update process will be canceled
* RETURNCODE = 4.
CONTINUE.
RAISE invalid_time_format.
ENDTRY.
ENDIF.
Regards
Ajay