Release 7.40, SP08 of Application ABAP in SAP Netweaver is another bundled release that comes with a new kernel. While 7.40, SP02 was delivered with kernel release 740 and  7.40, SP05 with kernel release 741, 7.40, SP08 is based on kernel 742. When upgrading your 740 application server to 7.40, SP08 you have to use kernel 742 and by this you will get the following enhancements of the ABAP language in a fully downward compatible way.

Expressions

  • Predicative method call IF meth( ) and a new boolean function xsdbool for logical expressions
  • Iterative expressions FOR … UNTIL|WHILE in constructor expressions, new constructor expression REDUCE especially for FOR
  • Addition BASE for start values of constructor expressions

Internal Tables

Database Access

  • Inline declarations, enhanced SQL expressions and new position of INTO clause in Open SQL
  • Parameter views, new built-in functions and view extensions in  ABAP CDS
  • Tabular changing parameters, class based exceptions and specialized BAdIs in AMDP

Furthermore, you can make interface methods optional now. As always, you find all ABAP News in the ABAP Keyword Documentation, that was updated in the SAP Help Portal. The updated version contains a new reference documentation for the ABAP Dictionary. The next bundled release with new ABAP features (I know some niceties already)  will be 7.40, SP12 presumably.

To report this post you need to login first.

