cancel
Showing results for 
Search instead for 
Did you mean: 

Errors while transferring conditions: duplicates found

Former Member
0 Kudos

Hi SCN

We have upgraded from 4.6 to ECC 6.

While changing the actions from transaction WTY I am getting fallowing message

Errors while transferring conditions: duplicates found



Message no. VH806

Diagnosis


During the data transfer after successful pricing, the system recognized that document conditions with the same key exist for condition type ZP01.

and item pricing conditions are repeating and it is looking like

Experts please share your views on this wired problem and correct answers will be appricated.

Thank you,

Warm regards

#SRT

Accepted Solutions (1)

Accepted Solutions (1)

michael_piehl
Active Participant
0 Kudos

From the quick scan of the code, I don't see any reason why that should be causing you any issues. Does this same behavior occur for any new claims? or only for claims existing before the upgrade?

I know that a LOT of stuff changed between 4.6 & ECC 6.0, so it is very possible that the code being executed behind the scenes is different from the 4.6 code for pricing.

The other thing to try, just to see what happens is if you delete one of the duplicate conditions, does it get regenerated? is the error resolved? or does nothing change?

Thanks,

Mike

Former Member
0 Kudos

Hi Michael,

Many thanks for your reply,

The same thing is happening with the new claim also..when I am creating new claim and trying to update the price all the condition names are disappearing and when I try to give manual values after the names gone away it says that particular condition type like

Condition ZP01 is missing in pricing procedure A

Message no. V1206

Where as there is no pricing procedure with name A in pricing procedure, don't know why system is taking all the condition types description out and giving this error.

Additionally when I try to delete one of duplicate condition it say's

Condition ZP01 cannot be deleted

Message no. V1226


** Some how I am able to get the rid of duplicate occurring conditions for this I have changed OWTY>>Control Data>>Copying Control>>Assign Copy Procedures to Claim Types

From here by removing check boxes for CopyPriceMat, CopyPriceFR and CopyPriceSUBL, any comment on this...??

Thank you,

Regards

#SRT

Answers (5)

Answers (5)

michael_piehl
Active Participant
0 Kudos

ok... well, with the easy stuff out of the way, here's what I'd try next.

1. go into your pricing procedure/condition types, and remove any requirements or calculations associated with them. You can create a copy and assign it if it's easier.

if that works, you know you have a code issue. assign them back one at a time until the issue resurfaces.

2. if the issue is still there, create a whole new pricing procedure. Create it with minimal conditions and keep building it up to your current procedure. Test it one addition at a time until it happens again.

one more question I just thought of. What area is it occurring (IC, OC, IV, OV) or is it occurring every where. just trying to make sure it's not an action issue, but it certainly sounds like a pricing issue.

Thanks,

Mike

michael_piehl
Active Participant
0 Kudos

I know it sounds obvious, and I'm sure you've already done this, but have you checked the OWTY-->Define Claim Type, and checked to be sure the settings are still intact within this piece of configuration? Check the pricing procedure assigned here, and then just double check to make sure the pricing procedure still exists. You might even try the regen program for pricing. I think it's RV80HGEN... Just to see if that might make a difference.

Good luck,

Mike

Former Member
0 Kudos

Hi Michael,

Thanks for all your continuous help,

I already did all the generation of routines in new system.

As per configuration point I have checked everywhere and it seems okay and pricing procedure is assigned there and it exists.

But still no luck

Thank you,

Regards

#SRT

Former Member
0 Kudos

hi Check if any SAP notes exiting for this issue ...

-Linganna

Former Member
0 Kudos

Hi Katigiri,

There is no existing note for ECC 6 for this error .

Thank you,

Best regards,

#SRT

Former Member
0 Kudos

The blow code may be reason behind this wired error but the same was working fine in old system (4.6)

any comment on the code as per ECC 6

FORM FRM_KONDI_WERT_901.

