Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
 {color:#0000ff}\*======================================================================\*{color}

{color:#0000ff}\*DESCRIPTION : THE PURPOSE OF THIS PROGRAM IS TO PROVIDE *{color}

{color:#0000ff}\* USERS WITH INFORMATION ABOUT THE PRICING *{color}

{color:#0000ff}\* CONDITION ON THE SYSTEM, TO ALLOW USERS TO SEE *{color}

{color:#0000ff}\* IF THE PRICING CONDITIONS HAVE BEEN SET UP, *{color}

{color:#0000ff}\* AND TO CHECK THE DETAILS OF THOSE CONDITIONS. *{color}

{color:#0000ff}\*======================================================================\*{color}

{color:#0000ff}\*\* Author: Aveek Ghose{color}

{color:#0000ff}\*======================================================================\*{color}

{color:#0000ff}\*CHANGE HISTORY LOG *{color}

{color:#0000ff}\*----------------------------------------------------------------------\*{color}

{color:#0000ff}\*MOD. NO.\| DATE \| NAME \| CORRECTION NUMBER \| CHANGE REFERENCE # *{color}

{color:#0000ff}\***********************************************************************\*{color}

{color:#0000ff}\*&---------------------------------------------------------------------\*{color}

{color:#0000ff}\*& Report ZPRICING_REP_CONDTN *{color}

{color:#0000ff}\*& *{color}

{color:#0000ff}\*&---------------------------------------------------------------------\*{color}

{color:#0000ff}\*& *{color}

{color:#0000ff}\*& *{color}

{color:#0000ff}\*&---------------------------------------------------------------------\*{color}REPORT ZPRICING_REP_CONDTN MESSAGE-ID ZPRICING

LINE-SIZE 1000

LINE-COUNT 65

NO STANDARD PAGE HEADING .{color:#0000ff}\*----------------------------------------------------------------------\*{color}

{color:#0000ff}\* Include for Global Data Declaration *{color}

{color:#0000ff}\*----------------------------------------------------------------------\*{color}

{color:#0000ff}\* This Include contains all Global Data and Type declaration{color}{color:#0000ff}\* INCLUDE zpricing_condtn_top.{color}{color:#0000ff}\*&---------------------------------------------------------------------\*{color}

{color:#0000ff}\*& Include ZPRICING_CONDTN_TOP{color}

{color:#0000ff}\*&---------------------------------------------------------------------\*{color}\***********************************************************************\*

TYPE-POOLS : SLIS.

\*&---------------------------------------------------------------------\*

\*& Include ZPRICING_CONDTN_TOP *

\*&---------------------------------------------------------------------\*

\***********************************************************************\*

\* CONSTANT DECLARATION *

\***********************************************************************\*

CONSTANTS:

C_YES TYPE C VALUE 'X',

C_NO TYPE C VALUE SPACE,

C_SCREEN TYPE SYDYNNR VALUE '9000', "Screen for ALV Report

C_BACK TYPE SY-UCOMM VALUE '&F03', "Function Code BACK

C_UP TYPE SY-UCOMM VALUE '&F15', "Function Code ABBA

C_EXIT TYPE SY-UCOMM VALUE '&F12', "Function Code BABA

C_SESSION_MANAGER TYPE SY-TCODE VALUE 'SESSION_MANAGER',

C_SAVE TYPE C VALUE 'A', "Save

C_STRUCTURE TYPE TABNAME VALUE 'TY_CONDTN_REP', "Structure for Report

C_RELID TYPE RELID VALUE 'LT', "Customer specific variants

C_KAPPL_V TYPE KAPPL VALUE 'V', "Application

C_KVEWE_A TYPE KVEWE VALUE 'A', "Usage for General Pricing

C_KVEWE_N TYPE KVEWE VALUE 'N', "Usage for Free Goods

C_PRICING_A TYPE C VALUE 'A', "Pricing Table starting with

C_KOTE(4) TYPE C VALUE 'KOTE', "Rebate Table starting with

C_KOTN(4) TYPE C VALUE 'KOTN', "Free Goods Table starting

C_SIGN_I TYPE C VALUE 'I', "Sign for Including

C_OPTION_EQ(2) TYPE C VALUE 'EQ', "Option Equal To

C_OPTION_LE(2) TYPE C VALUE 'LE', "Option Less than equal to

C_OPTION_GE(2) TYPE C VALUE 'GE', "Option Greater than equal to

C_ACTVT(5) TYPE C VALUE 'ACTVT', "Activity for authorization

C_DISP_03(2) TYPE C VALUE '03', "Display

C_KOAID_C TYPE KOAID VALUE 'C', "Rebate

C_SYS_TYPE(1) TYPE C VALUE 'C', "CRM System

C_VBAK_VKO(10) TYPE C VALUE 'V_VBAK_VKO', "Authority Object V_VBAK_VKO

C_SPART TYPE FIELDNAME VALUE 'SPART', "Division

C_AND(3) TYPE C VALUE 'AND', "Constant for AND

C_ENG TYPE SYLANGU VALUE 'E', "English Language

C_I_CONDTN_REP TYPE CHAR30 VALUE 'I_CONDTN_REP',

C_GUI_STATUS TYPE CHAR20 VALUE '/EUR/GUI_PRIC_REP',

C_TITLEBAR TYPE SY-TITLE VALUE '/EUR/TITLE_PRICE_REP',

\***\* Constants for Selection field names \***\*

C_VKORG_LOW(12) TYPE C VALUE 'S_VKORG-LOW',

C_VTWEG_LOW(12) TYPE C VALUE 'S_VTWEG-LOW',

C_VTWEG_HIGH(13) TYPE C VALUE 'S_VTWEG-HIGH',

C_KSCHL_LOW(12) TYPE C VALUE 'S_KSCHL-LOW',

C_KSCHL_HIGH(13) TYPE C VALUE 'S_KSCHL-HIGH',

C_CAMPID_LOW(12) TYPE C VALUE 'S_CAMPID-LOW',

C_CAMPID_HIGH(13) TYPE C VALUE 'S_CAMPID-HIGH',

C_KUNNR_LOW(12) TYPE C VALUE 'S_KUNNR-LOW',

C_KUNNR_HIGH(13) TYPE C VALUE 'S_KUNNR-HIGH',

C_HIENR_LOW(12) TYPE C VALUE 'S_HIENR-LOW',

C_HIENR_HIGH(13) TYPE C VALUE 'S_HIENR-HIGH',

C_KONDA_LOW(12) TYPE C VALUE 'S_KONDA-LOW',

C_KONDA_HIGH(13) TYPE C VALUE 'S_KONDA-HIGH',

C_MATNR_LOW(12) TYPE C VALUE 'S_MATNR-LOW',

C_MATNR_HIGH(13) TYPE C VALUE 'S_MATNR-HIGH',

C_MVGR1_LOW(12) TYPE C VALUE 'S_MVGR1-LOW',

C_MVGR1_HIGH(13) TYPE C VALUE 'S_MVGR1-HIGH',

C_PRODH1_LOW(12) TYPE C VALUE 'S_PRODH1-LOW',

C_PRODH1_HIGH(13) TYPE C VALUE 'S_PRODH1-HIGH',

C_PRODH2_LOW(12) TYPE C VALUE 'S_PRODH2-LOW',

C_PRODH2_HIGH(13) TYPE C VALUE 'S_PRODH2-HIGH',

C_PRODH3_LOW(12) TYPE C VALUE 'S_PRODH3-LOW',

C_PRODH3_HIGH(13) TYPE C VALUE 'S_PRODH3-HIGH',

C_PRODH4_LOW(12) TYPE C VALUE 'S_PRODH4-LOW',

C_PRODH4_HIGH(13) TYPE C VALUE 'S_PRODH4-HIGH',

C_PRODH5_LOW(12) TYPE C VALUE 'S_PRODH5-LOW',

C_PRODH5_HIGH(13) TYPE C VALUE 'S_PRODH5-HIGH',

C_LOEVM_LOW(12) TYPE C VALUE 'S_LOEVM-LOW',

C_LOEVM_HIGH(13) TYPE C VALUE 'S_LOEVM-HIGH',

C_BONEM_LOW(12) TYPE C VALUE 'S_BONEM-LOW',

C_BONEM_HIGH(13) TYPE C VALUE 'S_BONEM-HIGH',

C_BOSTA_LOW(12) TYPE C VALUE 'S_BOSTA-LOW',

C_BOSTA_HIGH(13) TYPE C VALUE 'S_BOSTA-HIGH',

C_CDATAB(8) TYPE C VALUE 'P_CDATAB',

C_CDATBI(8) TYPE C VALUE 'P_CDATBI',

C_CRMSYS(8) TYPE C VALUE 'P_CRMSYS',

\***\* Constants for fieldnames \***\*

C_KNUMH TYPE FIELDNAME VALUE 'KNUMH',

C_KSCHL TYPE FIELDNAME VALUE 'KSCHL',

C_CVTEXT TYPE FIELDNAME VALUE 'CVTEXT',

C_KUNNR TYPE FIELDNAME VALUE 'KUNNR',

C_NAME1 TYPE FIELDNAME VALUE 'NAME1',

C_HIENR TYPE FIELDNAME VALUE 'HIENR',

C_NAME1_C TYPE FIELDNAME VALUE 'NAME1_C',

C_KONDA TYPE FIELDNAME VALUE 'KONDA',

C_PVTEXT TYPE FIELDNAME VALUE 'PVTEXT',

C_MATNR TYPE FIELDNAME VALUE 'MATNR',

C_MAKTX TYPE FIELDNAME VALUE 'MAKTX',

C_MVGR1 TYPE FIELDNAME VALUE 'MVGR1',

C_MBEZEI TYPE FIELDNAME VALUE 'MBEZEI',

C_PRODH1 TYPE FIELDNAME VALUE 'PRODH1',

C_PRODH2 TYPE FIELDNAME VALUE 'PRODH2',

C_PRODH3 TYPE FIELDNAME VALUE 'PRODH3',

C_YYPRODH4 TYPE FIELDNAME VALUE 'YYPRODH4',

C_YYPRODH5 TYPE FIELDNAME VALUE 'YYPRODH5',

C_CMPGN_ID TYPE FIELDNAME VALUE 'CMPGN_ID',

C_EXTERNAL_ID TYPE FIELDNAME VALUE 'EXTERNAL_ID',

C_KBETR TYPE FIELDNAME VALUE 'KBETR',

C_KONWA TYPE FIELDNAME VALUE 'KONWA',

C_KPEIN TYPE FIELDNAME VALUE 'KPEIN',

C_KMEIN TYPE FIELDNAME VALUE 'KMEIN',

C_DATAB TYPE FIELDNAME VALUE 'DATAB',

C_DATBI TYPE FIELDNAME VALUE 'DATBI',

C_KBRUE TYPE FIELDNAME VALUE 'KBRUE',

C_KWAEH TYPE FIELDNAME VALUE 'KWAEH',

C_LOEVM_KO TYPE FIELDNAME VALUE 'LOEVM_KO',

C_KZNEP TYPE FIELDNAME VALUE 'KZNEP',

C_KNUMA TYPE FIELDNAME VALUE 'KNUMA',

C_BOART TYPE FIELDNAME VALUE 'BOART',

C_RVTEXT TYPE FIELDNAME VALUE 'RVTEXT',

C_BON_ENH_VAKEY TYPE FIELDNAME VALUE 'BON_ENH_VAKEY',

C_BON_ENH_INDIRECT TYPE FIELDNAME VALUE 'BON_ENH_INDIRECT',

C_KSAPE TYPE FIELDNAME VALUE 'KSPAE',

C_BONEM TYPE FIELDNAME VALUE 'BONEM',

C_WAERS TYPE FIELDNAME VALUE 'WAERS',

C_ZLSCH TYPE FIELDNAME VALUE 'ZLSCH',

C_ABREX TYPE FIELDNAME VALUE 'ABREX',

C_RDATAB TYPE FIELDNAME VALUE 'RDATAB',

C_RDATBI TYPE FIELDNAME VALUE 'RDATBI',

C_BOSTA TYPE FIELDNAME VALUE 'BOSTA',

C_RRWRT TYPE FIELDNAME VALUE 'RRWRT',

C_AUWRT TYPE FIELDNAME VALUE 'AUWRT',

C_MPWRT TYPE FIELDNAME VALUE 'MPWRT',

C_BZWRT TYPE FIELDNAME VALUE 'BZWRT',

C_VKORG TYPE FIELDNAME VALUE 'VKORG',

C_VTWEG TYPE FIELDNAME VALUE 'VTWEG',

C_VKBUR TYPE FIELDNAME VALUE 'VKBUR',

C_VKGRP TYPE FIELDNAME VALUE 'VKGRP',

C_CERNAM TYPE FIELDNAME VALUE 'CERNAM',

C_CERDAT TYPE FIELDNAME VALUE 'CERDAT',

C_KRECH TYPE FIELDNAME VALUE 'KRECH',

C_KSTBW TYPE FIELDNAME VALUE 'KSTBW',

C_KZBZG TYPE FIELDNAME VALUE 'KZBZG',

C_STFKZ TYPE FIELDNAME VALUE 'STFKZ',

C_KSTBM1 TYPE FIELDNAME VALUE 'KSTBM1',

C_KSTBM2 TYPE FIELDNAME VALUE 'KSTBM2',

C_KSTBM3 TYPE FIELDNAME VALUE 'KSTBM3',

C_KSTBM4 TYPE FIELDNAME VALUE 'KSTBM4',

C_KSTBM5 TYPE FIELDNAME VALUE 'KSTBM5',

C_KSTBM6 TYPE FIELDNAME VALUE 'KSTBM6',

C_KSTBM7 TYPE FIELDNAME VALUE 'KSTBM7',

C_KSTBM8 TYPE FIELDNAME VALUE 'KSTBM8',

C_KSTBM9 TYPE FIELDNAME VALUE 'KSTBM9',

C_KSTBM10 TYPE FIELDNAME VALUE 'KSTBM10',

C_KBETR1 TYPE FIELDNAME VALUE 'KBETR1',

C_KBETR2 TYPE FIELDNAME VALUE 'KBETR2',

C_KBETR3 TYPE FIELDNAME VALUE 'KBETR3',

C_KBETR4 TYPE FIELDNAME VALUE 'KBETR4',

C_KBETR5 TYPE FIELDNAME VALUE 'KBETR5',

C_KBETR6 TYPE FIELDNAME VALUE 'KBETR6',

C_KBETR7 TYPE FIELDNAME VALUE 'KBETR7',

C_KBETR8 TYPE FIELDNAME VALUE 'KBETR8',

C_KBETR9 TYPE FIELDNAME VALUE 'KBETR9',

C_KBETR10 TYPE FIELDNAME VALUE 'KBETR10',

C_MXWRT TYPE FIELDNAME VALUE 'MXWRT',

C_GKWRT TYPE FIELDNAME VALUE 'GKWRT',

C_KVEWE TYPE FIELDNAME VALUE 'KVEWE',

C_KAPPL TYPE FIELDNAME VALUE 'KAPPL',

C_ERNAM TYPE FIELDNAME VALUE 'ERNAM',

C_ERDAT TYPE FIELDNAME VALUE 'ERDAT',

C_ERZET TYPE FIELDNAME VALUE 'ERZET',

C_AENAM TYPE FIELDNAME VALUE 'AENAM',

C_AEDAT TYPE FIELDNAME VALUE 'AEDAT',

C_AEZET TYPE FIELDNAME VALUE 'AEZET',

C_BOMAT TYPE FIELDNAME VALUE 'BOMAT',

C_BOTEXT TYPE FIELDNAME VALUE 'BOTEXT',

C_ABSPZ TYPE FIELDNAME VALUE 'ABSPZ',

C_KOBOG TYPE FIELDNAME VALUE 'KOBOG',

C_KNRMM TYPE FIELDNAME VALUE 'KNRMM',

C_KNRNM TYPE FIELDNAME VALUE 'KNRNM',

C_KNRME TYPE FIELDNAME VALUE 'KNRME',

C_KNRZM TYPE FIELDNAME VALUE 'KNRZM',

C_KNREZ TYPE FIELDNAME VALUE 'KNREZ',

C_FGPCR TYPE FIELDNAME VALUE 'FGPCR',

C_KNRRR TYPE FIELDNAME VALUE 'KNRRR',

C_KNRDD TYPE FIELDNAME VALUE 'KNRDD',

C_LSTANR TYPE FIELDNAME VALUE 'LSTANR',

C_DDTEXT TYPE FIELDNAME VALUE 'DDTEXT',

C_KNRMAT TYPE FIELDNAME VALUE 'KNRMAT',

C_FMAKTX TYPE FIELDNAME VALUE 'FMAKTX',

C_FORMNAME_AT_USER_COMMAND

TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.

\***********************************************************************\*

\* TYPE DECLARATION *

\***********************************************************************\*

\* Type declaration for the report output

TYPES: BEGIN OF TY_CONDTN_REP,

KSCHL TYPE KSCHA, "Condition Type

CVTEXT TYPE VTXTK, "Condition Type Description

KUNNR TYPE KUNNR, "Sold To Number

NAME1 TYPE NAME1_GP, "Sold To Name

HIENR TYPE KUNNR_KH, "Customer Hierarchy Number

NAME1_C TYPE NAME1_GP, "Customer Hierarchy Name

KONDA TYPE KONDA, "Price Group Name

PVTEXT TYPE BEZEI20, "Price Group Description

MATNR TYPE MATNR, "Material Number

MAKTX TYPE MAKTX, "Material Description

MVGR1 TYPE MVGR1, "Material Group 1

MBEZEI TYPE BEZEI40, "Material Group 1 Description

PRODH1 TYPE PRODH1, "ProdH 1 - Business

PRODH2 TYPE PRODH2, "ProdH 2 â€" Business ID

PRODH3 TYPE PRODH3, "ProdH 3 - Category

YYPRODH4 TYPE PRODH4, "ProdH 4 â€" Sub-Categ

YYPRODH5 TYPE PRODH5, "ProdH 5 â€" Seg/Sub Seg

CMPGN_ID TYPE CMPGN_ID_R3, "Campaign ID

EXTERNAL_ID TYPE CGPL_EXTID, "Campaign (External ID)

KBETR TYPE KBETR_KOND, "Condition Amount

KONWA TYPE KONWA, "Condition Unit

KPEIN TYPE KPEIN, "Condition Pricing Unit

KMEIN TYPE KMEIN, "Condition Unit of Measure

DATAB TYPE DATAB, "Condition Valid On

DATBI TYPE DATBI, "Condition Valid To

KBRUE TYPE KBRUE, "Condition Accrual Amount - Rebate

KWAEH TYPE KWAEH, "Condition Accrual Unit - Rebate

LOEVM_KO TYPE LOEVM_KO, "Condition Deletion Indicator

KZNEP TYPE KZNEP, "Condition Exclusive Indicator

KNUMA TYPE KNUMA, "Rebate Agreement Number

BOART TYPE BOART, "Rebate Agreement Type

RVTEXT TYPE VTEXT, "Rebate Agreement Type Description

BON_ENH_VAKEY TYPE BON_ENH_VAKEY, "Enhanced Rebate Indicator

BON_ENH_INDIRECT TYPE BON_ENH_INDIRECT, "Indir Setlmnt Types Indicator

KSPAE TYPE KSPAE, "Rebate Retroactive Indicator

BONEM TYPE BONEM, "Rebate Recipient

WAERS TYPE WAERS, "Rebate Currency

ZLSCH TYPE DZLSCH, "Rebate Payment Method

ABREX TYPE ABREX, "Rebate External Description

RDATAB TYPE ABDATAB, "Rebate Agreement Valid From

RDATBI TYPE ABDATBI, "Rebate Agreement Valid To

BOSTA TYPE BOSTA, "Rebate Agreement Status

RUWRT TYPE MC_RUKWT, "Rebate Accruals

RRWRT TYPE MC_RRKWT, "Rebate Accruals Reversed

AUWRT TYPE MC_AUWRT, "Rebate Payments

MPWRT TYPE MC_MPWRT, "Rebate: Maximum payable amount

BZWRT TYPE MC_BZWRT, "Rebate: Amount to be paid

VKORG TYPE VKORG, "Sales Organization

VTWEG TYPE VTWEG, "Distribution Channel

VKBUR TYPE VKBUR, "Sales Office

VKGRP TYPE VKGRP, "Sales Group

CERNAM TYPE ERNAM, "Condition Created By

CERDAT TYPE ERDAT, "Condition Created on Date

KRECH TYPE KRECH, "Condition Calculation Type

KSTBW TYPE KSTBW, "Condition Scales

KZBZG TYPE KZBZG, "Condition Scale Basis

STFKZ TYPE STFKZ, "Condition Scale Type

KSTBM1 TYPE KSTBM, "Condition Scale Quantity 1

KSTBM2 TYPE KSTBM, "Condition Scale Quantity 2

KSTBM3 TYPE KSTBM, "Condition Scale Quantity 3

KSTBM4 TYPE KSTBM, "Condition Scale Quantity 4

KSTBM5 TYPE KSTBM, "Condition Scale Quantity 5

KSTBM6 TYPE KSTBM, "Condition Scale Quantity 6

KSTBM7 TYPE KSTBM, "Condition Scale Quantity 7

KSTBM8 TYPE KSTBM, "Condition Scale Quantity 8

KSTBM9 TYPE KSTBM, "Condition Scale Quantity 9

KSTBM10 TYPE KSTBM, "Condition Scale Quantity 10

KBETR1 TYPE KBETR, "Condition Scale Amount 1

KBETR2 TYPE KBETR, "Condition Scale Amount 2

KBETR3 TYPE KBETR, "Condition Scale Amount 3

KBETR4 TYPE KBETR, "Condition Scale Amount 4

KBETR5 TYPE KBETR, "Condition Scale Amount 5

KBETR6 TYPE KBETR, "Condition Scale Amount 6

KBETR7 TYPE KBETR, "Condition Scale Amount 7

KBETR8 TYPE KBETR, "Condition Scale Amount 8

KBETR9 TYPE KBETR, "Condition Scale Amount 9

KBETR10 TYPE KBETR, "Condition Scale Amount 10

MXWRT TYPE MXWRT, "Condition Lower Limit

GKWRT TYPE GKWRT, "Condition Upper Limit

KVEWE TYPE KVEWE, "Condition Table Usage

KAPPL TYPE KAPPL, "Condition Application

ERNAM TYPE ERNAM, "Rebate Agreement Created By

ERDAT TYPE ERDAT, "Rebate Agreement Created on Date

ERZET TYPE ERZET, "Rebate Agreement Created on Time

AENAM TYPE AENAM, "Rebate Agreement Changed By

AEDAT TYPE AEDAT, "Rebate Agreement Changed on Date

AEZET TYPE AEZET, "Rebate Agreement Changed on Time

BOMAT TYPE BOMAT, "Rebate: Material for Settlement

BOTEXT TYPE BOTEXT, "Rebate Agreement Description

ABSPZ TYPE ABSPZ, "Rebate Verification Level

KOBOG TYPE KOBOG, "Rebate Condition Type Group

KNRMM TYPE KNRMM, "Free goods: Minimum quantity

KNRNM TYPE KNRNM, "Free goods: Free goods quantity

\*Free goods: Quantity unit for minimum quantity and free goods quantity

KNRME TYPE KNRME,

KNRZM TYPE KNRZM, "Free goods: Additional quantity

\*Free goods: Quantity unit for free goods additional quantity

KNREZ TYPE KNREZ,

FGPCR TYPE P DECIMALS 2, "Free goods: Percentage rate

\*Free goods: Calculation type for determining free goods quantity

KNRRR TYPE KNRRR,

KNRDD TYPE KNRDD, "Free goods category

LSTANR TYPE LSTANR, "Free goods delivery control

\*Free goods: Text output for exclusive or inclusive

DDTEXT TYPE VAL_TEXT,

KNRMAT TYPE KNRMAT, "Free Goods: Additional Material

FMAKTX TYPE MAKTX, "Free goods: Additional Material Description

\* Begin of MOD-001

ALAND TYPE LAND1, "Departure country

LLAND TYPE LAND1, "Destination country

TAXK1 TYPE TAXK1, "Tax classification 1 for customer

TAXM1 TYPE TAXKM, "Tax classification material

MWSKZ TYPE MWSKZ, "Tax on sales/purchases code

\* End of MOD-001

END OF TY_CONDTN_REP.

\* Type declaration for data of table T685

TYPES: BEGIN OF TY_T685,

KVEWE TYPE KVEWE, "Usage of the condition table

KAPPL TYPE KAPPL, "Application

KSCHL TYPE KSCHL, "Condition type

KOZGF TYPE KOZGF, "Access sequence

END OF TY_T685.

\* Type declaration for data of table T685A

TYPES: BEGIN OF TY_T685A,

KAPPL TYPE KAPPL, "Application

KSCHL TYPE KSCHL, "Condition type

KOAID TYPE KOAID, "Condition class

END OF TY_T685A.

\* Type declaration for data of table T682I

TYPES: BEGIN OF TY_T682I,

KVEWE TYPE KVEWE, "Usage of the condition table

KAPPL TYPE KAPPL, "Application

KOZGF TYPE KOZGF, "Access sequence

KOTABNR TYPE KOTABNR, "Condition table

KSCHL TYPE KSCHL, "Condition Type

TABNAME TYPE TABNAME, "Condition Table name

FLAG TYPE C, "Flag

END OF TY_T682I.

\* Type declaration for data of table DD03L

TYPES: BEGIN OF TY_DD03L,

TABNAME TYPE TABNAME, "Table Name

FIELDNAME TYPE FIELDNAME, "Field Name

END OF TY_DD03L.

TYPES: BEGIN OF TY_DD02L,

TABNAME TYPE TABNAME, "Table Name

END OF TY_DD02L.

TYPES: TY_CLAUSE(72) TYPE C.

TYPES: BEGIN OF TY_COND_REC,

KSCHL TYPE KSCHL,

KNUMH TYPE KNUMH,

END OF TY_COND_REC.

TYPES: BEGIN OF TY_INPUT_FIELD,

FIELDNAME TYPE FIELDNAME, "Fieldname

SELNAME(39) TYPE C, "Select Options

RELN TYPE CHAR2, "Relation

END OF TY_INPUT_FIELD.

TYPES: BEGIN OF TY_CONDTAB_DATA,

KNUMH TYPE KNUMH, "Condition Record Number

KVEWE TYPE KVEWE, "Condition Table Usage

KAPPL TYPE KAPPL, "Application

KSCHL TYPE KSCHA, "Condition Type

KUNNR TYPE KUNNR, "Sold To Number

HIENR TYPE KUNNR_KH, "Customer Hierarchy Number

KONDA TYPE KONDA, "Price Group Name

MATNR TYPE MATNR, "Material Number

MVGR1 TYPE MVGR1, "Material Group 1

PRODH1 TYPE PRODH1, "ProdH 1 - Business

PRODH2 TYPE PRODH2, "ProdH 2 â€" Business ID

PRODH3 TYPE PRODH3, "ProdH 3 - Category

YYPRODH4 TYPE PRODH4, "ProdH 4 â€" Sub-Categ

YYPRODH5 TYPE PRODH5, "ProdH 5 â€" Seg/Sub Seg

VKORG TYPE VKORG, "Sales Organization

VTWEG TYPE VTWEG, "Distribution Channel

CMPGN_ID TYPE CMPGN_ID_R3, "Campaign ID

EXTERNAL_ID TYPE CGPL_EXTID, "External Campaign ID

DATAB TYPE KODATAB, "Validity start date of the cond rec

DATBI TYPE KODATBI, "Validity end date of the cond rec

\* Begin of MOD-001

ALAND TYPE LAND1, "Departure country

LLAND TYPE LAND1, "Destination country

TAXK1 TYPE TAXK1, "Tax classification 1 for customer

TAXM1 TYPE TAXKM, "Tax classification material

MWSKZ TYPE MWSKZ, "Tax on sales/purchases code

\* End of MOD-001

END OF TY_CONDTAB_DATA.

\* Type declaration for Condition Data from Condition Tables

TYPES: BEGIN OF TY_CONDITION_DATA,

KNUMH TYPE KNUMH, "Condition record number

ERNAM TYPE ERNAM, "Name of Person who Created the Object

ERDAT TYPE ERDAT, "Date on which the record was created

KVEWE TYPE KVEWE, "Usage of the condition table

DATAB TYPE DATAB, "Valid-From Date

DATBI TYPE DATBI, "Valid To Date

KAPPL TYPE KAPPL, "Application

KSCHL TYPE KSCHA, "Condition type

STFKZ TYPE STFKZ, "Scale Type

KZBZG TYPE KZBZG, "Scale basis indicator

KSTBW TYPE KSTBW, "Scale value

KRECH TYPE KRECH, "Calculation type for condition

KBETR TYPE KBETR_KOND, "Rate (condition amount or percentage)

KPEIN TYPE KPEIN, "Condition pricing unit

KMEIN TYPE KMEIN, "Condition unit

MEINS TYPE MEINS, "Base Unit of Measure

KZNEP TYPE KZNEP, "Condition exclusion indicator

LOEVM_KO TYPE LOEVM_KO, "Deletion Indicator for Condition Item

BOMAT TYPE BOMAT, "Material for rebate settlement

KBRUE TYPE KBRUE, "Accrual Amount

KSPAE TYPE KSPAE, "Rebate was set up retroactively

BOSTA TYPE BOSTA_CR, "Condition Record Status (Rebate)

END OF TY_CONDITION_DATA.

\* Type declaration for Agreement data from KONA

TYPES: BEGIN OF TY_KONA,

KNUMA TYPE KNUMA, "Agreement

VKBUR TYPE VKBUR, "Sales office

VKGRP TYPE VKGRP, "Sales group

BOART TYPE BOART, "Agreement type

ERNAM TYPE ERNAM, "Name of Person who Created the Object

ERDAT TYPE ERDAT, "Date on which the record was created

ERZET TYPE ERZET, "Entry time

AENAM TYPE AENAM, "Name of person who changed object

AEDAT TYPE AEDAT, "Date of Last Change

AEZET TYPE AEZET, "Time last change was made

BONEM TYPE BONEM, "Rebate recipient

WAERS TYPE WAERS, "Currency Key

ABREX TYPE ABREX, "External description for agreement

ABSPZ TYPE ABSPZ, "Scope of verification level of rebate

BOSTA TYPE BOSTA, "Status of the agreement

DATAB TYPE DATAB, "Agreement valid-from date

DATBI TYPE DATBI, "Agreement valid-to date

KOBOG TYPE KOBOG, "Condition type/table group for agr

BOTEXT TYPE BOTEXT, "Description of agreement

ZLSCH TYPE DZLSCH, "Payment method

BON_ENH_VAKEY TYPE BON_ENH_VAKEY, "Indicates Enhand Reb Sett

BON_ENH_INDIRECT TYPE BON_ENH_INDIRECT, "Ind for Indir Settlmnt

END OF TY_KONA.

\* Type declaration for data of table KONDN

TYPES: BEGIN OF TY_KONDN,

KNUMH TYPE KNUMH, "Condition record number

KNRMM TYPE KNRMM, "Minimum quantity

KNRNM TYPE KNRNM, "Free goods quantity

KNRME TYPE KNRME, "Quantity unit for minimum/free quantity

KNRZM TYPE KNRZM, "Additional quantity for free goods

KNREZ TYPE KNREZ, "Quantity unit for free good additnl qty

KNRRR TYPE KNRRR, "Calculation type for free goods qty

KNRDD TYPE KNRDD, "Free goods category

LSTANR TYPE LSTANR, "Free goods delivery control

KNRMAT TYPE KNRMAT, "Scale basis indicator

END OF TY_KONDN.

\* Type declaration for data of table T685T

TYPES: BEGIN OF TY_T685T,

KSCHL TYPE KSCHL, "Condition type

VTEXT TYPE VTXTK, "Name

END OF TY_T685T.

\* Type declaration for data of table MAKT

TYPES: BEGIN OF TY_MAKT,

MATNR TYPE MATNR, "Material Number

MAKTX TYPE MAKTX, "Material Description

END OF TY_MAKT.

\* Type declaration for data of table KNA1

TYPES: BEGIN OF TY_KNA1,

KUNNR TYPE KUNNR, "Customer Number 1

NAME1 TYPE NAME1_GP, "Name 1

END OF TY_KNA1.

\* Type declaration for data of table T188T

TYPES: BEGIN OF TY_T188T,

KONDA TYPE KONDA, "Price group (customer)

VTEXT TYPE BEZEI20, "Description

END OF TY_T188T.

\* Type declaration for data of table TVM1T

TYPES: BEGIN OF TY_TVM1T,

MVGR1 TYPE MVGR1, "Material group 1

BEZEI TYPE BEZEI, "Description

END OF TY_TVM1T.

\* Type declaration for data of table T6B1T

TYPES: BEGIN OF TY_T6B1T,

BOART TYPE BOART, "Agreement type

VTEXT TYPE VTEXT, "Description

END OF TY_T6B1T.

\* Type declaration for data of table KONDNS

TYPES: BEGIN OF TY_KONDNS,

KNUMH TYPE KNUMH, "Condition record number

KNRMAT TYPE KNRMAT, "Additional material for free goods

END OF TY_KONDNS.

\* Type declaration for data of table DD07T

TYPES: BEGIN OF TY_DD07T,

VALPOS TYPE VALPOS, "Domain value key

DDTEXT TYPE VAL_TEXT, "Short text for fixed values

END OF TY_DD07T.

\* Type declaration for data of table

TYPES:BEGIN OF TY_CHECK,

VKORG TYPE VKORG, "Sales Org

VTWEG TYPE VTWEG, "Distribution Channel

FLAG TYPE CHAR1, "Flag used

END OF TY_CHECK.

\* Type declaration for data of internal table of External ID

TYPES: BEGIN OF TY_EXT_CMPGN,

EXTERNAL_ID TYPE CGPL_EXTID,

END OF TY_EXT_CMPGN.

\* Type declaration for data of table CGPL_PROJECT

TYPES: BEGIN OF TY_CGPL_PROJECT,

EXTERNAL_ID TYPE CGPL_EXTID, "External Identifier of Element

BWIDENTIFIER TYPE CGPL_BWIDENTIFIER, "BW Identification

END OF TY_CGPL_PROJECT.

\* Type declaration for data of internal table of Material No

TYPES: BEGIN OF TY_MATNR,

MATNR TYPE MATNR, "Material Number

END OF TY_MATNR.

\* Type declaration for data of internal table of Customer

TYPES: BEGIN OF TY_KUNNR,

KUNNR TYPE KUNNR, "Customer

END OF TY_KUNNR.

\**********************************************************************\*

\* Table Type Declarations *

\**********************************************************************\*

TYPES: TY_I_T682I TYPE STANDARD TABLE OF TY_T682I,

TY_I_INPUT_FIELD TYPE STANDARD TABLE OF TY_INPUT_FIELD,

TY_I_CONDTAB_DATA TYPE STANDARD TABLE OF TY_CONDTAB_DATA,

TY_I_KNUMH TYPE STANDARD TABLE OF COND_KNUMH,

TY_I_KONHDB TYPE STANDARD TABLE OF KONHDB,

TY_I_KONPDB TYPE STANDARD TABLE OF KONPDB,

TY_I_KONM TYPE STANDARD TABLE OF COND_KONM,

TY_I_KONW TYPE STANDARD TABLE OF COND_KONW,

TY_I_KONDN TYPE SORTED TABLE OF TY_KONDN

WITH NON-UNIQUE KEY KNUMH,

TY_I_KONDNS TYPE SORTED TABLE OF TY_KONDNS

WITH NON-UNIQUE KEY KNUMH,

TY_I_KONA TYPE SORTED TABLE OF TY_KONA

WITH NON-UNIQUE KEY KNUMA.

\***********************************************************************\*

\* INTERNAL TABLE DECLARATION *

\***********************************************************************\*

DATA: I_CONDTN_REP TYPE STANDARD TABLE OF TY_CONDTN_REP.

\*-->Begin of Biswarup TPR18842

DATA: I_CGPL_PROJECT TYPE STANDARD TABLE OF TY_CGPL_PROJECT,

REC_CGPL_PROJECT TYPE TY_CGPL_PROJECT.

\*<--End of Biswarup TPR18842

\* Mod-002 Begins

\* ALV related data declaration

TYPE-POOLS: SLIS.

\* Mod-002 Ends

\***********************************************************************\*

\* VARIABLE DECLARATION *

\***********************************************************************\*

DATA: V_VKORG TYPE VBAK-VKORG, "Sales Organization

V_VTWEG TYPE VBAK-VTWEG, "Distribution Channel

V_KSCHL TYPE KONP-KSCHL, "Condition type

V_CMPGN_ID TYPE CMPGN_ID_R3, "Campaign ID

V_EXTERNAL_ID TYPE CGPL_EXTID, "Campaign ID (External)

V_KUNNR TYPE KUNNR, "Sold to Party

V_HIENR TYPE KUNNR_KH, "Customer Hierarchy

V_KONDA TYPE T188-KONDA, "Price Group

V_MATNR TYPE MATNR, "Material number

V_MVGR1 TYPE TVM1-MVGR1, "Material Group 1

V_PRODH1 TYPE PRODH1, "ProdH 1 - Business

V_PRODH2 TYPE PRODH2, "ProdH 2 â€" Business ID

V_PRODH3 TYPE PRODH3, "ProdH 3 â€" Category

V_PRODH4 TYPE PRODH4, "ProdH 4 â€" Segment

V_PRODH5 TYPE PRODH5, "ProdH 5 â€" Seg/Sub Seg

V_LOEVM_KO TYPE KONP-LOEVM_KO, "Condition Deletion Indicator

V_CDATAB TYPE DATAB, "Condition Valid From

V_CDATBI TYPE DATBI, "Condition Valid To

V_BONEM TYPE KONA-BONEM, "Rebate Recipient

V_BOSTA TYPE KONA-BOSTA, "Rebate Agreement Status

V_BOART TYPE KONA-BOART, "Agreement Type MOD-001

V_ALAND TYPE T005-LAND1, "Departure Country MOD-001

V_RDATAB TYPE ABDATAB, "Rebate Agreement Valid From

V_RDATBI TYPE ABDATBI, "Rebate Agreeement Valid To

V_MESSAGE TYPE CMORESRFC-MESSAGE.

DATA: R_KVEWE TYPE RANGE OF KVEWE,

R_SALESORG TYPE RANGE OF VKORG,

R_DISTCH TYPE RANGE OF VTWEG.

DATA: I_FLDCAT TYPE LVC_T_FCAT. "table for field catalog " San

\* DATA: i_fldcat TYPE slis_t_fieldcat_alv.

DATA: WA_LAYOUT TYPE LVC_S_LAYO.

\* Mod-002 Begins

DATA :WA_LAYOUT1 TYPE SLIS_LAYOUT_ALV,

I_FLDCAT1 TYPE SLIS_T_FIELDCAT_ALV.

\* Mod-002 ends

DATA: V_CONTAINER TYPE SCRFNAME VALUE 'SCRN_CONTAINER',

"custom control in screen

WA_VARIANT TYPE DISVARIANT, "Structure for Variant

WA_VARIANT1 TYPE DISVARIANT, "Structure for Variant " Mod-002

OBJ_ALV_GRID TYPE REF TO CL_GUI_ALV_GRID,

"object for displaying the ALV grid

V_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

DATA: L_REC_FLDCAT TYPE LVC_S_FCAT.

DATA : I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, " field catalog

V_SAVE TYPE CHAR1, " to save the variant

V_EXIT TYPE CHAR1, " exit

V_REPID TYPE SY-REPID, " report name

V_VARIANT TYPE DISVARIANT, " variant

LAYOUT TYPE SLIS_LAYOUT_ALV, " layout variant

VX_VARIANT TYPE DISVARIANT. " variant

DATA: C_A TYPE CHAR1 VALUE 'A'. " constant A

\*DATA: l_rec_fldcat TYPE slis_fieldcat_alv.

\*DATA: l_fldcat TYPE slis_fieldcat_alv.\

\*----------------------------------------------------------------------\*

\* Include for Selection Screen Design *

\*----------------------------------------------------------------------\*

\* This Include contains the design of Selection Screen

\* INCLUDE zpricing_condtn_sel.

\*======================================================================\*

\*DESCRIPTION : THE PURPOSE OF THIS PROGRAM IS TO PROVIDE *

\* USERS WITH INFORMATION ABOUT THE PRICING *

\* CONDITION ON THE SYSTEM, TO ALLOW USERS TO SEE *

\* IF THE PRICING CONDITIONS HAVE BEEN SET UP, *

\* AND TO CHECK THE DETAILS OF THOSE CONDITIONS. *

\*======================================================================\*

\* Author: Aveek Ghose

\*======================================================================\*

\*CHANGE HISTORY LOG *

\*----------------------------------------------------------------------\*

\*MOD. NO.\| DATE \| NAME \| CORRECTION NUMBER \| CHANGE REFERENCE # *

\***********************************************************************\*

\*&---------------------------------------------------------------------\*

\*& Report ZPRICING_REP_CONDTN *

\*& *

\*&---------------------------------------------------------------------\*

\*& *

\*& *

\*&---------------------------------------------------------------------\*

\*&---------------------------------------------------------------------\*

\*& Include ZPRICING_CONDTN_SEL

\*&---------------------------------------------------------------------\*

\***********************************************************************\*

\*&---------------------------------------------------------------------\*

\*& Include ZPRICING_CONDTN_SEL *

\*&---------------------------------------------------------------------\*

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

\* Sales Organization

SELECT-OPTIONS: S_VKORG FOR V_VKORG NO INTERVALS NO-EXTENSION

\* MATCHCODE OBJECT c_vkorg

OBLIGATORY,

\* Distribution Channel

S_VTWEG FOR V_VTWEG NO-EXTENSION

\* MATCHCODE OBJECT c_vtweg

OBLIGATORY,

\* Begin of Changes MOD-001

\* Departure Country

S_ALAND FOR V_ALAND NO-EXTENSION,

\* End of Changes MOD-001

\* Condition Type

S_KSCHL FOR V_KSCHL NO-EXTENSION,

\* Campaign ID

S_CAMPID FOR V_CMPGN_ID NO-EXTENSION,

\* Campaign (External ID)

S_XCAMID FOR V_EXTERNAL_ID NO-EXTENSION,

\* Sold-to Party

S_KUNNR FOR V_KUNNR NO-EXTENSION

MATCHCODE OBJECT C_KUNNR,

\* Customer Hierarchy

S_HIENR FOR V_HIENR NO-EXTENSION

MATCHCODE OBJECT C_KUNNR,

\* Price Group

S_KONDA FOR V_KONDA NO-EXTENSION,

\* Material

S_MATNR FOR V_MATNR NO-EXTENSION

MATCHCODE OBJECT S_MAT1,

\* Material Group 1

S_MVGR1 FOR V_MVGR1 NO-EXTENSION,

\* Product Hierarchy 1 - Business

S_PRODH1 FOR V_PRODH1 NO-EXTENSION

MATCHCODE OBJECT PRODH,

\* Product Hierarchy 2 â€" Business ID

S_PRODH2 FOR V_PRODH2 NO-EXTENSION,

\* MATCHCODE OBJECT prodh,

\* Product Hierarchy 3 - Category

S_PRODH3 FOR V_PRODH3 NO-EXTENSION,

\* MATCHCODE OBJECT prodh,

\* Product Hierarchy 4 â€" Sub-Category

S_PRODH4 FOR V_PRODH4 NO-EXTENSION,

\* MATCHCODE OBJECT prodh,

\* Product Hierarchy 5 â€" Seg/Sub Seg

S_PRODH5 FOR V_PRODH5 NO-EXTENSION,

\* MATCHCODE OBJECT prodh,

\* Condition Deletion Indicator

S_LOEVM FOR V_LOEVM_KO NO-EXTENSION.

\* Condition Valid From

PARAMETERS: P_CDATAB LIKE V_CDATAB,

\* Condition Valid To

P_CDATBI LIKE V_CDATBI.

\* Begin of MOD-001

\* Rebate Agreement Type

SELECT-OPTIONS: S_BOART FOR V_BOART NO-EXTENSION.

\* End of MOD-001

\* Rebate Recipient

SELECT-OPTIONS: S_BONEM FOR V_BONEM NO-EXTENSION,

\* Rebate Agreement Status

S_BOSTA FOR V_BOSTA . " NO-EXTENSION.

\* Rebate Agreement Valid From

PARAMETERS: P_RDATAB LIKE V_RDATAB,

\* Rebate Agreement Valid To

P_RDATBI LIKE V_RDATBI.

SELECTION-SCREEN SKIP 1.

\* Prices / Discounts / Surcharges

PARAMETERS: P_PRICE TYPE C AS CHECKBOX,

\* Rebates

P_REBATE TYPE C AS CHECKBOX,

\* Free Goods

P_FREEGD TYPE C AS CHECKBOX.

SELECTION-SCREEN SKIP 1.

\* CRM System

PARAMETERS: P_CRMSYS TYPE RFCDES-RFCDEST,

\* Layout Variant

P_VARI TYPE SLIS_VARI.

SELECTION-SCREEN END OF BLOCK B1.

\* The Include for Class Definition and Implementation

\* INCLUDE zpricing_cond_class.

\*======================================================================\*

\*DESCRIPTION : THE PURPOSE OF THIS PROGRAM IS TO PROVIDE *

\* USERS WITH INFORMATION ABOUT THE PRICING *

\* CONDITION ON THE SYSTEM, TO ALLOW USERS TO SEE *

\* IF THE PRICING CONDITIONS HAVE BEEN SET UP, *

\* AND TO CHECK THE DETAILS OF THOSE CONDITIONS. *

\*======================================================================\*

\* Author: Aveek Ghose

\*======================================================================\*

\*CHANGE HISTORY LOG *

\*----------------------------------------------------------------------\*

\*MOD. NO.\| DATE \| NAME \| CORRECTION NUMBER \| CHANGE REFERENCE # *

\***********************************************************************\*

\*&---------------------------------------------------------------------\*

\*& Report ZPRICING_REP_CONDTN *

\*& *

\*&---------------------------------------------------------------------\*

\*& *

\*& *

\*&---------------------------------------------------------------------\*

\*&---------------------------------------------------------------------\*

\*& Include ZPRICING_COND_CLASS *

\*&---------------------------------------------------------------------\*

CLASS LCL_DATA_SELECTION DEFINITION.

PUBLIC SECTION.

CLASS-METHODS: CLASS_CONSTRUCTOR, "Authority check

M_GET_LAYOUT_VARIANT_F4, "F4 for Layout Variant

M_SELSCREEN_OUTPUT_CONTROL,

M_SELSCREEN_PRODH_F4.

METHODS: M_MAIN_PROCESSING, "Main processing

M_BUILD_FIELD_CATALOGUE, "Build Field Catalogue

\* Populate the ALV Field Catalogue

M_POPULATE_FLDCAT IMPORTING IM_FLDNAME TYPE LVC_FNAME

IM_OUTLEN TYPE LVC_OUTLEN

IM_CLPOS TYPE LVC_COLPOS

IM_RWPOS TYPE LVC_ROWPOS

IM_TABNAME TYPE LVC_TNAME

IM_COLTEXT TYPE LVC_TXTCOL

IM_NO_OUT TYPE LVC_NOOUT

IM_RFIELD TYPE LVC_RFNAME

IM_RTABLE TYPE LVC_RTNAME

OPTIONAL

IM_LCASE TYPE LOWERCASE

OPTIONAL,

\* Retrieve Data for display in ALV

M_RETRIEVE_DATA CHANGING CH_I_T682I TYPE TY_I_T682I,

\* Retrieve the Condition Records from the respective Condition Tables

M_GET_COND_RECORD

IMPORTING IM_I_T682I TYPE TY_I_T682I

CHANGING CH_I_CONDTAB_DATA TYPE TY_I_CONDTAB_DATA,

\* Validate the database table existence in SAP system

M_VALIDATE_TABLE CHANGING CH_I_T682I TYPE TY_I_T682I,

\* Retrieve the Condition data from Condition Header and Item

M_GET_COND_DATA

IMPORTING IM_I_CONDTAB_DATA TYPE TY_I_CONDTAB_DATA

CHANGING CH_I_KNUMH TYPE TY_I_KNUMH

CH_I_KONHDB TYPE TY_I_KONHDB

CH_I_KONPDB TYPE TY_I_KONPDB

CH_I_KONM TYPE TY_I_KONM

CH_I_KONW TYPE TY_I_KONW

CH_I_KONDN TYPE TY_I_KONDN

CH_I_KONDNS TYPE TY_I_KONDNS,

\* Get the BWIDENTIFIER from CRM

M_GET_CRM_BWIDENTIFIER,

\* Retrieve the Rebate Agreement data

M_GET_AGREEMENT_DATA

IMPORTING IM_I_KONPDB TYPE TY_I_KONPDB

CHANGING CH_I_KONA TYPE TY_I_KONA,

M_GET_REBATE_ACCRUAL_VALUES,

\* Get the descriptive texts

M_GET_TEXTS,

\* Process Data before display

M_PROCESS_DATA,

\* Populate the internal table based on the selection screen

M_INPUT_FIELD

CHANGING CH_I_INPUT_FIELD TYPE TY_I_INPUT_FIELD.

DATA:

I_T682I TYPE STANDARD TABLE OF TY_T682I,

\* Internal Table for the Input Field

I_INPUT_FIELD TYPE STANDARD TABLE OF TY_INPUT_FIELD,

I_CONDTAB_DATA TYPE STANDARD TABLE OF TY_CONDTAB_DATA,

I_CONDITION_DATA TYPE STANDARD TABLE OF TY_CONDITION_DATA,

I_KONA TYPE SORTED TABLE OF TY_KONA

WITH NON-UNIQUE KEY KNUMA,

\* Internal table to store Free Goods detail

I_KONDN TYPE SORTED TABLE OF TY_KONDN

WITH NON-UNIQUE KEY KNUMH,

I_KONDNS TYPE SORTED TABLE OF TY_KONDNS

WITH NON-UNIQUE KEY KNUMH.

DATA: I_KNUMH TYPE STANDARD TABLE OF COND_KNUMH,

I_KONHDB TYPE STANDARD TABLE OF KONHDB,

I_KONPDB TYPE STANDARD TABLE OF KONPDB,

I_KONM TYPE STANDARD TABLE OF COND_KONM,

I_KONW TYPE STANDARD TABLE OF COND_KONW,

I_T685T TYPE SORTED TABLE OF TY_T685T

WITH NON-UNIQUE KEY KSCHL,

I_MAKT TYPE STANDARD TABLE OF TY_MAKT

WITH NON-UNIQUE KEY MATNR,

I_KNA1 TYPE STANDARD TABLE OF TY_KNA1

WITH NON-UNIQUE KEY KUNNR,

I_T188T TYPE STANDARD TABLE OF TY_T188T

WITH NON-UNIQUE KEY KONDA,

I_TVM1T TYPE STANDARD TABLE OF TY_TVM1T

WITH NON-UNIQUE KEY MVGR1,

I_T6B1T TYPE STANDARD TABLE OF TY_T6B1T

WITH NON-UNIQUE KEY BOART,

I_DD07T TYPE STANDARD TABLE OF TY_DD07T

WITH NON-UNIQUE KEY VALPOS.

ENDCLASS. "lcl_data_selection DEFINITION

\*&---------------------------------------------------------------------\*

\*& Class (Implementation) lcl_data_selection

\*&---------------------------------------------------------------------\*

\* Implementation of the Class LCL_DATA_SELECTION

\*----------------------------------------------------------------------\*

CLASS LCL_DATA_SELECTION IMPLEMENTATION.

\*&---------------------------------------------------------------------\*

\*& METHOD CONSTRUCTOR

\*&---------------------------------------------------------------------\*

\* Authority Check

\*----------------------------------------------------------------------\*

METHOD CLASS_CONSTRUCTOR.

\* Local internal table for authorisation check

DATA : L_I_CHECK TYPE STANDARD TABLE OF

TY_CHECK INITIAL SIZE 0,

\* Local work area for authorisation check

L_WA_CHECK TYPE TY_CHECK.

DATA : L_LINES TYPE SYTABIX ,

L_LINES1 TYPE SYTABIX .

DATA : WA_SALESORG LIKE LINE OF R_SALESORG ,

WA_DISTCH LIKE LINE OF R_DISTCH.

CLEAR L_WA_CHECK.

CLEAR L_I_CHECK.

SELECT VKORG "Sales Org

VTWEG "Distr Channel

FROM TVTA "Organizational Unit: Sales Area(s)

INTO TABLE L_I_CHECK

WHERE VKORG IN S_VKORG

AND VTWEG IN S_VTWEG.

\* Record not found display error msg

IF SY-SUBRC NE 0.

\* Message that the Sales Org & Distr Chnl combination invalid

MESSAGE I073.

LEAVE LIST-PROCESSING.

ENDIF.

DESCRIBE TABLE L_I_CHECK LINES L_LINES .

CLEAR : R_SALESORG,

R_DISTCH.

\* Collect all Sales organization in a range

\* LOOP AT l_i_check INTO l_wa_check.

\*

\* AUTHORITY-CHECK OBJECT c_vbak_vko "V_VBAK_VKO

\* ID c_vkorg FIELD l_wa_check-vkorg

\* ID c_vtweg FIELD l_wa_check-vtweg

\* ID c_spart DUMMY

\* ID c_actvt FIELD c_disp_03.

\*

\* IF sy-subrc IS INITIAL.

\* DELETE l_i_check INDEX sy-tabix.

\* ENDIF.

\*

\* ENDLOOP.

\*

\* DESCRIBE TABLE l_i_check LINES l_lines1 .

\*

\* IF l_lines1 = l_lines .

\*\* Message that user is not authorized

\* MESSAGE i074.

\* LEAVE LIST-PROCESSING.

\* ENDIF.

ENDMETHOD. "CLASS_CONSTRUCTOR

\*&---------------------------------------------------------------------\*

\*& METHOD m_get_layout_variant_f4

\*&---------------------------------------------------------------------\*

\* Search Help on the parameter Layout Variant

\*----------------------------------------------------------------------\*

METHOD M_GET_LAYOUT_VARIANT_F4.

WA_VARIANT-REPORT = SY-REPID.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

IS_VARIANT = WA_VARIANT

I_SAVE = C_SAVE "A

IMPORTING

ES_VARIANT = WA_VARIANT

EXCEPTIONS

NOT_FOUND = 1

PROGRAM_ERROR = 2

OTHERS = 3.

IF SY-SUBRC IS INITIAL.

P_VARI = WA_VARIANT-VARIANT.

ENDIF.

ENDMETHOD. "M_GET_LAYOUT_VARIANT_F4

\*&---------------------------------------------------------------------\*

\*& METHOD m_selscreen_output_control

\*&---------------------------------------------------------------------\*

\* Control the selection screen outout

\*----------------------------------------------------------------------\*

METHOD M_SELSCREEN_OUTPUT_CONTROL.

IF S_XCAMID IS INITIAL.

LOOP AT SCREEN.

IF SCREEN-NAME = C_CRMSYS.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDMETHOD. "m_selscreen_output_control

\*&---------------------------------------------------------------------\*

\*& METHOD m_selscreen_prodh_f4

\*&---------------------------------------------------------------------\*

\* Search Help on the ProdH values on selection screen

\*----------------------------------------------------------------------\*

METHOD M_SELSCREEN_PRODH_F4.

DATA: L_WA_PRODHS TYPE PRODHS.

DATA: L_NODE_PICKED TYPE PRODH_D,

L_SELFIELD TYPE FIELDNAME,

L_STUFE TYPE PRODH_STUF.

GET CURSOR FIELD L_SELFIELD.

IF L_SELFIELD = 'S_PRODH2-LOW' OR L_SELFIELD = 'S_PRODH2-HIGH'.

L_STUFE = 2.

ENDIF.

IF L_SELFIELD = 'S_PRODH3-LOW' OR L_SELFIELD = 'S_PRODH3-HIGH'.

L_STUFE = 3.

ENDIF.

IF L_SELFIELD = 'S_PRODH4-LOW' OR L_SELFIELD = 'S_PRODH4-HIGH'.

L_STUFE = 4.

ENDIF.

IF L_SELFIELD = 'S_PRODH5-LOW' OR L_SELFIELD = 'S_PRODH5-HIGH'.

L_STUFE = 5.

ENDIF.

CALL FUNCTION 'RV_PRODUKTHIERARCHIE_SHOW'

EXPORTING

ROOT = ' '

SELMODE = '3'

STUFE = L_STUFE

REFRESH = 'X'

DISPLAY = 'X'

X1 = 5

X2 = 80

Y1 = 5

Y2 = 24

\* VKORG =

\* VTWEG =

SPRAS = SY-LANGU

SHOW_ONLY = ' '

IMPORTING

NODE_PICKED = L_NODE_PICKED

\* TABLES

\* DISP_T179 =

\* XM_MAT1P =

EXCEPTIONS

ROOT_NOT_EXIST = 1

TOO_MANY_LEVEL = 2

OTHERS = 3

.

IF SY-SUBRC = 0.

MOVE L_NODE_PICKED TO L_WA_PRODHS.

CASE L_SELFIELD.

WHEN 'S_PRODH2-LOW'.

S_PRODH2-LOW = L_WA_PRODHS-PRODH2.

WHEN 'S_PRODH2-HIGH'.

S_PRODH2-HIGH = L_WA_PRODHS-PRODH2.

WHEN 'S_PRODH3-LOW'.

S_PRODH3-LOW = L_WA_PRODHS-PRODH3.

WHEN 'S_PRODH3-HIGH'.

S_PRODH3-HIGH = L_WA_PRODHS-PRODH3.

\* WHEN 'S_PRODH4-LOW'.

\* s_prodh4-low = l_wa_prodhs-prodh4.

\* WHEN 'S_PRODH4-HIGH'.

\* s_prodh4-high = l_wa_prodhs-prodh4.

\* WHEN 'S_PRODH5-LOW'.

\* s_prodh5-low = l_wa_prodhs-prodh5.

\* WHEN 'S_PRODH5-HIGH'.

\* s_prodh5-high = l_wa_prodhs-prodh5.

ENDCASE.

ENDIF.

ENDMETHOD. "m_selscreen_prodh_f4

\*&---------------------------------------------------------------------\*

\*& METHOD m_retrieve_data

\*&---------------------------------------------------------------------\*

\* Retrieve data from the Database Tables

\*----------------------------------------------------------------------\*

METHOD M_RETRIEVE_DATA.

FIELD-SYMBOLS: <L_FS_T682I> TYPE TY_T682I,

<L_FS_T685> TYPE TY_T685,

<L_FS_T685A> TYPE TY_T685A.

\* Structure for range tables

DATA: BEGIN OF REC_KVEWE,

SIGN TYPE TVARV_SIGN,

OPTION TYPE TVARV_OPTI,

LOW TYPE KVEWE,

HIGH TYPE KVEWE,

END OF REC_KVEWE.

DATA:

\* internal table for DATA in table t685

L_I_T685 TYPE SORTED TABLE OF TY_T685

WITH NON-UNIQUE KEY KVEWE KAPPL KOZGF,

L_I_T685_A TYPE SORTED TABLE OF TY_T685

WITH NON-UNIQUE KEY KVEWE KAPPL KSCHL KOZGF,

L_I_T685A TYPE SORTED TABLE OF TY_T685A

WITH NON-UNIQUE KEY KAPPL KSCHL KOAID,

\* Internal Table for data in table T682I

L_I_T682I_TEMP TYPE SORTED TABLE OF TY_T682I

WITH NON-UNIQUE KEY KVEWE KAPPL KSCHL KOZGF,

L_I_T682I_A TYPE STANDARD TABLE OF TY_T682I,

L_I_T682I_N TYPE STANDARD TABLE OF TY_T682I.

\* Populate the Range Table for Usage(T685-KVEWE) because we want only

\* General Pricing, Free Goods and Rebate

REC_KVEWE-SIGN = C_SIGN_I. "I

REC_KVEWE-OPTION = C_OPTION_EQ. "EQ

IF P_PRICE = C_YES OR P_REBATE = C_YES.

REC_KVEWE-LOW = C_KVEWE_A. "A

APPEND REC_KVEWE TO R_KVEWE.

ENDIF.

IF P_FREEGD = C_YES.

REC_KVEWE-LOW = C_KVEWE_N. "N

APPEND REC_KVEWE TO R_KVEWE.

ENDIF.

IF R_KVEWE IS INITIAL.

MESSAGE I072.

\* Promt an Info Message to check at least one box

LEAVE LIST-PROCESSING.

ENDIF.

\* For each Condition Type in the selection screen get the Access

\* Sequence from the database table T685.

SELECT KVEWE "Usage of the condition table

KAPPL "Application

KSCHL "Condition type

KOZGF "Access sequence

FROM T685 "Conditions: Types

INTO TABLE L_I_T685

WHERE KVEWE IN R_KVEWE

AND KAPPL = C_KAPPL_V "V

AND KSCHL IN S_KSCHL

AND KOZGF <> C_NO.

IF NOT SY-SUBRC IS INITIAL.

\* Information Message that no data is selected

MESSAGE I030.

LEAVE LIST-PROCESSING.

ENDIF.

L_I_T685_A = L_I_T685.

DELETE L_I_T685_A WHERE KVEWE <> C_KVEWE_A. "A

IF NOT L_I_T685_A IS INITIAL.

SELECT KAPPL

KSCHL

KOAID

FROM T685A

INTO TABLE L_I_T685A

FOR ALL ENTRIES IN L_I_T685_A

WHERE KAPPL = C_KAPPL_V

AND KSCHL = L_I_T685_A-KSCHL

AND KOAID = C_KOAID_C. "C

IF NOT SY-SUBRC IS INITIAL.

\* No condition types for rebate exists for the selection criteria.

MESSAGE I075.

ENDIF.

ENDIF.

\* The following is the way to distinguish different conditions:

\* If the Usage (T685-KVEWE) is:

\* \--> 'A' then the condition type is 'Pricing' or 'Rebate'

\* \--> 'N' then the condition type is 'Free Goods'

\* Keep the distinct Access Sequence only

DELETE ADJACENT DUPLICATES FROM L_I_T685

COMPARING KVEWE KAPPL KSCHL.

\* For each Access Sequence get the Tables (T682I-KOTABNR)from the

\* database table T682I

SELECT KVEWE "Usage of the condition table

KAPPL "Application

KOZGF "Access sequence

KOTABNR "Condition table

FROM T682I "Conditions: Access Sequences (Generated Form)

INTO TABLE L_I_T682I_TEMP

FOR ALL ENTRIES IN L_I_T685

WHERE KVEWE = L_I_T685-KVEWE

AND KAPPL = C_KAPPL_V "V

AND KOZGF = L_I_T685-KOZGF.

IF NOT SY-SUBRC IS INITIAL.

\* Information Message that no data is selected

MESSAGE I030.

LEAVE LIST-PROCESSING.

ENDIF.

\* For Pricing the Access Tables will be obtained by the following logic:

\* Pricing - Concatenate 'A' to the tables (T682I-KOTABNR)

\* Rebate - Concatenate 'KOTE' to the tables (T682I-KOTABNR)

\* Free Goods - Concatenate 'KOTN' to all the tables (T682I-KOTABNR)

L_I_T682I_A = L_I_T682I_TEMP.

L_I_T682I_N = L_I_T682I_TEMP.

\* Table for Usage related for General Pricing

DELETE L_I_T682I_A WHERE NOT KVEWE = C_KVEWE_A. "A

\* Table for Usage related for Free Goods

DELETE L_I_T682I_N WHERE NOT KVEWE = C_KVEWE_N. "N

\* Get the names of the database tables from where

\* the Condition Records for Pricing will be retrieved

LOOP AT L_I_T682I_A ASSIGNING <L_FS_T682I>.

READ TABLE L_I_T685 ASSIGNING <L_FS_T685> WITH KEY

KVEWE = <L_FS_T682I>-KVEWE "Usage

KAPPL = <L_FS_T682I>-KAPPL "Application

KOZGF = <L_FS_T682I>-KOZGF "Access sequence

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

<L_FS_T682I>-KSCHL = <L_FS_T685>-KSCHL.

READ TABLE L_I_T685A ASSIGNING <L_FS_T685A> WITH KEY

KAPPL = C_KAPPL_V

KSCHL = <L_FS_T685>-KSCHL

KOAID = C_KOAID_C "C

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

IF P_REBATE = C_YES.

CONCATENATE C_KOTE "KOTE

<L_FS_T682I>-KOTABNR

INTO <L_FS_T682I>-TABNAME.

ENDIF.

ELSE.

IF P_PRICE = C_YES.

CONCATENATE C_PRICING_A "A

<L_FS_T682I>-KOTABNR

INTO <L_FS_T682I>-TABNAME.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

\* Get the names of the database tables from where

\* the Condition Records for Free Goods will be retrieved

LOOP AT L_I_T682I_N ASSIGNING <L_FS_T682I>.

CONCATENATE C_KOTN "KOTN

<L_FS_T682I>-KOTABNR

INTO <L_FS_T682I>-TABNAME.

READ TABLE L_I_T685 ASSIGNING <L_FS_T685> WITH KEY

KVEWE = <L_FS_T682I>-KVEWE "Usage

KAPPL = <L_FS_T682I>-KAPPL

"Application

KOZGF = <L_FS_T682I>-KOZGF

BINARY SEARCH.

"Access sequence

IF SY-SUBRC IS INITIAL.

<L_FS_T682I>-KSCHL = <L_FS_T685>-KSCHL.

ENDIF.

ENDLOOP.

\* The resultant tables will give the name of the tables from where

\* the Condition Record can be retrieved.

IF P_PRICE = C_YES

OR P_REBATE = C_YES.

CH_I_T682I = L_I_T682I_A.

ENDIF.

IF P_FREEGD = C_YES.

IF CH_I_T682I IS INITIAL.

CH_I_T682I = L_I_T682I_N.

ELSE.

APPEND LINES OF L_I_T682I_N TO CH_I_T682I.

ENDIF.

ENDIF.

DELETE CH_I_T682I WHERE TABNAME = SPACE.

IF CH_I_T682I IS INITIAL.

\* Info message that no Condition Table

MESSAGE I066.

LEAVE LIST-PROCESSING.

ENDIF.

\* Retain the distinct table names in the internal table.

SORT CH_I_T682I BY TABNAME.

DELETE ADJACENT DUPLICATES FROM CH_I_T682I

COMPARING TABNAME.

ENDMETHOD. "M_RETRIEVE_DATA

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_table

\*&---------------------------------------------------------------------\*

\* Validate that the Condition Tables that were determined

\* actually exists in SAP

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_TABLE.

DATA: L_I_DD02L TYPE SORTED TABLE OF TY_DD02L

WITH NON-UNIQUE KEY TABNAME.

FIELD-SYMBOLS: <L_FS_T682I> TYPE TY_T682I,

<L_FS_DD02L> TYPE TY_DD02L.

SELECT TABNAME

FROM DD02L

INTO TABLE L_I_DD02L

FOR ALL ENTRIES IN CH_I_T682I

WHERE TABNAME = CH_I_T682I-TABNAME.

IF NOT SY-SUBRC IS INITIAL.

\* No Condition Tables could be determined for the selection criteria

MESSAGE I066.

LEAVE LIST-PROCESSING.

ENDIF.

LOOP AT CH_I_T682I ASSIGNING <L_FS_T682I>.

READ TABLE L_I_DD02L ASSIGNING <L_FS_DD02L>

WITH KEY TABNAME = <L_FS_T682I>-TABNAME

BINARY SEARCH.

IF NOT SY-SUBRC IS INITIAL.

<L_FS_T682I>-FLAG = C_YES.

ENDIF.

ENDLOOP.

DELETE CH_I_T682I WHERE FLAG = C_YES.

IF CH_I_T682I IS INITIAL.

\* Info message that no Condition Table

MESSAGE I066.

LEAVE LIST-PROCESSING.

ENDIF.

ENDMETHOD. "M_VALIDATE_TABLE

\*&---------------------------------------------------------------------\*

\*& METHOD m_input_field

\*&---------------------------------------------------------------------\*

\* Populating all the Input Values in the Selection Screen

\* into an internal table

\*----------------------------------------------------------------------\*

METHOD M_INPUT_FIELD.

\* Work area of the internal table i_input_field

DATA: L_WA_INPUT_FIELD TYPE TY_INPUT_FIELD.

\* Sales Organization

L_WA_INPUT_FIELD-FIELDNAME = C_VKORG. "VKORG

L_WA_INPUT_FIELD-SELNAME = C_VKORG_LOW. "S_VKORG-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

\* Distribution Channel

IF ( NOT S_VTWEG-LOW IS INITIAL AND

NOT S_VTWEG-HIGH IS INITIAL ) OR

( S_VTWEG-LOW IS INITIAL AND

NOT S_VTWEG-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_VTWEG. "VTWEG

L_WA_INPUT_FIELD-SELNAME = C_VTWEG_LOW. "S_VTWEG-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_VTWEG. "VTWEG

L_WA_INPUT_FIELD-SELNAME = C_VTWEG_HIGH. "S_VTWEG-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_VTWEG-LOW IS INITIAL AND

S_VTWEG-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_VTWEG. "VTWEG

L_WA_INPUT_FIELD-SELNAME = C_VTWEG_LOW. "S_VTWEG-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Condition Type

IF ( NOT S_KSCHL-LOW IS INITIAL AND

NOT S_KSCHL-HIGH IS INITIAL ) OR

( S_KSCHL-LOW IS INITIAL AND

NOT S_KSCHL-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_KSCHL. "KSCHL

L_WA_INPUT_FIELD-SELNAME = C_KSCHL_LOW. "S_KSCHL-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_KSCHL. "KSCHL

L_WA_INPUT_FIELD-SELNAME = C_KSCHL_HIGH. "S_KSCHL-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_KSCHL-LOW IS INITIAL AND

S_KSCHL-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_KSCHL. "KSCHL

L_WA_INPUT_FIELD-SELNAME = C_KSCHL_LOW. "S_KSCHL-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Campaign ID

IF ( NOT S_CAMPID-LOW IS INITIAL AND

NOT S_CAMPID-HIGH IS INITIAL ) OR

( S_CAMPID-LOW IS INITIAL AND

NOT S_CAMPID-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_CMPGN_ID. "CMPGN_ID

L_WA_INPUT_FIELD-SELNAME = C_CAMPID_LOW. "S_CAMPID-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_CMPGN_ID. "CMPGN_ID

L_WA_INPUT_FIELD-SELNAME = C_CAMPID_HIGH. "S_CAMPID-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_CAMPID-LOW IS INITIAL AND

S_CAMPID-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_CMPGN_ID. "CMPGN_ID

L_WA_INPUT_FIELD-SELNAME = C_CAMPID_LOW. "S_CAMPID-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* External Campaign ID

IF ( NOT S_XCAMID-LOW IS INITIAL AND

NOT S_XCAMID-HIGH IS INITIAL ) OR

( S_XCAMID-LOW IS INITIAL AND

NOT S_XCAMID-HIGH IS INITIAL ).

\* An RFC to the destination CRM system will be done by which the

\* BWIDENTIFIER will be retrived from CGPL_PROJECT for all the

\* values of the External Campaign ID.

CALL METHOD M_GET_CRM_BWIDENTIFIER.

\*-->Begin of TPR18842 Biswarup 20.04.2005 comment

\* IF s_campid IS INITIAL.

\*<--End of TPR18842 Biswarup 20.04.2005 comment

\*-->Begin of TPR18842 Biswarup 20.04.2005

IF NOT S_CAMPID\[\] IS INITIAL.

\*<--End of TPR18842 Biswarup 20.04.2005

L_WA_INPUT_FIELD-FIELDNAME = C_CMPGN_ID. "CMPGN_ID

L_WA_INPUT_FIELD-SELNAME = C_CAMPID_LOW. "S_CAMPID-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_CMPGN_ID. "CMPGN_ID

L_WA_INPUT_FIELD-SELNAME = C_CAMPID_HIGH. "S_CAMPID-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

ELSEIF NOT S_XCAMID-LOW IS INITIAL AND

S_XCAMID-HIGH IS INITIAL.

\* An RFC to the destination CRM system will be done by which the

\* BWIDENTIFIER will be retrived from CGPL_PROJECT for all the

\* values of the External Campaign ID.

CALL METHOD M_GET_CRM_BWIDENTIFIER.

\*-->Begin of TPR18842 Biswarup 20.04.2005 comment

\* IF s_campid IS INITIAL.

\*<--End of TPR18842 Biswarup 20.04.2005 comment

\*-->Begin of TPR18842 Biswarup 20.04.2005

IF NOT S_CAMPID\[\] IS INITIAL.

\*<--End of TPR18842 Biswarup 20.04.2005

L_WA_INPUT_FIELD-FIELDNAME = C_CMPGN_ID. "CMPGN_ID

L_WA_INPUT_FIELD-SELNAME = C_CAMPID_LOW. "S_CAMPID-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

ENDIF.

\* Sold to Party

IF ( NOT S_KUNNR-LOW IS INITIAL AND

NOT S_KUNNR-HIGH IS INITIAL ) OR

( S_KUNNR-LOW IS INITIAL AND

NOT S_KUNNR-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_KUNNR. "KUNNR

L_WA_INPUT_FIELD-SELNAME = C_KUNNR_LOW. "S_KUNNR-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_KUNNR. "KUNNR

L_WA_INPUT_FIELD-SELNAME = C_KUNNR_HIGH. "S_KUNNR-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_KUNNR-LOW IS INITIAL AND

S_KUNNR-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_KUNNR. "KUNNR

L_WA_INPUT_FIELD-SELNAME = C_KUNNR_LOW. "S_KUNNR-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ'.

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Customer Hierarchy

IF ( NOT S_HIENR-LOW IS INITIAL AND

NOT S_HIENR-HIGH IS INITIAL ) OR

( S_HIENR-LOW IS INITIAL AND

NOT S_HIENR-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_HIENR. "HIENR

L_WA_INPUT_FIELD-SELNAME = C_HIENR_LOW. "S_HIENR-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_HIENR. "HIENR

L_WA_INPUT_FIELD-SELNAME = C_HIENR_HIGH. "S_HIENR-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_HIENR-LOW IS INITIAL AND

S_HIENR-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_HIENR. "HIENR

L_WA_INPUT_FIELD-SELNAME = C_HIENR_LOW. "S_HIENR-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Price Group

IF ( NOT S_KONDA-LOW IS INITIAL AND

NOT S_KONDA-HIGH IS INITIAL ) OR

( S_KONDA-LOW IS INITIAL AND

NOT S_KONDA-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_KONDA. "KONDA

L_WA_INPUT_FIELD-SELNAME = C_KONDA_LOW. "S_KONDA-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_KONDA. "KONDA

L_WA_INPUT_FIELD-SELNAME = C_KONDA_HIGH. "S_KONDA-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_KONDA-LOW IS INITIAL AND

S_KONDA-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_KONDA. "KONDA

L_WA_INPUT_FIELD-SELNAME = C_KONDA_LOW. "S_KONDA-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Material

IF ( NOT S_MATNR-LOW IS INITIAL AND

NOT S_MATNR-HIGH IS INITIAL ) OR

( S_MATNR-LOW IS INITIAL AND

NOT S_MATNR-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_MATNR. "MATNR

L_WA_INPUT_FIELD-SELNAME = C_MATNR_LOW. "S_MATNR-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_MATNR. "MATNR

L_WA_INPUT_FIELD-SELNAME = C_MATNR_HIGH. "S_MATNR-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_MATNR-LOW IS INITIAL AND

S_MATNR-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_MATNR. "MATNR

L_WA_INPUT_FIELD-SELNAME = C_MATNR_LOW. "S_MATNR-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Material Group 1

IF ( NOT S_MVGR1-LOW IS INITIAL AND

NOT S_MVGR1-HIGH IS INITIAL ) OR

( S_MVGR1-LOW IS INITIAL AND

NOT S_MVGR1-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_MVGR1. "MVGR1

L_WA_INPUT_FIELD-SELNAME = C_MVGR1_LOW. "S_MVGR1-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_MVGR1. "MVGR1

L_WA_INPUT_FIELD-SELNAME = C_MVGR1_HIGH. "S_MVGR1-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_MVGR1-LOW IS INITIAL AND

S_MVGR1-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_MVGR1. "MVGR1

L_WA_INPUT_FIELD-SELNAME = C_MVGR1_LOW. "S_MVGR1-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Prodh1

IF ( NOT S_PRODH1-LOW IS INITIAL AND

NOT S_PRODH1-HIGH IS INITIAL ) OR

( S_PRODH1-LOW IS INITIAL AND

NOT S_PRODH1-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH1. "PRODH1

L_WA_INPUT_FIELD-SELNAME = C_PRODH1_LOW. "S_PRODH1-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH1. "PRODH1

L_WA_INPUT_FIELD-SELNAME = C_PRODH1_HIGH. "S_PRODH1-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_PRODH1-LOW IS INITIAL AND

S_PRODH1-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH1. "PRODH1

L_WA_INPUT_FIELD-SELNAME = C_PRODH1_LOW. "S_PRODH1-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Prodh2

IF ( NOT S_PRODH2-LOW IS INITIAL AND

NOT S_PRODH2-HIGH IS INITIAL ) OR

( S_PRODH2-LOW IS INITIAL AND

NOT S_PRODH2-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH2. "PRODH2

L_WA_INPUT_FIELD-SELNAME = C_PRODH2_LOW. "S_PRODH2-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH2. "PRODH2

L_WA_INPUT_FIELD-SELNAME = C_PRODH2_HIGH. "S_PRODH2-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_PRODH2-LOW IS INITIAL AND

S_PRODH2-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH2. "PRODH2

L_WA_INPUT_FIELD-SELNAME = C_PRODH2_LOW. "S_PRODH2-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Prodh3

IF ( NOT S_PRODH3-LOW IS INITIAL AND

NOT S_PRODH3-HIGH IS INITIAL ) OR

( S_PRODH3-LOW IS INITIAL AND

NOT S_PRODH3-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH3. "PRODH3

L_WA_INPUT_FIELD-SELNAME = C_PRODH3_LOW. "S_PRODH3-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH3. "PRODH3

L_WA_INPUT_FIELD-SELNAME = C_PRODH3_HIGH. "S_PRODH3-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_PRODH3-LOW IS INITIAL AND

S_PRODH3-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_PRODH3. "PRODH3

L_WA_INPUT_FIELD-SELNAME = C_PRODH3_LOW. "S_PRODH3-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Prodh4

IF ( NOT S_PRODH4-LOW IS INITIAL AND

NOT S_PRODH4-HIGH IS INITIAL ) OR

( S_PRODH4-LOW IS INITIAL AND

NOT S_PRODH4-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_YYPRODH4. "YYPRODH4

L_WA_INPUT_FIELD-SELNAME = C_PRODH4_LOW. "S_PRODH4-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_YYPRODH4. "YYPRODH4

L_WA_INPUT_FIELD-SELNAME = C_PRODH4_HIGH. "S_PRODH4-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_PRODH4-LOW IS INITIAL AND

S_PRODH4-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_YYPRODH4. "YYPRODH4

L_WA_INPUT_FIELD-SELNAME = C_PRODH4_LOW. "S_PRODH4-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Prodh5

IF ( NOT S_PRODH5-LOW IS INITIAL AND

NOT S_PRODH5-HIGH IS INITIAL ) OR

( S_PRODH5-LOW IS INITIAL AND

NOT S_PRODH5-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_YYPRODH5. "YYPRODH5

L_WA_INPUT_FIELD-SELNAME = C_PRODH5_LOW. "S_PRODH5-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_YYPRODH5. "YYPRODH5

L_WA_INPUT_FIELD-SELNAME = C_PRODH5_HIGH. "S_PRODH5-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_PRODH5-LOW IS INITIAL AND

S_PRODH5-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_YYPRODH5. "YYPRODH5

L_WA_INPUT_FIELD-SELNAME = C_PRODH5_LOW. "S_PRODH5-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Condition Deletion Indicator

IF ( NOT S_LOEVM-LOW IS INITIAL AND

NOT S_LOEVM-HIGH IS INITIAL ) OR

( S_LOEVM-LOW IS INITIAL AND

NOT S_LOEVM-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_LOEVM_KO. "LOEVM_KO

L_WA_INPUT_FIELD-SELNAME = C_LOEVM_LOW. "S_LOEVM-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_LOEVM_KO. "LOEVM_KO

L_WA_INPUT_FIELD-SELNAME = C_LOEVM_HIGH. "S_LOEVM-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_LOEVM-LOW IS INITIAL AND

S_LOEVM-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_LOEVM_KO. "LOEVM_KO

L_WA_INPUT_FIELD-SELNAME = C_LOEVM_LOW. "S_LOEVM-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Rebate Recipient

IF ( NOT S_BONEM-LOW IS INITIAL AND

NOT S_BONEM-HIGH IS INITIAL ) OR

( S_BONEM-LOW IS INITIAL AND

NOT S_BONEM-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_BONEM. "BONEM

L_WA_INPUT_FIELD-SELNAME = C_BONEM_LOW. "S_BONEM-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_BONEM. "BONEM

L_WA_INPUT_FIELD-SELNAME = C_BONEM_HIGH. "S_BONEM-HIGH'.

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_BONEM-LOW IS INITIAL AND

S_BONEM-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_BONEM. "BONEM

L_WA_INPUT_FIELD-SELNAME = C_BONEM_LOW. "S_BONEM-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Rebate Agreement Status

IF ( NOT S_BOSTA-LOW IS INITIAL AND

NOT S_BOSTA-HIGH IS INITIAL ) OR

( S_BOSTA-LOW IS INITIAL AND

NOT S_BOSTA-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = C_BOSTA. "BOSTA

L_WA_INPUT_FIELD-SELNAME = C_BOSTA_LOW. "S_BOSTA-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = C_BOSTA. "BOSTA

L_WA_INPUT_FIELD-SELNAME = C_BOSTA_HIGH. "S_BOSTA-HIGH

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_BOSTA-LOW IS INITIAL AND

S_BOSTA-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = C_BOSTA. "BOSTA

L_WA_INPUT_FIELD-SELNAME = C_BOSTA_LOW. "S_BOSTA-LOW

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Begin of MOD-001

\* Departure Country

IF ( NOT S_ALAND-LOW IS INITIAL AND

NOT S_ALAND-HIGH IS INITIAL ) OR

( S_ALAND-LOW IS INITIAL AND

NOT S_ALAND-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = 'ALAND'.

L_WA_INPUT_FIELD-SELNAME = 'S_ALAND-LOW'.

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = 'ALAND'.

L_WA_INPUT_FIELD-SELNAME = 'S_ALAND-HIGH'.

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_ALAND-LOW IS INITIAL AND

S_ALAND-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = 'ALAND'.

L_WA_INPUT_FIELD-SELNAME = 'S_ALAND-LOW'.

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* Rebate Agreement Type

IF ( NOT S_BOART-LOW IS INITIAL AND

NOT S_BOART-HIGH IS INITIAL ) OR

( S_BOART-LOW IS INITIAL AND

NOT S_BOART-HIGH IS INITIAL ).

L_WA_INPUT_FIELD-FIELDNAME = 'BOART'.

L_WA_INPUT_FIELD-SELNAME = 'S_BOART-LOW'.

L_WA_INPUT_FIELD-RELN = C_OPTION_GE. "GE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

L_WA_INPUT_FIELD-FIELDNAME = 'BOART'.

L_WA_INPUT_FIELD-SELNAME = 'S_BOART-HIGH'.

L_WA_INPUT_FIELD-RELN = C_OPTION_LE. "LE

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ELSEIF NOT S_BOART-LOW IS INITIAL AND

S_BOART-HIGH IS INITIAL.

L_WA_INPUT_FIELD-FIELDNAME = 'BOART'.

L_WA_INPUT_FIELD-SELNAME = 'S_BOART-LOW'.

L_WA_INPUT_FIELD-RELN = C_OPTION_EQ. "EQ

APPEND L_WA_INPUT_FIELD TO CH_I_INPUT_FIELD.

CLEAR L_WA_INPUT_FIELD.

ENDIF.

\* End of MOD-001

ENDMETHOD. "M_INPUT_FIELD

\*&---------------------------------------------------------------------\*

\*& METHOD m_get_cond_record

\*&---------------------------------------------------------------------\*

\* Retrieve the Condition Records from the respective Condition *

\* Tables

\*----------------------------------------------------------------------\*

METHOD M_GET_COND_RECORD.

FIELD-SYMBOLS: <FS_T682I> TYPE TY_T682I,

<FS_DD03L> TYPE TY_DD03L,

<FS_INPUT_FIELD> TYPE TY_INPUT_FIELD,

<FS_I_COND_TAB_DATA> TYPE STANDARD TABLE,

<FS_WA_COND_TAB_DATA> TYPE ANY,

<FS_FIELD> TYPE ANY.

\* Local internal table declaration

DATA: I_DD03L TYPE SORTED TABLE OF TY_DD03L

WITH NON-UNIQUE KEY TABNAME,

I_CLAUSE TYPE STANDARD TABLE OF TY_CLAUSE.

\* Internal table of data

DATA: I_COND_TAB_DATA TYPE REF TO DATA.

\* Work area declarations

DATA: L_WA_CLAUSE TYPE TY_CLAUSE,

L_WA_CONDTAB_DATA TYPE TY_CONDTAB_DATA.

\* Local variable declaration

DATA: L_CNT_FIRST TYPE SYTABIX, "Counter for where clause

L_TABNAME TYPE TABNAME. "Table name

\* For each table the primary key fields needs to be retrieved

\* from the database table DD03L

SELECT TABNAME "Table Name

FIELDNAME "Field Name

FROM DD03L "Table Fields

INTO TABLE I_DD03L

FOR ALL ENTRIES IN IM_I_T682I

WHERE TABNAME = IM_I_T682I-TABNAME.

IF NOT SY-SUBRC IS INITIAL.

\* Message

MESSAGE I030.

LEAVE LIST-PROCESSING.

ENDIF.

\* For each table, the fields will be determined. Each field then

\* will be checked whether it exists in the selection screen.

LOOP AT IM_I_T682I ASSIGNING <FS_T682I>.

\* Initialize the counter to count the number of where clause.

CLEAR : L_CNT_FIRST.

MOVE <FS_T682I>-TABNAME TO L_TABNAME.

\* Creating the Internal table with the structure of the

\* current table.

CREATE DATA I_COND_TAB_DATA

TYPE STANDARD TABLE OF (L_TABNAME).

ASSIGN I_COND_TAB_DATA->\* TO <FS_I_COND_TAB_DATA>.

LOOP AT I_DD03L ASSIGNING <FS_DD03L>

WHERE TABNAME =

<FS_T682I>-TABNAME.

\* If the field in the database table is there in the selection

\* screen then that field could be in the where clause.

LOOP AT I_INPUT_FIELD ASSIGNING <FS_INPUT_FIELD>

WHERE FIELDNAME =

<FS_DD03L>-FIELDNAME.

IF L_CNT_FIRST GE 1.

\* From the second and subsequent where clause, the following

\* logic will be implemented

CONCATENATE C_AND "AND

<FS_INPUT_FIELD>-FIELDNAME "Field name

<FS_INPUT_FIELD>-RELN "Relation

<FS_INPUT_FIELD>-SELNAME "Sel screen field

INTO L_WA_CLAUSE SEPARATED BY SPACE.

APPEND L_WA_CLAUSE TO I_CLAUSE.

CLEAR L_WA_CLAUSE.

ELSE.

\* For the first where clause of the table the following

\* logic will be implemented

CONCATENATE SPACE

<FS_INPUT_FIELD>-FIELDNAME

<FS_INPUT_FIELD>-RELN

<FS_INPUT_FIELD>-SELNAME

INTO L_WA_CLAUSE SEPARATED BY SPACE.

APPEND L_WA_CLAUSE TO I_CLAUSE.

CLEAR L_WA_CLAUSE.

ENDIF.

\* Increment the value of the counter

ADD 1 TO L_CNT_FIRST.

ENDLOOP.

ENDLOOP.

\* If the where clause is initial, then the selection from the

\* tables would not be done.

\* This is done do prevent the huge data volume that may be retrived.

\* Due to the following statement, no retrieval will be made from the

\* database where at least one filtering condition is not there in

\* the selection screen.

IF I_CLAUSE IS INITIAL.

CONTINUE.

ENDIF.

\* Retrieve all the fields of the particular database table

\* into the internal table that is formed for that particular case

\* based on the where condition of that particular case.

\* Each loop pass will retrieve from a distinct database table.

SELECT *

FROM (<FS_DD03L>-TABNAME)

INTO TABLE <FS_I_COND_TAB_DATA>

WHERE (I_CLAUSE).

IF SY-SUBRC IS INITIAL.

\* If data is found in the database table then the desired fields

\* if found will be taken in one internal table.

LOOP AT <FS_I_COND_TAB_DATA> ASSIGNING

<FS_WA_COND_TAB_DATA>.

\* Usage

ASSIGN COMPONENT C_KVEWE OF STRUCTURE "KVEWE

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-KVEWE = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Application

ASSIGN COMPONENT C_KAPPL OF STRUCTURE "KAPPL

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-KAPPL = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Condition Type

ASSIGN COMPONENT C_KSCHL OF STRUCTURE "KSCHL

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-KSCHL = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Sold-to Party

ASSIGN COMPONENT C_KUNNR OF STRUCTURE "KUNNR

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-KUNNR = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Customer Hierarchy

ASSIGN COMPONENT C_HIENR OF STRUCTURE "HIENR

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-HIENR = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Price Group

ASSIGN COMPONENT C_KONDA OF STRUCTURE "KONDA

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-KONDA = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Material

ASSIGN COMPONENT C_MATNR OF STRUCTURE "MATNR

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-MATNR = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Material Group 1

ASSIGN COMPONENT C_MVGR1 OF STRUCTURE "MVGR1

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-MVGR1 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* ProdH1

ASSIGN COMPONENT C_PRODH1 OF STRUCTURE "PRODH1

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-PRODH1 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* ProdH2

ASSIGN COMPONENT C_PRODH2 OF STRUCTURE "PRODH2

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-PRODH2 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* ProdH3

ASSIGN COMPONENT C_PRODH3 OF STRUCTURE "PRODH3

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-PRODH3 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* ProdH4

ASSIGN COMPONENT C_YYPRODH4 OF STRUCTURE "YYPRODH4

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-YYPRODH4 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* ProdH5

ASSIGN COMPONENT C_YYPRODH5 OF STRUCTURE "YYPRODH5

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-YYPRODH5 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Condition Record Number

ASSIGN COMPONENT C_KNUMH OF STRUCTURE "KNUMH

<FS_WA_COND_TAB_DATA> TO <FS_FIELD>

.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-KNUMH = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Sales Organization

ASSIGN COMPONENT C_VKORG OF STRUCTURE "VKORG

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-VKORG = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Distribution Channel

ASSIGN COMPONENT C_VTWEG OF STRUCTURE "VTWEG

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-VTWEG = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Campaign ID

ASSIGN COMPONENT C_CMPGN_ID OF STRUCTURE "CMPGN_ID

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-CMPGN_ID = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Campaign ID (External)

\*-->Begin of Biswarup TPR18842 25.04.2005 comment

\* ASSIGN COMPONENT c_external_id OF STRUCTURE "EXTERNAL_ID

\* <fs_wa_cond_tab_data> TO <fs_field>.

\*

\* IF <fs_field> IS ASSIGNED.

\* l_wa_condtab_data-external_id = <fs_field>.

\* UNASSIGN <fs_field>.

\* ENDIF.

\*<--End of Biswarup TPR18842 25.04.2005 comment

\*-->Begin of Biswarup TPR18842 25.04.2005

READ TABLE I_CGPL_PROJECT INTO REC_CGPL_PROJECT

WITH KEY BWIDENTIFIER = L_WA_CONDTAB_DATA-CMPGN_ID

BINARY SEARCH.

IF SY-SUBRC = 0.

L_WA_CONDTAB_DATA-EXTERNAL_ID

= REC_CGPL_PROJECT-EXTERNAL_ID.

ENDIF.

\*<--End of Biswarup TPR18842 25.04.2005

\* Condition Valid On

ASSIGN COMPONENT C_DATAB OF STRUCTURE "DATAB

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-DATAB = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Condition Valid To

ASSIGN COMPONENT C_DATBI OF STRUCTURE "DATBI

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-DATBI = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Begin of MOD-001

\* Departure Country

ASSIGN COMPONENT 'ALAND' OF STRUCTURE

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-ALAND = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Destination Country

ASSIGN COMPONENT 'LLAND' OF STRUCTURE

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-LLAND = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Tax classification 1 for customer

ASSIGN COMPONENT 'TAXK1' OF STRUCTURE

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-TAXK1 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Tax classification material

ASSIGN COMPONENT 'TAXM1' OF STRUCTURE

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-TAXM1 = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\* Tax on sales/purchases code

ASSIGN COMPONENT 'MWSKZ' OF STRUCTURE

<FS_WA_COND_TAB_DATA> TO

<FS_FIELD>.

IF <FS_FIELD> IS ASSIGNED.

L_WA_CONDTAB_DATA-MWSKZ = <FS_FIELD>.

UNASSIGN <FS_FIELD>.

ENDIF.

\*\* Rebate Agreement Type

\* ASSIGN COMPONENT 'BOART' OF STRUCTURE

\* <fs_wa_cond_tab_data> TO <fs_field>

.

\*

\* IF <fs_field> IS ASSIGNED.

\* l_wa_condtab_data-datbi = <fs_field>.

\* UNASSIGN <fs_field>.

\* ENDIF.

\* End of MOD-001

APPEND L_WA_CONDTAB_DATA TO CH_I_CONDTAB_DATA.

CLEAR L_WA_CONDTAB_DATA.

ENDLOOP.

ENDIF.

REFRESH I_CLAUSE.

ENDLOOP.

\* Retain those records where the Application is

\* related only to Sales & Distribution

DELETE CH_I_CONDTAB_DATA WHERE KAPPL <> C_KAPPL_V.

IF NOT P_CDATAB IS INITIAL.

DELETE CH_I_CONDTAB_DATA WHERE DATAB < P_CDATAB.

ENDIF.

IF NOT P_CDATBI IS INITIAL.

DELETE CH_I_CONDTAB_DATA WHERE DATBI > P_CDATBI.

ENDIF.

\* If the internal table is empty then no data has been selected

\* for the given set of selection criteria.

IF CH_I_CONDTAB_DATA IS INITIAL.

MESSAGE I030.

LEAVE LIST-PROCESSING.

ENDIF.

ENDMETHOD. "M_GET_COND_RECORD

\*&---------------------------------------------------------------------\*

\*& METHOD m_get_cond_data

\*&---------------------------------------------------------------------\*

\* Retrieve the Condition data from the Condition Header KONH *

\* and the Condition Item KONP. *

\*----------------------------------------------------------------------\*

METHOD M_GET_COND_DATA.

\* Local internal table for free goods conditions

DATA: L_I_KONDN TYPE STANDARD TABLE OF TY_KONDN.

\* Work area declarations .

DATA: L_WA_CONDTAB_DATA TYPE TY_CONDTAB_DATA,

L_WA_COND_KNUMH TYPE COND_KNUMH.

\* Accumulate all the Condition Records (KNUMH) into one

\* Internal table.

LOOP AT IM_I_CONDTAB_DATA INTO L_WA_CONDTAB_DATA.

L_WA_COND_KNUMH-KNUMH = L_WA_CONDTAB_DATA-KNUMH.

APPEND L_WA_COND_KNUMH TO CH_I_KNUMH.

CLEAR L_WA_COND_KNUMH.

ENDLOOP.

\**********************************************************************\*

\* Retrieval of Condition and related scales data from the SAP *

\* database tables for General Pricing and Rebate. *

\**********************************************************************\*

\* Retrieve the Condition detail from the database tables

\* KONH & KONP only for General Pricing and Free Goods

IF P_PRICE = C_YES OR P_REBATE = C_YES.

CALL FUNCTION 'SELECT_PRICES_DETAILS'

TABLES

T_KNUMH = CH_I_KNUMH "Table containing Condition Records

T_KONH = CH_I_KONHDB "Table containing Condition Header

T_KONP = CH_I_KONPDB "Table containing Condition Detail

T_KONM = CH_I_KONM "Table containing Scales

T_KONW = CH_I_KONW. "Table containing Scales

ENDIF.

\**********************************************************************\*

\* Retrieval of Condition and related scales data from the SAP *

\* database tables for Free Goods. *

\**********************************************************************\*

IF P_FREEGD = C_YES.

\* For the detail of Free Goods condition retrieve data

\* from the database table KONDN

SELECT KNUMH "Condition record number

KNRMM "Minimum quantity

KNRNM "Free goods quantity

KNRME "Quantity unit for minimum/free quantity

KNRZM "Additional quantity for free goods

KNREZ "Quantity unit for free good additnl qty

KNRRR "Calculation type for free goods qty

KNRDD "Free goods category

LSTANR "Free goods delivery control

KNRMAT "Scale basis indicator

FROM KONDN "Conditions: Free goods - Data section

INTO TABLE CH_I_KONDN

FOR ALL ENTRIES IN CH_I_KNUMH

WHERE KNUMH = CH_I_KNUMH-KNUMH.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE I064.

ELSE.

ENDIF.

ENDIF.

ENDMETHOD. "M_GET_COND_DATA

\*&---------------------------------------------------------------------\*

\*& METHOD m_get_crm_bwidentifier

\*&---------------------------------------------------------------------\*

\* Retrieve the BWIDENTIFIER from the table CGPL_PROJECT in CRM *

\* *

\*----------------------------------------------------------------------\*

METHOD M_GET_CRM_BWIDENTIFIER.

FIELD-SYMBOLS: <L_FS_CGPL_PROJECT> TYPE TY_CGPL_PROJECT.

\* Local internal table declaration

DATA: L_I_CGPL_PROJECT TYPE STANDARD TABLE OF TY_CGPL_PROJECT.

\* Variable for storing RFC destination

DATA: L_RFCDEST TYPE RFCDEST.

DATA: L_REC_SCAMPID LIKE LINE OF S_CAMPID.

DATA: L_V_LINES TYPE I.

DATA: BEGIN OF REC_SELOPT,

SIGN TYPE TVARV_SIGN,

OPTION TYPE TVARV_OPTI,

LOW TYPE TVARV_VAL,

HIGH TYPE TVARV_VAL,

END OF REC_SELOPT.

\* CALL FUNCTION '/GLB/RGT_RFC_DESTINATION'

\* EXPORTING

\* destsysttype = c_sys_type "C

\* IMPORTING

\* rfcdest = l_rfcdest

\* EXCEPTIONS

\* no_destination_found = 1

\* own_logical_system_not_found = 2

\* OTHERS = 3.

IF SY-SUBRC IS INITIAL.

\* If the CRM system entered by the user does not match with the

\* CRM system that has been determined then RFC will be done

\* to the determined CRM destination following an information message.

IF NOT P_CRMSYS IS INITIAL.

IF L_RFCDEST <> P_CRMSYS.

MESSAGE I076 WITH L_RFCDEST.

ENDIF.

ENDIF.

\*-->Begin of TPR18842 Biswarup 20.04.2005

DATA:

L_I_EXTERNAL_ID TYPE RSPARAMS_TT,

L_WA_EXTERNAL_ID TYPE RSPARAMS,

L_WA_XCAMID LIKE LINE OF S_XCAMID.

REFRESH L_I_EXTERNAL_ID.

LOOP AT S_XCAMID INTO L_WA_XCAMID.

CLEAR L_WA_EXTERNAL_ID.

L_WA_EXTERNAL_ID-SIGN = L_WA_XCAMID-SIGN.

L_WA_EXTERNAL_ID-OPTION = L_WA_XCAMID-OPTION.

L_WA_EXTERNAL_ID-LOW = L_WA_XCAMID-LOW.

L_WA_EXTERNAL_ID-HIGH = L_WA_XCAMID-HIGH.

APPEND L_WA_EXTERNAL_ID TO L_I_EXTERNAL_ID.

ENDLOOP.

\*<--End of TPR18842 Biswarup 20.04.2005

CALL FUNCTION '/EUR/CEUCS_GET_CMPGN_ID' DESTINATION L_RFCDEST

EXPORTING

\*-->Begin of TPR18842 Biswarup 20.04.2005 comment

\* im_i_external_id = s_xcamid

\*<--End of TPR18842 Biswarup 20.04.2005 comment

\*-->Begin of TPR18842 Biswarup 20.04.2005

IM_I_EXTERNAL_ID = L_I_EXTERNAL_ID

\*<--End of TPR18842 Biswarup 20.04.2005

IMPORTING

EX_I_CGPL_PROJECT = L_I_CGPL_PROJECT

EXCEPTIONS

NO_DATA_RETRIEVED = 1

COMMUNICATION_FAILURE = 2 MESSAGE V_MESSAGE

SYSTEM_FAILURE = 3 MESSAGE V_MESSAGE.

\*-->Begin of Biswarup TPR18842 25.04.2005

REFRESH I_CGPL_PROJECT.

I_CGPL_PROJECT = L_I_CGPL_PROJECT.

SORT I_CGPL_PROJECT BY BWIDENTIFIER.

\*<--End of Biswarup TPR18842 25.04.2005

IF SY-SUBRC IS INITIAL.

LOOP AT L_I_CGPL_PROJECT ASSIGNING <L_FS_CGPL_PROJECT>.

REC_SELOPT-SIGN = C_SIGN_I. "I

REC_SELOPT-OPTION = C_OPTION_EQ. "EQ

REC_SELOPT-LOW = <L_FS_CGPL_PROJECT>-BWIDENTIFIER.

APPEND REC_SELOPT TO S_CAMPID.

CLEAR REC_SELOPT.

ENDLOOP.

\*-->Begin of TPR18842 Biswarup 20.04.2005

READ TABLE S_CAMPID INTO L_REC_SCAMPID INDEX 1.

S_CAMPID = L_REC_SCAMPID.

DESCRIBE TABLE S_CAMPID LINES L_V_LINES.

IF L_V_LINES > 1.

READ TABLE S_CAMPID INTO L_REC_SCAMPID INDEX L_V_LINES.

S_CAMPID-HIGH = L_REC_SCAMPID-LOW.

ENDIF.

\*<--End of TPR18842 Biswarup 20.04.2005

ENDIF.

ENDIF.

ENDMETHOD. "M_GET_CRM_BWIDENTIFIER

\*&---------------------------------------------------------------------\*

\*& METHOD m_get_agreement_data

\*&---------------------------------------------------------------------\*

\* Retrieve the Agreement data from the database table KONA *

\* *

\*----------------------------------------------------------------------\*

METHOD M_GET_AGREEMENT_DATA.

\* Local internal table of Condition details

DATA: L_I_KONPDB TYPE STANDARD TABLE OF KONPDB.

\* Retrieve the Rebate data only for the rebate conditions

IF NOT P_REBATE = C_YES.

EXIT.

ENDIF.

L_I_KONPDB = IM_I_KONPDB.

DELETE L_I_KONPDB WHERE KNUMA_BO = SPACE.

IF L_I_KONPDB IS INITIAL.

MESSAGE I065.

EXIT.

ENDIF.

\* Retrieve Agreement related data from the SAP database table KONA

SELECT KNUMA "Agreement

VKBUR "Sales office

VKGRP "Sales group

BOART "Agreement type

ERNAM "Name of Person who Created the Object

ERDAT "Date on which the record was created

ERZET "Entry time

AENAM "Name of person who changed object

AEDAT "Date of Last Change

AEZET "Time last change was made

BONEM "Rebate recipient

WAERS "Currency Key

ABREX "External description for agreement

ABSPZ "Scope of verification level of rebate

BOSTA "Status of the agreement

DATAB "Agreement valid-from date

DATBI "Agreement valid-to date

KOBOG "Condition type/table group for agr

BOTEXT "Description of agreement

ZLSCH "Payment method

BON_ENH_VAKEY "Indicates Enhand Reb Sett

BON_ENH_INDIRECT "Ind for Indir Settlmnt

FROM KONA "Rebate Agreements

INTO TABLE CH_I_KONA

FOR ALL ENTRIES IN L_I_KONPDB

WHERE KNUMA = L_I_KONPDB-KNUMA_BO

AND BONEM IN S_BONEM

AND BOSTA IN S_BOSTA.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE I065.

ELSE.

IF NOT P_RDATAB IS INITIAL.

DELETE CH_I_KONA WHERE DATAB < P_RDATAB.

ENDIF.

IF NOT CH_I_KONA IS INITIAL.

IF NOT P_RDATBI IS INITIAL.

DELETE CH_I_KONA WHERE DATBI > P_RDATBI.

ENDIF.

ENDIF.

IF NOT CH_I_KONA IS INITIAL.

CALL METHOD M_GET_REBATE_ACCRUAL_VALUES.

ENDIF.

ENDIF.

ENDMETHOD. "M_GET_AGREEMENT_DATA

\*&---------------------------------------------------------------------\*

\*& METHOD m_get_rebate_accrual_values

\*&---------------------------------------------------------------------\*

\* Retrieve the Rebate Accrusl Values

\*----------------------------------------------------------------------\*

METHOD M_GET_REBATE_ACCRUAL_VALUES.

FIELD-SYMBOLS: <L_FS_KONA> TYPE TY_KONA,

<L_FS_T6B1> TYPE T6B1,

<L_FS_KONP> TYPE KONPDB,

<L_FS_COND_ITM> TYPE KONPDB.

DATA: L_I_T6B1 TYPE STANDARD TABLE OF T6B1,

L_I_COND_ITM TYPE STANDARD TABLE OF KONPDB,

L_I_COND_SCL TYPE STANDARD TABLE OF CONDSCALE,

L_I_COND_KEY TYPE STANDARD TABLE OF VAKEVB.

DATA: L_WA_KONA_TAB TYPE KONA,

L_WA_T6B1 TYPE T6B1.

L_I_COND_ITM = I_KONPDB.

SELECT *

FROM T6B1

INTO TABLE L_I_T6B1

FOR ALL ENTRIES IN I_KONA

WHERE BOART = I_KONA-BOART.

IF SY-SUBRC IS INITIAL.

SORT L_I_T6B1 BY BOART.

LOOP AT I_KONA ASSIGNING <L_FS_KONA>.

\**********************************\*

\* Populate the work area for KONA *

\**********************************\*

\* Agreement

L_WA_KONA_TAB-KNUMA = <L_FS_KONA>-KNUMA.

\* Sales office

L_WA_KONA_TAB-VKBUR = <L_FS_KONA>-VKBUR.

\* Sales group

L_WA_KONA_TAB-VKGRP = <L_FS_KONA>-VKGRP.

\* Agreement type

L_WA_KONA_TAB-BOART = <L_FS_KONA>-BOART.

\* Name of Person who Created the Object

L_WA_KONA_TAB-ERNAM = <L_FS_KONA>-ERNAM.

\* Date on which the record was created

L_WA_KONA_TAB-ERDAT = <L_FS_KONA>-ERDAT.

\* Entry time

L_WA_KONA_TAB-ERZET = <L_FS_KONA>-ERZET.

\* Name of person who changed object

L_WA_KONA_TAB-AENAM = <L_FS_KONA>-AENAM.

\* Date of Last Change

L_WA_KONA_TAB-AEDAT = <L_FS_KONA>-AEDAT.

\* Time last change was made

L_WA_KONA_TAB-AEZET = <L_FS_KONA>-AEZET.

\* Rebate recipient

L_WA_KONA_TAB-BONEM = <L_FS_KONA>-BONEM.

\* Currency Key

L_WA_KONA_TAB-WAERS = <L_FS_KONA>-WAERS.

\* External description for agreement

L_WA_KONA_TAB-ABREX = <L_FS_KONA>-ABREX.

\* Scope of verification level of rebate

L_WA_KONA_TAB-ABSPZ = <L_FS_KONA>-ABSPZ.

\* Status of the agreement

L_WA_KONA_TAB-BOSTA = <L_FS_KONA>-BOSTA.

\* Agreement valid-from date

L_WA_KONA_TAB-DATAB = <L_FS_KONA>-DATAB.

\* Agreement valid-to date

L_WA_KONA_TAB-DATBI = <L_FS_KONA>-DATBI.

\* Condition type/table group for agr

L_WA_KONA_TAB-KOBOG = <L_FS_KONA>-KOBOG.

\* Description of agreement

L_WA_KONA_TAB-BOTEXT = <L_FS_KONA>-BOTEXT.

\* Payment method

L_WA_KONA_TAB-ZLSCH = <L_FS_KONA>-ZLSCH.

\* Indicates Enhand Reb Sett

L_WA_KONA_TAB-BON_ENH_VAKEY = <L_FS_KONA>-BON_ENH_VAKEY.

\* Ind for Indir Settlmnt

L_WA_KONA_TAB-BON_ENH_INDIRECT =

<L_FS_KONA>-BON_ENH_INDIRECT.

READ TABLE L_I_T6B1 INTO L_WA_T6B1

WITH KEY BOART = <L_FS_KONA>-BOART

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

CALL FUNCTION 'SD_BONUS_KONPD_FILL'

EXPORTING

REBATE_AGREEMENT = L_WA_KONA_TAB

REBATE_AGREEMENT_TYPE = L_WA_T6B1

PERIOD_DATAB = L_WA_KONA_TAB-DATAB

PERIOD_DATBI = L_WA_KONA_TAB-DATBI

TABLES

COND_ITEM = L_I_COND_ITM

COND_SCALES = L_I_COND_SCL

COND_KEYS = L_I_COND_KEY

EXCEPTIONS

INVALID_BONUS_TYPE = 1

OTHERS = 2.

IF SY-SUBRC IS INITIAL.

SORT L_I_COND_ITM BY KNUMH KOPOS.

LOOP AT I_KONPDB ASSIGNING <L_FS_KONP>.

READ TABLE L_I_COND_ITM ASSIGNING <L_FS_COND_ITM>

WITH KEY KNUMH = <L_FS_KONP>-KNUMH

KOPOS = <L_FS_KONP>-KOPOS

KNUMA_BO =

<L_FS_KONP>-KNUMA_BO

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Rebate Accruals

<L_FS_KONP>-RUWRT = <L_FS_COND_ITM>-RUWRT.

\* Rebate Accruals Reversed

<L_FS_KONP>-RRWRT = <L_FS_COND_ITM>-RRWRT.

\* Rebate Payments

<L_FS_KONP>-AUWRT = <L_FS_COND_ITM>-AUWRT.

\* Rebate: Maximum payable amount

<L_FS_KONP>-MPWRT = <L_FS_COND_ITM>-MPWRT.

\* Rebate: Amount to be paid

<L_FS_KONP>-BZWRT = <L_FS_COND_ITM>-BZWRT.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

REFRESH: L_I_COND_ITM,

L_I_COND_SCL,

L_I_COND_KEY.

CLEAR: L_WA_KONA_TAB,

L_WA_T6B1.

ENDLOOP.

ENDIF.

ENDMETHOD. "m_get_rebate_accrual_values

\*&---------------------------------------------------------------------\*

\*& METHOD m_get_texts

\*&---------------------------------------------------------------------\*

\* Retrieve the descriptive texts

\*----------------------------------------------------------------------\*

METHOD M_GET_TEXTS.

FIELD-SYMBOLS: <L_FS_CONDTAB_DATA> TYPE TY_CONDTAB_DATA,

<L_FS_KONDNS> TYPE TY_KONDNS.

\* Declaration of local internal tables for temporary use

DATA: L_I_CONDTAB_DATA TYPE STANDARD TABLE OF TY_CONDTAB_DATA,

L_I_KONDNS TYPE STANDARD TABLE OF TY_KONDNS,

L_I_KONA TYPE STANDARD TABLE OF TY_KONA,

\* Internal table to collect all condition & free goods material

L_I_MATNR TYPE STANDARD TABLE OF TY_MATNR,

\* Internal table to collect all Customer & Customer Hierarchy

L_I_KUNNR TYPE STANDARD TABLE OF TY_KUNNR.

\* Work area for the internal table for Material

DATA: L_WA_MATNR TYPE TY_MATNR,

\* Work area for the internal table of Customer

L_WA_KUNNR TYPE TY_KUNNR.

\* Retrieve the Condition Type descriptions

L_I_CONDTAB_DATA = I_CONDTAB_DATA.

SORT L_I_CONDTAB_DATA BY KSCHL.

DELETE ADJACENT DUPLICATES FROM L_I_CONDTAB_DATA COMPARING KSCHL.

SELECT KSCHL

VTEXT

FROM T685T

INTO TABLE I_T685T

FOR ALL ENTRIES IN L_I_CONDTAB_DATA

WHERE SPRAS = SY-LANGU

AND KSCHL = L_I_CONDTAB_DATA-KSCHL.

IF NOT SY-SUBRC IS INITIAL.

SELECT KSCHL

VTEXT

FROM T685T

INTO TABLE I_T685T

FOR ALL ENTRIES IN L_I_CONDTAB_DATA

WHERE SPRAS = C_ENG "E

AND KSCHL = L_I_CONDTAB_DATA-KSCHL.

ENDIF.

\* Retrieve the Material description

REFRESH L_I_CONDTAB_DATA.

L_I_CONDTAB_DATA = I_CONDTAB_DATA.

L_I_KONDNS = I_KONDNS.

SORT L_I_CONDTAB_DATA BY MATNR.

SORT L_I_KONDNS BY KNRMAT.

DELETE ADJACENT DUPLICATES FROM L_I_CONDTAB_DATA COMPARING MATNR.

DELETE ADJACENT DUPLICATES FROM L_I_KONDNS COMPARING KNRMAT.

LOOP AT L_I_CONDTAB_DATA ASSIGNING <L_FS_CONDTAB_DATA>.

L_WA_MATNR-MATNR = <L_FS_CONDTAB_DATA>-MATNR.

APPEND L_WA_MATNR TO L_I_MATNR.

CLEAR L_WA_MATNR.

ENDLOOP.

LOOP AT L_I_KONDNS ASSIGNING <L_FS_KONDNS>.

L_WA_MATNR-MATNR = <L_FS_KONDNS>-KNRMAT.

APPEND L_WA_MATNR TO L_I_MATNR.

CLEAR L_WA_MATNR.

ENDLOOP.

SORT L_I_MATNR BY MATNR.

DELETE ADJACENT DUPLICATES FROM L_I_MATNR COMPARING MATNR.

SELECT MATNR

MAKTX

FROM MAKT

INTO TABLE I_MAKT

FOR ALL ENTRIES IN L_I_MATNR

WHERE MATNR = L_I_MATNR-MATNR

AND SPRAS = SY-LANGU.

IF NOT SY-SUBRC IS INITIAL.

SELECT MATNR

MAKTX

FROM MAKT

INTO TABLE I_MAKT

FOR ALL ENTRIES IN L_I_MATNR

WHERE MATNR = L_I_MATNR-MATNR

AND SPRAS = C_ENG. "E

ENDIF.

\* Retrieve the Name of the Customer

L_I_CONDTAB_DATA = I_CONDTAB_DATA.

SORT L_I_CONDTAB_DATA BY KUNNR.

DELETE ADJACENT DUPLICATES FROM L_I_CONDTAB_DATA COMPARING KUNNR.

LOOP AT L_I_CONDTAB_DATA ASSIGNING <L_FS_CONDTAB_DATA>.

L_WA_KUNNR-KUNNR = <L_FS_CONDTAB_DATA>-KUNNR.

APPEND L_WA_KUNNR TO L_I_KUNNR.

CLEAR L_WA_KUNNR.

ENDLOOP.

REFRESH L_I_CONDTAB_DATA.

L_I_CONDTAB_DATA = I_CONDTAB_DATA.

SORT L_I_CONDTAB_DATA BY HIENR.

DELETE ADJACENT DUPLICATES FROM L_I_CONDTAB_DATA COMPARING HIENR.

LOOP AT L_I_CONDTAB_DATA ASSIGNING <L_FS_CONDTAB_DATA>.

L_WA_KUNNR-KUNNR = <L_FS_CONDTAB_DATA>-HIENR.

APPEND L_WA_KUNNR TO L_I_KUNNR.

CLEAR L_WA_KUNNR.

ENDLOOP.

SORT L_I_KUNNR BY KUNNR.

DELETE ADJACENT DUPLICATES FROM L_I_KUNNR COMPARING KUNNR.

SELECT KUNNR

NAME1

FROM KNA1

INTO TABLE I_KNA1

FOR ALL ENTRIES IN L_I_KUNNR

WHERE KUNNR = L_I_KUNNR-KUNNR.

\* Retrieve the Price Group description

REFRESH L_I_CONDTAB_DATA.

L_I_CONDTAB_DATA = I_CONDTAB_DATA.

SORT L_I_CONDTAB_DATA BY KONDA.

DELETE ADJACENT DUPLICATES FROM L_I_CONDTAB_DATA COMPARING KONDA.

SELECT KONDA

VTEXT

FROM T188T

INTO TABLE I_T188T

FOR ALL ENTRIES IN L_I_CONDTAB_DATA

WHERE SPRAS = SY-LANGU

AND KONDA = L_I_CONDTAB_DATA-KONDA.

IF NOT SY-SUBRC IS INITIAL.

SELECT KONDA

VTEXT

FROM T188T

INTO TABLE I_T188T

FOR ALL ENTRIES IN L_I_CONDTAB_DATA

WHERE SPRAS = C_ENG "E

AND KONDA = L_I_CONDTAB_DATA-KONDA.

ENDIF.

\* Retrieve the Material Group 1 description

REFRESH L_I_CONDTAB_DATA.

L_I_CONDTAB_DATA = I_CONDTAB_DATA.

SORT L_I_CONDTAB_DATA BY MVGR1.

DELETE ADJACENT DUPLICATES FROM L_I_CONDTAB_DATA COMPARING MVGR1.

SELECT MVGR1

BEZEI

FROM TVM1T

INTO TABLE I_TVM1T

FOR ALL ENTRIES IN L_I_CONDTAB_DATA

WHERE SPRAS = SY-LANGU

AND MVGR1 = L_I_CONDTAB_DATA-MVGR1.

IF NOT SY-SUBRC IS INITIAL.

SELECT MVGR1

BEZEI

FROM TVM1T

INTO TABLE I_TVM1T

FOR ALL ENTRIES IN L_I_CONDTAB_DATA

WHERE SPRAS = C_ENG "E

AND MVGR1 = L_I_CONDTAB_DATA-MVGR1.

ENDIF.

\* Retrieve the Rebate Agreement Type description

IF NOT I_KONA IS INITIAL.

L_I_KONA = I_KONA.

SORT L_I_KONA BY BOART.

DELETE ADJACENT DUPLICATES FROM L_I_KONA COMPARING BOART.

SELECT BOART "Agreement type

VTEXT "Description

FROM T6B1T

INTO TABLE I_T6B1T

FOR ALL ENTRIES IN L_I_KONA

WHERE SPRAS = SY-LANGU

AND BOART = L_I_KONA-BOART.

IF NOT SY-SUBRC IS INITIAL.

SELECT BOART "Agreement type

VTEXT "Description

FROM T6B1T

INTO TABLE I_T6B1T

FOR ALL ENTRIES IN L_I_KONA

WHERE SPRAS = C_ENG "E

AND BOART = L_I_KONA-BOART.

ENDIF.

ENDIF.

\* Free goods: Text output for exclusive or inclusive

SELECT VALPOS "Domain value key

DDTEXT "Short text for fixed values

FROM DD07T

INTO TABLE I_DD07T

WHERE DOMNAME = C_KNRDD "KNRDD

AND DDLANGUAGE = SY-LANGU.

IF NOT SY-SUBRC IS INITIAL.

SELECT VALPOS "Domain value key

DDTEXT "Short text for fixed values

FROM DD07T

INTO TABLE I_DD07T

WHERE DOMNAME = C_KNRDD "KNRDD

AND DDLANGUAGE = C_ENG. "E

ENDIF.

ENDMETHOD. "M_GET_TEXTS.

\*&---------------------------------------------------------------------\*

\*& METHOD m_process_data

\*&---------------------------------------------------------------------\*

\* Process the retrieved data to build the final Internal Table

\*----------------------------------------------------------------------\*

METHOD M_PROCESS_DATA.

FIELD-SYMBOLS: <L_FS_KNUMH> TYPE COND_KNUMH,

<L_FS_KONPDB> TYPE KONPDB,

<L_FS_KONHDB> TYPE KONHDB,

<L_FS_CONDTAB_DATA> TYPE TY_CONDTAB_DATA,

<L_FS_KONA> TYPE TY_KONA,

<L_FS_KONDN> TYPE TY_KONDN,

<L_FS_T685T> TYPE TY_T685T,

<L_FS_MAKT> TYPE TY_MAKT,

<L_FS_KNA1> TYPE TY_KNA1,

<L_FS_T188T> TYPE TY_T188T,

<L_FS_TVM1T> TYPE TY_TVM1T,

<L_FS_KONM> TYPE COND_KONM,

<L_FS_T6B1T> TYPE TY_T6B1T,

<L_FS_KONDNS> TYPE TY_KONDNS,

<L_FS_DD07T> TYPE TY_DD07T.

\* Work area of the final internal table

DATA: L_WA_CONDTN_REP TYPE TY_CONDTN_REP.

\* Counter for loop passes

DATA: L_CNT TYPE SYTABIX.

\* Get the descriptive texts of the desired fields

CALL METHOD M_GET_TEXTS.

SORT I_CONDTAB_DATA BY KNUMH.

SORT I_KONPDB BY KNUMH.

SORT I_KONHDB BY KNUMH.

SORT I_KONM BY KNUMH.

SORT I_KONW BY KNUMH.

LOOP AT I_KNUMH ASSIGNING <L_FS_KNUMH>.

\* General Condition data

READ TABLE I_CONDTAB_DATA ASSIGNING <L_FS_CONDTAB_DATA>

WITH KEY KNUMH = <L_FS_KNUMH>-KNUMH

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Condition Type

L_WA_CONDTN_REP-KSCHL = <L_FS_CONDTAB_DATA>-KSCHL.

\* Sold To Number

L_WA_CONDTN_REP-KUNNR = <L_FS_CONDTAB_DATA>-KUNNR.

\* Customer Hierarchy Number

L_WA_CONDTN_REP-HIENR = <L_FS_CONDTAB_DATA>-HIENR.

\* Price Group Name

L_WA_CONDTN_REP-KONDA = <L_FS_CONDTAB_DATA>-KONDA.

\* Material Number

L_WA_CONDTN_REP-MATNR = <L_FS_CONDTAB_DATA>-MATNR.

\* Material Group 1

L_WA_CONDTN_REP-MVGR1 = <L_FS_CONDTAB_DATA>-MVGR1.

\* ProdH 1 - Business

L_WA_CONDTN_REP-PRODH1 = <L_FS_CONDTAB_DATA>-PRODH1.

\* ProdH 2 â€" Business ID

L_WA_CONDTN_REP-PRODH2 = <L_FS_CONDTAB_DATA>-PRODH2.

\* ProdH 3 - Category

L_WA_CONDTN_REP-PRODH3 = <L_FS_CONDTAB_DATA>-PRODH3.

\* ProdH 4 â€" Sub-Categ

L_WA_CONDTN_REP-YYPRODH4 = <L_FS_CONDTAB_DATA>-YYPRODH4.

\* ProdH 5 â€" Seg/Sub Seg

L_WA_CONDTN_REP-YYPRODH5 = <L_FS_CONDTAB_DATA>-YYPRODH5.

\* Campaign ID

L_WA_CONDTN_REP-CMPGN_ID = <L_FS_CONDTAB_DATA>-CMPGN_ID.

\* Campaign (External ID)

L_WA_CONDTN_REP-EXTERNAL_ID =

<L_FS_CONDTAB_DATA>-EXTERNAL_ID.

\* Sales Organization

L_WA_CONDTN_REP-VKORG = <L_FS_CONDTAB_DATA>-VKORG.

\* Distribution Channel

L_WA_CONDTN_REP-VTWEG = <L_FS_CONDTAB_DATA>-VTWEG.

\* Begin of MOD-001

\* Departure Country

L_WA_CONDTN_REP-ALAND = <L_FS_CONDTAB_DATA>-ALAND.

\* Destination Country

L_WA_CONDTN_REP-LLAND = <L_FS_CONDTAB_DATA>-LLAND.

\* Tax classification 1 for customer

L_WA_CONDTN_REP-TAXK1 = <L_FS_CONDTAB_DATA>-TAXK1.

\* Tax classification material

L_WA_CONDTN_REP-TAXM1 = <L_FS_CONDTAB_DATA>-TAXM1.

\* Tax on sales/purchases code

L_WA_CONDTN_REP-MWSKZ = <L_FS_CONDTAB_DATA>-MWSKZ.

\* End of MOD-001

READ TABLE I_T685T ASSIGNING <L_FS_T685T>

WITH KEY KSCHL = <L_FS_CONDTAB_DATA>-KSCHL

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Condition Type Description

L_WA_CONDTN_REP-CVTEXT = <L_FS_T685T>-VTEXT.

ENDIF.

READ TABLE I_MAKT ASSIGNING <L_FS_MAKT>

WITH KEY MATNR = <L_FS_CONDTAB_DATA>-MATNR

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Material Description

L_WA_CONDTN_REP-MAKTX = <L_FS_MAKT>-MAKTX.

ENDIF.

READ TABLE I_KNA1 ASSIGNING <L_FS_KNA1>

WITH KEY KUNNR =

<L_FS_CONDTAB_DATA>-KUNNR

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Sold To Name

L_WA_CONDTN_REP-NAME1 = <L_FS_KNA1>-NAME1.

ENDIF.

READ TABLE I_KNA1 ASSIGNING <L_FS_KNA1>

WITH KEY KUNNR =

<L_FS_CONDTAB_DATA>-HIENR

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Customer Hierarchy Name

L_WA_CONDTN_REP-NAME1_C = <L_FS_KNA1>-NAME1.

ENDIF.

READ TABLE I_T188T ASSIGNING <L_FS_T188T>

WITH KEY KONDA =

<L_FS_CONDTAB_DATA>-KONDA

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Price Group Description

L_WA_CONDTN_REP-PVTEXT = <L_FS_T188T>-VTEXT.

ENDIF.

READ TABLE I_TVM1T ASSIGNING <L_FS_TVM1T>

WITH KEY MVGR1 =

<L_FS_CONDTAB_DATA>-MVGR1

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Material Group 1 Description

L_WA_CONDTN_REP-MBEZEI = <L_FS_TVM1T>-BEZEI.

ENDIF.

ENDIF.

IF P_PRICE = C_YES OR P_REBATE = C_YES.

\* Get the Condition Detail data

READ TABLE I_KONPDB ASSIGNING <L_FS_KONPDB>

WITH KEY KNUMH = <L_FS_KNUMH>-KNUMH

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Condition Amount

IF <L_FS_KONPDB>-KONWA = '%'.

L_WA_CONDTN_REP-KBETR = <L_FS_KONPDB>-KBETR / 10.

ELSE.

L_WA_CONDTN_REP-KBETR = <L_FS_KONPDB>-KBETR.

ENDIF.

\* Condition Unit

L_WA_CONDTN_REP-KONWA = <L_FS_KONPDB>-KONWA.

\* Condition Pricing Unit

L_WA_CONDTN_REP-KPEIN = <L_FS_KONPDB>-KPEIN.

\* Condition Unit of Measure

L_WA_CONDTN_REP-KMEIN = <L_FS_KONPDB>-KMEIN.

\* Condition Accrual Amount - Rebate

L_WA_CONDTN_REP-KBRUE = <L_FS_KONPDB>-KBRUE.

\* Condition Accrual Unit - Rebate

L_WA_CONDTN_REP-KWAEH = <L_FS_KONPDB>-KWAEH.

\* Condition Deletion Indicator

L_WA_CONDTN_REP-LOEVM_KO = <L_FS_KONPDB>-LOEVM_KO.

\* Condition Exclusive Indicator

L_WA_CONDTN_REP-KZNEP = <L_FS_KONPDB>-KZNEP.

\* Rebate Retroactive Indicator

L_WA_CONDTN_REP-KSPAE = <L_FS_KONPDB>-KSPAE.

\* Rebate Accruals

L_WA_CONDTN_REP-RUWRT = <L_FS_KONPDB>-RUWRT.

\* Rebate Accruals Reversed

L_WA_CONDTN_REP-RRWRT = <L_FS_KONPDB>-RRWRT.

\* Rebate Payments

L_WA_CONDTN_REP-AUWRT = <L_FS_KONPDB>-AUWRT.

\* Rebate: Maximum payable amount

L_WA_CONDTN_REP-MPWRT = <L_FS_KONPDB>-MPWRT.

\* Rebate: Amount to be paid

L_WA_CONDTN_REP-BZWRT = <L_FS_KONPDB>-BZWRT.

\* Condition Calculation Type

L_WA_CONDTN_REP-KRECH = <L_FS_KONPDB>-KRECH.

\* Condition Scales

L_WA_CONDTN_REP-KSTBW = <L_FS_KONPDB>-KSTBW.

\* Condition Scale Basis

L_WA_CONDTN_REP-KZBZG = <L_FS_KONPDB>-KZBZG.

\* Condition Scale Type

L_WA_CONDTN_REP-STFKZ = <L_FS_KONPDB>-STFKZ.

\* Condition Lower Limit

L_WA_CONDTN_REP-MXWRT = <L_FS_KONPDB>-MXWRT.

\* Condition Upper Limit

L_WA_CONDTN_REP-GKWRT = <L_FS_KONPDB>-GKWRT.

\* Condition Application

L_WA_CONDTN_REP-KAPPL = <L_FS_KONPDB>-KAPPL.

\* Rebate: Material for Settlement

L_WA_CONDTN_REP-BOMAT = <L_FS_KONPDB>-BOMAT.

\* Begin of MOD-001

\* Tax on sales/purchases code

L_WA_CONDTN_REP-MWSKZ = <L_FS_KONPDB>-MWSK1.

\* End of MOD-001

ENDIF.

\* Get the Condition Header data

READ TABLE I_KONHDB ASSIGNING <L_FS_KONHDB>

WITH KEY KNUMH = <L_FS_KNUMH>-KNUMH

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Condition Valid On

L_WA_CONDTN_REP-DATBI = <L_FS_KONHDB>-DATBI.

\* Condition Valid To

L_WA_CONDTN_REP-DATAB = <L_FS_KONHDB>-DATAB.

\* Condition Created By

L_WA_CONDTN_REP-ERNAM = <L_FS_KONHDB>-ERNAM.

\* Condition Created on Date

L_WA_CONDTN_REP-ERDAT = <L_FS_KONHDB>-ERDAT.

\* Condition Table Usage

L_WA_CONDTN_REP-KVEWE = <L_FS_KONHDB>-KVEWE.

ENDIF.

READ TABLE I_KONA ASSIGNING <L_FS_KONA>

WITH KEY KNUMA =

<L_FS_KONPDB>-KNUMA_BO

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Rebate Agreement Number

L_WA_CONDTN_REP-KNUMA = <L_FS_KONA>-KNUMA.

\* Rebate Agreement Type

L_WA_CONDTN_REP-BOART = <L_FS_KONA>-BOART.

\* Enhanced Rebate Indicator

L_WA_CONDTN_REP-BON_ENH_VAKEY =

<L_FS_KONA>-BON_ENH_VAKEY.

\* Indirect Settlement Types Indicator

L_WA_CONDTN_REP-BON_ENH_INDIRECT =

<L_FS_KONA>-BON_ENH_INDIRECT.

\* Rebate Recipient

L_WA_CONDTN_REP-BONEM = <L_FS_KONA>-BONEM.

\* Rebate Currency

L_WA_CONDTN_REP-WAERS = <L_FS_KONA>-WAERS.

\* Rebate Payment Method

L_WA_CONDTN_REP-ZLSCH = <L_FS_KONA>-ZLSCH.

\* Rebate External Description

L_WA_CONDTN_REP-ABREX = <L_FS_KONA>-ABREX.

\* Rebate Agreement Valid From

L_WA_CONDTN_REP-RDATAB = <L_FS_KONA>-DATAB.

\* Rebate Agreement Valid To

L_WA_CONDTN_REP-RDATBI = <L_FS_KONA>-DATBI.

\* Rebate Agreement Status

L_WA_CONDTN_REP-BOSTA = <L_FS_KONA>-BOSTA.

\* Sales Office

L_WA_CONDTN_REP-VKBUR = <L_FS_KONA>-VKBUR.

\* Sales Group

L_WA_CONDTN_REP-VKGRP = <L_FS_KONA>-VKGRP.

\* Rebate Agreement Created By

L_WA_CONDTN_REP-ERNAM = <L_FS_KONA>-ERNAM.

\* Rebate Agreement Created on Date

L_WA_CONDTN_REP-ERDAT = <L_FS_KONA>-ERDAT.

\* Rebate Agreement Created on Time

L_WA_CONDTN_REP-ERZET = <L_FS_KONA>-ERZET.

\* Rebate Agreement Changed By

L_WA_CONDTN_REP-AENAM = <L_FS_KONA>-AENAM.

\* Rebate Agreement Changed on Date

L_WA_CONDTN_REP-AEDAT = <L_FS_KONA>-AEDAT.

\* Rebate Agreement Changed on Time

L_WA_CONDTN_REP-AEZET = <L_FS_KONA>-AEZET.

\* Rebate Agreement Description

L_WA_CONDTN_REP-BOTEXT = <L_FS_KONA>-BOTEXT.

\* Rebate Verification Level

L_WA_CONDTN_REP-ABSPZ = <L_FS_KONA>-ABSPZ.

\* Rebate Condition Type Group

L_WA_CONDTN_REP-KOBOG = <L_FS_KONA>-KOBOG.

READ TABLE I_T6B1T ASSIGNING <L_FS_T6B1T>

WITH KEY BOART = <L_FS_KONA>-BOART

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Rebate Agreement Type Description

L_WA_CONDTN_REP-RVTEXT = <L_FS_T6B1T>-VTEXT.

ENDIF.

ENDIF.

LOOP AT I_KONM ASSIGNING <L_FS_KONM>

WHERE KNUMH = <L_FS_KNUMH>-KNUMH.

IF L_CNT > 10.

EXIT.

ENDIF.

ADD 1 TO L_CNT.

CASE L_CNT.

WHEN 1.

\* Condition Scale Quantity 1

L_WA_CONDTN_REP-KSTBM1 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 1

L_WA_CONDTN_REP-KBETR1 = <L_FS_KONM>-KBETR.

WHEN 2.

\* Condition Scale Quantity 2

L_WA_CONDTN_REP-KSTBM2 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 2

L_WA_CONDTN_REP-KBETR2 = <L_FS_KONM>-KBETR.

WHEN 3.

\* Condition Scale Quantity 3

L_WA_CONDTN_REP-KSTBM3 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 3

L_WA_CONDTN_REP-KBETR3 = <L_FS_KONM>-KBETR.

WHEN 4.

\* Condition Scale Quantity 4

L_WA_CONDTN_REP-KSTBM4 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 4

L_WA_CONDTN_REP-KBETR4 = <L_FS_KONM>-KBETR.

WHEN 5.

\* Condition Scale Quantity 5

L_WA_CONDTN_REP-KSTBM5 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 5

L_WA_CONDTN_REP-KBETR5 = <L_FS_KONM>-KBETR.

WHEN 6.

\* Condition Scale Quantity 6

L_WA_CONDTN_REP-KSTBM6 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 6

L_WA_CONDTN_REP-KBETR6 = <L_FS_KONM>-KBETR.

WHEN 7.

\* Condition Scale Quantity 7

L_WA_CONDTN_REP-KSTBM7 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 7

L_WA_CONDTN_REP-KBETR7 = <L_FS_KONM>-KBETR.

WHEN 8.

\* Condition Scale Quantity 8

L_WA_CONDTN_REP-KSTBM8 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 8

L_WA_CONDTN_REP-KBETR8 = <L_FS_KONM>-KBETR.

WHEN 9.

\* Condition Scale Quantity 9

L_WA_CONDTN_REP-KSTBM9 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 9

L_WA_CONDTN_REP-KBETR9 = <L_FS_KONM>-KBETR.

WHEN 10.

\* Condition Scale Quantity 10

L_WA_CONDTN_REP-KSTBM10 = <L_FS_KONM>-KSTBM.

\* Condition Scale Amount 10

L_WA_CONDTN_REP-KBETR10 = <L_FS_KONM>-KBETR.

ENDCASE.

ENDLOOP.

ENDIF.

IF P_FREEGD = C_YES.

READ TABLE I_KONDN ASSIGNING <L_FS_KONDN>

WITH KEY KNUMH =

<L_FS_KNUMH>-KNUMH

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Free goods: Minimum quantity

L_WA_CONDTN_REP-KNRMM = <L_FS_KONDN>-KNRMM.

\* Free goods: Free goods quantity

L_WA_CONDTN_REP-KNRNM = <L_FS_KONDN>-KNRNM.

\* Free goods: Quantity unit for minimum quantity

\* and free goods quantity

L_WA_CONDTN_REP-KNRME = <L_FS_KONDN>-KNRME.

\* Free goods: Additional quantity

L_WA_CONDTN_REP-KNRZM = <L_FS_KONDN>-KNRZM.

\* Free goods: Quantity unit for free goods additional quantity

L_WA_CONDTN_REP-KNREZ = <L_FS_KONDN>-KNREZ.

\* Free goods: Calculation type for determining free goods quantity

L_WA_CONDTN_REP-KNRRR = <L_FS_KONDN>-KNRRR.

\* Free goods category

L_WA_CONDTN_REP-KNRDD = <L_FS_KONDN>-KNRDD.

\* Free goods delivery control

L_WA_CONDTN_REP-LSTANR = <L_FS_KONDN>-LSTANR.

\* Free Goods: Additional Material

L_WA_CONDTN_REP-KNRMAT = <L_FS_KONDN>-KNRMAT.

\* Free goods: Percentage rate

IF <L_FS_KONDN>-KNRDD = 1

OR <L_FS_KONDN>-KNRDD = 3.

L_WA_CONDTN_REP-FGPCR

= ( <L_FS_KONDN>-KNRZM * 100 ) /

<L_FS_KONDN>-KNRNM.

ENDIF.

IF <L_FS_KONDN>-KNRDD = 2.

L_WA_CONDTN_REP-FGPCR

= ( <L_FS_KONDN>-KNRZM * 100 ) / (

<L_FS_KONDN>-KNRNM +

<L_FS_KONDN>-KNRZM )

.

ENDIF.

\* The length of the VALPOS and KNRDD is different

\* but there is no chance of data loss.

READ TABLE I_DD07T ASSIGNING <L_FS_DD07T>

WITH KEY VALPOS =

<L_FS_KONDN>-KNRDD

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Free goods: Text output for exclusive or inclusive

L_WA_CONDTN_REP-DDTEXT = <L_FS_DD07T>-DDTEXT.

ENDIF.

READ TABLE I_MAKT ASSIGNING <L_FS_MAKT>

WITH KEY MATNR = <L_FS_KONDN>-KNRMAT

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

\* Free goods: Additional Material Description

L_WA_CONDTN_REP-FMAKTX = <L_FS_MAKT>-MAKTX.

ENDIF.

ENDIF.

ENDIF.

APPEND L_WA_CONDTN_REP TO I_CONDTN_REP.

CLEAR L_WA_CONDTN_REP.

ENDLOOP.

SORT I_CONDTN_REP BY KSCHL.

ENDMETHOD. "M_PROCESS_DATA

\*&---------------------------------------------------------------------\*

\*& METHOD m_main_processing

\*&---------------------------------------------------------------------\*

\* Main Method which in turn will call the different methods

\* to achieve the functionality of the program.

\*----------------------------------------------------------------------\*

METHOD M_MAIN_PROCESSING.

\* Retrieve the data from the Condition Tables for the different

\* Condition Types and get the corresponding table names from where

\* the Condition Records to be retrieved.

CALL METHOD M_RETRIEVE_DATA

CHANGING

CH_I_T682I = I_T682I.

\* Validate whether the tables determined from the previous method

\* actually exists in the SAP database.

CALL METHOD M_VALIDATE_TABLE

CHANGING

CH_I_T682I = I_T682I.

\* Populate the internal table with the contents of the selection

\* screen.

CALL METHOD M_INPUT_FIELD

CHANGING

CH_I_INPUT_FIELD = I_INPUT_FIELD.

\* Get the Condition Records for all the condition type and for the

\* set of criteria in the selection screen.

CALL METHOD M_GET_COND_RECORD

EXPORTING

IM_I_T682I = I_T682I

CHANGING

CH_I_CONDTAB_DATA = I_CONDTAB_DATA.

\* Get the detail of the Condition Type from the SAP database tables

\* and then the corresponding scales if they exist.

CALL METHOD M_GET_COND_DATA

EXPORTING

IM_I_CONDTAB_DATA = I_CONDTAB_DATA

CHANGING

CH_I_KNUMH = I_KNUMH

CH_I_KONHDB = I_KONHDB

CH_I_KONPDB = I_KONPDB

CH_I_KONM = I_KONM

CH_I_KONW = I_KONW

CH_I_KONDN = I_KONDN

CH_I_KONDNS = I_KONDNS.

\* Get the detail of the Rebate Agreement data from the SAP database

\* table KONA.

CALL METHOD M_GET_AGREEMENT_DATA

EXPORTING

IM_I_KONPDB = I_KONPDB

CHANGING

CH_I_KONA = I_KONA.

\* The retrieved data will be processed into the desired internal table

\* which will finally displayed in the report.

CALL METHOD M_PROCESS_DATA.

CALL METHOD M_BUILD_FIELD_CATALOGUE.

\* if sy-batch eq 'X'.

\* TRY.

\* perform alv_report_display.

\* CATCH cx_sy_program_not_found.

\* CATCH cx_root.

\* ENDTRY.

\* endif.

\* else.

TRY.

\* Calling the Screen that has the container.

\* The ALV report will be shown on the container

\* CALL SCREEN c_screen. "9000

CALL SCREEN 9000. "9000

CATCH CX_SY_PROGRAM_NOT_FOUND.

CATCH CX_ROOT.

ENDTRY.

\* Work area of the final internal table

\* endif.

ENDMETHOD. "M_MAIN_PROCESSING

\*&---------------------------------------------------------------------\*

\*& METHOD m_populate_fldcat

\*&---------------------------------------------------------------------\*

\* Process to populate the Field Catalogue for ALV Grid Display

\*----------------------------------------------------------------------\*

METHOD M_POPULATE_FLDCAT.

DATA: L_REC_FLDCAT TYPE LVC_S_FCAT.

DATA: L_FLDCAT TYPE LVC_S_FCAT.

L_REC_FLDCAT-FIELDNAME = IM_FLDNAME.

L_REC_FLDCAT-OUTPUTLEN = IM_OUTLEN.

L_REC_FLDCAT-COL_POS = IM_CLPOS.

L_REC_FLDCAT-ROW_POS = IM_RWPOS .

L_REC_FLDCAT-TABNAME = IM_TABNAME.

L_REC_FLDCAT-KEY = 'X'.

L_REC_FLDCAT-SELTEXT = IM_COLTEXT.

L_REC_FLDCAT-NO_OUT = IM_NO_OUT.

L_REC_FLDCAT-REF_TABLE = IM_RTABLE.

L_REC_FLDCAT-REF_FIELD = IM_RFIELD.

APPEND L_REC_FLDCAT TO I_FLDCAT.

CLEAR L_REC_FLDCAT.

\* CLEAR l_fldcat .

\* l_fldcat-tabname = im_tabname.

\* l_fldcat-fieldname = im_fldname.

\* l_fldcat-key = 'X'.

\* l_fldcat-seltext_L = im_coltext.

\* l_fldcat-no_out = space.

\* APPEND l_fldcat TO i_fldcat1.

ENDMETHOD. "M_POPULATE_FLDCAT

\*&---------------------------------------------------------------------\*

\*& METHOD m_build_field_catalogue

\*&---------------------------------------------------------------------\*

\* Populating the ALV Fieldcatalogue with proper attributes

\*----------------------------------------------------------------------\*

METHOD M_BUILD_FIELD_CATALOGUE.

\* Populate Condition Type

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSCHL "Fieldname

IM_OUTLEN = 14 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-003 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KSCHL "Reference Field

).

\* Populate Condition Type Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_CVTEXT "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-004 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_CVTEXT "Reference Field

).

\* Populate Sold To Number

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KUNNR "Fieldname

IM_OUTLEN = 14 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-005 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KUNNR "Reference Field

IM_RTABLE = 'KNA1'

).

\*\* Populate Sold To Name

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_NAME1 "Fieldname

IM_OUTLEN = 12 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-006 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_NAME1 "Reference Field

IM_RTABLE = 'KNA1'

IM_LCASE = C_YES

).

\* Populate Customer Hierarchy Number

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_HIENR "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-007 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KUNNR "Reference Field

IM_RTABLE = 'KNA1'

).

\* Populate Customer Hierarchy Name

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_NAME1_C "Fieldname

\* im_outlen = 23 "Output Length

IM_OUTLEN = 20 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-008 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_NAME1 "Reference Field

IM_RTABLE = 'KNA1'

IM_LCASE = C_YES

).

\* Populate Price Group Name

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KONDA "Fieldname

IM_OUTLEN = 16 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-009 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KONDA "Reference Field

).

\* Populate Price Group Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_PVTEXT "Fieldname

IM_OUTLEN = 23 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-010 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_PVTEXT "Reference Field

).

\* Populate Material Number

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_MATNR "Fieldname

IM_OUTLEN = 18 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-011 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_MATNR "Reference Field

IM_RTABLE = 'MARA'

IM_LCASE = C_YES

).

\* Populate Material Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_MAKTX "Fieldname

IM_OUTLEN = 40 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-012 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_MAKTX "Reference Field

).

\* Populate Material Group 1

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_MVGR1 "Fieldname

IM_OUTLEN = 16 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-013 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_MVGR1 "Reference Field

).

\* Populate Material Group 1 Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_MBEZEI "Fieldname

IM_OUTLEN = 28 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-014 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_MBEZEI "Reference Field

).

\* Populate ProdH 1 - Business

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_PRODH1 "Fieldname

IM_OUTLEN = 18 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-015 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_PRODH1 "Reference Field

).

\* Populate ProdH 2 â€" Business ID

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_PRODH2 "Fieldname

IM_OUTLEN = 19 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-016 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_PRODH2 "Reference Field

).

\* Populate ProdH 3 - Category

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_PRODH3 "Fieldname

IM_OUTLEN = 18 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-017 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_PRODH3 "Reference Field

).

\* Populate ProdH 4 â€" Sub-Categ

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_YYPRODH4 "Fieldname

IM_OUTLEN = 19 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-018 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_YYPRODH4 "Reference Field

).

\* Populate ProdH 5 â€" Seg/Sub Seg

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_YYPRODH5 "Fieldname

IM_OUTLEN = 21 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-019 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_YYPRODH5 "Reference Field

).

\* Populate CAMPIGN ID

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_CMPGN_ID "Fieldname

IM_OUTLEN = 11 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-020 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_CMPGN_ID "Reference Field

).

\* Populate Campaign (External ID)

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_EXTERNAL_ID "Fieldname

IM_OUTLEN = 22 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-021 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_EXTERNAL_ID "Reference Field

).

\* Populate Condition Amount

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR "Fieldname

IM_OUTLEN = 16 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-022 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KBETR "Reference Field

).

\* Populate Condition Unit

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KONWA "Fieldname

IM_OUTLEN = 14 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-023 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KONWA "Reference Field

).

\* Populate Condition Pricing Unit

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KPEIN "Fieldname

IM_OUTLEN = 22 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-024 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KPEIN "Reference Field

).

\* Populate Condition Unit of Measure

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KMEIN "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-025 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KMEIN "Reference Field

).

\* Populate Condition Valid On

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_DATAB "Fieldname

IM_OUTLEN = 18 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-026 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_DATAB "Reference Field

).

\* Populate Condition Valid To

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_DATBI "Fieldname

IM_OUTLEN = 18 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-027 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_DATBI "Reference Field

).

\* Populate Condition Accrual Amount - Rebate

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBRUE "Fieldname

IM_OUTLEN = 33 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-028 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KBRUE "Reference Field

).

\* Populate Condition Accrual Unit - Rebate

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KWAEH "Fieldname

IM_OUTLEN = 31 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-029 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KWAEH "Reference Field

).

\* Populate Condition Deletion Indicator

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_LOEVM_KO "Fieldname

IM_OUTLEN = 28 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-030 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_LOEVM_KO "Reference Field

).

\* Populate Condition Exclusive Indicator

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KZNEP "Fieldname

IM_OUTLEN = 29 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-031 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KZNEP "Reference Field

).

\* Populate Rebate Agreement Number

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KNUMA "Fieldname

IM_OUTLEN = 23 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-032 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KNUMA "Reference Field

IM_RTABLE = 'KONA'

).

\* Populate Rebate Agreement Type

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BOART "Fieldname

IM_OUTLEN = 21 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-033 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_BOART "Reference Field

).

\* Populate Rebate Agreement Type Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_RVTEXT "Fieldname

IM_OUTLEN = 33 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-034 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_RVTEXT "Reference Field

).

\* Populate Enhanced Rebate Indicator

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BON_ENH_VAKEY "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-035 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_BON_ENH_VAKEY "Reference Field

).

\* Populate Indirect Settlement Types Indicator

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BON_ENH_INDIRECT "Fieldname

IM_OUTLEN = 35 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-036 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_BON_ENH_INDIRECT "Reference Field

).

\* Populate Rebate Retroactive Indicator

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSAPE "Fieldname

IM_OUTLEN = 28 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-037 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_KSAPE "Reference Field

).

\* Populate Rebate Recipient

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BONEM "Fieldname

IM_OUTLEN = 16 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-038 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_BONEM "Reference Field

).

\* Populate Rebate Currency

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_WAERS "Fieldname

IM_OUTLEN = 15 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-039 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_WAERS "Reference Field

).

\* Populate Rebate Payment Method

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_ZLSCH "Fieldname

IM_OUTLEN = 21 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-040 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_ZLSCH "Reference Field

).

\* Populate Rebate External Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_ABREX "Fieldname

IM_OUTLEN = 27 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-041 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_ABREX "Reference Field

).

\* Populate Rebate Agreement Valid From

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_RDATAB "Fieldname

IM_OUTLEN = 27 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-042 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_RDATAB "Reference Field

).

\* Populate Rebate Agreement Valid To

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_RDATBI "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-043 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_RDATBI "Reference Field

).

\* Populate Rebate Agreement Status

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BOSTA "Fieldname

IM_OUTLEN = 23 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-044 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_BOSTA "Reference Field

).

\* Populate Rebate Accruals

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = 'RUWRT' "Fieldname

IM_OUTLEN = 15 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-045 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_BOSTA "Reference Field

).

