banner



How To Create A Structure In Sap Abap

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

Associated Function Group: RHAS
Released Date: 07.04.1998
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM STRUCTURE_BUILD - STRUCTURE BUILD


CALL FUNCTION 'STRUCTURE_BUILD' "Build Structure   EXPORTING     plvar =                     " hrrhas-plvar  Plan Version     otype =                     " hrrhas-otype  Object Type     objid =                     "               Object Number *   wegid = SPACE               " hrrhas-wegid  Evaluation Path *   svect = '1'                 " hrrhas-svect  Status Vector *   sbegd = SY-DATUM            " hrrhas-sbegd  Start Date *   sendd = SY-DATUM            " hrrhas-sendd  End Date *   tflag = SPACE               " hrrhas-tflag  Indicator: Get Texts *   vflag = SPACE               " hrrhas-vflag  Indicator: Get Relationship Information *   activ = SPACE               " hrrhas-activ  Status Overlap Indicator *   tdepth = 0                  " hrrhas-tdepth  Technical Depth *   sflag = 'X'                 " hrrhas-sflag  Cut Indicator *   recurs = SPACE              " hrrhas-recurs  Recursiveness Check: 'X' --> Yes, '' --> No *   77aw_int = SPACE            " hrrhas-77aw_int  Switch: Read Path in T77AW ('') or 77AW (X) *   authy = 'X'                 " hrrhas-authy  Authorization Indicator *   authy_base = '$'            " hrrhas-authy_base *   cbflag = SPACE              " hrrhas-cbflag  Indicator: Get Control Block Number *   text_buffer_fill = SPACE    " hrpp0c-test *   dflag = SPACE               " *   buffer_mode = SPACE         "   IMPORTING     object =                    " objec         Object Information => OBJEC     root =                      " gdstr         General Structure Information (Root) => GDSTR     entry =                     " struc         Structure Information on Current Object => STRUC     cb_nr =                     " hrrhas-cb_nr  Control Block Number * TABLES *   check_tab_desc =            " hrcheck   EXCEPTIONS     ROOT_NOT_FOUND = 1          "               Root not Available     WEGID_NOT_FOUND = 2         "               Evaluation Path Does Not Exist     .  "  STRUCTURE_BUILD

ABAP code example for Function Module STRUCTURE_BUILD



The ABAP code below is a full code listing to execute function module STRUCTURE_BUILD 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_object  TYPE OBJEC ,
ld_root  TYPE GDSTR ,
ld_entry  TYPE STRUC ,
ld_cb_nr  TYPE HRRHAS-CB_NR ,
it_check_tab_desc  TYPE STANDARD TABLE OF HRCHECK,"TABLES PARAM
wa_check_tab_desc  LIKE LINE OF it_check_tab_desc .

DATA(ld_plvar) = some text here

DATA(ld_otype) = some text here
DATA(ld_objid) = 'some text here'.

DATA(ld_wegid) = some text here

DATA(ld_svect) = some text here

DATA(ld_sbegd) = 20210129

DATA(ld_sendd) = 20210129

DATA(ld_tflag) = some text here

DATA(ld_vflag) = some text here

DATA(ld_activ) = some text here

DATA(ld_tdepth) = Check type of data required

DATA(ld_sflag) = some text here

DATA(ld_recurs) = some text here

DATA(ld_77aw_int) = some text here

DATA(ld_authy) = some text here

DATA(ld_authy_base) = some text here

DATA(ld_cbflag) = some text here

DATA(ld_text_buffer_fill) = some text here
DATA(ld_dflag) = 'some text here'.
DATA(ld_buffer_mode) = 'some text here'.

"populate fields of struture and append to itab
append wa_check_tab_desc to it_check_tab_desc. . CALL FUNCTION 'STRUCTURE_BUILD' EXPORTING plvar = ld_plvar otype = ld_otype objid = ld_objid * wegid = ld_wegid * svect = ld_svect * sbegd = ld_sbegd * sendd = ld_sendd * tflag = ld_tflag * vflag = ld_vflag * activ = ld_activ * tdepth = ld_tdepth * sflag = ld_sflag * recurs = ld_recurs * 77aw_int = ld_77aw_int * authy = ld_authy * authy_base = ld_authy_base * cbflag = ld_cbflag * text_buffer_fill = ld_text_buffer_fill * dflag = ld_dflag * buffer_mode = ld_buffer_mode IMPORTING object = ld_object root = ld_root entry = ld_entry cb_nr = ld_cb_nr * TABLES * check_tab_desc = it_check_tab_desc EXCEPTIONS ROOT_NOT_FOUND = 1 WEGID_NOT_FOUND = 2 . " STRUCTURE_BUILD
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_object  TYPE OBJEC ,
ld_plvar  TYPE HRRHAS-PLVAR ,
it_check_tab_desc  TYPE STANDARD TABLE OF HRCHECK ,
wa_check_tab_desc  LIKE LINE OF it_check_tab_desc,
ld_root  TYPE GDSTR ,
ld_otype  TYPE HRRHAS-OTYPE ,
ld_entry  TYPE STRUC ,
ld_objid  TYPE STRING ,
ld_cb_nr  TYPE HRRHAS-CB_NR ,
ld_wegid  TYPE HRRHAS-WEGID ,
ld_svect  TYPE HRRHAS-SVECT ,
ld_sbegd  TYPE HRRHAS-SBEGD ,
ld_sendd  TYPE HRRHAS-SENDD ,
ld_tflag  TYPE HRRHAS-TFLAG ,
ld_vflag  TYPE HRRHAS-VFLAG ,
ld_activ  TYPE HRRHAS-ACTIV ,
ld_tdepth  TYPE HRRHAS-TDEPTH ,
ld_sflag  TYPE HRRHAS-SFLAG ,
ld_recurs  TYPE HRRHAS-RECURS ,
ld_77aw_int  TYPE HRRHAS-77AW_INT ,
ld_authy  TYPE HRRHAS-AUTHY ,
ld_authy_base  TYPE HRRHAS-AUTHY_BASE ,
ld_cbflag  TYPE HRRHAS-CBFLAG ,
ld_text_buffer_fill  TYPE HRPP0C-TEST ,
ld_dflag  TYPE STRING ,
ld_buffer_mode  TYPE STRING .

ld_plvar = some text here

"populate fields of struture and append to itab
append wa_check_tab_desc to it_check_tab_desc.

ld_otype = some text here
ld_objid = 'some text here'.

ld_wegid = some text here

ld_svect = some text here

ld_sbegd = 20210129

ld_sendd = 20210129

ld_tflag = some text here

ld_vflag = some text here

ld_activ = some text here

ld_tdepth = Check type of data required

ld_sflag = some text here

ld_recurs = some text here

ld_77aw_int = some text here

ld_authy = some text here

ld_authy_base = some text here

ld_cbflag = some text here

ld_text_buffer_fill = some text here
ld_dflag = 'some text here'.
ld_buffer_mode = 'some text here'.


SAP Documentation for FM STRUCTURE_BUILD

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



How To Create A Structure In Sap Abap

Source: https://www.se80.co.uk/sapfms/s/stru/structure_build.htm

Posted by: maravillamilt1943.blogspot.com

0 Response to "How To Create A Structure In Sap Abap"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel