SAP Function Modules

EHFND_CHM_WRITE_DOCUMENT SAP Function module - CHDO EHFND_CHM => Gen. by RSSCD000







EHFND_CHM_WRITE_DOCUMENT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name EHFND_CHM_WRITE_DOCUMENT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: EHFND_CHM_CH_DOC
Released Date: Not Released
Processing type: Start update immediately (start immed)
update module start immediate settings


Pattern for FM EHFND_CHM_WRITE_DOCUMENT - EHFND CHM WRITE DOCUMENT





CALL FUNCTION 'EHFND_CHM_WRITE_DOCUMENT' "CHDO EHFND_CHM => Gen. by RSSCD000
  EXPORTING
    objectid =                  " cdhdr-objectid
    tcode =                     " cdhdr-tcode
    utime =                     " cdhdr-utime
    udate =                     " cdhdr-udate
    username =                  " cdhdr-username
    planned_change_number = SPACE  " cdhdr-planchngnr
    object_change_indicator = 'U'  " cdhdr-change_ind
    planned_or_real_changes = SPACE  " cdhdr-change_ind
    no_change_pointers = SPACE  " cdhdr-change_ind
*   n_ehfndd_chm_binfo =        " ehfndd_chm_binfo
*   o_ehfndd_chm_binfo =        " ehfndd_chm_binfo
*   upd_ehfndd_chm_binfo = SPACE  " cdpos-chngind
*   upd_ehfndd_chm_hclss = SPACE  " cdpos-chngind
*   upd_ehfndd_chm_hing = SPACE  " cdpos-chngind
*   upd_ehfndd_chm_hstmt = SPACE  " cdpos-chngind
*   upd_ehfndd_chm_mat = SPACE  " cdpos-chngind
*   upd_ehfndd_chm_name = SPACE  " cdpos-chngind
*   n_ehfndd_chm_root =         " ehfndd_chm_root
*   o_ehfndd_chm_root =         " ehfndd_chm_root
*   upd_ehfndd_chm_root = SPACE  " cdpos-chngind
* TABLES
*   xehfndd_chm_hclss =         " cdoehfndd_chm_hclss
*   yehfndd_chm_hclss =         " cdoehfndd_chm_hclss
*   xehfndd_chm_hing =          " cdoehfndd_chm_hing
*   yehfndd_chm_hing =          " cdoehfndd_chm_hing
*   xehfndd_chm_hstmt =         " cdoehfndd_chm_hstmt
*   yehfndd_chm_hstmt =         " cdoehfndd_chm_hstmt
*   xehfndd_chm_mat =           " cdoehfndd_chm_mat
*   yehfndd_chm_mat =           " cdoehfndd_chm_mat
*   xehfndd_chm_name =          " cdoehfndd_chm_name
*   yehfndd_chm_name =          " cdoehfndd_chm_name
    .  "  EHFND_CHM_WRITE_DOCUMENT

ABAP code example for Function Module EHFND_CHM_WRITE_DOCUMENT