\* Populate Rebate Accruals Reversed

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_RRWRT "Fieldname

IM_OUTLEN = 24 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-046 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_RRWRT "Reference Field

).

\* Populate Rebate Payments

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_AUWRT "Fieldname

IM_OUTLEN = 15 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-047 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_AUWRT "Reference Field

).

\* Populate Rebate: Maximum payable amount

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_MPWRT "Fieldname

IM_OUTLEN = 30 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-048 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_MPWRT "Reference Field

).

\* Populate Rebate: Amount to be paid

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BZWRT "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-049 "Column Text

IM_NO_OUT = SPACE "Column is not output

IM_RFIELD = C_BZWRT "Reference Field

).

\* Populate Sales Organization

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_VKORG "Fieldname

IM_OUTLEN = 15 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-050 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_VKORG "Reference Field

).

\* Populate Distribution Channel

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_VTWEG "Fieldname

IM_OUTLEN = 24 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-051 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_VTWEG "Reference Field

).

\* Populate Sales Office

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_VKBUR "Fieldname

IM_OUTLEN = 15 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-052 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_VKBUR "Reference Field

).

\* Populate Sales Group

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_VKGRP "Fieldname

IM_OUTLEN = 30 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-053 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_VKGRP "Reference Field

).

\* Populate Condition Created By

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_CERNAM "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-054 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_CERNAM "Reference Field

).

