Skip to Content

There are a lot of posts about things that can be improved in the new SAP Community (and I guess they will).

What I will point out in this blog is something that is really positive, at least for me.

It’s the advanced capabilities for displaying source code in posts. Thanks so much for that.

Copying source code from source code editors into blogs wasn’t too straight forward in the old SCN. Normally I copied it first to notepad to get rid of non compatible formats and then to the blog editor where I had to format it tediously by hand.

When writing a blog now,

 

  • you simply hit the {;} in the toolbar (or CODE in discussions),
  • you get a kind of notepad where you can copy your source code into,
  • you select a language from a value list that even includes ABAP

And that’s it!

The following

gives

SELECT FROM scarr
       FIELDS *
       INTO TABLE @DATA(scarr).

CALL TRANSFORMATION id SOURCE scarr = scarr
                       RESULT XML DATA(xml).

cl_demo_output=>display_xml( xml ).

And the following

gives

<asx:abap version="1.0" xmlns:asx="http://www.sap.com/abapxml">
 <asx:values>
  <SCARR>
   <SCARR>
    <MANDT>000</MANDT>
    <CARRID>AC</CARRID>
    <CARRNAME>Air Canada</CARRNAME>
    <CURRCODE>CAD</CURRCODE>
    <URL>http://www.aircanada.ca</URL>
   </SCARR>
   <SCARR>
    <MANDT>000</MANDT>
    <CARRID>AF</CARRID>
    <CARRNAME>Air France</CARRNAME>
    <CURRCODE>EUR</CURRCODE>
    <URL>http://www.airfrance.fr</URL>
   </SCARR>
   <SCARR>
    <MANDT>000</MANDT>
    <CARRID>AZ</CARRID>
    <CARRNAME>Alitalia</CARRNAME>
    <CURRCODE>EUR</CURRCODE>
    <URL>http://www.alitalia.it</URL>
   </SCARR>
  </SCARR>
 </asx:values>
</asx:abap>

Language specific syntax coloring for free, posh!

Only a small caveat. When displaying a post with source code it may take some time until it is formatted and until the syntax coloring appears (sometimes you even have to refresh to format the source code).

To report this post you need to login first.

6 Comments

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

  1. Jelena Perfiljeva

    Uhm, it’s nice, but how many people publishing content on SCN actually need this? You and Paul Hardy? Majority of the spaces, err, tags are not even development related. Oh well, if you and Paul are happy – I’m happy. 🙂

    I’m rather struggling to find the things that I like here, to be honest. The “more by this author” link is nice, but I haven’t had any trouble finding this through the author’s profile before. Hardly a fair trade-off for all the nice features that disappeared.

    (4) 
    1. Horst Keller Post author

      Yep, from the blog writer’s point it’s better now. But I see from the numbers of clicks that there are less readers then before. Pity.

      (0) 
      1. Suhas Saha

        The saddest part of all this is that i have lost the bookmarks from the good ol’ SCN.

        Now everytime i’m confused about LOOP…GROUP BY i have to google to find your blog 🙁

        (2) 
  2. Rizu Yadav

    Yes i also feels e-mail notification is must to track with day to day GROUP activity
    But UI is NICE “New for Betterment” but take time to familiar with the Change 🙂

    Br
    Rizu Yadav

    (1) 

Leave a Reply