Skip to Content

logic error

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 04:35 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 04:46 PM

    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

    Add comment
    10|10000 characters needed characters exceeded