SAP Function Modules

WB2_PO_VARIANCE_CHANGE SAP Function module







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

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


Pattern for FM WB2_PO_VARIANCE_CHANGE - WB2 PO VARIANCE CHANGE





CALL FUNCTION 'WB2_PO_VARIANCE_CHANGE' "
  EXPORTING
    i_doc_type =                " wb2_doc_type
    i_doc_number =              " vbeln
    i_item =                    " posnr
*   i_sub_item =                " posnr
*   i_gjahr =                   " gjahr
*   i_value =                   " wb2_complete_quan
*   i_ref_value =               " meins
*   i_charg =                   " charg_d
*   i_komwbgt =                 " komwbgt
*   in_ekpo =                   " ekpo
*   in_goitem =                 " goitem
*   in_lips =                   " lipsvb
*   in_vbap =                   " vbapvb
*   in_vbrp =                   " vbrpvb
*   i_doc_pred_doc =            " wb2_doc_pred_doc
  IMPORTING
    s_variance =                " wb2_complete_quan
    s_vari_uom =                " meins
    p_variance =                " wb2_complete_quan
    p_vari_uom =                " meins
    send_compl =                " wb2_send_completion
  EXCEPTIONS
    DOCUMENT_ERROR = 1          "
    UNLIMITED_FLAG_IS_NOT_SET = 2  "
    DELIVERY_COMP_FLAG_IS_NOT_SET = 3  "
    VOLUME_IS_NOT_FULLY_ASSOCIATED = 4  "
    CAN_NOT_GET_CURRENT_VOLUME = 5  "
    .  "  WB2_PO_VARIANCE_CHANGE

ABAP code example for Function Module WB2_PO_VARIANCE_CHANGE





The ABAP code below is a full code listing to execute function module WB2_PO_VARIANCE_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_s_variance  TYPE WB2_COMPLETE_QUAN ,
ld_s_vari_uom  TYPE MEINS ,
ld_p_variance  TYPE WB2_COMPLETE_QUAN ,
ld_p_vari_uom  TYPE MEINS ,
ld_send_compl  TYPE WB2_SEND_COMPLETION .

DATA(ld_i_doc_type) = 'Check type of data required'.
DATA(ld_i_doc_number) = 'Check type of data required'.
DATA(ld_i_item) = 'Check type of data required'.
DATA(ld_i_sub_item) = 'Check type of data required'.
DATA(ld_i_gjahr) = 'Check type of data required'.
DATA(ld_i_value) = 'Check type of data required'.
DATA(ld_i_ref_value) = 'Check type of data required'.
DATA(ld_i_charg) = 'Check type of data required'.
DATA(ld_i_komwbgt) = 'Check type of data required'.
DATA(ld_in_ekpo) = 'Check type of data required'.
DATA(ld_in_goitem) = 'Check type of data required'.
DATA(ld_in_lips) = 'Check type of data required'.
DATA(ld_in_vbap) = 'Check type of data required'.
DATA(ld_in_vbrp) = 'Check type of data required'.
DATA(ld_i_doc_pred_doc) = 'Check type of data required'. . CALL FUNCTION 'WB2_PO_VARIANCE_CHANGE' EXPORTING i_doc_type = ld_i_doc_type i_doc_number = ld_i_doc_number i_item = ld_i_item * i_sub_item = ld_i_sub_item * i_gjahr = ld_i_gjahr * i_value = ld_i_value * i_ref_value = ld_i_ref_value * i_charg = ld_i_charg * i_komwbgt = ld_i_komwbgt * in_ekpo = ld_in_ekpo * in_goitem = ld_in_goitem * in_lips = ld_in_lips * in_vbap = ld_in_vbap * in_vbrp = ld_in_vbrp * i_doc_pred_doc = ld_i_doc_pred_doc IMPORTING s_variance = ld_s_variance s_vari_uom = ld_s_vari_uom p_variance = ld_p_variance p_vari_uom = ld_p_vari_uom send_compl = ld_send_compl EXCEPTIONS DOCUMENT_ERROR = 1 UNLIMITED_FLAG_IS_NOT_SET = 2 DELIVERY_COMP_FLAG_IS_NOT_SET = 3 VOLUME_IS_NOT_FULLY_ASSOCIATED = 4 CAN_NOT_GET_CURRENT_VOLUME = 5 . " WB2_PO_VARIANCE_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 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_s_variance  TYPE WB2_COMPLETE_QUAN ,
ld_i_doc_type  TYPE WB2_DOC_TYPE ,
ld_s_vari_uom  TYPE MEINS ,
ld_i_doc_number  TYPE VBELN ,
ld_p_variance  TYPE WB2_COMPLETE_QUAN ,
ld_i_item  TYPE POSNR ,
ld_p_vari_uom  TYPE MEINS ,
ld_i_sub_item  TYPE POSNR ,
ld_send_compl  TYPE WB2_SEND_COMPLETION ,
ld_i_gjahr  TYPE GJAHR ,
ld_i_value  TYPE WB2_COMPLETE_QUAN ,
ld_i_ref_value  TYPE MEINS ,
ld_i_charg  TYPE CHARG_D ,
ld_i_komwbgt  TYPE KOMWBGT ,
ld_in_ekpo  TYPE EKPO ,
ld_in_goitem  TYPE GOITEM ,
ld_in_lips  TYPE LIPSVB ,
ld_in_vbap  TYPE VBAPVB ,
ld_in_vbrp  TYPE VBRPVB ,
ld_i_doc_pred_doc  TYPE WB2_DOC_PRED_DOC .

ld_i_doc_type = 'Check type of data required'.
ld_i_doc_number = 'Check type of data required'.
ld_i_item = 'Check type of data required'.
ld_i_sub_item = 'Check type of data required'.
ld_i_gjahr = 'Check type of data required'.
ld_i_value = 'Check type of data required'.
ld_i_ref_value = 'Check type of data required'.
ld_i_charg = 'Check type of data required'.
ld_i_komwbgt = 'Check type of data required'.
ld_in_ekpo = 'Check type of data required'.
ld_in_goitem = 'Check type of data required'.
ld_in_lips = 'Check type of data required'.
ld_in_vbap = 'Check type of data required'.
ld_in_vbrp = 'Check type of data required'.
ld_i_doc_pred_doc = '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 WB2_PO_VARIANCE_CHANGE or its description.