Hi Александр Назаренко
Here you go...
Requirement: EHP7, min. SP05 ( see SAP note http://service.sap.com/sap/support/notes/1829328 )
Step 1: Required entry in transaction BD48
Step 2: maintain your distribution model
Now with above entry, you are able to maintain your distribution model accordingly. Ours looks like that:
Step 3: Required entry in transaction WE57
( see SAP note: http://service.sap.com/sap/support/notes/2058455 )
Step 4: Add missing functionality in function module MASTERIDOC_CREATE_SMD_CREMAS
THIS IS A MODIFICATION!!! (We will raise a customer message for it soon. AFAIK there is no SAP note addressing this issue till today).
Adding or changing a contact person in an already existing !!! vendor master - without changing anything else in this same vendor master - creates a KNVK change pointer in table BDCP2. However, this change pointer is never picked up by this function module and thus no CREMAS06-IDoc is triggered/created and thus no contact person additions/changes (would be in a KNVK-Segment of a CREMAS06-IDoc) are sent to some target system.
To solve this, we "copied" over some logic (see red lines) we found in MASTERIDOC_CREATE_SMD_DEBMAS to function module MASTERIDOC_CREATE_SMD_CREMAS and adopted it for LFA1 (search for WHEN 'KNVK').
[...]
WHEN 'KNVK'.
PERFORM move_x_to_y USING t_chgptrs-tabkey+0(3)
f_knvkkey-mandt.
IF f_knvkkey-mandt = space.
f_knvkkey-mandt = t_chgptrs-mandt.
ENDIF.
f_knvkkey-lifnr = t_chgptrs-cdobjid.
PERFORM move_x_to_y USING t_chgptrs-tabkey+3(10)
f_knvkkey-parnr.
f_lfa1key-mandt = f_knvkkey-mandt.
f_lfa1key-lifnr = f_knvkkey-lifnr.
t_lfa1key-mandt = f_knvkkey-mandt.
t_lfa1key-lifnr = f_knvkkey-lifnr.
PERFORM convert_cdchgid_to_msgfn
USING 'S'
t_lfa1key-msgfn.
READ TABLE t_lfa1key WITH KEY f_lfa1key BINARY SEARCH.
IF sy-subrc <> 0.
INSERT t_lfa1key INDEX sy-tabix.
ENDIF.
READ TABLE t_knvkkey WITH KEY f_knvkkey.
MOVE f_knvkkey-mandt TO t_knvkkey-mandt.
MOVE f_knvkkey-lifnr TO t_knvkkey-lifnr.
MOVE f_knvkkey-parnr TO t_knvkkey-parnr.
PERFORM convert_cdchgid_to_msgfn USING t_chgptrs-cdchgid
t_knvkkey-msgfn.
IF sy-subrc <> 0.
APPEND t_knvkkey.
ELSE.
MODIFY t_knvkkey INDEX sy-tabix.
ENDIF.
* add pointer to processed pointers
MOVE-CORRESPONDING f_knvkkey TO t_cpident_cre.
MOVE t_chgptrs-cpident TO t_cpident_cre-cpident.
APPEND t_cpident_cre.
[...]
Step 5: Check your Partner Profile (transaction WE20)
In your sending/source system, ensure you put in "CREMA06" as the basic type in your outbound parameters of your partner profile.
Hope this will help you and others as well.
Regards
Renaud