2007 Nov 26 7:32 PM
hi gurus,
i am storing all the gl accounts which do not go through a validation in an internal table i_saknr,
after validation process is over , if this internal table has any GL accounts, then i should list out these GL accounts.
can some one help me how to check if the i_saknr is empty.
thank you.
2007 Nov 26 7:34 PM
Hi,
if not itab[] is initial.
" is not empty
endif.
if itab[] is initial.
" is empty
endif.
a®
2007 Nov 26 7:34 PM
Hi,
if not itab[] is initial.
" is not empty
endif.
if itab[] is initial.
" is empty
endif.
a®
2007 Nov 26 7:37 PM
Hi Sanjana,
You can write a simple statement.
CHECK I_SAKNR[] is not initial.
Regards,
Satish
2007 Nov 26 9:17 PM
You can do like this:
DATA: BEGIN OF I_SAKNR OCCURS 0,
SAKNR TYPE BSEG-HKONT,
END OF I_SAKNR .
* Option 1
DESRIBE TABLE I_SAKNR LINE SY-INDEX.
IF SY-INDEX IS INITIAL.
PERFORM WRITE_ERROR_GL.
ENDIF.
* Option 2
IF NOT I_SAKNR [] IS INITIAL.
PERFORM WRITE_ERROR_GL.
ENDIF.
FORM WRITE_ERROR_GL.
WRITE : / 'Validation fails for these GL accounts'.
LOOP AT I_SAKNR .
WRITE: / I_SAKNR-SAKNR.
ENDLOOP.
ENDFORM.
Regards,
Naimesh Patel