<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add database field to the change pointers list... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380102#M811617</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Thansk for your quick response. Can you explain me in detail how to implement that ( i have not done this in the past ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Feb 2008 23:34:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-20T23:34:51Z</dc:date>
    <item>
      <title>Add database field to the change pointers list...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380100#M811615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I implemented an Outbound Scenario of triggering the DEBMAS IDoc for Customer Master. But now there is a special requirement indeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Whenever an user changes / updates E-Mail field (SMTP_ADDR) in Customer Master then it has to trigger an IDoc. Currently i do an explicit mapping inside the function module EXIT_SAPLVV01_001 (Customer Exit) for E-Mail to point to URL field of IDoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   But the challenge is now there is no E-Mail field in IDoc as well as in the list of change pointers. So, how to trigger a DEBMAS Idoc based on E-Mail field change in the customer master..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Any suggesstions / advice would be of great help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 22:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380100#M811615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T22:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add database field to the change pointers list...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380101#M811616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karsar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you change Email in a customer master neither a change pointer not a change document is created. You have to use BTE's (Business Transaction Events) for creating change documents for this purpose and create debmas idocs by reading those change documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the config steps required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
In t-code FIBF:
Set up a 'product of a customer' 
Set up a 'P/S module of a customer' for Business Transcation Events 00504004, 00504005 and 00504006 to call function Z_BTE_KUNHIER_CHANGES. 


Create function Z_BTE_KUNHIER_CHANGES (example below)


Create report that selects records from CDHDR where OBJECTLAS = 'KUNHIER' within your date parameters and calls function 'CHANGEDOCUMENT_READ' for each row selected from CDHDR. This will give you the change documents, so you can continue the logic to do whatever else you need.

FUNCTION z_bte_kunhier_changes.
*"----------------------------------------------------------------------
""Local interface:
*" IMPORTING
*" VALUE(FVI_EVENT) TYPE BUS_EVENT DEFAULT '00504005'
*" TABLES
*" FTR_NODE_LIST STRUCTURE BAPIKNA1_KNVH OPTIONAL
*" FTR_NODE_LISTX STRUCTURE BAPIKNA1_KNVHX OPTIONAL
*"----------------------------------------------------------------------
*

Called by BTE's: 
00504004 - Create Customer Hierarchy 
00504005 - Change Customer Hierarchy 
00504006 - Delete Customer Hierarchy 
----------------------------------------------------------------------

DATA:
lv_objectid TYPE cdobjectv.

STATICS:
lt_xknvh TYPE STANDARD TABLE OF vknvh,
ls_xknvh TYPE vknvh,
lt_yknvh TYPE STANDARD TABLE OF vknvh,
ls_yknvh TYPE vknvh.

CLEAR: lt_xknvh[],
lt_yknvh[].


process BTE for add or change of a customer hierarchy 
IF fvi_event = '00504004' OR fvi_event = '00504005'.
LOOP AT ftr_node_list.

CLEAR: ls_xknvh, ls_yknvh.
REFRESH: lt_xknvh, lt_yknvh.

MOVE sy-mandt TO ls_xknvh-mandt.
MOVE ftr_node_list-customer TO ls_xknvh-kunnr.
MOVE ftr_node_list-sales_org TO ls_xknvh-vkorg.
MOVE ftr_node_list-distr_chan TO ls_xknvh-vtweg.
MOVE ftr_node_list-division TO ls_xknvh-spart.
MOVE ftr_node_list-valid_from TO ls_xknvh-datab.
MOVE ftr_node_list-custhityp TO ls_xknvh-hityp.
MOVE ftr_node_list-parent_customer TO ls_xknvh-hkunnr.
MOVE ftr_node_list-parent_sales_org TO ls_xknvh-hvkorg.
MOVE ftr_node_list-parent_distr_chan TO ls_xknvh-hvtweg.
MOVE ftr_node_list-parent_division TO ls_xknvh-hspart.
MOVE ftr_node_list-valid_to TO ls_xknvh-datbi.
MOVE ftr_node_list-routine TO ls_xknvh-grpno.
MOVE ftr_node_list-rebate_rel TO ls_xknvh-bokre.
MOVE ftr_node_list-pric_rel TO ls_xknvh-prfre.
MOVE ftr_node_list-assign_hi TO ls_xknvh-hzuor.
CASE fvi_event.
WHEN '00504004'.
MOVE 'I' TO ls_xknvh-kz.
WHEN '00504005'.
MOVE 'U' TO ls_xknvh-kz.
ENDCASE.
APPEND ls_xknvh TO lt_xknvh.

