123456
123456
123456
*============================================================================
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_DATASOURCE) TYPE RSAOT_OLTPSOURCEf
*" VALUE(I_ISOURCE) TYPE SBIWA_S_INTERFACE-ISOURCE
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT
*" I_T_FIELDS TYPE SBIWA_T_FIELDS
*" C_T_DATA
*" C_T_MESSAGES STRUCTURE BALMI OPTIONAL
*" EXCEPTIONS
*" RSAP_CUSTOMER_EXIT_ERROR
CLEAR partner_no_guid.
CLEAR partner_no.
CLEAR guidd.
CLEAR bayi.
IF sy-subrc = 0.
ENDIF.
IF sy-subrc = 0.
ENDIF.
IF sy-subrc = 0.
ENDIF.
IF sy-subrc = 0.
l_s_crmt_bw_oppt_h-z_bayii = bayi.
ENDIF.
"UFUK
"----------------------------------------------------
l_s_crmt_bw_oppt_h-z_neden = z_neden.
SELECT SINGLE zzfld00004a
FROM crmd_dhr_headopp
INTO z_alt_ned
WHERE guid EQ l_s_crmt_bw_oppt_h-guid.
l_s_crmt_bw_oppt_h-z_alt_ned = z_alt_ned.
""""""
l_s_crmt_bw_oppt_h-zilgarac = zilgarac.
l_s_crmt_bw_oppt_h-z_ssuresi = z_ssuresi.
ENDLOOP.
DATA: l_s_zoxccd0177 TYPE zoxccd0177.
"""""""""""""""""""""""""" 14.07.2014
CLEAR :l_t_crmt_bw_lead_h,l_t_crmt_bw_lead_h[].
l_t_crmt_bw_lead_h[] = c_t_data[].
CLEAR : t_lead,t_lead[].
CLEAR t_lead.
CLEAR : l_s_crmt_bw_lead_h.
IF sy-subrc = 0.
l_s_crmt_bw_lead_h-z_cevap = z_cvp.
ENDIF.
IF sy-subrc = 0.
l_s_crmt_bw_lead_h-z_atanma = z_cvp.
ENDIF.
IF sy-subrc = 0.
l_s_crmt_bw_lead_h-zea15 = z_cvp.
ENDIF.
IF sy-subrc = 0.
l_s_crmt_bw_lead_h-z_acilis = acilis.
ENDIF.
IF sy-subrc = 0.
l_s_crmt_bw_lead_h-z_kapanis = kapanis.
ENDIF.
* ENDIF.
* IF l_s_crmt_bw_lead_h-process_type = 'ZTKS'.
* SELECT SINGLE a~tst_from
* INTO z_cvp
* FROM scapptseg AS a
* INNER JOIN crmd_link AS b
* ON a~appl_guid = b~guid_set
* INNER JOIN crmd_orderadm_h AS c
* ON b~guid_hi = c~guid
* WHERE c~guid EQ l_s_crmt_bw_lead_h-guid
* AND c~process_type = 'ZTKS'
* AND b~objtype_hi = '05'
* AND b~objtype_set = '30'
* AND a~appt_type = 'ZEA100000002'.
*
* IF sy-subrc = 0.
* l_s_crmt_bw_lead_h-z_cevap = z_cvp.
* ENDIF.
*
* SELECT SINGLE a~tst_from
* INTO z_cvp
* FROM scapptseg AS a
* INNER JOIN crmd_link AS b
* ON a~appl_guid = b~guid_set
* INNER JOIN crmd_orderadm_h AS c
* ON b~guid_hi = c~guid
* WHERE c~guid EQ l_s_crmt_bw_lead_h-guid
* AND c~process_type = 'ZTKS'
* AND b~objtype_hi = '05'
* AND b~objtype_set = '30'
* AND a~appt_type = 'ZEA100000001'.
*
* IF sy-subrc = 0.
* l_s_crmt_bw_lead_h-z_atanma = z_cvp.
* ENDIF.
*
** satis mdr tarafindan satis danismanina atanma zamani
*
* SELECT SINGLE a~tst_from
* INTO z_cvp
* FROM scapptseg AS a
* INNER JOIN crmd_link AS b
* ON a~appl_guid = b~guid_set
* INNER JOIN crmd_orderadm_h AS c
* ON b~guid_hi = c~guid
* WHERE c~guid EQ l_s_crmt_bw_lead_h-guid
* AND c~process_type = 'ZTKS'
* AND b~objtype_hi = '05'
* AND b~objtype_set = '30'
* AND a~appt_type = 'ZEA100000005'.
*
* IF sy-subrc = 0.
* l_s_crmt_bw_lead_h-zea15 = z_cvp.
* ENDIF.
*
**LEAD ACILIS TARIHI
*
* SELECT SINGLE created_at
* FROM crmd_orderadm_h
* INTO acilis
* WHERE guid EQ l_s_crmt_bw_lead_h-guid.
*
* IF sy-subrc = 0.
* l_s_crmt_bw_lead_h-z_acilis = acilis.
* ENDIF.
*
**LEAD KAPANIS TARIHI
*
* SELECT SINGLE a~tst_from
* INTO kapanis
* FROM scapptseg AS a
* INNER JOIN crmd_link AS b
* ON a~appl_guid = b~guid_set
* INNER JOIN crmd_orderadm_h AS c
* ON b~guid_hi = c~guid
* WHERE c~guid EQ l_s_crmt_bw_lead_h-guid
* AND c~process_type = 'ZTKS'
* AND b~objtype_hi = '05'
* AND b~objtype_set = '30'
* AND a~appt_type = 'ZEA100000003'.
*
* IF sy-subrc = 0.
* l_s_crmt_bw_lead_h-z_kapanis = kapanis.
* ENDIF.
* ENDIF.
l_tabix = sy-tabix.
CLEAR partner_no_guid.
CLEAR partner_no.
CLEAR guidd.
CLEAR bayi.
IF sy-subrc = 0.
SELECT SINGLE partner_no
INTO partner_no_guid
FROM crmd_partner
WHERE guid EQ guidd
AND partner_fct EQ 'Z0000004'.
ENDIF.
IF sy-subrc = 0.
SELECT SINGLE partner
INTO partner_no
FROM but000
WHERE partner_guid = partner_no_guid .
ENDIF.
IF sy-subrc = 0.
SELECT SINGLE objid
INTO bayi
FROM hrp1001
WHERE plvar = '01'
AND rsign = 'B'
AND relat = '207'
AND sclas = 'BP'
AND sobid = partner_no.
ENDIF.
IF sy-subrc = 0.
l_s_crmt_bw_lead_h-z_bayii = bayi.
ENDIF.
l_s_crmt_bw_lead_h-z_ssuresi = z_ssuresi.
"UFUK
"-----------------------------------------------------
* select single partner1
* into zcmmusteri
* from but050
* where partner2 = l_s_crmt_bw_lead_h-prospect
* and reltyp = 'ZBYMUS'
* and date_to = '99991231'.
*
* if sy-subrc = 0.
* l_s_crmt_bw_lead_h-zcmmusteri = zcmmusteri.
* else.
* l_s_crmt_bw_lead_h-zcmmusteri = l_s_crmt_bw_lead_h-prospect.
* endif.
* CLEAR: zcmmusteri.
* select single partner1
* into zcmmusteri
* from but050
* where partner2 = l_s_crmt_bw_lead_h-prospect
* and reltyp = 'ZBYMUS'
* and date_to = '99991231'.
* if sy-subrc = 0.
* l_s_crmt_bw_lead_h-zcmmusteri = zcmmusteri.
* else.
* select single partner2
* into zcmmusteri
* from but050
* where partner1 = l_s_crmt_bw_lead_h-prospect
* and reltyp = 'ZBYMUS'
* and date_to = '99991231'.
* if sy-subrc = 0.
* l_s_crmt_bw_lead_h-zcmmusteri = zcmmusteri.
* ENDIF.
* ENDIF.
"UFUK
"----------------------------------------------------------
l_s_crmt_bw_lead_h-zilgarac = zilgarac.
SELECT SINGLE stat
FROM crm_jest
INTO (l_s_crmt_bw_lead_h-lead_s)
WHERE objnr = l_s_crmt_bw_lead_h-guid
AND stat LIKE 'E%' AND inact = ''.
ENDLOOP.
CLEAR : lt_crmt_bw_ds_activity,lt_crmt_bw_ds_activity[].
lt_crmt_bw_ds_activity[] = c_t_data[].
CLEAR : t_crmt,t_crmt[].
CLEAR partner_no_guid.
CLEAR partner_no.
CLEAR guidd.
CLEAR bayi.
CLEAR ztarih.
CLEAR zappt_type.
IF sy-subrc = 0.
SELECT SINGLE partner_no
INTO partner_no_guid
FROM crmd_partner
WHERE guid EQ guidd
AND partner_fct EQ 'Z0000004'.
ENDIF.
IF sy-subrc = 0.
SELECT SINGLE partner
INTO partner_no
FROM but000
WHERE partner_guid EQ partner_no_guid .
ENDIF.
IF sy-subrc = 0.
SELECT SINGLE objid
INTO bayi
FROM hrp1001
WHERE plvar EQ '01' AND
rsign EQ 'B' AND
relat EQ '207' AND
sclas EQ 'BP' AND
sobid EQ partner_no.
ENDIF.
IF sy-subrc = 0.
ls_crmt_bw_ds_activity-z_bayii = bayi.
ENDIF.
IF sy-subrc = 0.
ls_crmt_bw_ds_activity-zrandevutarih = ztarih.
ENDIF.
CLEAR ztarih.
CLEAR zappt_type.
IF sy-subrc = 0.
ls_crmt_bw_ds_activity-ztestsurustarih = ztarih.
ENDIF.
ls_crmt_bw_ds_activity-zilgarac = zilgarac.
IF sy-subrc = 0.
ls_crmt_bw_ds_activity-zcmmusteri = zcmmusteri.
ELSE.
ls_crmt_bw_ds_activity-zcmmusteri = ls_crmt_bw_ds_activity-
activity_partner.
ENDIF.
ENDLOOP.
CLEAR t_crmt.
CLEAR ls_crmt_bw_ds_activity.
created1 = created.
changed1 = changed.
ENDLOOP.
WHEN 'ZBW_PROJECT'.
TYPES:
BEGIN OF ztakip,
takip_no TYPE ztakip_no,
END OF ztakip.
DATA: it_ztakip TYPE TABLE OF ztakip,
wa_ztakip TYPE ztakip,
it_takip TYPE TABLE OF zsms_activite,
wa_takip TYPE zsms_activite,
zcount TYPE i.
WHEN 'ZBW_ILETISIM'.
LOOP AT c_t_data INTO ls_zoxccd0188.
ls_partner-partner_fct = '00000002'.
ls_partner-partner_no = ls_zoxccd0188-partner_guid.
ENDIF.
ENDLOOP.
* lv_partner_mkt = ls_zoxccd0188-partner_guid.
CALL FUNCTION 'CRM_BUPA_MKT_PERM_READ'
EXPORTING
iv_partner_guid = ls_zoxccd0188-partner_guid
IMPORTING
et_but_mktperm = lt_but_mktperm
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
CASE ls_but_mktperm-permission.
WHEN '001'.
ls_zoxccd0188-sms = '1'.
WHEN '002'.
* gs_alv-sms = 'REDDEDILDI'.
ls_zoxccd0188-sms = '0'.
WHEN OTHERS.
ls_zoxccd0188-sms = ''.
ENDCASE.
CLEAR ls_but_mktperm.
READ TABLE lt_but_mktperm INTO ls_but_mktperm WITH KEY channel = 'TEL'.
CASE ls_but_mktperm-permission.
WHEN '001'.
ls_zoxccd0188-telefon = '1'.
WHEN '002'.
* gs_alv-telefon = 'REDDEDILDI'.
ls_zoxccd0188-telefon = '0'.
WHEN OTHERS.
ls_zoxccd0188-telefon = ''.
ENDCASE.
CLEAR ls_but_mktperm.
CASE ls_but_mktperm-permission.
WHEN '001'.
ls_zoxccd0188-eposta = '1'.
WHEN '002'.
* gs_alv-eposta = 'REDDEDILDI'.
ls_zoxccd0188-eposta = '0'.
WHEN OTHERS.
ls_zoxccd0188-eposta = ''.
ENDCASE.
CLEAR ls_but_mktperm.
CASE ls_but_mktperm-permission.
WHEN '001'.
ls_zoxccd0188-kvk = '1'.
WHEN '002'.
* gs_alv-eposta = 'REDDEDILDI'.
ls_zoxccd0188-kvk = '0'.
WHEN OTHERS.
ls_zoxccd0188-kvk = ''.
ENDCASE.
ENDCASE.