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
- GROUP BY for internal tables
- Filter expressions and default values for table expressions
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.
Nice information. Thank You!
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
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"
Nice news, Horst, thanks!!!
Excelent...
Great work! I really like where this is going!
Many Thanks!!
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.
DATA(lv_flag2) = COND #( WHEN lv_flag1 = abap_true THEN abap_false ELSE abap_true ).
Definitely not as good 🙁
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...
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 😀
No doubt! 🙂
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.
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
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.
Great information......Thanks..!
Good information!!!! thanks for share.
Please Experts, write some samples, please.....
thanks
ABAP Examples ...,
already thhe first one, 2048 is expression oriented.
Thanks.
Thank you. Good article.
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
Sure, but not being Karl Kessler, I am not allowed to blog about it before 7.50 is available ... 😉
OK, thanks for the info. I'll wait patiently 😉
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 😆
>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 🙂
I see more than you can see
Wait, wait a little while ...
😛
>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 🙂
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....
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 ...
Good Information! Thanks!
Nice article Thanks..
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
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.
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
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)
Actually, I've checked it right now in NW 7.02 and it seems to work just fine.
Regarding
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).
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.
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
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:
I am really a little bit concerned that this is not common knowledge (strings were introduced with release 4.6!).
Horst,
Thanks a lot!
I'll see to it that this becomes common knowledge here. And that people be aware of it.
Regards.
Kris
Well, just a hunch, I think it worths a new blog post.
OK, why not, 10 pts cheaply earned 😛
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:
It’d be nice if I could do something like this:
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.
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.
Thanks!