SAP Function Modules

IMAK_WRITE_DOCUMENT SAP Function module - CHDO IMAK => Gen. by RSSCD000







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

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


Pattern for FM IMAK_WRITE_DOCUMENT - IMAK WRITE DOCUMENT





CALL FUNCTION 'IMAK_WRITE_DOCUMENT' "CHDO IMAK => 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_ihpa = SPACE            " cdpos-chngind
    n_imak =                    " imak
    o_imak =                    " imak
    upd_imak = SPACE            " cdpos-chngind
    upd_imaka = SPACE           " cdpos-chngind
    upd_imakpa = SPACE          " cdpos-chngind
    upd_imakpi = SPACE          " cdpos-chngind
    upd_imakps = SPACE          " cdpos-chngind
    upd_imakpu = SPACE          " cdpos-chngind
    upd_imakpw = SPACE          " cdpos-chngind
    upd_imakt = SPACE           " cdpos-chngind
    upd_imakz = SPACE           " cdpos-chngind
    upd_imakzs = SPACE          " cdpos-chngind
    upd_imav = SPACE            " cdpos-chngind
    upd_imavt = SPACE           " cdpos-chngind
    upd_imavz = SPACE           " cdpos-chngind
  TABLES
    xihpa =                     " rihpa
    yihpa =                     " rihpa
    ximaka =                    " rimaka
    yimaka =                    " rimaka
    ximakpa =                   " rimakpa
    yimakpa =                   " rimakpa
    ximakpi =                   " rimakpi
    yimakpi =                   " rimakpi
    ximakps =                   " rimakps
    yimakps =                   " rimakps
    ximakpu =                   " rimakpu
    yimakpu =                   " rimakpu
    ximakpw =                   " rimakpw
    yimakpw =                   " rimakpw
    ximakt =                    " rimakt
    yimakt =                    " rimakt
    ximakz =                    " rimakz
    yimakz =                    " rimakz
    ximakzs =                   " rimakzs
    yimakzs =                   " rimakzs
    ximav =                     " rimav
    yimav =                     " rimav
    ximavt =                    " rimavt
    yimavt =                    " rimavt
    ximavz =                    " rimavz
    yimavz =                    " rimavz
    .  "  IMAK_WRITE_DOCUMENT

ABAP code example for Function Module IMAK_WRITE_DOCUMENT





The ABAP code below is a full code listing to execute function module IMAK_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_xihpa  TYPE STANDARD TABLE OF RIHPA,"TABLES PARAM
wa_xihpa  LIKE LINE OF it_xihpa ,
it_yihpa  TYPE STANDARD TABLE OF RIHPA,"TABLES PARAM
wa_yihpa  LIKE LINE OF it_yihpa ,
it_ximaka  TYPE STANDARD TABLE OF RIMAKA,"TABLES PARAM
wa_ximaka  LIKE LINE OF it_ximaka ,
it_yimaka  TYPE STANDARD TABLE OF RIMAKA,"TABLES PARAM
wa_yimaka  LIKE LINE OF it_yimaka ,
it_ximakpa  TYPE STANDARD TABLE OF RIMAKPA,"TABLES PARAM
wa_ximakpa  LIKE LINE OF it_ximakpa ,
it_yimakpa  TYPE STANDARD TABLE OF RIMAKPA,"TABLES PARAM
wa_yimakpa  LIKE LINE OF it_yimakpa ,
it_ximakpi  TYPE STANDARD TABLE OF RIMAKPI,"TABLES PARAM
wa_ximakpi  LIKE LINE OF it_ximakpi ,
it_yimakpi  TYPE STANDARD TABLE OF RIMAKPI,"TABLES PARAM
wa_yimakpi  LIKE LINE OF it_yimakpi ,
it_ximakps  TYPE STANDARD TABLE OF RIMAKPS,"TABLES PARAM
wa_ximakps  LIKE LINE OF it_ximakps ,
it_yimakps  TYPE STANDARD TABLE OF RIMAKPS,"TABLES PARAM
wa_yimakps  LIKE LINE OF it_yimakps ,
it_ximakpu  TYPE STANDARD TABLE OF RIMAKPU,"TABLES PARAM
wa_ximakpu  LIKE LINE OF it_ximakpu ,
it_yimakpu  TYPE STANDARD TABLE OF RIMAKPU,"TABLES PARAM
wa_yimakpu  LIKE LINE OF it_yimakpu ,
it_ximakpw  TYPE STANDARD TABLE OF RIMAKPW,"TABLES PARAM
wa_ximakpw  LIKE LINE OF it_ximakpw ,
it_yimakpw  TYPE STANDARD TABLE OF RIMAKPW,"TABLES PARAM
wa_yimakpw  LIKE LINE OF it_yimakpw ,
it_ximakt  TYPE STANDARD TABLE OF RIMAKT,"TABLES PARAM
wa_ximakt  LIKE LINE OF it_ximakt ,
it_yimakt  TYPE STANDARD TABLE OF RIMAKT,"TABLES PARAM
wa_yimakt  LIKE LINE OF it_yimakt ,
it_ximakz  TYPE STANDARD TABLE OF RIMAKZ,"TABLES PARAM
wa_ximakz  LIKE LINE OF it_ximakz ,
it_yimakz  TYPE STANDARD TABLE OF RIMAKZ,"TABLES PARAM
wa_yimakz  LIKE LINE OF it_yimakz ,
it_ximakzs  TYPE STANDARD TABLE OF RIMAKZS,"TABLES PARAM
wa_ximakzs  LIKE LINE OF it_ximakzs ,
it_yimakzs  TYPE STANDARD TABLE OF RIMAKZS,"TABLES PARAM
wa_yimakzs  LIKE LINE OF it_yimakzs ,
it_ximav  TYPE STANDARD TABLE OF RIMAV,"TABLES PARAM
wa_ximav  LIKE LINE OF it_ximav ,
it_yimav  TYPE STANDARD TABLE OF RIMAV,"TABLES PARAM
wa_yimav  LIKE LINE OF it_yimav ,
it_ximavt  TYPE STANDARD TABLE OF RIMAVT,"TABLES PARAM
wa_ximavt  LIKE LINE OF it_ximavt ,
it_yimavt  TYPE STANDARD TABLE OF RIMAVT,"TABLES PARAM
wa_yimavt  LIKE LINE OF it_yimavt ,
it_ximavz  TYPE STANDARD TABLE OF RIMAVZ,"TABLES PARAM
wa_ximavz  LIKE LINE OF it_ximavz ,
it_yimavz  TYPE STANDARD TABLE OF RIMAVZ,"TABLES PARAM
wa_yimavz  LIKE LINE OF it_yimavz .


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

