sitemap
Form Routine for KUNHIER update Function Module
Note: ABAP/4 is the proprietary programming language of SAP™
The following code is a sample for modifying SAP™ standard program RVKNVH00 and may
need to be adjusted according to your requirements. This code was developed based on
pieces of code present in similar SAP™ standard programs for updating/creating change
documents, such as the one for Customer Master.
IF CHANGE_LINK = 'X'.
CALL FUNCTION 'CUSTOMER_HIERARCHY_UPDATE' IN UPDATE TASK
TABLES
T_XKNVH = XVKNVH
T_YKNVH = YKNVH.
***** Insert code here *************************************************
* This block of code has been added to create Change Documents *
* on CDHDR/CDPOS tables via the function module - *
* KUNHIER_WRITE_DOCUMENT (called in the form). *
* XVKNVH is the new image of changes, whereas YKNVH is the old image. *
* For every line of change in XVKNVH with a corresponding old image in *
* YKNVH, a Change Document is written. *
************************************************************************
LOOP AT XVKNVH.
CLEAR: I_XVKNVH, I_YVKNVH.
REFRESH: I_XVKNVH, I_YVKNVH.
I_XVKNVH = XVKNVH.
APPEND I_XVKNVH.
READ TABLE YKNVH WITH KEY
MANDT = XVKNVH-MANDT
HITYP = XVKNVH-HITYP
KUNNR = XVKNVH-KUNNR
VKORG = XVKNVH-VKORG
VTWEG = XVKNVH-VTWEG
SPART = XVKNVH-SPART
DATAB = XVKNVH-DATAB.
IF SY-SUBRC EQ 0.
I_YVKNVH = YKNVH.
APPEND I_YVKNVH.
ENDIF.
PERFORM CD_CALL_KUNHIER
TABLES I_XVKNVH
I_YVKNVH
USING 'U' I_XVKNVH-KUNNR.
ENDLOOP.
*****
***** Code changes end here ********************************************
*------ Änderungsmeldungen ausgeben -----------------------------------
MESSAGE S028.
ELSE.
MESSAGE S033.
ENDIF.
Figure 5-3: Changes to program RVKNVH00
Figure 5-4: Form Routine for KUNHIER update Function Module
************ Insert Form here ******************************************
******* Form routine to create change documents. This function module *
******* was "generated" based on CD object KUNHIER. *
************************************************************************
FORM CD_CALL_KUNHIER
TABLES FXKNVH STRUCTURE VKNVH
FYKNVH STRUCTURE VKNVH
USING UPD_KNVH OBJECTID.
***
IF ( UPD_KNVH NE SPACE ).
CALL FUNCTION 'SWE_REQUESTER_TO_UPDATE'.
CALL FUNCTION 'KUNHIER_WRITE_DOCUMENT ' IN UPDATE TASK
EXPORTING
OBJECTID = OBJECTID
TCODE = 'VDH1'
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_ICDTXI_KUNHIER = SPACE
TABLES
ICDTXI_KUNHIER = I_ICDTXI_KUNHIER
XKNVH = FXKNVH
YKNVH = FYKNVH.
ENDIF.
ENDFORM.
All of the product names here are trademarks of their respective companies. The site
www.allsaplinks.com no way affiliated with SAP AG. We have made every effort for the content
integrity. Information used on this site is at your own risk.