‎2007 Sep 05 8:00 PM
Hello Friends ,
Please help me with this code
I am calculating no. of days closed , which is a keyfigure. I am using the call below but I getting error during data load .
DATA: create_date TYPE sy-datum,
update_date TYPE sy-datum ,
number of days closed(Keyfigure) (4) TYPE C ,
alert close flag (1) TYPE C .
IF alert cloase flag EQ 'Y'.
number of days closed(Keyfigure) = update_date - create_date .
ELSE.
number of days closed(Keyfigure) ='NULL'.
ENDIF.
RESULT = number of days closed(Keyfigure).
Thanks a lot!!!
‎2007 Sep 05 8:13 PM
Data load? Did it pass a syntax check?
Anyway, maybe this will help:
DATA: create_date TYPE sy-datum,
update_date TYPE sy-datum,
number_of_days_closed(4) TYPE c,
alert_close_flag(1) TYPE c,
result LIKE number_of_days_closed.
IF alert_close_flag EQ 'Y'.
number_of_days_closed = update_date - create_date .
ELSE.
CLEAR number_of_days_closed.
ENDIF.
result = number_of_days_closed.Rob
‎2007 Sep 05 8:13 PM
Data load? Did it pass a syntax check?
Anyway, maybe this will help:
DATA: create_date TYPE sy-datum,
update_date TYPE sy-datum,
number_of_days_closed(4) TYPE c,
alert_close_flag(1) TYPE c,
result LIKE number_of_days_closed.
IF alert_close_flag EQ 'Y'.
number_of_days_closed = update_date - create_date .
ELSE.
CLEAR number_of_days_closed.
ENDIF.
result = number_of_days_closed.Rob
‎2007 Sep 05 8:29 PM
Thnaks a ton ROB.
and yea it passed the syntax check ))
your code really helped I just replaced one line in my code from your's that is
CLEAR number_of_days_closed.
and hurray...it worked.
Thanks a ton again...
appreciated
Message was edited by:
sap_newbee
‎2007 Sep 05 8:35 PM
It passed a syntax check with:
alert close flag (1) TYPE C .
IF alert cloase flag EQ 'Y'.
?
Anyway, glad to help. Close the thread if your question is answered.
Rob
‎2007 Sep 05 8:37 PM
actually I wrote those 2 line in general , I mean just for the sake of proper understanding of feilds , but actually they are properly named InfoObjects.
Thanks a lot .
‎2007 Sep 05 8:40 PM
OK - anyway, you should stick with CLEAR. If you put a space into the field and then change the data type, you may run into problems. CLEAR (without any additions) put initial values for any data type into the field.
Rob
‎2007 Sep 05 9:01 PM
‎2007 Sep 05 8:34 PM
‎2007 Sep 05 8:36 PM