DATA(ld_n_imak) = 'Check type of data required'.
DATA(ld_o_imak) = 'Check type of data required'.

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


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


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


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


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


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


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


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


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


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


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


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


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


"populate fields of struture and append to itab
append wa_xihpa to it_xihpa.

"populate fields of struture and append to itab
append wa_yihpa to it_yihpa.

"populate fields of struture and append to itab
append wa_ximaka to it_ximaka.

"populate fields of struture and append to itab
append wa_yimaka to it_yimaka.

"populate fields of struture and append to itab
append wa_ximakpa to it_ximakpa.

"populate fields of struture and append to itab
append wa_yimakpa to it_yimakpa.

"populate fields of struture and append to itab
append wa_ximakpi to it_ximakpi.

"populate fields of struture and append to itab
append wa_yimakpi to it_yimakpi.

"populate fields of struture and append to itab
append wa_ximakps to it_ximakps.

"populate fields of struture and append to itab
append wa_yimakps to it_yimakps.

"populate fields of struture and append to itab
append wa_ximakpu to it_ximakpu.

"populate fields of struture and append to itab
append wa_yimakpu to it_yimakpu.

"populate fields of struture and append to itab
append wa_ximakpw to it_ximakpw.

"populate fields of struture and append to itab
append wa_yimakpw to it_yimakpw.

"populate fields of struture and append to itab
append wa_ximakt to it_ximakt.

"populate fields of struture and append to itab
append wa_yimakt to it_yimakt.

"populate fields of struture and append to itab
append wa_ximakz to it_ximakz.

"populate fields of struture and append to itab
append wa_yimakz to it_yimakz.

"populate fields of struture and append to itab
append wa_ximakzs to it_ximakzs.

"populate fields of struture and append to itab
append wa_yimakzs to it_yimakzs.

"populate fields of struture and append to itab
append wa_ximav to it_ximav.

"populate fields of struture and append to itab
append wa_yimav to it_yimav.

"populate fields of struture and append to itab
append wa_ximavt to it_ximavt.

"populate fields of struture and append to itab
append wa_yimavt to it_yimavt.

"populate fields of struture and append to itab
append wa_ximavz to it_ximavz.