The ABAP code below is a full code listing to execute function module EHFND_CHM_WRITE_DOCUMENT including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_xehfndd_chm_hclss  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HCLSS,"TABLES PARAM
wa_xehfndd_chm_hclss  LIKE LINE OF it_xehfndd_chm_hclss ,
it_yehfndd_chm_hclss  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HCLSS,"TABLES PARAM
wa_yehfndd_chm_hclss  LIKE LINE OF it_yehfndd_chm_hclss ,
it_xehfndd_chm_hing  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HING,"TABLES PARAM
wa_xehfndd_chm_hing  LIKE LINE OF it_xehfndd_chm_hing ,
it_yehfndd_chm_hing  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HING,"TABLES PARAM
wa_yehfndd_chm_hing  LIKE LINE OF it_yehfndd_chm_hing ,
it_xehfndd_chm_hstmt  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HSTMT,"TABLES PARAM
wa_xehfndd_chm_hstmt  LIKE LINE OF it_xehfndd_chm_hstmt ,
it_yehfndd_chm_hstmt  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HSTMT,"TABLES PARAM
wa_yehfndd_chm_hstmt  LIKE LINE OF it_yehfndd_chm_hstmt ,
it_xehfndd_chm_mat  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_MAT,"TABLES PARAM
wa_xehfndd_chm_mat  LIKE LINE OF it_xehfndd_chm_mat ,
it_yehfndd_chm_mat  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_MAT,"TABLES PARAM
wa_yehfndd_chm_mat  LIKE LINE OF it_yehfndd_chm_mat ,
it_xehfndd_chm_name  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_NAME,"TABLES PARAM
wa_xehfndd_chm_name  LIKE LINE OF it_xehfndd_chm_name ,
it_yehfndd_chm_name  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_NAME,"TABLES PARAM
wa_yehfndd_chm_name  LIKE LINE OF it_yehfndd_chm_name .


SELECT single OBJECTID
FROM CDHDR
INTO @DATA(ld_objectid).


SELECT single TCODE
FROM CDHDR
INTO @DATA(ld_tcode).


SELECT single UTIME
FROM CDHDR
INTO @DATA(ld_utime).


SELECT single UDATE
FROM CDHDR
INTO @DATA(ld_udate).


SELECT single USERNAME
FROM CDHDR
INTO @DATA(ld_username).


SELECT single PLANCHNGNR
FROM CDHDR
INTO @DATA(ld_planned_change_number).


SELECT single CHANGE_IND
FROM CDHDR
INTO @DATA(ld_object_change_indicator).


SELECT single CHANGE_IND
FROM CDHDR
INTO @DATA(ld_planned_or_real_changes).


SELECT single CHANGE_IND
FROM CDHDR
INTO @DATA(ld_no_change_pointers).

DATA(ld_n_ehfndd_chm_binfo) = 'Check type of data required'.
DATA(ld_o_ehfndd_chm_binfo) = 'Check type of data required'.

SELECT single CHNGIND
FROM CDPOS
INTO @DATA(ld_upd_ehfndd_chm_binfo).


SELECT single CHNGIND
FROM CDPOS
INTO @DATA(ld_upd_ehfndd_chm_hclss).


SELECT single CHNGIND
FROM CDPOS
INTO @DATA(ld_upd_ehfndd_chm_hing).


SELECT single CHNGIND
FROM CDPOS
INTO @DATA(ld_upd_ehfndd_chm_hstmt).


SELECT single CHNGIND
FROM CDPOS
INTO @DATA(ld_upd_ehfndd_chm_mat).


SELECT single CHNGIND
FROM CDPOS
INTO @DATA(ld_upd_ehfndd_chm_name).

DATA(ld_n_ehfndd_chm_root) = 'Check type of data required'.
DATA(ld_o_ehfndd_chm_root) = 'Check type of data required'.

SELECT single CHNGIND
FROM CDPOS
INTO @DATA(ld_upd_ehfndd_chm_root).


"populate fields of struture and append to itab
append wa_xehfndd_chm_hclss to it_xehfndd_chm_hclss.

"populate fields of struture and append to itab
append wa_yehfndd_chm_hclss to it_yehfndd_chm_hclss.

"populate fields of struture and append to itab
append wa_xehfndd_chm_hing to it_xehfndd_chm_hing.

"populate fields of struture and append to itab
append wa_yehfndd_chm_hing to it_yehfndd_chm_hing.

"populate fields of struture and append to itab
append wa_xehfndd_chm_hstmt to it_xehfndd_chm_hstmt.

"populate fields of struture and append to itab
append wa_yehfndd_chm_hstmt to it_yehfndd_chm_hstmt.

"populate fields of struture and append to itab
append wa_xehfndd_chm_mat to it_xehfndd_chm_mat.

"populate fields of struture and append to itab
append wa_yehfndd_chm_mat to it_yehfndd_chm_mat.