\* Populate Condition Created on Date

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_CERDAT "Fieldname

IM_OUTLEN = 18 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-055 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_CERDAT "Reference Field

).

\* Populate Condition Calculation Type

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KRECH "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-057 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KRECH "Reference Field

).

\* Populate Condition Scales

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBW "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-058 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBW "Reference Field

).

\* Populate Condition Scale Basis

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KZBZG "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-059 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KZBZG "Reference Field

).

\* Populate Condition Scale Type

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_STFKZ "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-060 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_STFKZ "Reference Field

).

\* Populate Condition Scale Quantity 1

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM1 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-061 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM1 "Reference Field

).

\* Populate Condition Scale Quantity 2

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM2 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-062 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM2 "Reference Field

).

\* Populate Condition Scale Quantity 3

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM3 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-063 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM3 "Reference Field

).

\* Populate Condition Scale Quantity 4

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM4 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-064 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM4 "Reference Field

).

\* Populate Condition Scale Quantity 5

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM5 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-065 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM5 "Reference Field

).

\* Populate Condition Scale Quantity 6

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM6 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-066 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM6 "Reference Field

).

\* Populate Condition Scale Quantity 7

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM7 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-067 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM7 "Reference Field

).

\* Populate Condition Scale Quantity 8

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM8 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-068 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM8 "Reference Field

).

