Original query:

select b.dept_emos, c.header_id_it as header_id_it, a.kodecab as acronim, d.salesrep_id as jajaid, a.custid, c.ship_to_id, 
c.bill_to_id, c.payment_term_id as termid, c.customer_po_number,
c.username as shipname, concat(c.creation_date, '') as tglentry, 
c.org_id, c.image as orig_doc_ref, 
b.dept_emos, c.orig_sys_document_ref
from cs_site_lang a, cs_gruplang b, emart_header_po_sp c , cs_mst_callplan d
where a.sales_channel_code = b.gruplang 
and a.shipid = c.ship_to_id 
and d.cp_cust_site_use_id = a.shipid
and d.cp_dept_code = b.dept_emos
and c.header_id_it is not null