"populate fields of struture and append to itab
append wa_xehfndd_chm_name to it_xehfndd_chm_name.

"populate fields of struture and append to itab
append wa_yehfndd_chm_name to it_yehfndd_chm_name. . CALL FUNCTION 'EHFND_CHM_WRITE_DOCUMENT' EXPORTING objectid = ld_objectid tcode = ld_tcode utime = ld_utime udate = ld_udate username = ld_username planned_change_number = ld_planned_change_number object_change_indicator = ld_object_change_indicator planned_or_real_changes = ld_planned_or_real_changes no_change_pointers = ld_no_change_pointers * n_ehfndd_chm_binfo = ld_n_ehfndd_chm_binfo * o_ehfndd_chm_binfo = ld_o_ehfndd_chm_binfo * upd_ehfndd_chm_binfo = ld_upd_ehfndd_chm_binfo * upd_ehfndd_chm_hclss = ld_upd_ehfndd_chm_hclss * upd_ehfndd_chm_hing = ld_upd_ehfndd_chm_hing * upd_ehfndd_chm_hstmt = ld_upd_ehfndd_chm_hstmt * upd_ehfndd_chm_mat = ld_upd_ehfndd_chm_mat * upd_ehfndd_chm_name = ld_upd_ehfndd_chm_name * n_ehfndd_chm_root = ld_n_ehfndd_chm_root * o_ehfndd_chm_root = ld_o_ehfndd_chm_root * upd_ehfndd_chm_root = ld_upd_ehfndd_chm_root * TABLES * xehfndd_chm_hclss = it_xehfndd_chm_hclss * yehfndd_chm_hclss = it_yehfndd_chm_hclss * xehfndd_chm_hing = it_xehfndd_chm_hing * yehfndd_chm_hing = it_yehfndd_chm_hing * xehfndd_chm_hstmt = it_xehfndd_chm_hstmt * yehfndd_chm_hstmt = it_yehfndd_chm_hstmt * xehfndd_chm_mat = it_xehfndd_chm_mat * yehfndd_chm_mat = it_yehfndd_chm_mat * xehfndd_chm_name = it_xehfndd_chm_name * yehfndd_chm_name = it_yehfndd_chm_name . " EHFND_CHM_WRITE_DOCUMENT
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_objectid  TYPE CDHDR-OBJECTID ,
it_xehfndd_chm_hclss  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HCLSS ,
wa_xehfndd_chm_hclss  LIKE LINE OF it_xehfndd_chm_hclss,
ld_tcode  TYPE CDHDR-TCODE ,
it_yehfndd_chm_hclss  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HCLSS ,
wa_yehfndd_chm_hclss  LIKE LINE OF it_yehfndd_chm_hclss,
ld_utime  TYPE CDHDR-UTIME ,
it_xehfndd_chm_hing  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HING ,
wa_xehfndd_chm_hing  LIKE LINE OF it_xehfndd_chm_hing,
ld_udate  TYPE CDHDR-UDATE ,
it_yehfndd_chm_hing  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HING ,
wa_yehfndd_chm_hing  LIKE LINE OF it_yehfndd_chm_hing,
ld_username  TYPE CDHDR-USERNAME ,
it_xehfndd_chm_hstmt  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HSTMT ,
wa_xehfndd_chm_hstmt  LIKE LINE OF it_xehfndd_chm_hstmt,
ld_planned_change_number  TYPE CDHDR-PLANCHNGNR ,
it_yehfndd_chm_hstmt  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_HSTMT ,
wa_yehfndd_chm_hstmt  LIKE LINE OF it_yehfndd_chm_hstmt,
ld_object_change_indicator  TYPE CDHDR-CHANGE_IND ,
it_xehfndd_chm_mat  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_MAT ,
wa_xehfndd_chm_mat  LIKE LINE OF it_xehfndd_chm_mat,
ld_planned_or_real_changes  TYPE CDHDR-CHANGE_IND ,
it_yehfndd_chm_mat  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_MAT ,
wa_yehfndd_chm_mat  LIKE LINE OF it_yehfndd_chm_mat,
ld_no_change_pointers  TYPE CDHDR-CHANGE_IND ,
it_xehfndd_chm_name  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_NAME ,
wa_xehfndd_chm_name  LIKE LINE OF it_xehfndd_chm_name,
ld_n_ehfndd_chm_binfo  TYPE EHFNDD_CHM_BINFO ,
it_yehfndd_chm_name  TYPE STANDARD TABLE OF CDOEHFNDD_CHM_NAME ,
wa_yehfndd_chm_name  LIKE LINE OF it_yehfndd_chm_name,
ld_o_ehfndd_chm_binfo  TYPE EHFNDD_CHM_BINFO ,
ld_upd_ehfndd_chm_binfo  TYPE CDPOS-CHNGIND ,
ld_upd_ehfndd_chm_hclss  TYPE CDPOS-CHNGIND ,
ld_upd_ehfndd_chm_hing  TYPE CDPOS-CHNGIND ,
ld_upd_ehfndd_chm_hstmt  TYPE CDPOS-CHNGIND ,
ld_upd_ehfndd_chm_mat  TYPE CDPOS-CHNGIND ,
ld_upd_ehfndd_chm_name  TYPE CDPOS-CHNGIND ,
ld_n_ehfndd_chm_root  TYPE EHFNDD_CHM_ROOT ,
ld_o_ehfndd_chm_root  TYPE EHFNDD_CHM_ROOT ,
ld_upd_ehfndd_chm_root  TYPE CDPOS-CHNGIND .