"populate fields of struture and append to itab
append wa_yimavz to it_yimavz. . CALL FUNCTION 'IMAK_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_ihpa = ld_upd_ihpa n_imak = ld_n_imak o_imak = ld_o_imak upd_imak = ld_upd_imak upd_imaka = ld_upd_imaka upd_imakpa = ld_upd_imakpa upd_imakpi = ld_upd_imakpi upd_imakps = ld_upd_imakps upd_imakpu = ld_upd_imakpu upd_imakpw = ld_upd_imakpw upd_imakt = ld_upd_imakt upd_imakz = ld_upd_imakz upd_imakzs = ld_upd_imakzs upd_imav = ld_upd_imav upd_imavt = ld_upd_imavt upd_imavz = ld_upd_imavz TABLES xihpa = it_xihpa yihpa = it_yihpa ximaka = it_ximaka yimaka = it_yimaka ximakpa = it_ximakpa yimakpa = it_yimakpa ximakpi = it_ximakpi yimakpi = it_yimakpi ximakps = it_ximakps yimakps = it_yimakps ximakpu = it_ximakpu yimakpu = it_yimakpu ximakpw = it_ximakpw yimakpw = it_yimakpw ximakt = it_ximakt yimakt = it_yimakt ximakz = it_ximakz yimakz = it_yimakz ximakzs = it_ximakzs yimakzs = it_yimakzs ximav = it_ximav yimav = it_yimav ximavt = it_ximavt yimavt = it_yimavt ximavz = it_ximavz yimavz = it_yimavz . " IMAK_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:
it_xihpa  TYPE STANDARD TABLE OF RIHPA ,
wa_xihpa  LIKE LINE OF it_xihpa,
ld_objectid  TYPE CDHDR-OBJECTID ,
it_yihpa  TYPE STANDARD TABLE OF RIHPA ,
wa_yihpa  LIKE LINE OF it_yihpa,
ld_tcode  TYPE CDHDR-TCODE ,
it_ximaka  TYPE STANDARD TABLE OF RIMAKA ,
wa_ximaka  LIKE LINE OF it_ximaka,
ld_utime  TYPE CDHDR-UTIME ,
it_yimaka  TYPE STANDARD TABLE OF RIMAKA ,
wa_yimaka  LIKE LINE OF it_yimaka,
ld_udate  TYPE CDHDR-UDATE ,
it_ximakpa  TYPE STANDARD TABLE OF RIMAKPA ,
wa_ximakpa  LIKE LINE OF it_ximakpa,
ld_username  TYPE CDHDR-USERNAME ,
it_yimakpa  TYPE STANDARD TABLE OF RIMAKPA ,
wa_yimakpa  LIKE LINE OF it_yimakpa,
ld_planned_change_number  TYPE CDHDR-PLANCHNGNR ,
it_ximakpi  TYPE STANDARD TABLE OF RIMAKPI ,
wa_ximakpi  LIKE LINE OF it_ximakpi,
ld_object_change_indicator  TYPE CDHDR-CHANGE_IND ,
it_yimakpi  TYPE STANDARD TABLE OF RIMAKPI ,
wa_yimakpi  LIKE LINE OF it_yimakpi,
ld_planned_or_real_changes  TYPE CDHDR-CHANGE_IND ,
it_ximakps  TYPE STANDARD TABLE OF RIMAKPS ,
wa_ximakps  LIKE LINE OF it_ximakps,
ld_no_change_pointers  TYPE CDHDR-CHANGE_IND ,
it_yimakps  TYPE STANDARD TABLE OF RIMAKPS ,
wa_yimakps  LIKE LINE OF it_yimakps,
ld_upd_ihpa  TYPE CDPOS-CHNGIND ,
it_ximakpu  TYPE STANDARD TABLE OF RIMAKPU ,
wa_ximakpu  LIKE LINE OF it_ximakpu,
ld_n_imak  TYPE IMAK ,
it_yimakpu  TYPE STANDARD TABLE OF RIMAKPU ,
wa_yimakpu  LIKE LINE OF it_yimakpu,
ld_o_imak  TYPE IMAK ,
it_ximakpw  TYPE STANDARD TABLE OF RIMAKPW ,
wa_ximakpw  LIKE LINE OF it_ximakpw,
ld_upd_imak  TYPE CDPOS-CHNGIND ,
it_yimakpw  TYPE STANDARD TABLE OF RIMAKPW ,
wa_yimakpw  LIKE LINE OF it_yimakpw,
ld_upd_imaka  TYPE CDPOS-CHNGIND ,
it_ximakt  TYPE STANDARD TABLE OF RIMAKT ,
wa_ximakt  LIKE LINE OF it_ximakt,
ld_upd_imakpa  TYPE CDPOS-CHNGIND ,
ld_upd_imakpi  TYPE CDPOS-CHNGIND ,
it_yimakt  TYPE STANDARD TABLE OF RIMAKT ,
wa_yimakt  LIKE LINE OF it_yimakt,
ld_upd_imakps  TYPE CDPOS-CHNGIND ,
it_ximakz  TYPE STANDARD TABLE OF RIMAKZ ,
wa_ximakz  LIKE LINE OF it_ximakz,
ld_upd_imakpu  TYPE CDPOS-CHNGIND ,
it_yimakz  TYPE STANDARD TABLE OF RIMAKZ ,
wa_yimakz  LIKE LINE OF it_yimakz,
ld_upd_imakpw  TYPE CDPOS-CHNGIND ,
it_ximakzs  TYPE STANDARD TABLE OF RIMAKZS ,
wa_ximakzs  LIKE LINE OF it_ximakzs,
ld_upd_imakt  TYPE CDPOS-CHNGIND ,
it_yimakzs  TYPE STANDARD TABLE OF RIMAKZS ,
wa_yimakzs  LIKE LINE OF it_yimakzs,
ld_upd_imakz  TYPE CDPOS-CHNGIND ,
it_ximav  TYPE STANDARD TABLE OF RIMAV ,
wa_ximav  LIKE LINE OF it_ximav,
ld_upd_imakzs  TYPE CDPOS-CHNGIND ,
it_yimav  TYPE STANDARD TABLE OF RIMAV ,
wa_yimav  LIKE LINE OF it_yimav,
ld_upd_imav  TYPE CDPOS-CHNGIND ,
it_ximavt  TYPE STANDARD TABLE OF RIMAVT ,
wa_ximavt  LIKE LINE OF it_ximavt,
ld_upd_imavt  TYPE CDPOS-CHNGIND ,
it_yimavt  TYPE STANDARD TABLE OF RIMAVT ,
wa_yimavt  LIKE LINE OF it_yimavt,
ld_upd_imavz  TYPE CDPOS-CHNGIND ,
it_ximavz  TYPE STANDARD TABLE OF RIMAVZ ,
wa_ximavz  LIKE LINE OF it_ximavz,
it_yimavz  TYPE STANDARD TABLE OF RIMAVZ ,
wa_yimavz  LIKE LINE OF it_yimavz.


