SAP Function Modules

J_7L_CUST3_FORMEL SAP Function module







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

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


Pattern for FM J_7L_CUST3_FORMEL - J 7L CUST3 FORMEL





CALL FUNCTION 'J_7L_CUST3_FORMEL' "
  EXPORTING
    formel =                    " j_7le01-formel
    entnr =                     " j_7le01-entnr
    land1 =                     " j_7le01-land1
    bukrs =                     " j_7lp01-bukrs
*   plvrs =                     " j_7lp01-plvrs
*   sokoa =                     " j_7lp02-sokoa
*   stofe =                     " j_7lp02-stofe
*   stofi =                     " j_7lrstofi
*   vflkl =                     " j_7lp02-vflkl
*   datum = SY-DATUM            " sy-datum
*   stfkz =                     " j_7le15-stfkz
*   fmeng = 1                   " j_7lkb2-fmeng  Component Quantity for Internal Calculation
*   vrpnr =                     " j_7lv01-vrpnr
*   variante =                  " j_7lvvariante
*   meins =                     " mara-meins
* TABLES
*   position =                  " j_7lv1p
*   fraktion =                  " j_7lkb3
  CHANGING
    entge =                     " j_7lv1p-netwe
  EXCEPTIONS
    FORMEL_ERROR = 1            "
    .  "  J_7L_CUST3_FORMEL

ABAP code example for Function Module J_7L_CUST3_FORMEL





The ABAP code below is a full code listing to execute function module J_7L_CUST3_FORMEL 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_position  TYPE STANDARD TABLE OF J_7LV1P,"TABLES PARAM
wa_position  LIKE LINE OF it_position ,
it_fraktion  TYPE STANDARD TABLE OF J_7LKB3,"TABLES PARAM
wa_fraktion  LIKE LINE OF it_fraktion .


SELECT single NETWE
FROM J_7LV1P
INTO @DATA(ld_entge).


SELECT single FORMEL
FROM J_7LE01
INTO @DATA(ld_formel).


SELECT single ENTNR
FROM J_7LE01
INTO @DATA(ld_entnr).


SELECT single LAND1
FROM J_7LE01
INTO @DATA(ld_land1).


SELECT single BUKRS
FROM J_7LP01
INTO @DATA(ld_bukrs).


SELECT single PLVRS
FROM J_7LP01
INTO @DATA(ld_plvrs).


SELECT single SOKOA
FROM J_7LP02
INTO @DATA(ld_sokoa).


SELECT single STOFE
FROM J_7LP02
INTO @DATA(ld_stofe).

DATA(ld_stofi) = 'Check type of data required'.

SELECT single VFLKL
FROM J_7LP02
INTO @DATA(ld_vflkl).

DATA(ld_datum) = '20210129'.

SELECT single STFKZ
FROM J_7LE15
INTO @DATA(ld_stfkz).


DATA(ld_fmeng) = Check type of data required

SELECT single VRPNR
FROM J_7LV01
INTO @DATA(ld_vrpnr).

DATA(ld_variante) = '20210129'.

SELECT single MEINS
FROM MARA
INTO @DATA(ld_meins).


"populate fields of struture and append to itab
append wa_position to it_position.

"populate fields of struture and append to itab
append wa_fraktion to it_fraktion. . CALL FUNCTION 'J_7L_CUST3_FORMEL' EXPORTING formel = ld_formel entnr = ld_entnr land1 = ld_land1 bukrs = ld_bukrs * plvrs = ld_plvrs * sokoa = ld_sokoa * stofe = ld_stofe * stofi = ld_stofi * vflkl = ld_vflkl * datum = ld_datum * stfkz = ld_stfkz * fmeng = ld_fmeng * vrpnr = ld_vrpnr * variante = ld_variante * meins = ld_meins * TABLES * position = it_position * fraktion = it_fraktion CHANGING entge = ld_entge EXCEPTIONS FORMEL_ERROR = 1 . " J_7L_CUST3_FORMEL
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_entge  TYPE J_7LV1P-NETWE ,
ld_formel  TYPE J_7LE01-FORMEL ,
it_position  TYPE STANDARD TABLE OF J_7LV1P ,
wa_position  LIKE LINE OF it_position,
ld_entnr  TYPE J_7LE01-ENTNR ,
it_fraktion  TYPE STANDARD TABLE OF J_7LKB3 ,
wa_fraktion  LIKE LINE OF it_fraktion,
ld_land1  TYPE J_7LE01-LAND1 ,
ld_bukrs  TYPE J_7LP01-BUKRS ,
ld_plvrs  TYPE J_7LP01-PLVRS ,
ld_sokoa  TYPE J_7LP02-SOKOA ,
ld_stofe  TYPE J_7LP02-STOFE ,
ld_stofi  TYPE J_7LRSTOFI ,
ld_vflkl  TYPE J_7LP02-VFLKL ,
ld_datum  TYPE SY-DATUM ,
ld_stfkz  TYPE J_7LE15-STFKZ ,
ld_fmeng  TYPE J_7LKB2-FMENG ,
ld_vrpnr  TYPE J_7LV01-VRPNR ,
ld_variante  TYPE J_7LVVARIANTE ,
ld_meins  TYPE MARA-MEINS .


SELECT single NETWE
FROM J_7LV1P
INTO ld_entge.


SELECT single FORMEL
FROM J_7LE01
INTO ld_formel.


"populate fields of struture and append to itab
append wa_position to it_position.

SELECT single ENTNR
FROM J_7LE01
INTO ld_entnr.


"populate fields of struture and append to itab
append wa_fraktion to it_fraktion.

SELECT single LAND1
FROM J_7LE01
INTO ld_land1.


SELECT single BUKRS
FROM J_7LP01
INTO ld_bukrs.


SELECT single PLVRS
FROM J_7LP01
INTO ld_plvrs.


SELECT single SOKOA
FROM J_7LP02
INTO ld_sokoa.


SELECT single STOFE
FROM J_7LP02
INTO ld_stofe.

ld_stofi = '20210129'.

SELECT single VFLKL
FROM J_7LP02
INTO ld_vflkl.

ld_datum = '20210129'.

SELECT single STFKZ
FROM J_7LE15
INTO ld_stfkz.


ld_fmeng = Check type of data required

SELECT single VRPNR
FROM J_7LV01
INTO ld_vrpnr.

ld_variante = '20210129'.

SELECT single MEINS
FROM MARA
INTO ld_meins.

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