Skip to Content
Personal Insights

ABAP restrictions: keep it to 72 characters – really?

Once upon a time, long ago there where certain restrictions.
Like: Ram was precious. Disc space was scarce.
This led to some “best practices” or rules that probably still stick with people (maybe not even knowing the history), although they don’t make sense anymore.

One example is not using “speaking” naming, but encoding meaning into short, arbitrary codes. “Order Creation” is V45 (SPMV45A), “Delivery Creation” is V50 (SAPMV50A).
Makes sense to you? Well congratulation, then you are in the business from some time already, nice.

Anyways, I though the rule “a line of coding may not be more than 72 characters!” would be one of this arcane, neglectable rules.
Surely this doesn’t matter in a modern (say S/4HANA 1909, FPS2) SAP-system, right?!

Well, you guessed it – it does still matter! There are cases, that do hurt quite much (as in: dump!) if you use a character to much.

Wanna try it out?! Here’s my example:

I your sandbox got to RM07IMAT, put in a line with more than 72 characters.

MI22, F8, ctrl+shift+F12-> dump:

 

See?

There are quit some SAP Notes for READ_REPORT_LINE_TOO_LONG – at least the ones I checke don’t solve that problem by just allowing more that 72 chars already.
They all alter the code to keep to this restriction.

So: how long are your ABAP code lines?

/
14 Comments
You must be Logged on to comment or reply to a post.
    • Do you have a sadistic and masoschist personality to read ABAP blog posts then? 😉

      Hopefully, any ABAP program developed since 2001 (ABAP 6.10) doesn’t have to be limited to 72 characters anymore. Only legacy programs eventually suffer this limit.

      • Actually I think any report – old or new – will suffer from that if it is put into FM K_KKB_FIELDCAT_MERGE (Like it happens in e.g. MI22 ).

          data:
                l_abap_source like rssource occurs 0 with header line.
        [...]
            read report l_prog_tab_local into l_abap_source.

        So anything more the 72 char, this will give the mentioned dump. 🙁

        DDIC-Structure RSSOURCE consist of Data-Element EDPLINE, Domain EDPLINE, and that’s a CHAR 72. -> How about a filed length-extension here? That would be nice!

        • “Only legacy” doesn’t mean that there are “few”. But only those which call K_KKB_FIELDCAT_MERGE (and all derived FMs like REUSE_ALV_FIELDCATALOG_MERGE) with the parameter I_STRUCNAME are concerned. It’s far from meaning all the calls to this FM. Hopefully, there is no reason to call this FM anymore since 6.10 as the field catalog is automatically calculated with CL_SALV_TABLE.