"populate fields of struture and append to itab
append wa_xihpa to it_xihpa.

SELECT single OBJECTID
FROM CDHDR
INTO ld_objectid.


"populate fields of struture and append to itab
append wa_yihpa to it_yihpa.

SELECT single TCODE
FROM CDHDR
INTO ld_tcode.


"populate fields of struture and append to itab
append wa_ximaka to it_ximaka.

SELECT single UTIME
FROM CDHDR
INTO ld_utime.


"populate fields of struture and append to itab
append wa_yimaka to it_yimaka.

SELECT single UDATE
FROM CDHDR
INTO ld_udate.


"populate fields of struture and append to itab
append wa_ximakpa to it_ximakpa.

SELECT single USERNAME
FROM CDHDR
INTO ld_username.


"populate fields of struture and append to itab
append wa_yimakpa to it_yimakpa.

SELECT single PLANCHNGNR
FROM CDHDR
INTO ld_planned_change_number.


"populate fields of struture and append to itab
append wa_ximakpi to it_ximakpi.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_object_change_indicator.


"populate fields of struture and append to itab
append wa_yimakpi to it_yimakpi.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_planned_or_real_changes.


"populate fields of struture and append to itab
append wa_ximakps to it_ximakps.

SELECT single CHANGE_IND
FROM CDHDR
INTO ld_no_change_pointers.


"populate fields of struture and append to itab
append wa_yimakps to it_yimakps.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_ihpa.


"populate fields of struture and append to itab
append wa_ximakpu to it_ximakpu.
ld_n_imak = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_yimakpu to it_yimakpu.
ld_o_imak = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ximakpw to it_ximakpw.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imak.


"populate fields of struture and append to itab
append wa_yimakpw to it_yimakpw.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imaka.


"populate fields of struture and append to itab
append wa_ximakt to it_ximakt.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakpa.


SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakpi.


"populate fields of struture and append to itab
append wa_yimakt to it_yimakt.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakps.


"populate fields of struture and append to itab
append wa_ximakz to it_ximakz.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakpu.


"populate fields of struture and append to itab
append wa_yimakz to it_yimakz.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakpw.


"populate fields of struture and append to itab
append wa_ximakzs to it_ximakzs.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakt.


"populate fields of struture and append to itab
append wa_yimakzs to it_yimakzs.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakz.


"populate fields of struture and append to itab
append wa_ximav to it_ximav.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imakzs.


"populate fields of struture and append to itab
append wa_yimav to it_yimav.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imav.


"populate fields of struture and append to itab
append wa_ximavt to it_ximavt.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imavt.


"populate fields of struture and append to itab
append wa_yimavt to it_yimavt.

SELECT single CHNGIND
FROM CDPOS
INTO ld_upd_imavz.


"populate fields of struture and append to itab
append wa_ximavz to it_ximavz.

"populate fields of struture and append to itab
append wa_yimavz to it_yimavz.

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