SAP Function Modules

J_1B_SD_CFOP_CHANGE SAP Function module - CFOP (Re-)Determination in SD for modified parameters







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

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


Pattern for FM J_1B_SD_CFOP_CHANGE - J 1B SD CFOP CHANGE





CALL FUNCTION 'J_1B_SD_CFOP_CHANGE' "CFOP (Re-)Determination in SD for modified parameters
  EXPORTING
    i_tvak =                    " tvak          Sales document type
*   i_pstyv =                   " vbap-pstyv    Sales Item Category
    i_posnr =                   " vbap-posnr    Item line number
*   branch =                    " j_1bbranch-branch  Branch (CGC)
*   i_bukrs =                   " vbak-bukrs_vf  Company
*   i_mara =                    " mara          Material
*   ownprod =                   " mbew-ownpr    Own Production
*   matuse =                    " mbew-mtuse    Material Usage
    iss =                       " j_1btxsdc-iss  Service
*   i_misuse =                  " j_1btxsdc-iss  Usage Material for movement
*   cfop =                      " vbap-j_1bcfop  CFOP
*   taxlaw1 =                   " vbap-j_1btaxlw1  Tax Law ICMS
*   taxlaw2 =                   " vbap-j_1btaxlw2  Tax Law IPI
    txsdc =                     " j_1btxsdc
    plant =                     " vbap-werks
    txjcd_wk =                  " komk-txjcd
*   i_kuwev =                   " kuwev         Ship-to Party's View of the Customer Master Record
    date_i =                    " dats          Valid-from Date of CFOP Version
*   is_enhancement =            " isi_j_1b_sd_cfop_change  IS Erweiterungsstruktur - FB Import Parameter
*   mtorg =                     " mbew-mtorg    Origin of the material
*   cnae =                      " j_1bcnae      CNAE
*   crtn =                      " j_1bcrtn      CRT Number
*   icmstaxpay =                " j_1bicmstaxpay  ICMS Taxpayer
*   indtyp =                    " j_1bindtyp    Industry Main Type
*   tdt =                       " j_1btdt       Tax Declaration Type
*   comsize =                   " j_1bcomsize   Company Size
*   decregpc =                  " j_1bdecregpc  Declaration Regimen for PIS/COFINS
*   legalnat =                  " j_1blegalnat  Legal Nature
*   extwg =                     " extwg         External Material Group
*   prdha =                     " prodh_d       Product hierarchy
  IMPORTING
    cfop =                      " vbap-j_1bcfop  CFOP
    taxlaw1_trans =             " vbap-j_1btaxlw1  Tax Law ICMS transaction
    taxlaw2_trans =             " vbap-j_1btaxlw2  Tax law IPI Transaction
    taxlaw1 =                   " vbap-j_1btaxlw1  Tax Law ICMS
    taxlaw2 =                   " vbap-j_1btaxlw2  Tax Law IPI
  TABLES
    t_vbpa =                    " vbpa
  EXCEPTIONS
    ITEM_CATEGORY_NOT_FOUND = 1  "              Item Category not in J_1BSDICA
    BRANCH_NOT_FOUND = 2        "               Branch not found
    COMPANY_NOT_FOUND = 3       "               Company not found
    CFOP_NOT_FOUND = 4          "               CFOP not found in J_1BAG
    CFOP_TEXT_NOT_FOUND = 5     "               CFOP Text not found in J_1BAGT
    CUSTOMER_NOT_FOUND = 6      "               KNA1 not found
    .  "  J_1B_SD_CFOP_CHANGE

ABAP code example for Function Module J_1B_SD_CFOP_CHANGE





The ABAP code below is a full code listing to execute function module J_1B_SD_CFOP_CHANGE 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_cfop  TYPE VBAP-J_1BCFOP ,
ld_taxlaw1_trans  TYPE VBAP-J_1BTAXLW1 ,
ld_taxlaw2_trans  TYPE VBAP-J_1BTAXLW2 ,
ld_taxlaw1  TYPE VBAP-J_1BTAXLW1 ,
ld_taxlaw2  TYPE VBAP-J_1BTAXLW2 ,
it_t_vbpa  TYPE STANDARD TABLE OF VBPA,"TABLES PARAM
wa_t_vbpa  LIKE LINE OF it_t_vbpa .

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

SELECT single PSTYV
FROM VBAP
INTO @DATA(ld_i_pstyv).


SELECT single POSNR
FROM VBAP
INTO @DATA(ld_i_posnr).


SELECT single BRANCH
FROM J_1BBRANCH
INTO @DATA(ld_branch).


SELECT single BUKRS_VF
FROM VBAK
INTO @DATA(ld_i_bukrs).

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

SELECT single OWNPR
FROM MBEW
INTO @DATA(ld_ownprod).


SELECT single MTUSE
FROM MBEW
INTO @DATA(ld_matuse).


SELECT single ISS
FROM J_1BTXSDC
INTO @DATA(ld_iss).


SELECT single ISS
FROM J_1BTXSDC
INTO @DATA(ld_i_misuse).


SELECT single J_1BCFOP
FROM VBAP
INTO @DATA(ld_cfop).


SELECT single J_1BTAXLW1
FROM VBAP
INTO @DATA(ld_taxlaw1).


SELECT single J_1BTAXLW2
FROM VBAP
INTO @DATA(ld_taxlaw2).

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

SELECT single WERKS
FROM VBAP
INTO @DATA(ld_plant).


DATA(ld_txjcd_wk) = some text here
DATA(ld_i_kuwev) = 'Check type of data required'.
DATA(ld_date_i) = 'Check type of data required'.
DATA(ld_is_enhancement) = 'Check type of data required'.

SELECT single MTORG
FROM MBEW
INTO @DATA(ld_mtorg).

DATA(ld_cnae) = 'Check type of data required'.
DATA(ld_crtn) = 'Check type of data required'.
DATA(ld_icmstaxpay) = 'Check type of data required'.
DATA(ld_indtyp) = 'Check type of data required'.
DATA(ld_tdt) = 'Check type of data required'.
DATA(ld_comsize) = 'Check type of data required'.
DATA(ld_decregpc) = 'Check type of data required'.
DATA(ld_legalnat) = 'Check type of data required'.
DATA(ld_extwg) = 'Check type of data required'.
DATA(ld_prdha) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_vbpa to it_t_vbpa. . CALL FUNCTION 'J_1B_SD_CFOP_CHANGE' EXPORTING i_tvak = ld_i_tvak * i_pstyv = ld_i_pstyv i_posnr = ld_i_posnr * branch = ld_branch * i_bukrs = ld_i_bukrs * i_mara = ld_i_mara * ownprod = ld_ownprod * matuse = ld_matuse iss = ld_iss * i_misuse = ld_i_misuse * cfop = ld_cfop * taxlaw1 = ld_taxlaw1 * taxlaw2 = ld_taxlaw2 txsdc = ld_txsdc plant = ld_plant txjcd_wk = ld_txjcd_wk * i_kuwev = ld_i_kuwev date_i = ld_date_i * is_enhancement = ld_is_enhancement * mtorg = ld_mtorg * cnae = ld_cnae * crtn = ld_crtn * icmstaxpay = ld_icmstaxpay * indtyp = ld_indtyp * tdt = ld_tdt * comsize = ld_comsize * decregpc = ld_decregpc * legalnat = ld_legalnat * extwg = ld_extwg * prdha = ld_prdha IMPORTING cfop = ld_cfop taxlaw1_trans = ld_taxlaw1_trans taxlaw2_trans = ld_taxlaw2_trans taxlaw1 = ld_taxlaw1 taxlaw2 = ld_taxlaw2 TABLES t_vbpa = it_t_vbpa EXCEPTIONS ITEM_CATEGORY_NOT_FOUND = 1 BRANCH_NOT_FOUND = 2 COMPANY_NOT_FOUND = 3 CFOP_NOT_FOUND = 4 CFOP_TEXT_NOT_FOUND = 5 CUSTOMER_NOT_FOUND = 6 . " J_1B_SD_CFOP_CHANGE
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 ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "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_cfop  TYPE VBAP-J_1BCFOP ,
ld_i_tvak  TYPE TVAK ,
it_t_vbpa  TYPE STANDARD TABLE OF VBPA ,
wa_t_vbpa  LIKE LINE OF it_t_vbpa,
ld_taxlaw1_trans  TYPE VBAP-J_1BTAXLW1 ,
ld_i_pstyv  TYPE VBAP-PSTYV ,
ld_taxlaw2_trans  TYPE VBAP-J_1BTAXLW2 ,
ld_i_posnr  TYPE VBAP-POSNR ,
ld_taxlaw1  TYPE VBAP-J_1BTAXLW1 ,
ld_branch  TYPE J_1BBRANCH-BRANCH ,
ld_taxlaw2  TYPE VBAP-J_1BTAXLW2 ,
ld_i_bukrs  TYPE VBAK-BUKRS_VF ,
ld_i_mara  TYPE MARA ,
ld_ownprod  TYPE MBEW-OWNPR ,
ld_matuse  TYPE MBEW-MTUSE ,
ld_iss  TYPE J_1BTXSDC-ISS ,
ld_i_misuse  TYPE J_1BTXSDC-ISS ,
ld_cfop  TYPE VBAP-J_1BCFOP ,
ld_taxlaw1  TYPE VBAP-J_1BTAXLW1 ,
ld_taxlaw2  TYPE VBAP-J_1BTAXLW2 ,
ld_txsdc  TYPE J_1BTXSDC ,
ld_plant  TYPE VBAP-WERKS ,
ld_txjcd_wk  TYPE KOMK-TXJCD ,
ld_i_kuwev  TYPE KUWEV ,
ld_date_i  TYPE DATS ,
ld_is_enhancement  TYPE ISI_J_1B_SD_CFOP_CHANGE ,
ld_mtorg  TYPE MBEW-MTORG ,
ld_cnae  TYPE J_1BCNAE ,
ld_crtn  TYPE J_1BCRTN ,
ld_icmstaxpay  TYPE J_1BICMSTAXPAY ,
ld_indtyp  TYPE J_1BINDTYP ,
ld_tdt  TYPE J_1BTDT ,
ld_comsize  TYPE J_1BCOMSIZE ,
ld_decregpc  TYPE J_1BDECREGPC ,
ld_legalnat  TYPE J_1BLEGALNAT ,
ld_extwg  TYPE EXTWG ,
ld_prdha  TYPE PRODH_D .

ld_i_tvak = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_vbpa to it_t_vbpa.

SELECT single PSTYV
FROM VBAP
INTO ld_i_pstyv.


SELECT single POSNR
FROM VBAP
INTO ld_i_posnr.


SELECT single BRANCH
FROM J_1BBRANCH
INTO ld_branch.


SELECT single BUKRS_VF
FROM VBAK
INTO ld_i_bukrs.

ld_i_mara = 'Check type of data required'.

SELECT single OWNPR
FROM MBEW
INTO ld_ownprod.


SELECT single MTUSE
FROM MBEW
INTO ld_matuse.


SELECT single ISS
FROM J_1BTXSDC
INTO ld_iss.


SELECT single ISS
FROM J_1BTXSDC
INTO ld_i_misuse.


SELECT single J_1BCFOP
FROM VBAP
INTO ld_cfop.


SELECT single J_1BTAXLW1
FROM VBAP
INTO ld_taxlaw1.


SELECT single J_1BTAXLW2
FROM VBAP
INTO ld_taxlaw2.

ld_txsdc = 'Check type of data required'.

SELECT single WERKS
FROM VBAP
INTO ld_plant.


ld_txjcd_wk = some text here
ld_i_kuwev = 'Check type of data required'.
ld_date_i = 'Check type of data required'.
ld_is_enhancement = 'Check type of data required'.

SELECT single MTORG
FROM MBEW
INTO ld_mtorg.

ld_cnae = 'Check type of data required'.
ld_crtn = 'Check type of data required'.
ld_icmstaxpay = 'Check type of data required'.
ld_indtyp = 'Check type of data required'.
ld_tdt = 'Check type of data required'.
ld_comsize = 'Check type of data required'.
ld_decregpc = 'Check type of data required'.
ld_legalnat = 'Check type of data required'.
ld_extwg = 'Check type of data required'.
ld_prdha = '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 J_1B_SD_CFOP_CHANGE or its description.