2007 Dec 18 4:00 AM
Hi Gurus, I have to set date as per the company code REGUP-BUKRS using sap-script. I am unable to get the date..
/: IF ®UP-BURKS& EQ 2000
/: SET DATE MASK = 'DD/MM/YYYY'
®UP-BLDAT&
/: ENDIF
This there is anything wrong in this code ?
2007 Dec 18 10:43 PM
/: IF ®UP-BURKS& EQ '2000' -> should be single quotation
/: SET DATE MASK = 'DD/MM/YYYY'
®UP-BLDAT&
/: ENDIF
Thanks
Seshu
Hi Gurus, I have to set date as per the company code REGUP-BUKRS using sap-script. I am unable to get the date..
/: IF ®UP-BURKS& EQ 2000
/: SET DATE MASK = 'DD/MM/YYYY'
®UP-BLDAT&
/: ENDIF
This there is anything wrong in this code ?
2007 Dec 18 9:52 PM
2007 Dec 18 10:43 PM
/: IF ®UP-BURKS& EQ '2000' -> should be single quotation
/: SET DATE MASK = 'DD/MM/YYYY'
®UP-BLDAT&
/: ENDIF
Thanks
Seshu
2007 Dec 18 11:12 PM
Thanks Seshu for the reply. I want to know if we use set date mask like below
set date mask = 'dd/mm/yyyy' only
does this changes all dates with data element DATS ? or this only changes the field following set date mask like &ergup-bldat& defined as below
set date mask = 'dd/mm/yyyy'
®up-bldat&
Thanks in advance
2007 Dec 19 12:24 AM
Not Sure, I guess it effects the only that field.
if not then
if you want to have only one field then you can have simple perform routine to get date format
Thanks
Seshu
2007 Dec 19 2:36 AM
I have three date date fields that need to be a particular date format when we have a 2000 company code. For all remaining we need another format. How can we do this in sapscripts. I tried but i didnt get. Can anyone help me out ?
2007 Dec 19 4:01 PM
2007 Dec 19 4:22 PM
Please use below syntax in SE71 Text editor ( Before displaying date)
/: PERFORM GET_DATE_FORMAT IN PROGRAM ZGET_DATE
/: USING ®UP-BLDAT&
/: CHANGING &DATE&
/: ENDPERFORM
Now goto SE38 -> create program(ZGET_DATE) -> now use below syntax
FORM GET_DATE_FORMAT
tables in_tab structure itcsy
out_tab structure itcsy.
lOCAL VARIABLES
data: LV_DATE(10) TYPE C,
LV_DAY(2),
LV_MON(2),
LV_YEAR(4),
LV_FDATE(10) TYPE C.
CLEAR : LV_DATE,
LV_DAY,
LV_MON,
LV_YEAR,
LV_FDATE.
read table in_tab with key NAME = 'REGUP-BLDAT'.
if sy-subrc eq 0.
LV_DATE = IN_TAB-VALUE
endif.
Date Formatting
lv_year = lv_date+0(4).
lv_mon = lv_date+5(2).
lv_day = lv_date+8(2).
concatenate lv_day '/' lv_mon '/' lv_year into lv_fdate.
read table out_tab with key NAME = 'DATE'.
if sy-subrc eq 0.
out_tab-value = lv_fdate.
modify out_tab index sy-tabix.
endif.
ENDFORM.
You can use same logic for all dates.
Thanks
Seshu
2008 Mar 09 9:32 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |