SAP Function Modules

EHHSS_SEG_WRITE_DOCUMENT SAP Function module - CHDO EHHSS_SEG => Gen. by RSSCD000







EHHSS_SEG_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 EHHSS_SEG_WRITE_DOCUMENT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: EHHSS_SEG_CH_DOC
Released Date: Not Released
Processing type: Start of update delayed (Start Delayed)
update module start delayed settings


Pattern for FM EHHSS_SEG_WRITE_DOCUMENT - EHHSS SEG WRITE DOCUMENT





CALL FUNCTION 'EHHSS_SEG_WRITE_DOCUMENT' "CHDO EHHSS_SEG => 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
    upd_ehhssd_seg_agt = SPACE  " cdpos-chngind
    upd_ehhssd_seg_job = SPACE  " cdpos-chngind
    upd_ehhssd_seg_loc = SPACE  " cdpos-chngind
    upd_ehhssd_seg_name = SPACE  " cdpos-chngind
    upd_ehhssd_seg_rev = SPACE  " cdpos-chngind
    upd_ehhssd_seg_root = SPACE  " cdpos-chngind
    upd_ehhssd_seg_team = SPACE  " cdpos-chngind
    upd_ehhsss_cdtxctxtt = SPACE  " cdpos-chngind
    xehhsss_cdtxctxtt =         " cdoehhsss_cdtxctxtts
    yehhsss_cdtxctxtt =         " cdoehhsss_cdtxctxtts
  TABLES
    xehhssd_seg_agt =           " cdoehhssd_seg_agt
    yehhssd_seg_agt =           " cdoehhssd_seg_agt
    xehhssd_seg_job =           " cdoehhssd_seg_job
    yehhssd_seg_job =           " cdoehhssd_seg_job
    xehhssd_seg_loc =           " cdoehhssd_seg_loc
    yehhssd_seg_loc =           " cdoehhssd_seg_loc
    xehhssd_seg_name =          " cdoehhssd_seg_name
    yehhssd_seg_name =          " cdoehhssd_seg_name
    xehhssd_seg_rev =           " cdoehhssd_seg_rev
    yehhssd_seg_rev =           " cdoehhssd_seg_rev
    xehhssd_seg_root =          " cdoehhssd_seg_root
    yehhssd_seg_root =          " cdoehhssd_seg_root
    xehhssd_seg_team =          " cdoehhssd_seg_team
    yehhssd_seg_team =          " cdoehhssd_seg_team
    .  "  EHHSS_SEG_WRITE_DOCUMENT

ABAP code example for Function Module EHHSS_SEG_WRITE_DOCUMENT





The ABAP code below is a full code listing to execute function module EHHSS_SEG_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_xehhssd_seg_agt  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_AGT,"TABLES PARAM
wa_xehhssd_seg_agt  LIKE LINE OF it_xehhssd_seg_agt ,
it_yehhssd_seg_agt  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_AGT,"TABLES PARAM
wa_yehhssd_seg_agt  LIKE LINE OF it_yehhssd_seg_agt ,
it_xehhssd_seg_job  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_JOB,"TABLES PARAM
wa_xehhssd_seg_job  LIKE LINE OF it_xehhssd_seg_job ,
it_yehhssd_seg_job  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_JOB,"TABLES PARAM
wa_yehhssd_seg_job  LIKE LINE OF it_yehhssd_seg_job ,
it_xehhssd_seg_loc  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_LOC,"TABLES PARAM
wa_xehhssd_seg_loc  LIKE LINE OF it_xehhssd_seg_loc ,
it_yehhssd_seg_loc  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_LOC,"TABLES PARAM
wa_yehhssd_seg_loc  LIKE LINE OF it_yehhssd_seg_loc ,
it_xehhssd_seg_name  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_NAME,"TABLES PARAM
wa_xehhssd_seg_name  LIKE LINE OF it_xehhssd_seg_name ,
it_yehhssd_seg_name  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_NAME,"TABLES PARAM
wa_yehhssd_seg_name  LIKE LINE OF it_yehhssd_seg_name ,
it_xehhssd_seg_rev  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_REV,"TABLES PARAM
wa_xehhssd_seg_rev  LIKE LINE OF it_xehhssd_seg_rev ,
it_yehhssd_seg_rev  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_REV,"TABLES PARAM
wa_yehhssd_seg_rev  LIKE LINE OF it_yehhssd_seg_rev ,
it_xehhssd_seg_root  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_ROOT,"TABLES PARAM
wa_xehhssd_seg_root  LIKE LINE OF it_xehhssd_seg_root ,
it_yehhssd_seg_root  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_ROOT,"TABLES PARAM
wa_yehhssd_seg_root  LIKE LINE OF it_yehhssd_seg_root ,
it_xehhssd_seg_team  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_TEAM,"TABLES PARAM
wa_xehhssd_seg_team  LIKE LINE OF it_xehhssd_seg_team ,
it_yehhssd_seg_team  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_TEAM,"TABLES PARAM
wa_yehhssd_seg_team  LIKE LINE OF it_yehhssd_seg_team .


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).


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


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


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


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


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


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


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


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

