sitemap
Change Document Update Function Module for Customer Hierarchy

Note: ABAP/4 is the proprietary programming language of SAP™

This function module was generated using transaction SCDO for Change Document (CD) object
KUNHIER.


FUNCTION KUNHIER_WRITE_DOCUMENT        .


CALL FUNCTION 'CHANGEDOCUMENT_OPEN'
        EXPORTING OBJECTCLASS = 'KUNHIER   '
                  OBJECTID    = OBJECTID
          PLANNED_CHANGE_NUMBER = PLANNED_CHANGE_NUMBER
     PLANNED_OR_REAL_CHANGES = PLANNED_OR_REAL_CHANGES
        EXCEPTIONS SEQUENCE_INVALID = 1
                   OTHERS           = 2.

CASE SY-SUBRC.
WHEN 1. MESSAGE A001 WITH 'SEQUENCE INVALID'.
WHEN 2. MESSAGE A001 WITH 'OPEN ERROR'.
ENDCASE.


IF UPD_KNVH       NE SPACE.
CALL FUNCTION 'CHANGEDOCUMENT_MULTIPLE_CASE'
          EXPORTING  TABLENAME           = 'KNVH      '
                     CHANGE_INDICATOR    = UPD_KNVH
                     DOCU_DELETE         = 'X'
          TABLES     TABLE_OLD           = YKNVH
                     TABLE_NEW           = XKNVH
          EXCEPTIONS NAMETAB_ERROR       = 1
                     OPEN_MISSING        = 2
                     POSITION_INSERT_FAILED = 3
                     OTHERS              = 4.

CASE SY-SUBRC.
WHEN 1. MESSAGE A001 WITH 'NAMETAB-ERROR'.
WHEN 2. MESSAGE A001 WITH 'OPEN MISSING'.
WHEN 3. MESSAGE A001 WITH 'INSERT ERROR'.
WHEN 4. MESSAGE A001 WITH 'MULTIPLE ERROR'.
ENDCASE.
ENDIF.


IF UPD_ICDTXT_KUNHIER    NE SPACE.
CALL FUNCTION 'CHANGEDOCUMENT_TEXT_CASE'
              TABLES    TEXTTABLE  = ICDTXT_KUNHIER
          EXCEPTIONS OPEN_MISSING        = 1
                     POSITION_INSERT_FAILED = 2
                     OTHERS              = 3.

CASE SY-SUBRC.
WHEN 1. MESSAGE A001 WITH 'OPEN MISSING'.
WHEN 2. MESSAGE A001 WITH 'INSERT ERROR'.
WHEN 3. MESSAGE A001 WITH 'TEXT ERROR'.
ENDCASE.
ENDIF.


CALL FUNCTION 'CHANGEDOCUMENT_CLOSE'
       EXPORTING  OBJECTCLASS    = 'KUNHIER   '
                  OBJECTID       = OBJECTID
                  DATE_OF_CHANGE = UDATE
                  TIME_OF_CHANGE = UTIME
                  TCODE          = TCODE
                  USERNAME       = USERNAME
OBJECT_CHANGE_INDICATOR = OBJECT_CHANGE_INDICATOR
       EXCEPTIONS HEADER_INSERT_FAILED = 1
                  OBJECT_INVALID       = 2
                  OPEN_MISSING         = 3
                  NO_POSITION_INSERTED = 4
                  OTHERS               = 5.

CASE SY-SUBRC.
WHEN 1. MESSAGE A001 WITH 'INSERT HEADER FAILED'.
WHEN 2. MESSAGE A001 WITH 'OBJECT INVALID'.
WHEN 3. MESSAGE A001 WITH 'OPEN MISSING'.
WHEN 5. MESSAGE A001 WITH 'CLOSE ERROR'.
ENDCASE.

ENDFUNCTION.
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.
SapMaterial.com   
ABAP TECHNICAL

SAP Introduction

sap abap faq

sap Tables

SAP Transaction codes

Internal tables

data dictionary

performance tuning

transports & Requests

Sap scripts

Smartforms

lsmw

reports

sap Workflow

module pool/ dialog
programming

table control

user exits

sap memory

abap memory

alv reports

ABAP ADVANCED

IDOC

ALE

BAPI

BADI

RFC


FUNCTIONAL SIDE

Materials Management

FICO

Human Resources

BIW / BW / SEM


Free Documentation
Abap Material

Ale Material

BAPI Material

BC Material

IDOC Material

R/3 Database Management

SAP material

RFC

Transport

Sales & Distribution Material

Basic Data and Function
Material

Basis (BC) Material

Billing Material

CA Material

CATT : Computer Aided Test
Tool

Capacity Evaluation and
leveling Material

Capacity Planning Material

Cross Application Material

Countries

Customer Service Material

Enterpise  Material

Financial / Controlling (FICO)

Internet Time Sheet

Inspection Material

HR Material

Material Management
Material

Payments Material

Payroll Material

Pension Fund

Production Planning and
Control

Plant Maintenance

Quality Management Material

Real Estate Material

SAP material

Wage Types