SELECT single OBJECTID
FROM CDHDR
INTO ld_objectid.


"populate fields of struture and append to itab
append wa_xehfndd_chm_hclss to it_xehfndd_chm_hclss.

SELECT single TCODE
FROM CDHDR
INTO ld_tcode.


"populate fields of struture and append to itab
append wa_yehfndd_chm_hclss to it_yehfndd_chm_hclss.

SELECT single UTIME
FROM CDHDR
INTO ld_utime.


"populate fields of struture and append to itab
append wa_xehfndd_chm_hing to it_xehfndd_chm_hing.

SELECT single UDATE
FROM CDHDR
INTO ld_udate.


"populate fields of struture and append to itab
append wa_yehfndd_chm_hing to it_yehfndd_chm_hing.

SELECT single USERNAME
FROM CDHDR
INTO ld_username.


"populate fields of struture and append to itab
append wa_xehfndd_chm_hstmt to it_xehfndd_chm_hstmt.

SELECT single PLANCHNGNR
FROM CDHDR
INTO ld_planned_change_number.


"populate fields of struture and append to itab
append wa_yehfndd_chm_hstmt to it_yehfndd_chm_hstmt.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_object_change_indicator.


"populate fields of struture and append to itab
append wa_xehfndd_chm_mat to it_xehfndd_chm_mat.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_planned_or_real_changes.


"populate fields of struture and append to itab
append wa_yehfndd_chm_mat to it_yehfndd_chm_mat.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_no_change_pointers.


"populate fields of struture and append to itab
append wa_xehfndd_chm_name to it_xehfndd_chm_name.
ld_n_ehfndd_chm_binfo = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_yehfndd_chm_name to it_yehfndd_chm_name.
ld_o_ehfndd_chm_binfo = 'Check type of data required'.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehfndd_chm_binfo.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehfndd_chm_hclss.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehfndd_chm_hing.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehfndd_chm_hstmt.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehfndd_chm_mat.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehfndd_chm_name.

ld_n_ehfndd_chm_root = 'Check type of data required'.
ld_o_ehfndd_chm_root = 'Check type of data required'.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehfndd_chm_root.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name EHFND_CHM_WRITE_DOCUMENT or its description.