\* Populate Condition Scale Quantity 9

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM9 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-069 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM9 "Reference Field

).

\* Populate Condition Scale Quantity 10

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KSTBM10 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-070 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KSTBM10 "Reference Field

).

\* Populate Condition Scale Amount 1

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR1 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-071 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR1 "Reference Field

).

\* Populate Condition Scale Amount 2

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR2 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-072 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR2 "Reference Field

).

\* Populate Condition Scale Amount 3

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR3 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-073 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR3 "Reference Field

).

\* Populate Condition Scale Amount 4

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR4 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-074 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR4 "Reference Field

).

\* Populate Condition Scale Amount 5

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR5 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-075 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR5 "Reference Field

).

\* Populate Condition Scale Amount 6

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR6 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-076 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR6 "Reference Field

).

\* Populate Condition Scale Amount 7

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR7 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-077 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR7 "Reference Field

).

\* Populate Condition Scale Amount 8

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR8 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-078 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR8 "Reference Field

).

\* Populate Condition Scale Amount 9

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR9 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-079 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR9 "Reference Field

).

\* Populate Condition Scale Amount 10

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KBETR10 "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-080 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KBETR10 "Reference Field

).

\* Populate Condition Lower Limit

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_MXWRT "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-081 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_MXWRT "Reference Field

).

\* Populate Condition Upper Limit

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_GKWRT "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-082 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_GKWRT "Reference Field

).

\* Populate Condition Table Usage

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KVEWE "Fieldname

IM_OUTLEN = 21 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-086 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KVEWE "Reference Field

).

\* Populate Condition Application

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KAPPL "Fieldname

IM_OUTLEN = 21 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-087 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KAPPL "Reference Field

).

\* Populate Rebate Agreement Created By

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_ERNAM "Fieldname

IM_OUTLEN = 27 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-088 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_ERNAM "Reference Field

).

\* Populate Rebate Agreement Created on Date

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_ERDAT "Fieldname

IM_OUTLEN = 32 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-089 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_ERDAT "Reference Field

).

\* Populate Rebate Agreement Created on Time

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_ERZET "Fieldname

IM_OUTLEN = 32 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-090 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_ERZET "Reference Field

).

\* Populate Rebate Agreement Changed By

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_AENAM "Fieldname

IM_OUTLEN = 27 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-091 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_AENAM "Reference Field

).

\* Populate Rebate Agreement Changed on Date

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_AEDAT "Fieldname

IM_OUTLEN = 32 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-092 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_AEDAT "Reference Field

).

\* Populate Rebate Agreement Changed on Time

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_AEZET "Fieldname

IM_OUTLEN = 32 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-093 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_AEZET "Reference Field

).

\* Populate Material for Rebate Settlement

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BOMAT "Fieldname

IM_OUTLEN = 32 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-094 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_BOMAT "Reference Field

).

\* Populate Rebate Agreement Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_BOTEXT "Fieldname

IM_OUTLEN = 28 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-095 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_BOTEXT "Reference Field

).

\* Populate Rebate Verification Level

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_ABSPZ "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-096 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_ABSPZ "Reference Field

).

\* Populate Rebate Condition Type Group

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KOBOG "Fieldname

IM_OUTLEN = 27 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-097 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KOBOG "Reference Field

).

\* Populate Free goods: Minimum quantity

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KNRMM "Fieldname

IM_OUTLEN = 28 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-098 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KNRMM "Reference Field

).

\* Populate Free goods: Free goods quantity

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KNRNM "Fieldname

IM_OUTLEN = 31 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-099 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KNRNM "Reference Field

).

\* Populate Free goods: Quantity unit for minimum quantity

\* and free goods quantity

\* CALL METHOD m_populate_fldcat(

\* im_fldname = c_knrme "Fieldname

\* im_outlen = 35 "Output Length

\* im_clpos = 1 "Column Position

\* im_rwpos = 1 "Row Position

\* im_tabname = c_i_condtn_rep "Table name

\* im_coltext = text-100 "Column Text

\* im_no_out = c_yes "Column is not output

\* im_rfield = c_knrme "Reference Field

\* ).

