2006 Sep 21 3:30 PM
Hi,
I have three variables which store yyyy, mm and dd (and all are of C type). Now I want all of this into one variable which is of the format sy-datum so that I will be able to compare this with sy-datum.
(like if wa_datum LE sy-datum, perform this etc)
Can you tell me how you do that?
Thanks,
Krishen
2006 Sep 21 3:32 PM
hi Krishen,
Use Concatenate statement ..
i.e, concatenate f1 f2 f3 into f4.
Regards,
Santosh
hi Krishen,
Use Concatenate statement ..
i.e, concatenate f1 f2 f3 into f4.
Regards,
Santosh
2006 Sep 21 3:32 PM
Hi,
DATA: v_date type sydatum.
Concatenate 'YYYY' 'MM' 'DD' INTO V_DATE.
Ex.
data: v_date type sydatum.
concatenate '2006' '09' '20' into v_date.
if v_date < sy-datum.
write: / v_date.
endif.
THanks
Naren
2006 Sep 21 3:32 PM
hi Krishen,
Use Concatenate statement ..
i.e, concatenate f1 f2 f3 into f4.
Regards,
Santosh
2006 Sep 21 3:33 PM
2006 Sep 21 3:34 PM
Hi,
You can try something like this.
DATA: WA_DATUM LIKE SY-DATUM.
MOVE V_YYYY TO WA_DATUM(4).
MOVE V_MM TO WA_DATUM+4(2).
MOVE V_DD TO WA_DATUM+6(2).
IF WA_DATUM LE SY-DATUM.
...
ELSE.
...
ENDIF.Regards,
Ferry Lianto
2006 Sep 21 3:35 PM
Declare a variable of type sy-datum. And pass the value to that variable and compare.
For example:
data: ws_date type char10.
data: ws_date1 type sy-datum,
ws_date2 type sy-datum.
ws_date = '2006.01.01'.
concatenate ws_date0(4) ws_date4(2) ws_date+6(2) into ws_date1.
ws_date2 = '20060101'.
if ws_date1 eq ws_date2.
*do sum operation
endif.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |