SAP TechEd Blog Posts
Share your experiences about SAP TechEd: Write about your favorite sessions and other conference highlights.
cancel
Showing results for 
Search instead for 
Did you mean: 
MattHarding
Active Contributor
0 Kudos

After almost being scheduled disastrously alongside Thomas Jung presenting an excellent session on UI Stuff, I was luckily moved in an "unconference" manner to a later session where I had a diverse group of people to talk about standards from the perspective of coding.

 

The gist of my session is as follows:

An invitation for all developers of ABAP, JAVA, PI/XI, Portals, BI/BW, etc; to discuss the following topics concerning standards (focus on coding standards):

    +Do you believe you have good standards and if so, does your company benefit significantly from these? </li><li>Where were your standards sourced from?</li><li>Should standards include scope and type for variables (i.e. local integer, global character)?</li><li>Should/Could SAP supply more detailed Customer (Z namespace) standards based on their internal standards?+*FUNCTION ZCS_RFC_VC_COURSE_LIST5. </div><div>*"--
    </div><div>""Local Interface: </div><div>*"  IMPORTING </div><div>*"     VALUE(COURSE_ID) TYPE  ZCS_COURSE_ID OPTIONAL </div><div>*"  EXPORTING </div><div>*"     VALUE(E_VALUE_HELP) TYPE  ZCS_COURSE_ATT_RFC_TBL </div><div>*"

    </div><div>  DATA model TYPE REF TO zcl_cs_main_model. </div><div>  CREATE OBJECT model. </div><div>  TRY. </div><div>      DATA courses TYPE zcs_course_att_tbl. </div><div>      model->read_course_listing( </div><div>         IMPORTING </div><div>           e_courses = courses ). </div><div>      FIELD-SYMBOLS: <wa_course> LIKE LINE OF courses, </div><div>                     <wa_help>   LIKE LINE OF e_value_help. </div><div>      LOOP AT courses ASSIGNING <wa_course>. </div><div>        APPEND INITIAL LINE TO e_value_help ASSIGNING <wa_help>. </div><div>        MOVE-CORRESPONDING <wa_course> TO <wa_help>. </div><div>      ENDLOOP. </div><div>    CATCH zcx_course_system . </div><div>  ENDTRY. </div><div>  SORT e_value_help BY course_id. </div><div>ENDFUNCTION. </div></div><p> </p><p>And compared it to how this code would look in my company (approximately):</p><div>FUNCTION Z_RFCHTE__VC_COURSE_LIST5. </div><div>*"

    </div><div>""Local Interface: </div><div>*"  IMPORTING </div><div>*"     VALUE(IC_COURSE_ID) TYPE  ZDE_CS_COURSE_ID OPTIONAL </div><div>*"  EXPORTING </div><div>*"     VALUE(OTB_VALUE_HELP) TYPE  ZTT_CS_COURSE_ATT_RFC </div><div>*"
    --
    </div><div>  DATA lo_model TYPE REF TO zclhte_cs_main_model. </div><div>  DATA ltb_courses TYPE ztt_cs_course_att_rfc. </div><div>  FIELD-SYMBOLS: LIKE LINE OF ltb_courses, </div><div>                                     LIKE LINE OF otb_value_help. </div><div>  CREATE OBJECT lo_model. </div><div>  TRY. </div><div>      lo_model->read_course_listing( </div><div>           IMPORTING </div><div>              otb_courses = ltb_courses ). </div><div>         LOOP AT ltb_courses ASSIGNING . </div><div>         APPEND INITIAL LINE TO otb_value_help ASSIGNING . </div><div>          MOVE-CORRESPONDING . </div><div>     ENDLOOP. </div><div>  CATCH zcx_course_system . </div><div>  ENDTRY. </div><div>  SORT otb_value_help BY course_id. </div><div>ENDFUNCTION.</div><p> </p><p> </p><p>Unfortunately, I couldn't get online at the time, but others stated it was pretty evident that if I grab code from an existing SAP function, the standards would look dramatically different again (even looking at 2 different modules within SAP would look different typically).</p><p> </p><p>I know there's not a great difference above (both pieces of code are written well), but consider debugging the code and jumping around hundreds of different functions/methods.  Or consider being a developer team lead and having to review every developer's code (try spotting an inappropriate global variable in the middle of code if not named such). </p><p> </p><p>I then went on to discuss coding conventions in other areas of SAP like:</p><ul><li>JAVA - java.sun.com - Quite light on for actual coding, mainly focussed on formatting and high-level naming.  Also, using NWDI and modifying SAP standard was an issue if, for example, each developer liked the location of their opening { to be in a different position (would make looking at deltas quite difficult)</li><li>SLD - For people starting with XI/PI and Sol Man, the SLD is overlooked for quite some time until you realise how bad it is to give developers full access to create any product/software component they look, and develop wherever they like.  i.e. This area is really easy to get wrong.</li><li>Web Dynpro - SAP actually have standards developed for Web Dynpro JAVA, but as Peter McNulty stated, since Web Dynpro is so model driven, naming standards for objects don't make much sense.  Most Web Dynpro developers I work with agree, and hence why I'm not sure SAP can ever win if they do publish standards (we complain both ways it seems).</li><li>XI/PI - Bill Li also published some XI standards but unfortunately, XI/PI is one of those tools where I don't think any XI developer quite agrees where mappings and ccBPM's really fit and again is something where rather than embrace the standards, we want to discuss them in more detail.</li></ul><p> </p><p>So at this point, we all agreed to various degrees that wouldn't it be great to have a global standard.  The big problem now was:</p><p>How do we do this in such a way that everyone considers adopting it including SAP?*

     

    So assuming we just start with ABAP standards/guidelines to begin with; there were 2 key ideas discussed that I thought just may work:

      1. Develop this in the same way that a standards body would develop a messaging standard.  i.e. Identify the right target audience to compile this and get sponsorship.  Could be similar to the focus groups approach used for ES development (giving SAP ultimate control).
      2. Similarly, use SDN and a WIKI or similar to develop the coding conventions globally.  Obviously we would need a small group to define the initial proposal for standards including what level we go to; but I believe the critical task for this to work is for SAP to say that they will adopt the final conventions for all future work. Again, SAP will hold ultimate control, but hey, I'm happy to be told there are no coding conventions and just come up with a class, function group, etc definitions if everyone thinks this is best. 

     

    Anyway, I've proposed a further BoF session for TechEd 2008 for determining an approach - https://wiki.sdn.sap.com/wiki/x/CICUAQ  - but in the mean time - it seems more people than just me care about this - so let us know your thoughts on how you think we could actually get this to work.

     

    For those who attended, apologies for not capturing the entire conversation and possibly missing many good points, and thanks everyone for the good discussion.  It was very refreshing.

     

    As an after thought and another example, we just had a session from Tom about UI Strategy and it was evident that SAP is doing a lot to unify the visual experience.  This is clearly an area where SAP could and should publish clear UI guidelines just like what has been done for the iPhone to gain consistent user experiences when dealing with business applications...

    3 Comments