\*\* Populate Free goods: Free goods quantity

\*

\* CALL METHOD m_populate_fldcat(

\* im_fldname = c_knrme "Fieldname

\* im_outlen = 35 "Output Length

\* im_clpos = 1 "Column Position

\* im_rwpos = 1 "Row Position

\* im_tabname = c_i_condtn_rep "Table name

\* im_coltext = text-100 "Column Text

\* im_no_out = c_yes "Column is not output

\* im_rfield = c_knrme "Reference Field

\* ).

\* Populate Free goods: Additional quantity

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KNRZM "Fieldname

IM_OUTLEN = 31 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-101 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KNRZM "Reference Field

).

\*\* Populate Free goods: Quantity unit for free goods additional quantity

\* CALL METHOD m_populate_fldcat(

\* im_fldname = c_knrez "Fieldname

\* im_outlen = 36 "Output Length

\* im_clpos = 1 "Column Position

\* im_rwpos = 1 "Row Position

\* im_tabname = c_i_condtn_rep "Table name

\* im_coltext = text-102 "Column Text

\* im_no_out = c_yes "Column is not output

\* im_rfield = c_knrez "Reference Field

\* ).

\*

\* Populate Free Goods: Percentage Rate

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_FGPCR "Fieldname

IM_OUTLEN = 36 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-103 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_FGPCR "Reference Field

).

\* Populate Free goods: Calculation type for determining

\* free goods quantity

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KNRRR "Fieldname

IM_OUTLEN = 33 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-104 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KNRRR "Reference Field

).

\* Populate Free goods category

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KNRDD "Fieldname

IM_OUTLEN = 19 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-105 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KNRDD "Reference Field

).

\* Populate Free goods delivery control

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_LSTANR "Fieldname

IM_OUTLEN = 27 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-106 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_LSTANR "Reference Field

).

\* Populate Free goods: Text output for exclusive or inclusive

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_DDTEXT "Fieldname

IM_OUTLEN = 27 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-107 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_DDTEXT "Reference Field

).

\* Populate Free Goods: Additional Material

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_KNRMAT "Fieldname

IM_OUTLEN = 26 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-108 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_KNRMAT "Reference Field

).

\* Populate Free goods: Additional Material Description

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = C_FMAKTX "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-109 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = C_FMAKTX "Reference Field

).

\* Begin of MOD-001

\* Populate the Departure Country

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = 'ALAND' "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-110 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = 'LAND1' "Reference Field

).

\* Populate the Destination Country

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = 'LLAND' "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-111 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = 'LAND1' "Reference Field

).

\* Populate the Tax classification 1 for Customer

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = 'TAXK1' "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-112 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = 'TAXK1' "Reference Field

).

\* Populate the Tax classification Material

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = 'TAXM1' "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-113 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = 'TAXM1' "Reference Field

).

\* Populate the Tax on sales/purchase code

CALL METHOD M_POPULATE_FLDCAT(

IM_FLDNAME = 'MWSKZ' "Fieldname

IM_OUTLEN = 25 "Output Length

IM_CLPOS = 1 "Column Position

IM_RWPOS = 1 "Row Position

IM_TABNAME = C_I_CONDTN_REP "Table name

IM_COLTEXT = TEXT-114 "Column Text

IM_NO_OUT = C_YES "Column is not output

IM_RFIELD = 'MWSKZ' "Reference Field

).

\* End of MOD-001

ENDMETHOD. "M_BUILD_FIELD_CATALOGUE

ENDCLASS. "lcl_data_selection

\*---------------------------------------------------------------------\*

\* CLASS lcl_input_validation DEFINITION

\*---------------------------------------------------------------------\*

\*

\*---------------------------------------------------------------------\*

CLASS LCL_INPUT_VALIDATION DEFINITION.

PUBLIC SECTION.

CLASS-METHODS: M_VALIDATE_SALES_ORG, "Validate the Sales Org

M_VALIDATE_DISTR_CHL, "Validate the Distr Channel

M_VALIDATE_SALES_AREA, "Validate Sales Area

M_VALIDATE_COND_TYPE, "Validate the Condition Type

M_VALIDATE_CUSTOMER, "Validate the Sold to Party

M_VALIDATE_CUS_HIER, "Validate Customer Hierarchy

M_VALIDATE_PRICE_GRP, "validate the Price Group

M_VALIDATE_MATERIAL, "Validate the Material

M_VALIDATE_MAT_GRP1, "Validate the material Group 1

M_VALIDATE_REB_RECP, "Validate Rebate recipient

M_VALIDATE_VARIANT, "Validate Variant Name

M_VALIDATE_CONDEL_IND, "Validate Cond Del Indicator

M_VALIDATE_REB_AGG_STAT, "Validate Rebate Agg Status

M_VALIDATE_PRODH1, "Validate ProdH1

M_VALIDATE_PRODH2, "Validate ProdH2

M_VALIDATE_PRODH3, "Validate ProdH3

M_VALIDATE_PRODH4, "Validate ProdH4

M_VALIDATE_PRODH5, "Validate ProdH5

\* Begin of MOD-001

M_VALIDATE_ALAND, "Validate Departure Country

M_VALIDATE_BOART. "Validate Agreement Type

\* Begin of MOD-001

ENDCLASS. "lcl_input_validation DEFINITION

\*&---------------------------------------------------------------------\*

\*& Class (Implementation) lcl_input_validation

\*&---------------------------------------------------------------------\*

\* Class for Selection Screen Validation

\*----------------------------------------------------------------------\*

CLASS LCL_INPUT_VALIDATION IMPLEMENTATION.

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_sales_org

\*&---------------------------------------------------------------------\*

\* Validation of Sales Organization

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_SALES_ORG.

DATA : L_VKORG TYPE VKORG.

SELECT VKORG

FROM TVKO

INTO (L_VKORG)

UP TO 1 ROWS

WHERE VKORG IN S_VKORG.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message: Please choose valid Sales Organization

MESSAGE E402.

ENDIF.

ENDMETHOD. "m_validate_sales_org

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_distr_chl

\*&---------------------------------------------------------------------\*

\* Validation of Distribution Channel

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_DISTR_CHL.

DATA : L_VTWEG TYPE VTWEG.

SELECT VTWEG

FROM TVTW

INTO (L_VTWEG)

UP TO 1 ROWS

WHERE VTWEG IN S_VTWEG.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message: Please choose valid Distribution Channel

MESSAGE E403.

ENDIF.

ENDMETHOD. "m_validate_distr_chl

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_distr_chl

\*&---------------------------------------------------------------------\*

\* Validation of Sales Area

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_SALES_AREA.

DATA: L_VKORG TYPE VKORG,

L_VTWEG TYPE VTWEG.

SELECT VKORG

VTWEG

FROM TVKOV

INTO (L_VKORG, L_VTWEG)

UP TO 1 ROWS

WHERE VKORG IN S_VKORG

AND VTWEG IN S_VTWEG.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE E073.

ENDIF.

ENDMETHOD. "m_validate_sales_area

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_cond_type

\*&---------------------------------------------------------------------\*

\* Validation of Condition Type

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_COND_TYPE.

DATA : L_KSCHL TYPE KSCHA.

SELECT KSCHL

FROM T685

INTO (L_KSCHL)

UP TO 1 ROWS

WHERE KSCHL IN S_KSCHL.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message: Please enter the valid condition type

MESSAGE E527.

ENDIF.

ENDMETHOD. "m_validate_cond_type

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_customer

\*&---------------------------------------------------------------------\*

\* Validation of Customer

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_CUSTOMER.

DATA : L_KUNNR TYPE KUNNR.

SELECT KUNNR

FROM KNA1

INTO (L_KUNNR)

UP TO 1 ROWS

WHERE KUNNR IN S_KUNNR.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message: Choose valid customer (Sold to Party)

MESSAGE E517.

ENDIF.

ENDMETHOD. "m_validate_customer

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_cus_hier

\*&---------------------------------------------------------------------\*

\* Validation of Customer Hierarchy

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_CUS_HIER.

DATA : L_KUNNR TYPE KUNNR.

SELECT KUNNR

FROM KNA1

INTO (L_KUNNR)

UP TO 1 ROWS

WHERE KUNNR IN S_HIENR.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message: Choose valid customer hierarchy (Node)

MESSAGE E513.

ENDIF.

ENDMETHOD. "m_validate_cus_hier

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_price_grp

\*&---------------------------------------------------------------------\*

\* Validation of Price Group

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_PRICE_GRP.

DATA: L_KONDA TYPE KONDA.

SELECT KONDA

FROM T188

INTO (L_KONDA)

UP TO 1 ROWS

WHERE KONDA IN S_KONDA.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message:Price group is invalid. Please enter a valid price group.

MESSAGE E067.

ENDIF.

ENDMETHOD. "m_validate_price_grp

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_material

\*&---------------------------------------------------------------------\*

\* Validation of Material

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_MATERIAL.

DATA : L_MATNR TYPE MATNR.

SELECT MATNR

FROM MARA

INTO (L_MATNR)

UP TO 1 ROWS

WHERE MATNR IN S_MATNR.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message: Invalid material

MESSAGE E409.

ENDIF.

ENDMETHOD. "m_validate_material

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_mat_grp1

\*&---------------------------------------------------------------------\*

\* Validation of Material Group 1

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_MAT_GRP1.

DATA: L_MVGR1 TYPE MVGR1.

SELECT MVGR1

FROM TVM1

INTO (L_MVGR1)

UP TO 1 ROWS

WHERE MVGR1 IN S_MVGR1.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Message: Material Group 1 is invalid

MESSAGE E069.

ENDIF.

ENDMETHOD. "m_validate_mat_grp1

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_reb_recp

\*&---------------------------------------------------------------------\*

\* Validation of Rebate Recipient

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_REB_RECP.

DATA : L_KUNNR TYPE KUNNR.

SELECT KUNNR

FROM KNA1

INTO (L_KUNNR)

UP TO 1 ROWS

WHERE KUNNR IN S_BONEM.

ENDSELECT.

IF SY-SUBRC <> 0.

\* Rebate recipient is invalid.Please enter valid rebate recipient

\* (Customer)

MESSAGE E070.

ENDIF.

ENDMETHOD. "m_validate_reb_recp

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_variant

\*&---------------------------------------------------------------------\*

\* Validate Variant Name

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_VARIANT.

DATA: L_VARIANT TYPE SLIS_VARI.

SELECT VARIANT "Layout

UP TO 1 ROWS

FROM LTDX "Generic storage of layouts

INTO (L_VARIANT)

WHERE RELID = C_RELID

AND REPORT = SY-REPID

AND VARIANT = P_VARI.

ENDSELECT.

IF SY-SUBRC <> 0.

\* Error message that Invalid Layout Variant Name

MESSAGE E068.

ENDIF.

ENDMETHOD. "M_VALIDATE_VARIANT

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_condel_ind

\*&---------------------------------------------------------------------\*

\* Validate Condition Deletion Indicator

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_CONDEL_IND.

\* DATA: r_loevm TYPE RANGE OF loevm_ko.

\*

\* DATA: BEGIN OF rec_loevm,

\* sign TYPE tvarv_sign,

\* option TYPE tvarv_opti,

\* low TYPE loevm_ko,

\* high TYPE loevm_ko,

\* END OF rec_loevm.

\*

\* rec_loevm-sign = c_sign_i. "I

\* rec_loevm-option = c_option_eq. "EQ

\*

\* rec_loevm-low = space.

\* APPEND rec_loevm TO r_loevm.

\*

\* rec_loevm-low = c_yes.

\* APPEND rec_loevm TO r_loevm.

\*

\*clear rec_loevm.

\*read table r_loevm into rec_loevm

\* with key

IF NOT C_YES IN S_LOEVM.

\* Error message: Invalid condition deletion indicator.

MESSAGE E078.

ENDIF.

ENDMETHOD. "m_validate_condel_ind

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_reb_agg_stat

\*&---------------------------------------------------------------------\*

\* Validate Rebate Agreement Status

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_REB_AGG_STAT.

DATA: R_BOSTA TYPE RANGE OF BOSTA,

R_BOSTA_TEMP TYPE RANGE OF BOSTA.

DATA: BEGIN OF REC_BOSTA,

SIGN TYPE TVARV_SIGN,

OPTION TYPE TVARV_OPTI,

LOW TYPE BOSTA,

HIGH TYPE BOSTA,

END OF REC_BOSTA.

REC_BOSTA-SIGN = C_SIGN_I. "I

REC_BOSTA-OPTION = C_OPTION_EQ. "EQ

REC_BOSTA-LOW = 'A'.

APPEND REC_BOSTA TO R_BOSTA.

REC_BOSTA-LOW = 'B'.

APPEND REC_BOSTA TO R_BOSTA.

REC_BOSTA-LOW = 'C'.

APPEND REC_BOSTA TO R_BOSTA.

REC_BOSTA-LOW = 'D'.

APPEND REC_BOSTA TO R_BOSTA.

\* Mod-002 Begins

REC_BOSTA-LOW = SPACE.

APPEND REC_BOSTA TO R_BOSTA.

\* Mod-002 End

CLEAR REC_BOSTA.

R_BOSTA_TEMP\[\] = S_BOSTA\[\].

DELETE R_BOSTA_TEMP WHERE NOT LOW IN R_BOSTA.

IF R_BOSTA_TEMP IS INITIAL.

MESSAGE E079.

ENDIF.

ENDMETHOD. "m_validate_reb_agg_stat

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_prodh1

\*&---------------------------------------------------------------------\*

\* Validate ProdH1

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_PRODH1.

DATA: L_PRODH TYPE PRODH_D.

SELECT PRODH

UP TO 1 ROWS

FROM T179

INTO L_PRODH

WHERE PRODH IN S_PRODH1.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE E080.

ENDIF.

ENDMETHOD. "m_validate_prodh1

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_prodh2

\*&---------------------------------------------------------------------\*

\* Validate ProdH2

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_PRODH2.

DATA: L_PRODH TYPE PRODH_D.

SELECT PRODH

UP TO 1 ROWS

FROM T179

INTO L_PRODH

WHERE PRODH IN S_PRODH2.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE E080.

ENDIF.

ENDMETHOD. "m_validate_prodh2

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_prodh3

\*&---------------------------------------------------------------------\*

\* Validate ProdH3

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_PRODH3.

DATA: L_PRODH TYPE PRODH_D.

SELECT PRODH

UP TO 1 ROWS

FROM T179

INTO L_PRODH

WHERE PRODH IN S_PRODH3.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE E080.

ENDIF.

ENDMETHOD. "m_validate_prodh3

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_prodh4

\*&---------------------------------------------------------------------\*

\* Validate ProdH4

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_PRODH4.

DATA: L_PRODH TYPE PRODH_D.

SELECT PRODH

UP TO 1 ROWS

FROM T179

INTO L_PRODH

WHERE PRODH IN S_PRODH4.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE E080.

ENDIF.

ENDMETHOD. "m_validate_prodh4

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_prodh5

\*&---------------------------------------------------------------------\*

\* Validate ProdH5

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_PRODH5.

DATA: L_PRODH TYPE PRODH_D.

SELECT PRODH

UP TO 1 ROWS

FROM T179

INTO L_PRODH

WHERE PRODH IN S_PRODH5.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE E080.

ENDIF.

ENDMETHOD. "m_validate_prodh5

\* Begin of MOD-001

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_aland

\*&---------------------------------------------------------------------\*

\* Validate Country of Departure

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_ALAND.

DATA: L_LAND1 TYPE LAND1.

SELECT LAND1

UP TO 1 ROWS

FROM T005

INTO L_LAND1

WHERE LAND1 IN S_ALAND.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Error Message that the Departure Country is invalid

MESSAGE E089.

ENDIF.

ENDMETHOD. "m_validate_aland

\*&---------------------------------------------------------------------\*

\*& METHOD m_validate_boart

\*&---------------------------------------------------------------------\*

\* Validate Rebate Agreement Type

\*----------------------------------------------------------------------\*

METHOD M_VALIDATE_BOART.

DATA: L_BOART TYPE BOART.

SELECT BOART

UP TO 1 ROWS

FROM T6B1

INTO L_BOART

WHERE BOART IN S_BOART.

ENDSELECT.

IF NOT SY-SUBRC IS INITIAL.

\* Error Message that the Rebate Agreement Type is invalid

MESSAGE E090.

ENDIF.

ENDMETHOD. "m_validate_boart

\* End of MOD-001

ENDCLASS. "lcl_input_validation

\*Messages

\*---------------------------------------------------------\-

\*030

\*064

\*065

\*066

\*067

\*068

\*069

\*070

\*072

\*073

\*074

\*075

\*076

\*078

\*079

\*080

\*089

\*090

\*402

\*403

\*409

\*513

\*517

\*527

\* Declaring the object for the class LCL_DATA_SELECTION #EC

DATA: OBJ_ALV TYPE REF TO LCL_DATA_SELECTION.

\* The selection screen output control

AT SELECTION-SCREEN OUTPUT.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_OUTPUT_CONTROL.

\* Get the F4 Help to get the Layout Variant

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.

CALL METHOD LCL_DATA_SELECTION=>M_GET_LAYOUT_VARIANT_F4.

\* Get the F4 Help to get ProdH2

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH2-LOW.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH2-HIGH.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

\* Get the F4 Help to get ProdH3

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH3-LOW.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH3-HIGH.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

\* Get the F4 Help to get ProdH4

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH4-LOW.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH4-HIGH.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

\* Get the F4 Help to get ProdH5

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH5-LOW.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PRODH5-HIGH.

CALL METHOD LCL_DATA_SELECTION=>M_SELSCREEN_PRODH_F4.

\* Include to process the ALV Report Layout

\* INCLUDE zpricing_condtn_alv.

\*----------------------------------------------------------------------\*

\* AT SELECTION SCREEN on field *

\*----------------------------------------------------------------------\*

\* In this event the validation of the data entered through the

\* selection screen by user is validated against their respective

\* check/value tables. If the value entered is not valid then

\* appropiate error messages will be shown.

\* Validating the Sales Organization

AT SELECTION-SCREEN ON S_VKORG.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_SALES_ORG.

\* Validating the Distribution Channel

AT SELECTION-SCREEN ON S_VTWEG.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_DISTR_CHL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_SALES_AREA.

\* Validating the Condition Type

AT SELECTION-SCREEN ON S_KSCHL.

IF NOT S_KSCHL IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_COND_TYPE.

ENDIF.

\* Validating the Customer

AT SELECTION-SCREEN ON S_KUNNR.

IF NOT S_KUNNR IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_CUSTOMER.

ENDIF.

\* Validating the Customer Hierarchy

AT SELECTION-SCREEN ON S_HIENR.

IF NOT S_HIENR IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_CUS_HIER.

ENDIF.

\* Validating the Price Group

AT SELECTION-SCREEN ON S_KONDA.

IF NOT S_KONDA IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_PRICE_GRP.

ENDIF.

\* Validating the Material

AT SELECTION-SCREEN ON S_MATNR.

IF NOT S_MATNR IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_MATERIAL.

ENDIF.

\* Validating the Material Group 1

AT SELECTION-SCREEN ON S_MVGR1.

IF NOT S_MVGR1 IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_MAT_GRP1.

ENDIF.

\* Validating the Condition Deletion Indicator

AT SELECTION-SCREEN ON S_LOEVM.

IF NOT S_LOEVM IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_CONDEL_IND.

ENDIF.

\* Validating the Rebate Agreement Status.

AT SELECTION-SCREEN ON S_BOSTA.

IF NOT S_BOSTA IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_REB_AGG_STAT.

ENDIF.

\* Validating the Rebate Recipient

AT SELECTION-SCREEN ON S_BONEM.

IF NOT S_BONEM IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_REB_RECP.

ENDIF.

\* Validating the ProdH1

AT SELECTION-SCREEN ON S_PRODH1.

IF NOT S_PRODH1 IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_PRODH1.

ENDIF.

\*AT SELECTION-SCREEN ON s_prodh2.

\* IF NOT s_prodh2 IS INITIAL.

\* CALL METHOD lcl_input_validation=>m_validate_prodh2.

\* ENDIF.

\*

\*AT SELECTION-SCREEN ON s_prodh3.

\* IF NOT s_prodh3 IS INITIAL.

\* CALL METHOD lcl_input_validation=>m_validate_prodh3.

\* ENDIF.

\*

\*AT SELECTION-SCREEN ON s_prodh4.

\* IF NOT s_prodh4 IS INITIAL.

\* CALL METHOD lcl_input_validation=>m_validate_prodh4.

\* ENDIF.

\*

\*AT SELECTION-SCREEN ON s_prodh5.

\* IF NOT s_prodh5 IS INITIAL.

\* CALL METHOD lcl_input_validation=>m_validate_prodh5.

\* ENDIF.

AT SELECTION-SCREEN ON P_VARI.

\* Validate the Layout Variant Name

IF NOT P_VARI IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_VARIANT.

ENDIF.

AT SELECTION-SCREEN ON P_CRMSYS.

IF NOT S_XCAMID IS INITIAL.

IF P_CRMSYS IS INITIAL.

MESSAGE I077.

LEAVE LIST-PROCESSING.

ENDIF.

ENDIF.

\* Begin of MOD-001

AT SELECTION-SCREEN ON S_ALAND.

\* Validate the Country of Departure

IF NOT S_ALAND IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_ALAND.

ENDIF.

AT SELECTION-SCREEN ON S_BOART.

\* Validate the Rebate Agreement type

IF NOT S_BOART IS INITIAL.

CALL METHOD LCL_INPUT_VALIDATION=>M_VALIDATE_BOART.

ENDIF.

\* End of MOD-001

\*----------------------------------------------------------------------\*

\* START-OF-SELECTION *

\*----------------------------------------------------------------------\*

START-OF-SELECTION.

\* Data declaration for the class LCL_DATA_SELECTION

DATA: OBJ_DATA_SELECTION TYPE REF TO LCL_DATA_SELECTION.

\* Create the Instance of the Class LCL_DATA_SELECTION

CREATE OBJECT OBJ_DATA_SELECTION.

\* Call the method M_MAIN_PROCESSING in the class LCL_DATA_SELECTION

\* This method will retrieve the data from the database tables,

\* process the data to build the final report internal table

\* and call the screen to display the ALV report.

CALL METHOD OBJ_DATA_SELECTION->M_MAIN_PROCESSING.

\*GUI Texts

\*---------------------------------------------------------\-

\* /EUR/TITLE_PRICE_REP \--> Pricing Report - Conditions

\*Text elements

\*---------------------------------------------------------\-

\* 001 Selection screen

\* 002 Pricing Report - Conditions

\* 003 Condition Type

\* 004 Condition Type Description

\* 005 Sold To Number

\* 006 Sold To Name

\* 007 Customer Hierarchy Number

\* 008 Customer Hierarchy Name

\* 009 Price Group Name

\* 010 Price Group Description

\* 011 Material Number

\* 012 Material Description

\* 013 Material Group 1

\* 014 Material Group 1 Description

\* 015 ProdH 1 - Business

\* 016 ProdH 2 â€" Business ID

\* 017 ProdH 3 - Category

\* 018 ProdH 4 â€" Sub-Categ

\* 019 ProdH 5 â€" Seg/Sub Seg

\* 020 Campaign ID

\* 021 Campaign (External ID)

\* 022 Condition Amount

\* 023 Condition Unit

\* 024 Condition Pricing Unit

\* 025 Condition Unit of Measure

\* 026 Condition Valid On

\* 027 Condition Valid To

\* 028 Condition Accrual Amount - Rebate

\* 029 Condition Accrual Unit - Rebate

\* 030 Condition Deletion Indicator

\* 031 Condition Exclusive Indicator

\* 032 Rebate Agreement Number

\* 033 Rebate Agreement Type

\* 034 Rebate Agreement Type Description

\* 035 Enhanced Rebate Indicator

\* 036 Indirect Settlement Types Indicator

\* 037 Rebate Retroactive Indicator

\* 038 Rebate Recipient

\* 039 Rebate Currency