DATA(ld_xehhsss_cdtxctxtt) = 'Check type of data required'.
DATA(ld_yehhsss_cdtxctxtt) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_xehhssd_seg_agt to it_xehhssd_seg_agt.

"populate fields of struture and append to itab
append wa_yehhssd_seg_agt to it_yehhssd_seg_agt.

"populate fields of struture and append to itab
append wa_xehhssd_seg_job to it_xehhssd_seg_job.

"populate fields of struture and append to itab
append wa_yehhssd_seg_job to it_yehhssd_seg_job.

"populate fields of struture and append to itab
append wa_xehhssd_seg_loc to it_xehhssd_seg_loc.

"populate fields of struture and append to itab
append wa_yehhssd_seg_loc to it_yehhssd_seg_loc.

"populate fields of struture and append to itab
append wa_xehhssd_seg_name to it_xehhssd_seg_name.

"populate fields of struture and append to itab
append wa_yehhssd_seg_name to it_yehhssd_seg_name.

"populate fields of struture and append to itab
append wa_xehhssd_seg_rev to it_xehhssd_seg_rev.

"populate fields of struture and append to itab
append wa_yehhssd_seg_rev to it_yehhssd_seg_rev.

"populate fields of struture and append to itab
append wa_xehhssd_seg_root to it_xehhssd_seg_root.

"populate fields of struture and append to itab
append wa_yehhssd_seg_root to it_yehhssd_seg_root.

"populate fields of struture and append to itab
append wa_xehhssd_seg_team to it_xehhssd_seg_team.

"populate fields of struture and append to itab
append wa_yehhssd_seg_team to it_yehhssd_seg_team. . CALL FUNCTION 'EHHSS_SEG_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 upd_ehhssd_seg_agt = ld_upd_ehhssd_seg_agt upd_ehhssd_seg_job = ld_upd_ehhssd_seg_job upd_ehhssd_seg_loc = ld_upd_ehhssd_seg_loc upd_ehhssd_seg_name = ld_upd_ehhssd_seg_name upd_ehhssd_seg_rev = ld_upd_ehhssd_seg_rev upd_ehhssd_seg_root = ld_upd_ehhssd_seg_root upd_ehhssd_seg_team = ld_upd_ehhssd_seg_team upd_ehhsss_cdtxctxtt = ld_upd_ehhsss_cdtxctxtt xehhsss_cdtxctxtt = ld_xehhsss_cdtxctxtt yehhsss_cdtxctxtt = ld_yehhsss_cdtxctxtt TABLES xehhssd_seg_agt = it_xehhssd_seg_agt yehhssd_seg_agt = it_yehhssd_seg_agt xehhssd_seg_job = it_xehhssd_seg_job yehhssd_seg_job = it_yehhssd_seg_job xehhssd_seg_loc = it_xehhssd_seg_loc yehhssd_seg_loc = it_yehhssd_seg_loc xehhssd_seg_name = it_xehhssd_seg_name yehhssd_seg_name = it_yehhssd_seg_name xehhssd_seg_rev = it_xehhssd_seg_rev yehhssd_seg_rev = it_yehhssd_seg_rev xehhssd_seg_root = it_xehhssd_seg_root yehhssd_seg_root = it_yehhssd_seg_root xehhssd_seg_team = it_xehhssd_seg_team yehhssd_seg_team = it_yehhssd_seg_team . " EHHSS_SEG_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_xehhssd_seg_agt  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_AGT ,
wa_xehhssd_seg_agt  LIKE LINE OF it_xehhssd_seg_agt,
ld_tcode  TYPE CDHDR-TCODE ,
it_yehhssd_seg_agt  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_AGT ,
wa_yehhssd_seg_agt  LIKE LINE OF it_yehhssd_seg_agt,
ld_utime  TYPE CDHDR-UTIME ,
it_xehhssd_seg_job  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_JOB ,
wa_xehhssd_seg_job  LIKE LINE OF it_xehhssd_seg_job,
ld_udate  TYPE CDHDR-UDATE ,
it_yehhssd_seg_job  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_JOB ,
wa_yehhssd_seg_job  LIKE LINE OF it_yehhssd_seg_job,
ld_username  TYPE CDHDR-USERNAME ,
it_xehhssd_seg_loc  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_LOC ,
wa_xehhssd_seg_loc  LIKE LINE OF it_xehhssd_seg_loc,
ld_planned_change_number  TYPE CDHDR-PLANCHNGNR ,
it_yehhssd_seg_loc  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_LOC ,
wa_yehhssd_seg_loc  LIKE LINE OF it_yehhssd_seg_loc,
ld_object_change_indicator  TYPE CDHDR-CHANGE_IND ,
it_xehhssd_seg_name  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_NAME ,
wa_xehhssd_seg_name  LIKE LINE OF it_xehhssd_seg_name,
ld_planned_or_real_changes  TYPE CDHDR-CHANGE_IND ,
it_yehhssd_seg_name  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_NAME ,
wa_yehhssd_seg_name  LIKE LINE OF it_yehhssd_seg_name,
ld_no_change_pointers  TYPE CDHDR-CHANGE_IND ,
it_xehhssd_seg_rev  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_REV ,
wa_xehhssd_seg_rev  LIKE LINE OF it_xehhssd_seg_rev,
ld_upd_ehhssd_seg_agt  TYPE CDPOS-CHNGIND ,
it_yehhssd_seg_rev  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_REV ,
wa_yehhssd_seg_rev  LIKE LINE OF it_yehhssd_seg_rev,
it_xehhssd_seg_root  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_ROOT ,
wa_xehhssd_seg_root  LIKE LINE OF it_xehhssd_seg_root,
ld_upd_ehhssd_seg_job  TYPE CDPOS-CHNGIND ,
it_yehhssd_seg_root  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_ROOT ,
wa_yehhssd_seg_root  LIKE LINE OF it_yehhssd_seg_root,
ld_upd_ehhssd_seg_loc  TYPE CDPOS-CHNGIND ,
it_xehhssd_seg_team  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_TEAM ,
wa_xehhssd_seg_team  LIKE LINE OF it_xehhssd_seg_team,
ld_upd_ehhssd_seg_name  TYPE CDPOS-CHNGIND ,
it_yehhssd_seg_team  TYPE STANDARD TABLE OF CDOEHHSSD_SEG_TEAM ,
wa_yehhssd_seg_team  LIKE LINE OF it_yehhssd_seg_team,
ld_upd_ehhssd_seg_rev  TYPE CDPOS-CHNGIND ,
ld_upd_ehhssd_seg_root  TYPE CDPOS-CHNGIND ,
ld_upd_ehhssd_seg_team  TYPE CDPOS-CHNGIND ,
ld_upd_ehhsss_cdtxctxtt  TYPE CDPOS-CHNGIND ,
ld_xehhsss_cdtxctxtt  TYPE CDOEHHSSS_CDTXCTXTTS ,
ld_yehhsss_cdtxctxtt  TYPE CDOEHHSSS_CDTXCTXTTS .


