Senin, 23 Juli 2012
Belajar ABAP (2)
REPORT yrp_andy_latihan1 .
write:/ '------------------------- Date ------------------'.
write:/ sy-datum.
write:/ sy-datlo.
write:/ sy-dayst.
write:/ sy-fdayw.
write:/ sy-timlo.
write:/ sy-uzeit.
write:/ '------------------------- Date ------------------'.
write:/ '------------------------- Date ------------------'.
write:/ sy-datum.
write:/ sy-datlo.
write:/ sy-dayst.
write:/ sy-fdayw.
write:/ sy-timlo.
write:/ sy-uzeit.
write:/ '------------------------- Date ------------------'.
Kamis, 12 Juli 2012
Belajar ABAP (1)
Akhirnya dateng juga kesempetan gwe belajar ABAP. Mumpung dikasih kesempatan buat ngoprek ABAP dikantor, harus dimanfaatin bener2 nih :D ini koding pertama gwe...
REPORT yrp_andy_latihan1 .
* Definisi data
DATA : dg_a TYPE i, dg_b TYPE i, dg_c TYPE p DECIMALS 2, dg_d TYPE p
DECIMALS 2.
DATA: dg_name LIKE sy-uname, dg_tanggal LIKE sy-datum.
* initialisasi
dg_a = 10.
dg_b = 5.
dg_c = dg_a / dg_b.
dg_d = dg_a * dg_b.
dg_name = sy-uname.
dg_tanggal = sy-datum.
* output
WRITE:/ 'Hasil ', dg_a, ' + ', dg_b, '=', dg_c.
WRITE:/ 'Hasil ', dg_a, ' * ', dg_b, '=', dg_d.
WRITE:/ 'USERNAME : ', dg_name.
WRITE:/ 'Tanggal : ', dg_tanggal.
REPORT yrp_andy_latihan1 .
* Definisi data
DATA : dg_a TYPE i, dg_b TYPE i, dg_c TYPE p DECIMALS 2, dg_d TYPE p
DECIMALS 2.
DATA: dg_name LIKE sy-uname, dg_tanggal LIKE sy-datum.
* initialisasi
dg_a = 10.
dg_b = 5.
dg_c = dg_a / dg_b.
dg_d = dg_a * dg_b.
dg_name = sy-uname.
dg_tanggal = sy-datum.
* output
WRITE:/ 'Hasil ', dg_a, ' + ', dg_b, '=', dg_c.
WRITE:/ 'Hasil ', dg_a, ' * ', dg_b, '=', dg_d.
WRITE:/ 'USERNAME : ', dg_name.
WRITE:/ 'Tanggal : ', dg_tanggal.
Sabtu, 11 Februari 2012
Parsing data
update profil_dokter
set isi_profil=replace(isi_profil,
(
substring(
substring(isi_profil,instr(isi_profil,"
1,
instr(substring(isi_profil,instr(isi_profil,"')
)
),"")
where isi_profil !='' and isi_profil like '%src="%'
set isi_profil=replace(isi_profil,
(
substring(
substring(isi_profil,instr(isi_profil,"
1,
instr(substring(isi_profil,instr(isi_profil,"')
)
),"")
where isi_profil !='' and isi_profil like '%src="%'
Akal-akalan
create table x as
select id_dokter, substring(gambar,1,instr(gambar,'"')-1) pathgambar
from (
select id_dokter, path, substring(path,instr(path, "src")+6) gambar
from (
select id_dokter, isi_profil, gambar,
substring(isi_profil,instr(isi_profil,"
from profil_dokter where isi_profil !='' and isi_profil like '%src="%'
)a
)x
select id_dokter, substring(gambar,1,instr(gambar,'"')-1) pathgambar
from (
select id_dokter, path, substring(path,instr(path, "src")+6) gambar
from (
select id_dokter, isi_profil, gambar,
substring(isi_profil,instr(isi_profil,"
from profil_dokter where isi_profil !='' and isi_profil like '%src="%'
)a
)x
inner join (
SELECT id_dokter, reverse(substring(REVERSE(pathgambar), 1, instr(REVERSE(pathgambar),'/')-1)) gambar_dokter
from x
)y on (a.id_dokter=y.id_dokter)
set gambar=gambar_dokter
Bermain-main dengan path
select id_dokter, gambar, substring(gambar,1,instr(gambar,'"')-1) pathgambar
from (
select id_dokter, path, substring(path,instr(path, "src")+6) gambar
from (
select id_dokter, isi_profil, gambar,
substring(isi_profil,instr(isi_profil,"
from profil_dokter where isi_profil !='' and isi_profil like '%src="%'
)a
)x
from (
select id_dokter, path, substring(path,instr(path, "src")+6) gambar
from (
select id_dokter, isi_profil, gambar,
substring(isi_profil,instr(isi_profil,"
from profil_dokter where isi_profil !='' and isi_profil like '%src="%'
)a
)x
Senin, 06 Februari 2012
Subquery lagi
update k set incentive=(case when percentage_am=1 then k.incentive else k.incentive/2 end)
from trmasterincentive_summary k
inner join (
select x.idstructure, incentive,
case when (cast(y.jumlahAM_ach as float)) / (cast (y.JumlahAM as float)) > 0.6
then 1
else 0
end percentage_am
from trmasterincentive_summary x
inner join (
select a.idstructure,
(select COUNT(distinct idstructure_am) from structorg where year=2011 and month=11 and idcat=10 and idstructure_sm=a.idstructure)JumlahAM,
(
select COUNT(distinct idstructure_am)
from trmasterincentive_summary p
inner join structorg q on (p.idstructure=q.idstructure_am and q.idstructure_sm=a.idstructure)
where idjob in(3,29) and percentage>=90
)jumlahAM_ach
from trmasterincentive_summary a
where idlogstructure=176 and idjob in(1,24) and percentage>=90
) y on (x.idstructure=y.idstructure)
) l on (k.idstructure=l.idstructure)
from trmasterincentive_summary k
inner join (
select x.idstructure, incentive,
case when (cast(y.jumlahAM_ach as float)) / (cast (y.JumlahAM as float)) > 0.6
then 1
else 0
end percentage_am
from trmasterincentive_summary x
inner join (
select a.idstructure,
(select COUNT(distinct idstructure_am) from structorg where year=2011 and month=11 and idcat=10 and idstructure_sm=a.idstructure)JumlahAM,
(
select COUNT(distinct idstructure_am)
from trmasterincentive_summary p
inner join structorg q on (p.idstructure=q.idstructure_am and q.idstructure_sm=a.idstructure)
where idjob in(3,29) and percentage>=90
)jumlahAM_ach
from trmasterincentive_summary a
where idlogstructure=176 and idjob in(1,24) and percentage>=90
) y on (x.idstructure=y.idstructure)
) l on (k.idstructure=l.idstructure)
Langganan:
Postingan (Atom)
Blog Archive
About Me
- Koral Web
- Kami adalah web developer. Beberapa produk yang pernah kami buat antara lain website, aplikasi klinik, aplikasi apotik, aplikasi EDMS (Electronic Database Management System), Energy Consumption Management System, RKBI (Rencana Kunjungan Barang Import) dan lain-lain sesuai dengan request dari client kami. Jika Anda tertarik untuk membuat system atau aplikasi, jangan sungkan-sungkan menghubungi kami.
Bahasa Pemrogramanmu?
Nasihat
Barangsiapa capek lelah dan letihnya bukan karena Allah maka celakalah dia
Diberdayakan oleh Blogger.
Web Sunnah
Blog Archieve
- Info (3)
- Kajian (3)
- My Program (1)
- Orang Terkenal (1)
- scrip (2)
- SQL (23)
- Subquery (9)
- Trik (13)