Skip to Content
avatar image
Former Member

date validations

hi gurus,

For certain customer defined date fields, the interfaces for DLC are inputting an incorrect format “ / / “ instead of just leaving the field blank when there is no value being transmit-ted in the interface.

There needs to be a validation in the interface program that does not accept incorrectly formatted dates.

can any one give me codeing for date validations when posting master data through t.codes.if you dont enter any data in the date field then it should be inserted as null in sap database tables.

reward points given

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Aug 20, 2007 at 10:16 AM

    Hi Aruna,

    just try this.

    IF NOT itab-fieldname IS INITIAL.

    itab-fieldname = itab-fielname.

    ELSE.

    itab-fieldname = ' '.

    ENDIF.

    Reward points if helpful.

    Thanks

    Naveen khan.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 12:52 PM

    Hi Aruna, with my knowledge i can suggest you this code,

    to check the date format follow the code.

    CHECK <datefield> CP '__/__/____'

    and for inserting NULL

    if <datefield> is initial.

    <datefield> = NULL.

    endif.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 20, 2007 at 01:42 AM

    thanks

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 20, 2007 at 04:59 AM

    Hi..

    Try This..

    FM or Way to validate Date format. The date is from TEXT File

    call function 'DATE_CHECK_PLAUSIBILITY'

    exporting

    date = '23.09.2007'

    exceptions

    plausibility_check_failed = 1

    others = 2.

    if sy-subrc <> 0.

    write:/ 'Please verify the date'.

    exit.

    endif.

    reward if Helpful.

    Add comment
    10|10000 characters needed characters exceeded