SELECT single OBJECTID
FROM CDHDR
INTO ld_objectid.


"populate fields of struture and append to itab
append wa_xehhssd_seg_agt to it_xehhssd_seg_agt.

SELECT single TCODE
FROM CDHDR
INTO ld_tcode.


"populate fields of struture and append to itab
append wa_yehhssd_seg_agt to it_yehhssd_seg_agt.

SELECT single UTIME
FROM CDHDR
INTO ld_utime.


"populate fields of struture and append to itab
append wa_xehhssd_seg_job to it_xehhssd_seg_job.

SELECT single UDATE
FROM CDHDR
INTO ld_udate.


"populate fields of struture and append to itab
append wa_yehhssd_seg_job to it_yehhssd_seg_job.

SELECT single USERNAME
FROM CDHDR
INTO ld_username.


"populate fields of struture and append to itab
append wa_xehhssd_seg_loc to it_xehhssd_seg_loc.

SELECT single PLANCHNGNR
FROM CDHDR
INTO ld_planned_change_number.


"populate fields of struture and append to itab
append wa_yehhssd_seg_loc to it_yehhssd_seg_loc.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_object_change_indicator.


"populate fields of struture and append to itab
append wa_xehhssd_seg_name to it_xehhssd_seg_name.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_planned_or_real_changes.


"populate fields of struture and append to itab
append wa_yehhssd_seg_name to it_yehhssd_seg_name.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_no_change_pointers.


"populate fields of struture and append to itab
append wa_xehhssd_seg_rev to it_xehhssd_seg_rev.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhssd_seg_agt.


"populate fields of struture and append to itab
append wa_yehhssd_seg_rev to it_yehhssd_seg_rev.

"populate fields of struture and append to itab
append wa_xehhssd_seg_root to it_xehhssd_seg_root.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhssd_seg_job.


"populate fields of struture and append to itab
append wa_yehhssd_seg_root to it_yehhssd_seg_root.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhssd_seg_loc.


"populate fields of struture and append to itab
append wa_xehhssd_seg_team to it_xehhssd_seg_team.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhssd_seg_name.


"populate fields of struture and append to itab
append wa_yehhssd_seg_team to it_yehhssd_seg_team.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhssd_seg_rev.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhssd_seg_root.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhssd_seg_team.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ehhsss_cdtxctxtt.

ld_xehhsss_cdtxctxtt = 'Check type of data required'.
ld_yehhsss_cdtxctxtt = 'Check type of data required'.

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 EHHSS_SEG_WRITE_DOCUMENT or its description.