SAP Function Modules

CONVERT_IDOC_SYNTAX_TO_TREE SAP Function module







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

Associated Function Group: EDI8
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM CONVERT_IDOC_SYNTAX_TO_TREE - CONVERT IDOC SYNTAX TO TREE





CALL FUNCTION 'CONVERT_IDOC_SYNTAX_TO_TREE' "
  EXPORTING
    pi_idoctyp =                " edi_iapi00-idoctyp
    pi_descrp =                 " edi_iapi01-descrp  Name of basic IDoc type
*   pi_e2display = ' '          " sed5struc-e2display
*   pi_e2segrel = SY-SAPRL      " sed5struc-segrel
*   pi_e2segapplrel = SPACE     " sed5struc-segapplrel  Application Release in which IDoc Segment Released
  TABLES
    lt_idocsyn =                " edi_iapi02
    lt_prev_idocsyn =           " edi_iapi02
    lt_tree =                   " snodetext
    lt_attr =                   " sed5attr
    .  "  CONVERT_IDOC_SYNTAX_TO_TREE

ABAP code example for Function Module CONVERT_IDOC_SYNTAX_TO_TREE





The ABAP code below is a full code listing to execute function module CONVERT_IDOC_SYNTAX_TO_TREE 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_lt_idocsyn  TYPE STANDARD TABLE OF EDI_IAPI02,"TABLES PARAM
wa_lt_idocsyn  LIKE LINE OF it_lt_idocsyn ,
it_lt_prev_idocsyn  TYPE STANDARD TABLE OF EDI_IAPI02,"TABLES PARAM
wa_lt_prev_idocsyn  LIKE LINE OF it_lt_prev_idocsyn ,
it_lt_tree  TYPE STANDARD TABLE OF SNODETEXT,"TABLES PARAM
wa_lt_tree  LIKE LINE OF it_lt_tree ,
it_lt_attr  TYPE STANDARD TABLE OF SED5ATTR,"TABLES PARAM
wa_lt_attr  LIKE LINE OF it_lt_attr .


DATA(ld_pi_idoctyp) = some text here

DATA(ld_pi_descrp) = some text here

DATA(ld_pi_e2display) = some text here

DATA(ld_pi_e2segrel) = some text here

DATA(ld_pi_e2segapplrel) = some text here

"populate fields of struture and append to itab
append wa_lt_idocsyn to it_lt_idocsyn.

"populate fields of struture and append to itab
append wa_lt_prev_idocsyn to it_lt_prev_idocsyn.

"populate fields of struture and append to itab
append wa_lt_tree to it_lt_tree.

"populate fields of struture and append to itab
append wa_lt_attr to it_lt_attr. . CALL FUNCTION 'CONVERT_IDOC_SYNTAX_TO_TREE' EXPORTING pi_idoctyp = ld_pi_idoctyp pi_descrp = ld_pi_descrp * pi_e2display = ld_pi_e2display * pi_e2segrel = ld_pi_e2segrel * pi_e2segapplrel = ld_pi_e2segapplrel TABLES lt_idocsyn = it_lt_idocsyn lt_prev_idocsyn = it_lt_prev_idocsyn lt_tree = it_lt_tree lt_attr = it_lt_attr . " CONVERT_IDOC_SYNTAX_TO_TREE
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_pi_idoctyp  TYPE EDI_IAPI00-IDOCTYP ,
it_lt_idocsyn  TYPE STANDARD TABLE OF EDI_IAPI02 ,
wa_lt_idocsyn  LIKE LINE OF it_lt_idocsyn,
ld_pi_descrp  TYPE EDI_IAPI01-DESCRP ,
it_lt_prev_idocsyn  TYPE STANDARD TABLE OF EDI_IAPI02 ,
wa_lt_prev_idocsyn  LIKE LINE OF it_lt_prev_idocsyn,
ld_pi_e2display  TYPE SED5STRUC-E2DISPLAY ,
it_lt_tree  TYPE STANDARD TABLE OF SNODETEXT ,
wa_lt_tree  LIKE LINE OF it_lt_tree,
ld_pi_e2segrel  TYPE SED5STRUC-SEGREL ,
it_lt_attr  TYPE STANDARD TABLE OF SED5ATTR ,
wa_lt_attr  LIKE LINE OF it_lt_attr,
ld_pi_e2segapplrel  TYPE SED5STRUC-SEGAPPLREL .


ld_pi_idoctyp = some text here

"populate fields of struture and append to itab
append wa_lt_idocsyn to it_lt_idocsyn.

ld_pi_descrp = some text here

"populate fields of struture and append to itab
append wa_lt_prev_idocsyn to it_lt_prev_idocsyn.

ld_pi_e2display = some text here

"populate fields of struture and append to itab
append wa_lt_tree to it_lt_tree.

ld_pi_e2segrel = some text here

"populate fields of struture and append to itab
append wa_lt_attr to it_lt_attr.

ld_pi_e2segapplrel = some text here

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