*{ INSERT TB2K921640 1

*

DATA:

found TYPE xfeld,

perc TYPE int1,

d TYPE i,

wa_xkomv LIKE xkomv,

it_xkomv TYPE TABLE OF komv_index,

wa_xkomv2 LIKE xkomv.

DATA: lt_item TYPE wty_pvwty_dia_tab,

ls_item TYPE wty_pvwty_dia,

lt_version TYPE wty_pnwtyv_dia_tab,

ls_version TYPE wty_pnwtyv_dia,

lt_header TYPE wty_pnwtyh_dia_tab,

ls_header TYPE wty_pnwtyh_dia.

DATA: wa_pnwtyh TYPE pnwtyh.

DATA:

date(10) TYPE c,

datum TYPE pnwtyh-refdt,

wa_premium TYPE zpr_premium.

DATA:

wa_premium_def TYPE zpr_premium_def,

acttype TYPE zpr_premium_def-type_of_act,

SALESACT TYPE zpr_premium_def-sales_act. "CR31030

DATA: cs_pnwtyv_dia TYPE wty_pnwtyv_dia,

ls_items TYPE wty_pvwty_dia,

pname TYPE wty_pvwty_dia-pname,

versn TYPE wty_versn,

lines TYPE i.

DATA:

knumv TYPE vbrk-knumv,

sum1 TYPE konv-kbetr,

it_konv TYPE TABLE OF konv,

wa_konv TYPE konv,

posnr TYPE vbrp-posnr.

DATA:

wert TYPE komv_index-kwert,

bonus_pct TYPE zpr_premium-bonus_pct,

bonus_amt TYPE zpr_premium-bonus_amt,

handling_pct TYPE zpr_premium-handling_pct,

handling_amt TYPE zpr_premium-handling_amt.

SELECT SINGLE *

FROM pnwtyh

INTO wa_pnwtyh

WHERE clmno EQ komk-wty_clmno.

IF sy-subrc EQ 0.

REFRESH: lt_header, lt_version, lt_item.

CALL METHOD cl_ppeliwty_cntl=>claim_read_db

EXPORTING

iv_clmno = wa_pnwtyh-clmno

IMPORTING

et_pnwtyh = lt_header

et_pnwtyv = lt_version

et_pvwty = lt_item.

***** get last version

DESCRIBE TABLE lt_version LINES lines.

SORT lt_version BY versn.

READ TABLE lt_version INTO ls_version INDEX lines.

* describe table lt_item lines lines.

READ TABLE lt_header INTO ls_header INDEX 1.

READ TABLE lt_item INTO ls_item

WITH KEY pname(4) = ls_version-versn .

*komp

*komk

*xkwert

*xkomv

CLEAR: sum1.

SELECT SINGLE posnr FROM vbrp

INTO posnr

WHERE vbeln EQ wa_pnwtyh-refno

AND pstyv EQ 'ZT00'.

IF sy-subrc NE 0.

* GET PESSENGER CARS DATA

SELECT SINGLE knumv

FROM vbrk

INTO knumv

WHERE vbeln EQ wa_pnwtyh-refno.

SELECT * FROM konv

INTO wa_konv

WHERE knumv EQ knumv

AND ( kschl EQ 'ZN00' OR kschl EQ 'ZN01'

OR kschl EQ 'ZN02' OR kschl EQ 'ZN50'

OR kschl EQ 'ZN60' OR kschl EQ 'ZN80' )

AND kawrt NE 0.

sum1 = sum1 + wa_konv-kbetr.

ENDSELECT.

ELSE.

* GET TRUCKS DATA

SELECT SINGLE knumv

FROM vbrk

INTO knumv

WHERE vbeln EQ wa_pnwtyh-refno.

SELECT * FROM konv

INTO CORRESPONDING FIELDS OF wa_konv

WHERE knumv EQ knumv

AND kposn EQ posnr

AND ( kschl EQ 'ZT01' OR kschl EQ 'ZT02'

OR kschl EQ 'ZT04' OR kschl EQ 'ZT05' OR kschl EQ 'ZT06' )

AND kawrt NE 0.

sum1 = sum1 + wa_konv-kbetr.

ENDSELECT.

ENDIF.

IF sy-sysid EQ 'TB2' AND sum1 IS INITIAL.

sum1 = 10000.

ENDIF.

* Get the type of advertising for the sales activity

SELECT SINGLE SALES_ACT type_of_act

FROM zpr_premium_def

INTO (SALESACT, acttype)

WHERE matnr EQ ls_item-matnr.

* Begin of change IM59239 PIPA 14.01.2009

* following code was commented and new one created with

* all registration type present in the system

* IF acttype EQ 'D'.

** Get the demo vehicle registration date

* CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

* EXPORTING

* vin = wa_pnwtyh-relob_ext

* atnam = 'RD0005' "Zulass.dat. VFW

* IMPORTING

* date = date

* EXCEPTIONS

* characteristic_not_found = 1

* vin_not_found = 2

* no_value = 3

* dump = 4

* OTHERS = 5.

* ELSE.

** Get the registration dealer date

* CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

* EXPORTING

* vin = wa_pnwtyh-relob_ext

* atnam = 'RD0002' " Zul.dat. Endkunde

* IMPORTING

* date = date

* EXCEPTIONS

* characteristic_not_found = 1

* vin_not_found = 2

* no_value = 3

* dump = 4

* OTHERS = 5.

* ENDIF.

*

* UNPACK date TO datum.

DATA: date1(10) TYPE c,

date2(10) TYPE c,

datum1 TYPE pnwtyh-refdt,

datum2 TYPE pnwtyh-refdt.

*-----------------------------------------------------------------------------

DATA: gv_frame_contract TYPE zpr_premium-frame_contr,

gv_body TYPE zpr_premium-body_type_code,

gv_modelcode TYPE zpr_premium-model_code,

gv_opt TYPE zpr_premium-opt,

gv_model_year TYPE zpr_premium-model_year,

gv_sam TYPE zpr_premium-sam,

gv_ddate TYPE c,

gv_edate TYPE c,

lv_demdate(10),

lv_enddate(10),

enddate TYPE d,

demdate TYPE d,

gv_dproc TYPE zpr_premium_def-cl_proc,

gv_eproc TYPE zpr_premium_def-cl_proc..

DATA: t_l_class LIKe sclass OCCURS 0 WITH HEADER LINE.

DATA: t_l_objectdata LIKE clobjdat OCCURS 0 WITH HEADER LINE.

DATA: t_l_object LIKE clobjekte OCCURS 0 WITH HEADER LINE.

DATA: t_l_sel_char LIKE sel_char OCCURS 0 WITH HEADER LINE.

DATA: lv_atwrt LIKE ausp-atwrt.

DATA: lv_atinn LIKE cabn-atnam.

DATA: lv_class TYPE klasse_d.

DATA: lv_klart TYPE klah-klart.

DATA: lv_object_low TYPE kssk-objek,

lv_atflv TYPE ausp-atflv.

* Begin of insert by Santosh for CR31855

CONSTANTS: c_a type char1 value 'A',

c_u type char1 value 'U'.

* End of insert by Santosh for CR31855

*-----------------------------------------------------------------------------

IF acttype EQ 'D'.

* Get the demo vehicle registration date

CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

EXPORTING

vin = wa_pnwtyh-relob_ext

atnam = 'RD0005' "Zulass.dat. VFW

IMPORTING

DATE = DATE

EXCEPTIONS

characteristic_not_found = 1

vin_not_found = 2

no_value = 3

dump = 4

OTHERS = 5.

UNPACK date TO datum.

ELSEIF acttype EQ 'E'.

* Get the registration dealer date

CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

EXPORTING

vin = wa_pnwtyh-relob_ext

atnam = 'RD0002' " Zul.dat. Endkunde

IMPORTING

DATE = DATE

EXCEPTIONS

characteristic_not_found = 1

vin_not_found = 2

no_value = 3

dump = 4

OTHERS = 5.

UNPACK date TO datum.

ELSEIF acttype EQ 'F'.

* retrieve first registration

* Get the demo vehicle registration date

CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

EXPORTING

vin = wa_pnwtyh-relob_ext

atnam = 'RD0005' "Zulass.dat. VFW

IMPORTING

DATE = DATE1

EXCEPTIONS

characteristic_not_found = 1

vin_not_found = 2

no_value = 3

dump = 4

OTHERS = 5.

UNPACK date1 TO datum1.

* Get the registration dealer date

CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

EXPORTING

vin = wa_pnwtyh-relob_ext

atnam = 'RD0002' " Zul.dat. Endkunde

IMPORTING

DATE = DATE2

EXCEPTIONS

characteristic_not_found = 1

vin_not_found = 2

no_value = 3

dump = 4

OTHERS = 5.

UNPACK date2 TO datum2.

IF date1 IS NOT INITIAL AND date2 IS NOT INITIAL.

IF datum1 < datum2.

datum = datum1.

ELSE.

datum = datum2.

ENDIF.

ELSEIF date1 IS NOT INITIAL AND date2 IS INITIAL.

datum = datum1.

ELSEIF date1 IS INITIAL AND date2 IS NOT INITIAL.

datum = datum2.

ENDIF.

ELSEIF acttype EQ 'C'.

* retrieve end customer registration date, demo reg date must be empty

* Get the demo vehicle registration date

CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

EXPORTING

vin = wa_pnwtyh-relob_ext

atnam = 'RD0005' "Zulass.dat. VFW

IMPORTING

DATE = DATE1

EXCEPTIONS

characteristic_not_found = 1

vin_not_found = 2

no_value = 3

dump = 4

OTHERS = 5.

* Get the registration dealer date

CALL FUNCTION 'Z_W_F_PR_GET_CHARACTERISTICS'

EXPORTING

vin = wa_pnwtyh-relob_ext

atnam = 'RD0002' " Zul.dat. Endkunde

IMPORTING

DATE = DATE2

EXCEPTIONS

characteristic_not_found = 1

vin_not_found = 2

no_value = 3

dump = 4

OTHERS = 5.

UNPACK date2 TO datum2.

IF date1 IS INITIAL.

datum = datum2.

ENDIF.

* Begin of change by Santosh for CR31855

* ELSEIF acttype EQ 'A'.

ELSEIF acttype EQ c_a or acttype EQ c_u.

* END of change by Santosh for CR31855

CLEAR: gv_frame_contract,

gv_body,

gv_modelcode,

gv_opt,

gv_model_year,

gv_sam,

gv_ddate,

gv_edate,

lv_demdate,

lv_enddate,

enddate,

demdate,

lv_atwrt,

lv_atinn,

lv_class,

lv_klart,

lv_object_low,

lv_atflv.

REFRESH: t_l_class,

t_l_objectdata,

t_l_object,

t_l_sel_char .

CLEAR: lv_enddate,lv_demdate,enddate,demdate.

CLEAR: lv_atinn, lv_atwrt, lv_atflv.

lv_klart = '300'.

lv_object_low = wa_pnwtyh-relob_ext.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'

EXPORTING

class = lv_class

classtype = lv_klart

object = lv_object_low

objecttable = 'MARA'

TABLES

t_class = t_l_class

t_objectdata = t_l_objectdata

i_sel_characteristic = t_l_sel_char

EXCEPTIONS

no_classification = 1

no_classtypes = 2

invalid_class_type = 3

OTHERS = 4.

IF sy-subrc = 0.

ENDIF.

* get all the required characteristics.

READ TABLE t_l_objectdata WITH KEY atnam = 'NC0014'.

IF sy-subrc = 0.

gv_modelcode = t_l_objectdata-ausp1.

ENDIF.

CLEAR t_l_objectdata-ausp1.

READ TABLE t_l_objectdata WITH KEY atnam = 'NC0026'.

IF sy-subrc = 0.

gv_sam = t_l_objectdata-ausp1.

ENDIF.

CLEAR t_l_objectdata-ausp1.

READ TABLE t_l_objectdata WITH KEY atnam = 'NC0016'.

IF sy-subrc = 0.

gv_opt = t_l_objectdata-ausp1.

ENDIF.

CLEAR t_l_objectdata-ausp1.

READ TABLE t_l_objectdata WITH KEY atnam = 'NC0010'.

IF sy-subrc = 0.

gv_body = t_l_objectdata-ausp1.

ENDIF.

CLEAR t_l_objectdata-ausp1.

READ TABLE t_l_objectdata WITH KEY atnam = 'NC0015'.

IF sy-subrc = 0.

gv_model_year = t_l_objectdata-ausp1.

ENDIF.

CLEAR t_l_objectdata-ausp1.

READ TABLE t_l_objectdata WITH KEY atnam = 'RD0003'.

IF sy-subrc = 0.

gv_frame_contract = t_l_objectdata-ausp1.

ENDIF.

CLEAR t_l_objectdata-ausp1.

READ TABLE t_l_objectdata WITH KEY atnam = 'RD0002'.

IF sy-subrc = 0.

lv_atflv = t_l_objectdata-atflv.

ENDIF.

CLEAR t_l_objectdata-ausp1.

IF sy-subrc = 0.

IF lv_atflv IS NOT INITIAL.

* Convert floating point to character

CALL FUNCTION 'MC_FLTP_CHAR'

EXPORTING

fc_a_fld = lv_atflv

IMPORTING

fc_r_fld = lv_enddate.

CONDENSE lv_enddate.

enddate = lv_enddate.

ENDIF.

ENDIF.

CLEAR: lv_atinn, lv_atwrt, lv_atflv.

READ TABLE t_l_objectdata WITH KEY atnam = 'RD0005'.

IF sy-subrc = 0.

lv_atflv = t_l_objectdata-atflv.

ENDIF.

IF sy-subrc = 0.

IF lv_atflv IS NOT INITIAL.

* Convert floating point to character

CALL FUNCTION 'MC_FLTP_CHAR'

EXPORTING

fc_a_fld = lv_atflv

IMPORTING

fc_r_fld = lv_demdate.

CONDENSE lv_demdate.

demdate = lv_demdate.

ENDIF.

ENDIF.

**write selects to get dates.

CLEAR: gv_edate, gv_ddate.

IF enddate IS INITIAL AND demdate IS NOT INITIAL.

datum = demdate.

ELSEIF enddate IS NOT INITIAL AND demdate IS INITIAL.

datum = enddate.

ELSEIF enddate IS NOT INITIAL AND demdate IS NOT INITIAL.

CLEAR: gv_edate, gv_ddate.

DATA: BEGIN OF wa_sales_act,

sales_act TYPE zpr_premium_def-sales_act,

matnr TYPE zpr_premium_def-matnr,

cl_proc TYPE zpr_premium_def-cl_proc,

type_of_act TYPE zpr_premium_def-type_of_act,

END OF wa_sales_act.

CLEAR: gv_edate, wa_sales_act,gv_dproc,gv_eproc.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

gv_edate = 'X'.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE enddate

AND zpr_premium~valid_to GE enddate.

IF sy-subrc = 0.

gv_edate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

ENDIF.

ENDIF.

*------------------------------------------------------Demo date

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_eproc = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ gv_frame_contract

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ gv_sam

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ gv_opt

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ gv_modelcode

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ gv_model_year

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ gv_body

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

SELECT SINGLE zpr_premium_def~sales_act

zpr_premium_def~matnr

zpr_premium_def~cl_proc

zpr_premium_def~type_of_act

INTO wa_sales_act

FROM zpr_premium_def

INNER JOIN zpr_premium

ON zpr_premium~vkorg EQ zpr_premium_def~vkorg

AND zpr_premium~sales_act EQ zpr_premium_def~sales_act

WHERE zpr_premium~vkorg EQ 'DE01'

AND zpr_premium_def~sales_act EQ SALESACT

AND zpr_premium~frame_contr EQ ''

AND zpr_premium~body_type_code EQ ''

AND zpr_premium~model_code EQ ''

AND zpr_premium~opt EQ ''

AND zpr_premium~model_year EQ ''

AND zpr_premium~sam EQ ''

AND zpr_premium~valid_from LE demdate

AND zpr_premium~valid_to GE demdate.

IF sy-subrc = 0.

gv_ddate = 'X'.

IF wa_sales_act-cl_proc IS NOT INITIAL.

gv_dproc = 'X'.

ENDIF.

ENDIF.

*--------------------------------------------------------------

* Begin of insert by Santosh for CR31855

if acttype EQ c_u.

* IF gv_ddate = 'X' AND gv_edate = 'X'.

if demdate LT enddate.

datum = enddate.

endif.

* endif.

CLEAR: lv_demdate, lv_enddate, demdate, enddate.

ELSEIF acttype EQ c_a.

* End of insert by Santosh for CR31855

IF gv_ddate = 'X' AND gv_edate = 'X'.

IF gv_dproc EQ 'X'.

datum = demdate.

ELSEIF gv_eproc EQ 'X'.

datum = enddate.

ENDIF.

ELSEIF gv_ddate = 'X' AND gv_dproc EQ 'X'.

datum = demdate.

ELSEIF gv_edate = 'X' AND gv_eproc EQ 'X'.

datum = enddate.

ENDIF.

CLEAR: lv_demdate, lv_enddate, demdate, enddate.

ENDIF.

endif. "Santosh for CR31855

ENDIF.

* End of change IM59239 PIPA 14.01.2009

IF NOT ls_item-zz_frame_contr IS INITIAL.

CALL FUNCTION 'Z_GET_PREMIUM_DATA'

EXPORTING

matnr = ls_item-matnr

vin = wa_pnwtyh-relob_ext

frame_contr = ls_item-zz_frame_contr

datum = datum "wa_pnwtyh-refdt

IMPORTING

premium = wa_premium

EXCEPTIONS

not_found = 1

dump = 2

OTHERS = 3.

IF sy-subrc NE 0.

ENDIF.

ELSE.

CALL FUNCTION 'Z_GET_PREMIUM_DATA'

EXPORTING

matnr = ls_item-matnr

vin = wa_pnwtyh-relob_ext

* frame_contr = ls_item-zz_frame_contr

datum = datum "wa_pnwtyh-refdt

IMPORTING

premium = wa_premium

EXCEPTIONS

not_found = 1

dump = 2

OTHERS = 3.

IF sy-subrc NE 0.

ENDIF.

ENDIF.

LOOP AT xkomv INTO wa_xkomv WHERE kschl = 'ZP01'.

IF komv-kschl EQ 'ZP01'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

IF wa_xkomv-kbetr EQ 0.

wa_xkomv-kawrt = sum1.

xkwert = sum1.

ELSEIF komv-kbetr NE 0 AND komv-kschl EQ 'ZP01'.

wa_xkomv-kawrt = komv-kbetr.

wa_xkomv-kwert = komv-kbetr.

* sum1 = komv-kbetr.

xkwert = komv-kbetr.

ENDIF.

MODIFY xkomv[] FROM wa_xkomv INDEX sy-tabix.

EXIT.

ENDLOOP.

IF wa_premium-bonus_amt = 0.

* Take amount from invoice and calculate with %.

LOOP AT xkomv INTO wa_xkomv WHERE kschl = 'ZP02'.

IF komv-kschl EQ 'ZP02'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

IF wa_xkomv-kbetr EQ 0.

wa_xkomv-kbetr = ( wa_premium-bonus_pct * 10 ).

ELSEIF komv-kbetr NE 0 AND komv-kschl EQ 'ZP02'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

MODIFY xkomv FROM wa_xkomv.

EXIT.

ENDLOOP.

ELSE.

* Take amount from invoice.

LOOP AT xkomv INTO wa_xkomv WHERE kschl = 'ZP03'.

IF komv-kschl EQ 'ZP03'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

IF wa_xkomv-kbetr EQ 0.

wa_xkomv-kbetr = wa_premium-bonus_amt.

ELSEIF komv-kbetr NE 0 AND komv-kschl EQ 'ZP03'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

MODIFY xkomv FROM wa_xkomv.

EXIT.

ENDLOOP.

ENDIF.

*######## fill for handling stuff

IF wa_premium-handling_amt = 0.

* Take amount from invoice and calculate with %.

LOOP AT xkomv INTO wa_xkomv WHERE kschl = 'ZP04'.

IF komv-kschl EQ 'ZP04'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

IF wa_xkomv-kbetr EQ 0.

wa_xkomv-kbetr = ( wa_premium-handling_pct * 10 ) * -1.

ELSEIF komv-kbetr NE 0 AND komv-kschl EQ 'ZP04'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

MODIFY xkomv FROM wa_xkomv.

EXIT.

ENDLOOP.

ELSE.

* Take amount from invoice.

LOOP AT xkomv INTO wa_xkomv WHERE kschl = 'ZP05'.

* wa_xkomv-kbetr = wa_premium-handling_amt.

IF komv-kschl EQ 'ZP05'.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

IF wa_xkomv-kbetr EQ 0.

wa_xkomv-kbetr = wa_premium-handling_amt * -1.

ELSEIF komv-kbetr NE 0 AND komv-kschl EQ 'ZP05'.

IF komv-kbetr > 0.

komv-kbetr = komv-kbetr * -1.

ENDIF.

wa_xkomv-kbetr = komv-kbetr.

ENDIF.

MODIFY xkomv FROM wa_xkomv.

EXIT.

ENDLOOP.

ENDIF.

ENDIF.

*} INSERT

ENDFORM.




Thank you,

Regards

#SRT

Former Member
0 Kudos

Hi SRT,

Can you click on Analysis button in the conditions tab and post the screenshot for the same.

Former Member
0 Kudos

Hi Sesha,

Many thanks for your reply,

Before action change

After changing action

Thank you,

Regards

#SRT

Former Member
0 Kudos

Any comments........?????