Load image into abap internal table



User Rating:  / 4
PoorBest 
Details

The following code load image file into abap internal table :

View source
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.


You have no rights to post comments

   

Login  

   

     

© Developerpages