\* 040 Rebate Payment Method

\* 041 Rebate External Description

\* 042 Rebate Agreement Valid From

\* 043 Rebate Agreement Valid To

\* 044 Rebate Agreement Status

\* 045 Rebate Accruals

\* 046 Rebate Accruals Reversed

\* 047 Rebate Payments

\* 048 Rebate: Maximum payable amount

\* 049 Rebate: Amount to be paid

\* 050 Sales Organization

\* 051 Distribution Channel

\* 052 Sales Office

\* 053 Sales Group

\* 054 Condition Created By

\* 055 Condition Created on Date

\* 057 Condition Calculation Type

\* 058 Condition Scales

\* 059 Condition Scale Basis

\* 060 Condition Scale Type

\* 061 Condition Scale Quantity 1

\* 062 Condition Scale Quantity 2

\* 063 Condition Scale Quantity 3

\* 064 Condition Scale Quantity 4

\* 065 Condition Scale Quantity 5

\* 066 Condition Scale Quantity 6

\* 067 Condition Scale Quantity 7

\* 068 Condition Scale Quantity 8

\* 069 Condition Scale Quantity 9

\* 070 Condition Scale Quantity 10

\* 071 Condition Scale Amount 1

\* 072 Condition Scale Amount 2

\* 073 Condition Scale Amount 3

\* 074 Condition Scale Amount 4

\* 075 Condition Scale Amount 5

\* 076 Condition Scale Amount 6

\* 077 Condition Scale Amount 7

\* 078 Condition Scale Amount 8

\* 079 Condition Scale Amount 9

\* 080 Condition Scale Amount 10

\* 081 Condition Lower Limit

\* 082 Condition Upper Limit

\* 086 Condition Table Usage

\* 087 Condition Application

\* 088 Rebate Agreement Created By

\* 089 Rebate Agreement Created on Date

\* 090 Rebate Agreement Created on Time

\* 091 Rebate Agreement Changed By

\* 092 Rebate Agreement Changed on Date

\* 093 Rebate Agreement Changed on Time

\* 094 Rebate: Material for Settlement

\* 095 Rebate Agreement Description

\* 096 Rebate Verification Level

\* 097 Rebate Condition Type Group

\* 098 Free goods: Minimum quantity

\* 099 Free goods: Free goods quantity

\* 100 Free goods: min free goods quantity

\* 101 Free goods: AddL quantity

\* 102 Free goods: free goods addl quantity

\* 103 Free goods: Percentage rate

\* 104 Free goods: Calculation quantity

\* 105 Free goods category

\* 106 Free goods delivery control

\* 107 Free goods: Text output

\* 108 Free Goods: Additional Material

\* 109 Free goods: Addl Mat Desc

\* 110 Departure Country

\* 111 Destination Country

\* 112 Cust Tax class1

\* 113 Mat Tax class

\* 114 Sale/Pur code tax

\*Selection texts

\*---------------------------------------------------------\-

\* P_CDATAB Condition Valid From

\* P_CDATBI Condition Valid To

\* P_CRMSYS CRM System

\* P_FREEGD Free goods

\* P_PRICE Prices / Discounts / Surcharge

\* P_RDATAB Rebate Agreement Valid From

\* P_RDATBI Rebate Agreeement Valid To

\* P_REBATE Rebates

\* P_VARI Layout Variant

\* S_ALAND Departure Country

\* S_BOART Rebate Agreement Type

\* S_BONEM Rebate Recipient

\* S_BOSTA Rebate Agreement Status

\* S_CAMPID Campaign ID

\* S_HIENR Customer Hierarchy

\* S_KONDA Price Group

\* S_KSCHL Condition Type

\* S_KUNNR Sold To Party

\* S_LOEVM Condition Deletion Indicator

\* S_MATNR Material

\* S_MVGR1 Material Group 1

\* S_PRODH1 ProdH 1 - Business

\* S_PRODH2 ProdH 2 â€" Business ID

\* S_PRODH3 ProdH 3 â€" Category

\* S_PRODH4 ProdH 4 â€" Segment

\* S_PRODH5 ProdH 5 â€" Seg/Sub Seg

\* S_VKORG Sales Organization

\* S_VTWEG Distribution Channel

\* S_XCAMID Campaign (External ID)

\*Messages

\*---------------------------------------------------------\-

\*

\* Message class: ZDEV

\*030 No data found

\*064 No free goods data exists for the selection criteria

\*065 No Agreement exists for the selection criteria

\*066 No Condition Tables could be determined for the selection

\*criteria

\*067 Price group is invalid. Please enter a valid price group.

\*068 Layout variant is invalid. Please enter a valid layout variant.

\*069 Material group 1 is invalid. Please enter valid material group 1.

\*070 Rebate recipient is invalid.Please enter valid rebate

\*recipient(Customer)

\*072 Please select at least one checkbox.

\*073 Invalid combination of Sales Organization and Distribution

\*Channel

\*074 User is not authorized for the sales area

\*075 No condition types for rebate exists for the selection criteria.

\*076 Communication to desired CRM system not done. The determined

\*system is &

\*077 Please enter the CRM system

\*078 Invalid condition deletion indicator. Please choose 'X' or blank.

\*079 Invalid rebate agreement status.

\*080 Invalid product hierarchy. Please enter a valid value.

\*089 Invalid departure country. Please enter a valid value.

\*090 Invalid rebate agreement type. Please enter a valid value.

\*402 Please Choose valid Sales organisational Number

\*403 Please Choose valid Distribution Channel

\*409 Please Choose valid Material Number

\*513 Choose valid customer hierarchy (Node)

\*517 Choose valid customer (Sold to Party)

\*527 Please enter the valid condition type

\*======================================================================\*

\*DESCRIPTION : THE PURPOSE OF THIS PROGRAM IS TO PROVIDE *

\* USERS WITH INFORMATION ABOUT THE PRICING *

\* CONDITION ON THE SYSTEM, TO ALLOW USERS TO SEE *

\* IF THE PRICING CONDITIONS HAVE BEEN SET UP, *

\* AND TO CHECK THE DETAILS OF THOSE CONDITIONS. *

\*======================================================================\*

\*COPIED FROM : (CLONED PROGRAM) *

\*TITLE : (PROGRAM TITLE) *

\*OTHER RELATED OBJ : (OBJECT NAMES)...

\*\*

\*======================================================================\*

\*CHANGE HISTORY LOG *

\*----------------------------------------------------------------------\*

\*MOD. NO.\| DATE \| NAME \| CORRECTION NUMBER \| CHANGE REFERENCE # *

\***********************************************************************\*

\*&---------------------------------------------------------------------\*

\*& Report ZPRICING_REP_CONDTN *

\*& *

\*&---------------------------------------------------------------------\*

\*& *

\*& *

\*&---------------------------------------------------------------------\*

\*&---------------------------------------------------------------------\*

\*& Include ZPRICING_CONDTN_ALV

\*&---------------------------------------------------------------------\*

\*&---------------------------------------------------------------------\*

\*& Form ALV_REPORT_DISPLAY

\*&---------------------------------------------------------------------\*

\* text

\*----------------------------------------------------------------------\*

\* \--> p1 text

\* <-\- p2 text

\*----------------------------------------------------------------------\*

FORM ALV_REPORT_DISPLAY.

DATA: C_FINALTABLE TYPE SVAL-TABNAME VALUE 'I_CONDTN_REP'.

SET PF-STATUS 'MAIN100'.

SET TITLEBAR 'MAIN100'.

\****-for passing the field catalog which are to display

\* CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

\* EXPORTING

\* i_program_name = sy-repid

\* i_internal_tabname = c_finaltable " internal table

\* i_inclname = sy-repid " program name

\* CHANGING

\* ct_fieldcat = i_fldcat1. " fild catalog

\*\*

\*--displays in the Grid with ALV functions

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

I_STRUCTURE_NAME = C_FINALTABLE

IS_LAYOUT = WA_LAYOUT1

IT_FIELDCAT = I_FLDCAT

I_DEFAULT = C_A

I_SAVE = V_SAVE

IS_VARIANT = V_VARIANT

TABLES

T_OUTTAB = I_CONDTN_REP.

ENDFORM. " ALV_REPORT_DISPLAY

\*&---------------------------------------------------------------------\*

\*& Module STATUS_9000 OUTPUT

\*&---------------------------------------------------------------------\*

\* text

\*----------------------------------------------------------------------\*

MODULE STATUS_9000 OUTPUT.

DATA: C_FINALTABLE TYPE SVAL-TABNAME VALUE 'I_CONDTN_REP'.

DATA: WA_FIELDCAT TYPE LVC_S_FCAT.

DATA: WA_LAYOUT2 TYPE DISVARIANT.

DATA: V_GRID TYPE REF TO CL_GUI_ALV_GRID,

V_OKCODE TYPE SY-UCOMM,

V_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

SET PF-STATUS 'MAIN100'.

SET TITLEBAR 'MAIN100'.

\**§1.Create one ALV Control that shows the first table.

\* if v_custom_container is initial.

\*\* create a custom container control for our ALV Control

\*

\* create object v_custom_container

\* exporting

\* container_name = v_container

\* exceptions

\* cntl_error = 1

\* cntl_system_error = 2

\* create_error = 3

\* lifetime_error = 4

\* lifetime_dynpro_dynpro_link = 5.

\* if sy-subrc ne 0.

\*\* add your handling, for example

\* endif.

\*

\*\* create an instance of alv control

\* create object grid1

\* exporting i_parent = custom_container.

\*

\* call method grid1->set_table_for_first_display

\* exporting i_structure_name = 'ty_condtn_rep'

\* is_layout = wa_layout

\* changing it_outtab = i_condtn_rep.

\*

\****-for passing the field catalog which are to display

\* CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

\* EXPORTING

\* i_program_name = sy-repid

\* i_internal_tabname = c_finaltable " internal table

\* i_inclname = sy-repid " program name

\* CHANGING

\* ct_fieldcat = i_fldcat1. " fild catalog

\*\*

\**--displays in the Grid with ALV functions

\* CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

\* EXPORTING

\* i_callback_program = sy-repid

\*\* i_callback_user_command = c_formname_at_user_command

\* i_structure_name = c_finaltable

\* is_layout = wa_layout1

\* it_fieldcat = i_fldcat1

\* i_default = c_a

\* i_save = v_save

\* is_variant = v_variant

\* TABLES

\* t_outtab = i_condtn_rep.

\*

\*******\*

\* \->Create Object to receive events and link them to handler methods.

\* When the ALV Control raises the event for the specified instance

\* the corresponding method is automatically called.

\*

\* endif. "IF custom_container IS INITIAL

\* call method cl_gui_control=>set_focus exporting control = grPid1.

CREATE OBJECT V_CONTAINER1

EXPORTING

CONTAINER_NAME = 'CUSTOM'

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

CREATE_ERROR = 3

LIFETIME_ERROR = 4

LIFETIME_DYNPRO_DYNPRO_LINK = 5

OTHERS = 6.

IF SY-SUBRC <> 0.

\* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

\* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT V_GRID

EXPORTING

I_PARENT = V_CONTAINER1

EXCEPTIONS

ERROR_CNTL_CREATE = 1

ERROR_CNTL_INIT = 2

ERROR_CNTL_LINK = 3

ERROR_DP_CREATE = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

\* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

\* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL METHOD V_GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_VARIANT = WA_LAYOUT2

I_SAVE = 'A'

CHANGING

IT_OUTTAB = I_CONDTN_REP

IT_FIELDCATALOG = I_FLDCAT

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

OTHERS = 4.

IF SY-SUBRC <> 0.

\* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

\* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDMODULE. " STATUS_9000 OUTPUT

\*&---------------------------------------------------------------------\*

\*& Module USER_COMMAND_9000 INPUT

\*&---------------------------------------------------------------------\*

\* text

\*----------------------------------------------------------------------\*

MODULE USER_COMMAND_9000 INPUT.

DATA: OK_CODE(4) TYPE C.

CASE OK_CODE.

WHEN 'BACK'.

PERFORM EXIT_PROGRAM.

WHEN 'EXIT'.

PERFORM EXIT_PROGRAM.

ENDCASE.

CLEAR OK_CODE.

ENDMODULE. " USER_COMMAND_9000 INPUT

\*&---------------------------------------------------------------------\*

\*& Form EXIT_PROGRAM

\*&---------------------------------------------------------------------\*

\* text

\*----------------------------------------------------------------------\*

\* \--> p1 text

\* <-\- p2 text

\*----------------------------------------------------------------------\*

FORM EXIT_PROGRAM .

CALL METHOD V_CUSTOM_CONTAINER->FREE.

CALL METHOD CL_GUI_CFW=>FLUSH.

IF SY-SUBRC NE 0.

\* add your handling, for example

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

TITEL = SY-REPID

TXT2 = SY-SUBRC

TXT1 = 'Error in FLush'(500).

ENDIF.

LEAVE PROGRAM.

ENDFORM. " EXIT_PROGRAM

\*GUI Texts

\*---------------------------------------------------------\-

\* MAIN100 \--> Pricing Conditions

\*Text elements

\*---------------------------------------------------------\-

\* 001 Selection screen

\* 002 Pricing Report - Conditions

\* 003 Condition Type

\* 004 Condition Type Description

\* 005 Sold To Number

\* 006 Sold To Name

\* 007 Customer Hierarchy Number

\* 008 Customer Hierarchy Name

\* 009 Price Group Name

\* 010 Price Group Description

\* 011 Material Number

\* 012 Material Description

\* 013 Material Group 1

\* 014 Material Group 1 Description

\* 015 ProdH 1 - Business

\* 016 ProdH 2 Business ID

\* 017 ProdH 3 - Category

\* 018 ProdH 4 Sub-Categ

\* 019 ProdH 5 Seg/Sub Seg

\* 020 Campaign ID

\* 021 Campaign (External ID)

\* 022 Condition Amount

\* 023 Condition Unit

\* 024 Condition Pricing Unit

\* 025 Condition Unit of Measure

\* 026 Condition Valid On

\* 027 Condition Valid To

\* 028 Condition Accrual Amount - Rebate

\* 029 Condition Accrual Unit - Rebate

\* 030 Condition Deletion Indicator

\* 031 Condition Exclusive Indicator

\* 032 Rebate Agreement Number

\* 033 Rebate Agreement Type

\* 034 Rebate Agreement Type Description

\* 035 Enhanced Rebate Indicator

\* 036 Indirect Settlement Types Indicator

\* 037 Rebate Retroactive Indicator

\* 038 Rebate Recipient

\* 039 Rebate Currency

\* 040 Rebate Payment Method

\* 041 Rebate External Description

\* 042 Rebate Agreement Valid From

\* 043 Rebate Agreement Valid To

\* 044 Rebate Agreement Status

\* 045 Rebate Accruals

\* 046 Rebate Accruals Reversed

\* 047 Rebate Payments

\* 048 Rebate: Maximum payable amount

\* 049 Rebate: Amount to be paid

\* 050 Sales Organization

\* 051 Distribution Channel

\* 052 Sales Office

\* 053 Sales Group

\* 054 Condition Created By

\* 055 Condition Created on Date

\* 056 Condition Calculation Type

\* 057 Condition Scales

\* 058 Condition Scale Basis

\* 059 Condition Scale Type

\* 060 Condition Scale Quantity 1

\* 061 Condition Scale Quantity 2

\* 062 Condition Scale Quantity 3

\* 063 Condition Scale Quantity 4

\* 064 Condition Scale Quantity 4

\* 065 Condition Scale Quantity 5

\* 066 Condition Scale Quantity 6

\* 067 Condition Scale Quantity 7

\* 068 Condition Scale Quantity 8

\* 069 Condition Scale Quantity 9

\* 070 Condition Scale Quantity 10

\* 071 Condition Scale Amount 1

\* 072 Condition Scale Amount 2

\* 073 Condition Scale Amount 3

\* 074 Condition Scale Amount 4

\* 075 Condition Scale Amount 5

\* 076 Condition Scale Amount 6

\* 077 Condition Scale Amount 7

\* 078 Condition Scale Amount 8

\* 079 Condition Scale Amount 9

\* 080 Condition Scale Amount 10

\* 081 Condition Lower Limit

\* 082 Condition Upper Limit

\* 086 Condition Table Usage

\* 087 Condition Application

\* 088 Rebate Agreement Created By

\* 089 Rebate Agreement Created on Date

\* 090 Rebate Agreement Created on Time

\* 091 Rebate Agreement Changed By

\* 092 Rebate Agreement Changed on Date

\* 093 Rebate Agreement Changed on Time

\* 094 Rebate: Material for Settlement

\* 095 Rebate Agreement Description

\* 096 Rebate Verification Level

\* 097 Rebate Condition Type Group

\* 098 Free goods: Minimum quantity

\* 099 Free goods: Free goods quantity

\* 100 Free goods: min free goods quantity

\* 101 Free goods: AddL quantity

\* 102 Free goods: free goods addl quantity

\* 103 \*Free goods: Percentage rate

\* 104 Free goods: Calculation quantity

\* 105 Free goods category

\* 106 Free goods delivery control

\* 107 Free goods: Text output

\* 108 Free Goods: Additional Material

\* 109 Free goods: Addl Mat Desc

\* 110 Departure Country

\* 111 Destination Country

\* 112 Cust Tax class1

\* 113 Mat Tax class

\* 114 Sale/Pur code tax

\* 500 Error in FLush

\*Selection texts

\*---------------------------------------------------------\-

\* P_CDATAB Condition Valid From

\* P_CDATBI Condition Valid To

\* P_CRMSYS CRM System

\* P_FREEGD Free goods

\* P_PRICE Prices / Discounts / Surcharge

\* P_RDATAB Rebate Agreement Valid From

\* P_RDATBI Rebate Agreeement Valid To

\* P_REBATE Rebates

\* P_VARI Layout Variant

\* S_ALAND Departure Country

\* S_BOART Rebate Agreement Type

\* S_BONEM Rebate Recipient

\* S_BOSTA Rebate Agreement Status

\* S_CAMPID Campaign ID

\* S_HIENR Customer Hierarchy

\* S_KONDA Price Group

\* S_KSCHL Condition Type

\* S_KUNNR Sold To Party

\* S_LOEVM Condition Deletion Indicator

\* S_MATNR Material

\* S_MVGR1 Material Group 1

\* S_PRODH1 ProdH 1 - Business

\* S_PRODH2 ProdH 2 â€" Business ID

\* S_PRODH3 ProdH 3 â€" Category

\* S_PRODH4 ProdH 4 â€" Segment

\* S_PRODH5 ProdH 5 â€" Seg/Sub Seg

\* S_VKORG Sales Organization

\* S_VTWEG Distribution Channel

\* S_XCAMID Campaign (External ID)

\*Messages

\*---------------------------------------------------------\-

\*

\* Message class: ZPRICING

\*030 No data found

\*064 No free goods data exists for the selection criteria

\*065 No Agreement exists for the selection criteria

\*066 No Condition Tables could be determined for the selection

\* criteria

\*067 Price group is invalid. Please enter a valid price group.

\*068 Layout variant is invalid. Please enter a valid layout variant.

\*069 Material group 1 is invalid. Please enter valid material group 1.

\*070 Rebate recipient is invalid.Please enter valid rebate

\* recipient(Customer)

\*072 Please select at least one checkbox.

\*073 Invalid combination of Sales Organization and Distribution

\* Channel

\*074 User is not authorized for the sales area

\*075 No condition types for rebate exists for the selection criteria.

\*076 Communication to desired CRM system not done. The determined

\* system is &

\*077 Please enter the CRM system

\*078 Invalid condition deletion indicator. Please choose 'X' or blank.

\*079 Invalid rebate agreement status.

\*080 Invalid product hierarchy. Please enter a valid value.

\*089 Invalid departure country. Please enter a valid value.

\*090 Invalid rebate agreement type. Please enter a valid value.

\*402 Please Choose valid Sales organisational Number

\*403 Please Choose valid Distribution Channel

\*409 Please Choose valid Material Number

\*513 Choose valid customer hierarchy (Node)

\*517 Choose valid customer (Sold to Party)

\*527 Please enter the valid condition type

\*Text elements

\*---------------------------------------------------------\-

\* 001 Selection screen

\* 002 Pricing Report - Conditions

\* 003 Condition Type

\* 004 Condition Type Description

\* 005 Sold To Number

\* 006 Sold To Name

\* 007 Customer Hierarchy Number

\* 008 Customer Hierarchy Name

\* 009 Price Group Name

\* 010 Price Group Description

\* 011 Material Number

\* 012 Material Description

\* 013 Material Group 1

\* 014 Material Group 1 Description

\* 015 ProdH 1 - Business

\* 016 ProdH 2 Business ID

\* 017 ProdH 3 - Category

\* 018 ProdH 4 Sub-Categ

\* 019 ProdH 5 Seg/Sub Seg

\* 020 Campaign ID

\* 021 Campaign (External ID)

\* 022 Condition Amount

\* 023 Condition Unit

\* 024 Condition Pricing Unit

\* 025 Condition Unit of Measure

\* 026 Condition Valid On

\* 027 Condition Valid To

\* 028 Condition Accrual Amount - Rebate

\* 029 Condition Accrual Unit - Rebate

\* 030 Condition Deletion Indicator

\* 031 Condition Exclusive Indicator

\* 032 Rebate Agreement Number

\* 033 Rebate Agreement Type

\* 034 Rebate Agreement Type Description

\* 035 Enhanced Rebate Indicator

\* 036 Indirect Settlement Types Indicator

\* 037 Rebate Retroactive Indicator

\* 038 Rebate Recipient

\* 039 Rebate Currency

\* 040 Rebate Payment Method

\* 041 Rebate External Description

\* 042 Rebate Agreement Valid From

\* 043 Rebate Agreement Valid To

\* 044 Rebate Agreement Status

\* 045 Rebate Accruals

\* 046 Rebate Accruals Reversed

\* 047 Rebate Payments

\* 048 Rebate: Maximum payable amount

\* 049 Rebate: Amount to be paid

\* 050 Sales Organization

\* 051 Distribution Channel

\* 052 Sales Office

\* 053 Sales Group

\* 054 Condition Created By

\* 055 Condition Created on Date

\* 056 Condition Calculation Type

\* 057 Condition Scales

\* 058 Condition Scale Basis

\* 059 Condition Scale Type

\* 060 Condition Scale Quantity 1

\* 061 Condition Scale Quantity 2

\* 062 Condition Scale Quantity 3

\* 063 Condition Scale Quantity 4

\* 064 Condition Scale Quantity 4

\* 065 Condition Scale Quantity 5

\* 066 Condition Scale Quantity 6

\* 067 Condition Scale Quantity 7

\* 068 Condition Scale Quantity 8

\* 069 Condition Scale Quantity 9

\* 070 Condition Scale Quantity 10

\* 071 Condition Scale Amount 1

\* 072 Condition Scale Amount 2

\* 073 Condition Scale Amount 3

\* 074 Condition Scale Amount 4

\* 075 Condition Scale Amount 5

\* 076 Condition Scale Amount 6

\* 077 Condition Scale Amount 7

\* 078 Condition Scale Amount 8

\* 079 Condition Scale Amount 9

\* 080 Condition Scale Amount 10

\* 081 Condition Lower Limit

\* 082 Condition Upper Limit

\* 086 Condition Table Usage

\* 087 Condition Application

\* 088 Rebate Agreement Created By

\* 089 Rebate Agreement Created on Date

\* 090 Rebate Agreement Created on Time

\* 091 Rebate Agreement Changed By

\* 092 Rebate Agreement Changed on Date

\* 093 Rebate Agreement Changed on Time

\* 094 Rebate: Material for Settlement

\* 095 Rebate Agreement Description

\* 096 Rebate Verification Level

\* 097 Rebate Condition Type Group

\* 098 Free goods: Minimum quantity

\* 099 Free goods: Free goods quantity

\* 100 Free goods: min free goods quantity

\* 101 Free goods: AddL quantity

\* 102 Free goods: free goods addl quantity

\* 103 Free goods: Percentage rate

\* 104 Free goods: Calculation quantity

\* 105 Free goods category

\* 106 Free goods delivery control

\* 107 Free goods: Text output

\* 108 Free Goods: Additional Material

\* 109 Free goods: Addl Mat Desc

\* 110 Departure Country

\* 111 Destination Country

\* 112 Cust Tax class1

\* 113 Mat Tax class

\* 114 Sale/Pur code tax

\* 115 Error in FLush

\*Selection texts

\*---------------------------------------------------------\-

\* P_CDATAB Condition Valid From

\* P_CDATBI Condition Valid To

\* P_CRMSYS CRM System

\* P_FREEGD Free goods

\* P_PRICE Prices / Discounts / Surcharge

\* P_RDATAB Rebate Agreement Valid From

\* P_RDATBI Rebate Agreeement Valid To

\* P_REBATE Rebates

\* P_VARI Layout Variant

\* S_ALAND Departure Country

\* S_BOART Rebate Agreement Type

\* S_BONEM Rebate Recipient

\* S_BOSTA Rebate Agreement Status

\* S_CAMPID Campaign ID

\* S_HIENR Customer Hierarchy

\* S_KONDA Price Group

\* S_KSCHL Condition Type

\* S_KUNNR Sold To Party

\* S_LOEVM Condition Deletion Indicator

\* S_MATNR Material

\* S_MVGR1 Material Group 1

\* S_PRODH1 ProdH 1 - Business

\* S_PRODH2 ProdH 2 â€" Business ID

\* S_PRODH3 ProdH 3 â€" Category

\* S_PRODH4 ProdH 4 â€" Segment

\* S_PRODH5 ProdH 5 â€" Seg/Sub Seg

\* S_VKORG Sales Organization

\* S_VTWEG Distribution Channel

\* S_XCAMID Campaign (External ID)

\*Messages

\*---------------------------------------------------------\-

\*

\* Message class: ZPRICING

\*030

\*064

\*065

\*066

\*067

\*068

\*069

\*070

\*072

\*073

\*074

\*075

\*076

\*077

\*078

\*079

\*080

\*089

\*090

\*402

\*403

\*409

\*513

\*517

\*527
  • No labels