45 Comments

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

  1. Carsten Herzog

    Hi Horst.

    Thank you for this information. Do have an idea or a link where I can find further release informations regarding ABAP Object?

    Thanks in advance!

    C

    (0) 
  2. Vadim Vologzhanin

    Hello! This is an information of a great value, thank you!

    I’ve got one question – why there isn’t a real boolean type in ABAP? I mean the boolean type what behaves like one in Java or Javascript.

    For example, it would be nice to write like this:

    DATA lv_flag1 TYPE abap_bool VALUE abap_true.

    DATA(lv_flag2) = NOT lv_flag1.   “so lv_flag2 = abap_false

    or like this:

    WHILE lv_flag1.

    “do something…

    ENDWHILE.

    (0) 
      1. Glen Simpson

        Here’s an alternative that is shorter but equally mind-bending: πŸ˜›

        DATA(lv_flag2) = xsdbool( lv_flag1 EQ abap_false ).

        In the absence of simpler syntax (that I know of, anyway), I think that it might be better to create a quick static class to hide the complexity:

        CLASS bool DEFINITION.

           PUBLIC SECTION.

             CLASS-METHODS: bool

               IMPORTING value       TYPE abap_bool

               RETURNING VALUE(bool) TYPE abap_bool.

             CLASS-METHODS: not

               IMPORTING value      TYPE abap_bool

               RETURNING VALUE(not) TYPE abap_bool.

        ENDCLASS.

        CLASS bool IMPLEMENTATION.

           METHOD bool.

             bool = value.

           ENDMETHOD.

           METHOD not.

             not = xsdbool( value eq abap_false ).

           ENDMETHOD.

        ENDCLASS.

        Which allows you to do things like:


        DATA( something ) = abap_false.

        DATA( not_something) = bool=>not( something ).

        and:

        WHILE bool=>bool( something ).

        ENDWHILE.

        This isn’t perfect either but hopefully it’s easier to read and digest…

        (0) 
        1. Custodio de Oliveira

                                      Glen Simpson wrote:

          Here’s an alternative that is shorter but equally mind-bending: πŸ˜›

          DATA(lv_flag2) = xsdbool( lv_flag1 EQ abap_false ).

          I firstly wrote:

          DATA(lv_flag2) = boolc( lv_flag1 EQ abap_false ).


          But for some reason I thought it was not right. It must be Monday πŸ˜€

          (0) 
  3. Guilherme Dellagustin

    Hello Horst Keller,

    Do you know if there is any plans to enhance the support for Parameterized tests in ABAP Unit using test data containers (ETDC objects from transaction SECATT)?

    Currently this is done using an API to read the TDCs. It would be nice if it was integrated in a way that the test class would recognize the TDC and treat each variant as one test case somehow.

    Best Regards,

    Guilherme.

    (0) 
    1. Klaus Ziegler

      Hello Guilherme,

      as far as I can see there are no concrete plans to enhance the support for parameterized tests in ABAP Unit. So at present one needs to stick to techniques like you mentioned or shown in report RS_AU_SAMPLE_PARAMETERIZED_TST.

      Best Regards

        Klaus

      (0) 
      1. Guilherme Dellagustin

        Hello Klaus,

        Thanks for your answer. It is not one that makes me happy though πŸ™ .

        I think this would be a well appreciated feature for the Testing community.

        If one day you decide to include it, I would gladly participate as tester or evaluate early stage designs.

        Best Regards,

        Guilherme.

        (0) 
    1. Shai Sinai

      Hi,

      I’ve read the SAP Insider article regarding the NW 7.5 news,

      but I must say it felt more like what’s new in NW 7.4 SP05 than what’s new in NW 7.5 πŸ˜†

      (0) 
      1. Peter Inotai

        >but I must say it felt more like what’s new in NW 7.4 SP05 than what’s new in NW 7.5

        I also had the impression, that apart from the new features for CDS/AMDP there are not many things, which were not available in 7.4 via SPs.

        But it’s not because there are no new developments, but simple the ABAP group is nice enough to downport them to 7.4 πŸ™‚

        (0) 
        1. Horst Keller Post author

          there are not many things, which were not available in 7.4 via SPs.

          I see more than you can see

          /wp-content/uploads/2015/07/news_758063.jpg

          Wait, wait a little while …

          πŸ˜›

          (0) 
          1. Peter Inotai

            >I see more than you can see

            With such resolution I’m pretty sure … or maybe something is wrong with my eyes πŸ˜€

            But it sounds promising.

            >Wait, wait a little while …

            I’ll do. But it’s not so easy πŸ™‚

            (0) 
          2. Thomas Therre

            Hello,

            can you imagine to organize a Open SAP course about all this topics? Maybe together with some of your colleagues? e.g. Sascha Krüger?

            I would certainly be enrolled….

            (0) 
            1. Horst Keller Post author

              I can imagine an Open SAP course about all these topics, but not organized by me. B.t.w., there is a TechEd session about this and maybe those guys …

              (0) 
  4. Kris Claes

    Great thing.

    But I have a problem using the combination of CORRESPONDING and FILTER:

    I constucted this logic first:I filter data from one table in some ‘temporary’ table and append it to a ‘total’ table:

        DATA(lt_sm_temp) =  FILTER #( lt IN lt_filter_sm

                                         WHERE otype = otype ).

        lt_sm = CORRESPONDING #( BASE ( lt_sm ) lt_sm_temp ).

    This works fine!

    And then I put it all together, because that should be the way to go:

        lt_sm = CORRESPONDING #(

                   BASE ( lt_sm )

                   FILTER #( lt IN lt_filter_sm

                                WHERE otype = otype ) ).

    I can activate this, so the syntax is correct. But I get a shortdump executing it …

    Am I doing anything wrong?

    Rgards.

    Kris

    (0) 
    1. Horst Keller Post author

      I think I remember that one, there was an SCN discussion about it and the bug was reported to development.

      I’d say it is corrected with a kernel patch meanwhile. In my 7.50 development system it runs OK while with an older 7.40 kernel it dumps.

      (0) 
  5. Kris Claes

    Hi,

    for some time we are in 7.40 SP8 and notice something strange: we want to replace a character with a SPACE, but it seems the REPLACE doesn’t do that correctly:

    DATA: lv_string(1024) TYPE c VALUE ‘Dit is dus dat teken@en dat staat hier@ook’.

    REPLACE ALL OCCURRENCES OF ‘@’ IN lv_string WITH ‘  ‘ ” space

              REPLACEMENT COUNT  DATA(lv_cnt).

    I tried the same thing in our intake on 7.50 with the same result.

    We really have hundreds of shese statements, so it must have worked, I guess.

    Are we doing something wrong or has anything happened since the last upgrade?

    Regards.

    Kris

    (0) 
    1. Horst Keller Post author

      Works as “designed” ( 😐 ) and as always before, doesn’t it?

      Please see the good ol’ Trailing Blanks in Character String Processing and then REPLACE:

      in the case of new it is ignored.

      And last but not least REPLACE pattern IN:

      Note

      To be replaced by character-like content that contains trailing blanks, new has to have the data type string.

      (OK, the English translation is a bit awkward here, but I guess you can read the German original too)

      (0) 
      1. Shai Sinai

        Actually, I’ve checked it right now in NW 7.02 and it seems to work just fine.

        Regarding

        Note

        To be replaced by character-like content that contains trailing blanks, new has to have the data type string.

        I must say I didn’t understand why it means that the whole replace is being ignored.

        As far as I understand, it only means that trailing blanks are ignored.

        i.e. in this example,’@’ should be replaced with none (actually it will be removed).

        (0) 
        1. Horst Keller Post author

          seems to work just fine

          Depends on what you expect.

          You expected the right thing. Trailing blanks are ignored, therefore @ is replaced with an empty string.

          Kris expected wrongly that the blank is preserved in a replacement with type c. Instead he has to use type string.

          (0) 
      2. Kris Claes

        Oh … then I wonder whether people know what they are doing when testing this.

        Do you see the difference with this? Here ‘other’ quotes (“`” the accent grave in french) are used, not the regular ones “‘” and this seems to work.

          REPLACE ALL OCCURRENCES OF ‘@’ IN lv_string WITH ` ` ” space

                  REPLACEMENT COUNT  DATA(lv_cnt).

        Bizar, isn’t it?

        Thanks for the reply.

        Kris

        (0) 
        1. Horst Keller Post author

          Bizar, isn’t it?


          No, not at all!


          There is a well documented difference between data type c and data type string.


          And we have two types of character literals: text field literals (‘…’) and text string literals (`…`).


          And a lot of hints about the trailing blank stuff, e.g. in the literal chapter:


          • Trailing blanks in text field literals use memory, but are generally ignored in operand positions, like for all data objects of the type c. In text string literals they are always relevant, as in all data objects of type string.

          I am really a little bit concerned  that this is not common knowledge (strings were introduced with release 4.6!).







          (0) 
  6. Thomas Matecki

    Hi Horst!
    Are there any plans to create an analogue to the LINES OF internal_tableΒ for use in constructor expressions?

    For example, supposed I’m attempting to perform packet processing of a large internal table like this:

    DATA(idx_from) = 1.
    DATA(idx_to) = packet_size.
    
    WHILE idx_to LT lines_in_some_big_table.
    
        REFRESH lt_packet[].
        INSERT LINES OF lt_some_big_table FROM idx_from TO idx_to INTO lt_packet.
    
        "... Do some stuff using lt_packet.
    
        ADD packet_size TO: idx_to, idx_from.
    
    ENDWHILE.
    
    

    It’d be nice if I could do something like this:

    WHILE idx_to LT lines_in_some_big_table
    
        lt_packet =  LINES OF #( some_big_table 
    				FROM idx_from 
    				TO idx_to ).
       
       ".... Do some stuff
    
        ADD packet_size TO: idx_to, idx_from.
    
    ENDWHILE.
    

    One can easily see how this would compose very nicely to with anΒ iterative expressionΒ to provide a short and concise way to express something that is rather idiomatic to ABAP programming.

    (0) 

Leave a Reply