I solved this error today, was looking in the web for this solution and could not find, I just found a lot of people with the same issue, after upload the PDF and try to open in the server or attached the file or sending the file we got an error saying that the file has a error and could not be fixed, the reason is the file size, the open dataset is getting the sy-subrc <> to 0 at the last record and the record is not getting into the table. At the moment to exit we have to append the last row in the table.

I hope this help anyone.

TYPES: BEGIN OF hex_record,

        field(1024)  TYPE x,

       END OF hex_record.

lt_tab_ex2       TYPE STANDARD TABLE OF hex_record WITH HEADER LINE,

OPEN DATASET lv_fname FOR INPUT IN BINARY MODE.

      IF SY-subrc EQ 0.

        DO.

          READ DATASET lv_fname INTO lt_tab_ex2-field.

          IF SY-subrc EQ 0.

            append lt_tab_ex2.

          ELSE.

            append lt_tab_ex2.

            EXIT.

          ENDIF.

        ENDDO.

        CLOSE DATASET lv_fname.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Clément Belezy

    Hi Raymundo,

     

    There is an extra line in your code, the line after OPEN DATASET is not necessary in your code.

     

    However, your solution did the trick and solved my problem !

     

    Thanks a lot.

    Clément

    (0) 

Leave a Reply