Skip to Content
0
Former Member
Oct 28, 2009 at 09:53 AM

Error in my Function Module

31 Views

Dear Experts,

I have created a Function Module to call it from a Dependency .. the main object of this "Dependency & FM" is to calculate a Date in the characteristic of the batch ..

Note :

GRDate is the characteristic which hold the date i will work on "Import"

FRUD is the characteristic which will hold the manipulated date "Export"

Here is my Code :


FUNCTION ZUPDATEDATE.
*"--------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(GLOBALS) LIKE  CUOV_00 STRUCTURE  CUOV_00
*"  TABLES
*"      MATCH STRUCTURE  CUOV_01
*"      QUERY STRUCTURE  CUOV_01
*"  EXCEPTIONS
*"      FAIL
*"      INTERNAL_ERROR
*"--------------------------------------------------------------------
DATA:
        HELPDATE      LIKE AUSP-ATWRT,
        TEMPDATE      Type F.

REFRESH MATCH.

* Read date
READ TABLE QUERY WITH KEY 'GRDate'.
* Convert date
  CALL FUNCTION 'CTCV_CONVERT_FLOAT_TO_DATE'
       EXPORTING
            FLOAT = QUERY-ATFLV
       IMPORTING
            DATE  = HELPDATE.
*Compute
  TEMPDATE = HELPDATE + 1 .
  TEMPDATE = TEMPDATE * 86400.

* Return
READ TABLE QUERY WITH KEY 'FRUD'.

MATCH = QUERY.
MATCH-ATFLV = TEMPDATE.

* Change dates in customer exit
  CALL CUSTOMER-FUNCTION '003'
       EXPORTING
            GLOBALS = GLOBALS
            HSDAT   = HELPDATE
            VFDAT   = TEMPDATE
       TABLES
            QUERY   = QUERY
       CHANGING
            MATCH   = MATCH
       EXCEPTIONS
            OTHERS  = 1.

  APPEND MATCH.

ENDFUNCTION.

Please Advice