Monday, April 19, 2010

How to Get Datecode Using a Function Module

data: lf_dc type kweek," DC
        gf_imp_dc(4) type n.

*FM to get the datecode

call function 'DATE_GET_WEEK'

    exporting
         date = sy-datum
    importing
         week = lf_dc
    exceptions
         date_invalid = 1
         others          = 2.

gf_imp_dc = lf_dc+2.

write: gf_imp_dc.

Examples:-

If the sy-datum (system date) = 20100106, then the Date Code will be '1002'.

If the sy-datum = 20100115, then the Date code will be '1003'.

No comments:

Post a Comment