SAP Function Modules

G_LEDGER_FROM_RWDOC_GIVE SAP Function module







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

Associated Function Group: GIRW
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM G_LEDGER_FROM_RWDOC_GIVE - G LEDGER FROM RWDOC GIVE





CALL FUNCTION 'G_LEDGER_FROM_RWDOC_GIVE' "
  EXPORTING
*   i_awtyp = SPACE             " acchd-awtyp
    i_awref =                   " acchd-awref
*   i_aworg = SPACE             " acchd-aworg
*   i_awsys = SPACE             " acchd-awsys
*   i_rcomp = SPACE             " t880-rcomp
*   i_bukrs = SPACE             " accit-bukrs
*   i_local = 'X'               " t800a-comptab
*   i_global = SPACE            " t800a-comptab
*   i_docnr = SPACE             " glu1-docnr
*   i_valutyp = '0'             " valutyp
  IMPORTING
    e_docnr =                   " glu1-docnr
    e_ryear =                   " glu1-ryear
    e_rldnr =                   " glu1-rldnr
    e_rcomp =                   " t880-rcomp
    e_bukrs =                   " t001-bukrs
    e_comptab =                 " t800a-comptab
* TABLES
*   t_glidxa =                  " glidxa
  EXCEPTIONS
    NO_DOCUMENT = 1             "
    NO_DOCUMENT_SELECTED = 2    "
    .  "  G_LEDGER_FROM_RWDOC_GIVE

ABAP code example for Function Module G_LEDGER_FROM_RWDOC_GIVE





The ABAP code below is a full code listing to execute function module G_LEDGER_FROM_RWDOC_GIVE 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:
ld_e_docnr  TYPE GLU1-DOCNR ,
ld_e_ryear  TYPE GLU1-RYEAR ,
ld_e_rldnr  TYPE GLU1-RLDNR ,
ld_e_rcomp  TYPE T880-RCOMP ,
ld_e_bukrs  TYPE T001-BUKRS ,
ld_e_comptab  TYPE T800A-COMPTAB ,
it_t_glidxa  TYPE STANDARD TABLE OF GLIDXA,"TABLES PARAM
wa_t_glidxa  LIKE LINE OF it_t_glidxa .


DATA(ld_i_awtyp) = some text here

DATA(ld_i_awref) = some text here

DATA(ld_i_aworg) = some text here

DATA(ld_i_awsys) = some text here

SELECT single RCOMP
FROM T880
INTO @DATA(ld_i_rcomp).


DATA(ld_i_bukrs) = some text here

SELECT single COMPTAB
FROM T800A
INTO @DATA(ld_i_local).


SELECT single COMPTAB
FROM T800A
INTO @DATA(ld_i_global).


DATA(ld_i_docnr) = some text here
DATA(ld_i_valutyp) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_glidxa to it_t_glidxa. . CALL FUNCTION 'G_LEDGER_FROM_RWDOC_GIVE' EXPORTING * i_awtyp = ld_i_awtyp i_awref = ld_i_awref * i_aworg = ld_i_aworg * i_awsys = ld_i_awsys * i_rcomp = ld_i_rcomp * i_bukrs = ld_i_bukrs * i_local = ld_i_local * i_global = ld_i_global * i_docnr = ld_i_docnr * i_valutyp = ld_i_valutyp IMPORTING e_docnr = ld_e_docnr e_ryear = ld_e_ryear e_rldnr = ld_e_rldnr e_rcomp = ld_e_rcomp e_bukrs = ld_e_bukrs e_comptab = ld_e_comptab * TABLES * t_glidxa = it_t_glidxa EXCEPTIONS NO_DOCUMENT = 1 NO_DOCUMENT_SELECTED = 2 . " G_LEDGER_FROM_RWDOC_GIVE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here 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_e_docnr  TYPE GLU1-DOCNR ,
ld_i_awtyp  TYPE ACCHD-AWTYP ,
it_t_glidxa  TYPE STANDARD TABLE OF GLIDXA ,
wa_t_glidxa  LIKE LINE OF it_t_glidxa,
ld_e_ryear  TYPE GLU1-RYEAR ,
ld_i_awref  TYPE ACCHD-AWREF ,
ld_e_rldnr  TYPE GLU1-RLDNR ,
ld_i_aworg  TYPE ACCHD-AWORG ,
ld_e_rcomp  TYPE T880-RCOMP ,
ld_i_awsys  TYPE ACCHD-AWSYS ,
ld_e_bukrs  TYPE T001-BUKRS ,
ld_i_rcomp  TYPE T880-RCOMP ,
ld_e_comptab  TYPE T800A-COMPTAB ,
ld_i_bukrs  TYPE ACCIT-BUKRS ,
ld_i_local  TYPE T800A-COMPTAB ,
ld_i_global  TYPE T800A-COMPTAB ,
ld_i_docnr  TYPE GLU1-DOCNR ,
ld_i_valutyp  TYPE VALUTYP .


ld_i_awtyp = some text here

"populate fields of struture and append to itab
append wa_t_glidxa to it_t_glidxa.

ld_i_awref = some text here

ld_i_aworg = some text here

ld_i_awsys = some text here

SELECT single RCOMP
FROM T880
INTO ld_i_rcomp.


ld_i_bukrs = some text here

SELECT single COMPTAB
FROM T800A
INTO ld_i_local.


SELECT single COMPTAB
FROM T800A
INTO ld_i_global.


ld_i_docnr = some text here
ld_i_valutyp = '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 G_LEDGER_FROM_RWDOC_GIVE or its description.