05-07-2010 2:50 PM
I am debugging my code and for some reason, when a field is blank/empty/devoid of any characters what so ever
hexadecimal value is: 20002000200020002000200020002000 it is still not dropping into the code...
IF NOT it_actual[] IS INITIAL.
LOOP AT it_actual INTO lw_actual.
IF lw_actual-strdt IS INITIAL. *this does not work on empty field! *
READ TABLE it_actual INTO ls_actual INDEX 1.
lw_actual-strdt = ls_actual-strdt.
lw_actual-enddt = ls_actual-enddt.
MODIFY it_actual FROM lw_actual TRANSPORTING strdt enddt.
ENDIF.
ENDLOOP.
ENDIF.
The first loop round is okayu2026 as the field is populatedu2026
But on the second loop, the field is empty, but it does not drop into the codeu2026.
I am just trying to copy the header dates into the line item dates before I call the proxyu2026.
Any ideas? it is probably something obvious...
05-07-2010 3:02 PM
Hi,
Initial value depends on the data type, if it is a date field initial value should be '00000000' not empty.If it is coming empty from system you should check "if strdt = space" not initial. Check abap documentation for the initial key word.
Regards,
Edited by: Gungor Ozcelebi on May 7, 2010 4:04 PM
05-07-2010 2:58 PM
You are reading a table you are looping at, without saving the sy-tabix position before the read, and without using the index clause in the modify.
05-07-2010 3:03 PM
i think it has more to do with the data type field.
as it is a date field, if i enter 00000000 it then drops into the code.
05-07-2010 3:02 PM
Hi,
Initial value depends on the data type, if it is a date field initial value should be '00000000' not empty.If it is coming empty from system you should check "if strdt = space" not initial. Check abap documentation for the initial key word.
Regards,
Edited by: Gungor Ozcelebi on May 7, 2010 4:04 PM
05-07-2010 3:06 PM
05-07-2010 3:14 PM
i have opted for:
IF lw_actual-strdt EQ space
OR lw_actual-strdt IS INITIAL.