Αναζήτηση

Thursday, May 3, 2012

Load image into abap internal table

The following code load image file into abap internal table :
REPORT zload_photo.

parameters : p_file(255).

DATA: BEGIN OF i_photo OCCURS 0.
INCLUDE STRUCTURE solisti1.
DATA: END OF i_photo.

if p_file <> ''.

OPEN DATASET p_file FOR INPUT IN BINARY MODE.
IF sy-subrc <> 0.
write :/ 'file ', p_file, ' Cannot open !'.
else.
DO.
CLEAR i_photo.
READ DATASET p_file INTO i_photo.
IF sy-subrc EQ 0.
APPEND i_photo.
ELSE.
APPEND i_photo. "<---------- force to append last row
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET p_file.
endif.
endif.
Original Article : http://developerpages.gr/index.php/el/desktop-development-2/abap/61-load-image-into-abap-internal-table

No comments:

Post a Comment