lv_objectid = ftr_node_list-customer.


the ftr_node_listx table indicates which fields 
were updated, with a series of indicators 
READ TABLE ftr_node_listx
WITH KEY
customer = ftr_node_list-customer
sales_org = ftr_node_list-sales_org
distr_chan = ftr_node_list-distr_chan
division = ftr_node_list-division
valid_from = ftr_node_list-valid_from
custhityp = ftr_node_list-custhityp.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_xknvh TO ls_yknvh.
IF ftr_node_listx-valid_to = 'X'.
MOVE space TO ls_yknvh-datbi.
ENDIF.
IF ftr_node_listx-parent_customer = 'X'.
MOVE space TO ls_yknvh-hkunnr.
ENDIF.
IF ftr_node_listx-parent_sales_org = 'X'.
MOVE space TO ls_yknvh-hvkorg.
ENDIF.
IF ftr_node_listx-parent_distr_chan = 'X'.
MOVE space TO ls_yknvh-hvtweg.
ENDIF.
IF ftr_node_listx-parent_division = 'X'.
MOVE space TO ls_yknvh-hspart.
ENDIF.
IF ftr_node_listx-routine = 'X'.
MOVE space TO ls_yknvh-grpno.
ENDIF.
IF ftr_node_listx-rebate_rel = 'X'.
MOVE space TO ls_yknvh-bokre.
ENDIF.
IF ftr_node_listx-pric_rel = 'X'.
MOVE space TO ls_yknvh-prfre.
ENDIF.
IF ftr_node_listx-assign_hi = 'X'.
MOVE space TO ls_yknvh-hzuor.
ENDIF.
APPEND ls_yknvh TO lt_yknvh.
ENDIF.

CALL FUNCTION 'KUNHIER_WRITE_DOCUMENT' IN UPDATE TASK
EXPORTING
objectid = lv_objectid
tcode = sy-tcode
utime = sy-uzeit
udate = sy-datum
username = sy-uname
planned_change_number = space
objeci_change_indicator = 'U'
planned_or_real_changes = space

upd_knvh = upd_knvh 
upd_knvh = 'U'

upd_icdtxi_kunhier = space 
TABLES

ICDTXI_KUNHIER = I_ICDTXI_KUNHIER 
xknvh = lt_xknvh " new values
yknvh = lt_yknvh. " old values

ENDLOOP.
ENDIF.


process BTE for delete of a customer hierarchy 
IF fvi_event = '00504006'.
LOOP AT ftr_node_listx.

CLEAR: ls_xknvh, ls_yknvh.
REFRESH: lt_xknvh, lt_yknvh.

MOVE sy-mandt TO ls_yknvh-mandt.
MOVE ftr_node_listx-customer TO ls_yknvh-kunnr.
MOVE ftr_node_listx-sales_org TO ls_yknvh-vkorg.
MOVE ftr_node_listx-distr_chan TO ls_yknvh-vtweg.
MOVE ftr_node_listx-division TO ls_yknvh-spart.
MOVE ftr_node_listx-valid_from TO ls_yknvh-datab.
MOVE ftr_node_listx-custhityp TO ls_yknvh-hityp.
APPEND ls_yknvh TO lt_yknvh.

lv_objectid = ftr_node_listx-customer.

CALL FUNCTION 'KUNHIER_WRITE_DOCUMENT' IN UPDATE TASK
EXPORTING
objectid = lv_objectid
tcode = sy-tcode
utime = sy-uzeit
udate = sy-datum
username = sy-uname
planned_change_number = space
objeci_change_indicator = 'U'
planned_or_real_changes = space

upd_knvh = upd_knvh 
upd_knvh = 'U'

upd_icdtxi_kunhier = space 
TABLES

ICDTXI_KUNHIER = I_ICDTXI_KUNHIER 
xknvh = lt_xknvh " new values
yknvh = lt_yknvh. " old values

ENDLOOP.
ENDIF.


ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Naren Someneni on Feb 20, 2008 5:23 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 22:39:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380101#M811616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T22:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add database field to the change pointers list...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380102#M811617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Thansk for your quick response. Can you explain me in detail how to implement that ( i have not done this in the past ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 23:34:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380102#M811617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T23:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add database field to the change pointers list...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380103#M811618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karsar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The events mentioned in my message are for customer hierarchy changes. Let me check whether there are any BTE's available for customer changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 23:58:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-database-field-to-the-change-pointers-list/m-p/3380103#M811618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T23:58:01Z</dc:date>
    </item>
  </channel>
</rss>

