Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

logic error

prince_isaac
Active Participant
0 Kudos

hi gurus

can anyone please advise me how to adjust the piece of code below as it is not validating correctly

IF zsalesdata-dateofsale LE '2005.01.01'.

PERFORM improvements.

ELSEIF zsalesdata-dateofsale GT '2005.01.01' AND zsalesdata-dateofsale LE '2006.12.31'.

PERFORM insert_itab.

PERFORM multiple_impr.

PERFORM inflation_display.

PERFORM total.

  • ENDIF.

ELSEIF zsalesdata-dateofsale GT '2006.12.31'. "CPI calculations with effect from year beginning 01.01.2007

PERFORM insert_itab.

PERFORM cpi_inflat.

PERFORM inflation_display.

ENDIF.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI,

Check the date format in the field zsalesdata-dateofsale

data : lv_date1 type sy-datum,

lv_date2 type sy-datum,

lv_date3 type sy-datum.

lv_date1 = '20050101'.

lv_date2 = '20061231'.

IF zsalesdata-dateofsale LE lv_date1.

PERFORM improvements.

ELSEIF zsalesdata-dateofsale between lv_date1 AND lv_date2.

PERFORM insert_itab.

PERFORM multiple_impr.

PERFORM inflation_display.

PERFORM total.

  • ENDIF.

ELSEIF zsalesdata-dateofsale GT lv_date2. "CPI calculations with effect from year beginning 01.01.2007

PERFORM insert_itab.

PERFORM cpi_inflat.

PERFORM inflation_display.

ENDIF.

Thanks

mahesh

2 REPLIES 2

Former Member
0 Kudos

HI,

Check the date format in the field zsalesdata-dateofsale

data : lv_date1 type sy-datum,

lv_date2 type sy-datum,

lv_date3 type sy-datum.

lv_date1 = '20050101'.

lv_date2 = '20061231'.

IF zsalesdata-dateofsale LE lv_date1.

PERFORM improvements.

ELSEIF zsalesdata-dateofsale between lv_date1 AND lv_date2.

PERFORM insert_itab.

PERFORM multiple_impr.

PERFORM inflation_display.

PERFORM total.

  • ENDIF.

ELSEIF zsalesdata-dateofsale GT lv_date2. "CPI calculations with effect from year beginning 01.01.2007

PERFORM insert_itab.

PERFORM cpi_inflat.

PERFORM inflation_display.

ENDIF.

Thanks

mahesh

Former Member
0 Kudos

Hi Prince,

IF zsalesdata-dateofsale LE '2005.01.01'.

PERFORM improvements.

ELSE. "Means - Value is Greater than 2005.01.01 - Its Understood.

IF zsalesdata-dateofsale LE '2006.12.31'.

PERFORM insert_itab.

PERFORM multiple_impr.

PERFORM inflation_display.

PERFORM total.

ENDIF.

EndIF.

IF zsalesdata-dateofsale GT '2006.12.31'. "CPI calculations with effect from year beginning 01.01.2007

PERFORM insert_itab.

PERFORM cpi_inflat.

PERFORM inflation_display.

ENDIF.

Can you check the code in this way and let me know if you face some issues.

Regards,

Lijo Joseph