Skip to Content
Author's profile photo Horst Keller

ABAP Language News for Release 7.40, SP08

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.

Assigned Tags

      45 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Marcel GΓ€be
      Marcel GΓ€be

      Nice information. Thank You!

      Author's profile photo Carsten Herzog
      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

      Author's profile photo Carsten Herzog
      Carsten Herzog

      http://help.sap.com/abapdocu_740/en/index.htm?file=abennews-740_SP08.htm

      Ah I found it by myself πŸ˜‰  see Chapter "ABAP - Release-Specific Changes"

      Author's profile photo Former Member
      Former Member

      Nice news, Horst, thanks!!!

      Author's profile photo Gregory Gotera
      Gregory Gotera

      Excelent...

      Author's profile photo Former Member
      Former Member

      Great work! I really like where this is going!

      Author's profile photo Pradeep Kodinagula
      Pradeep Kodinagula

      Many Thanks!!

      Author's profile photo Vadim Vologzhanin
      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.

      Author's profile photo Custodio de Oliveira
      Custodio de Oliveira

      DATA(lv_flag2) = COND #( WHEN lv_flag1 = abap_true THEN abap_false ELSE abap_true ).


      Definitely not as good πŸ™

      Author's profile photo Glen Simpson
      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...

      Author's profile photo Custodio de Oliveira
      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 πŸ˜€

      Author's profile photo Glen Simpson
      Glen Simpson

      Custodio de Oliveira wrote:

      It must be Monday πŸ˜€

      No doubt! πŸ™‚

      Author's profile photo Guilherme Dellagustin
      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.

      Author's profile photo Klaus Ziegler
      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

      Author's profile photo Guilherme Dellagustin
      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.

      Author's profile photo Rambabu Balija
      Rambabu Balija

      Great information......Thanks..!

      Author's profile photo Former Member
      Former Member

      Good information!!!! thanks for share.

      Please Experts, write some samples, please.....

      thanks

      Author's profile photo Horst Keller
      Horst Keller
      Blog Post Author

      write some samples

      ABAP Examples ...,

      already thhe first one, 2048 is expression oriented.

      Author's profile photo Former Member
      Former Member

      Thanks.

      Author's profile photo Shagun Sharma
      Shagun Sharma

      Thank you. Good article.

      Author's profile photo Peter Inotai
      Peter Inotai

      Hi Horst,

      Is there plan to cover also ABAP 7.5 News?

      Some of them were mentioned here What’s Coming Next with SAP NetWeaver 7.5</title><meta name="news_keywords" content="SAP,data m…, but I'd love to see about them in more details.

      Sorry, I know I'm really demanding πŸ™‚

      Thanks,

      Peter

      Author's profile photo Horst Keller
      Horst Keller
      Blog Post Author

      Is there plan to cover also ABAP 7.5 News?

      Sure, but not being Karl Kessler, I am not allowed to blog about it before 7.50 is available ... πŸ˜‰

      Author's profile photo Peter Inotai
      Peter Inotai

      OK, thanks for the info. I'll wait patiently πŸ˜‰

      Author's profile photo Former Member
      Former Member

      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 πŸ˜†

      Author's profile photo Peter Inotai
      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 πŸ™‚

      Author's profile photo Horst Keller
      Horst Keller
      Blog 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 ...

      πŸ˜›

      Author's profile photo Peter Inotai
      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 πŸ™‚

      Author's profile photo Thomas Therre
      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....

      Author's profile photo Horst Keller
      Horst Keller
      Blog 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 ...

      Author's profile photo Former Member
      Former Member

      Good Information! Thanks!

      Author's profile photo Gokula Kumar
      Gokula Kumar

      Nice article Thanks..

      Author's profile photo Kris Claes
      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

      Author's profile photo Horst Keller
      Horst Keller
      Blog 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.

      Author's profile photo Kris Claes
      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

      Author's profile photo Horst Keller
      Horst Keller
      Blog 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)

      Author's profile photo Former Member
      Former Member

      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).

      Author's profile photo Horst Keller
      Horst Keller
      Blog 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.

      Author's profile photo Kris Claes
      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

      Author's profile photo Horst Keller
      Horst Keller
      Blog 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!).







      Author's profile photo Kris Claes
      Kris Claes

      Horst,

      Thanks a lot!

      I'll see to it that this becomes common knowledge here. And that people be aware of it.

      Regards.

      Kris

      Author's profile photo Former Member
      Former Member

      Well, just a hunch, I think it worths a new blog post.

      Author's profile photo Horst Keller
      Horst Keller
      Blog Post Author
      Author's profile photo Former Member
      Former Member

      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.

      Author's profile photo Horst Keller
      Horst Keller
      Blog Post Author

      LINES OF can be used with the VALUE or NEW operator.

      http://help.sap.com/abapdocu_751/en/index.htm?file=abenvalue_constructor_params_lspc.htm

      That should do.

      Author's profile photo Former Member
      Former Member

      Thanks!