Skip to Content
0
Former Member
Oct 15, 2007 at 01:00 AM

IF in loop

15 Views

Hi,

I cant get my IF to Write out what i select.

I am a beginner in coding and when doing the debugging it only skips past the Write statement in the IF.

Thanks y'all

FORM write_data USING u_sflight_tab TYPE t_sflight_tab.

FIELD-SYMBOLS <fs_sflight> LIKE LINE OF u_sflight_tab.

LOOP AT u_sflight_tab ASSIGNING <fs_sflight>.

t_sAvail = <fs_sflight>-SeatsMax - <fs_sflight>-SeatsOcc.

t_PercOcc = t_sAvail / <fs_sflight>-SeatsMax.

IF <fs_sflight>-fldate+4(4) BETWEEN '0301' and '0330'.

Write: 'Spring Break'.

ENDIF.

IF <fs_sflight>-fldate+4(4) BETWEEN '0401' and '0410'.

Write : 'Easter'.

ENDIF.

WRITE: / 'CarrId', <fs_sflight>-carrid,

'ConnID', <fs_sflight>-connid,

'FlDate', <fs_sflight>-fldate,

'SeatsOcc', <fs_sflight>-SeatsOcc,

'sAvail', t_sAvail,

'PercOCC', t_PercOcc,

'SeatsMax', <fs_sflight>-SeatsMax.