Skip to Content
-2

How Unit Test works on Open SQL?

Hi experts,

Say I want a DB handler class as below, in which method is pure Open SQL statement.

CLASS lcl_mara_db_handler IMPLEMETATION.

METHOD update_mara.

MODIFY mara FROM is_mara.

ENDMETHOD.

METHOD insert_mara.

INSERT.........

ENDMETHOD.

.......

ENDCLASS.

How can I write Unit Test first, as the decency is DB, do I need to consider that a different DB could return a different result? Or not necessary to consider the Unit Test on this leave?

BRs,

Archer

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 13, 2017 at 04:13 AM

    For that, we have test seams and injections.

    https://blogs.sap.com/2015/10/23/abap-news-for-750-test-seams-and-injections

    Since you are with SAP, you might also check the 7.52 documentation for another new possibility.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 13, 2017 at 05:41 AM

    OpenSQL gives the same result whatever the database is, that's the reason of being of OpenSQL (in answer to "do I need to consider that a different DB could return a different result?") I probably didn't get your point, sorry.

    Add comment
    10|10000 characters needed characters exceeded