on ‎2011 May 19 1:23 PM
Found this sarcastic bit of coding while debuggin today, made my day:
CL_WDR_CLIENT_ABSTRACT_HTTP
HANDLE_REQUEST
cl_wdr_client_ssr=>todo_cleanup( 'Evil hack because of missing support in RR_APPLICATION' )."#EC NOTEXT
method TODO_CLEANUP.
" REASON
if 1 = 1.
endif.
endmethod.There must be more of this kind. Contribute! For the good of the world!
cheers, Lukas
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
I forgot which program it was where i copied this piece of comment, but it made me laugh!
*&---------------------------------------------------------------------*
*& Report ZPSD_INTERFACE_GAS_003
*&
*&---------------------------------------------------------------------*
*###################################################################*
*#-----------------------------------------------------------------#*
*# |\\/\\//\| ----------------------------------- #*
*# | | / Report: \ #*
*# | (*) (*) / ZPSD_INTERFACE_GAS_003 \ #*
*# | __) / Version: 1.0 (2011-06-21) \ #*
*# (C _____\ / generated on 20110621 150151 \ #*
*# \ (__( --{-------------------------------------------} #*
*# | / \ By: / #*
*# /====\ \ INFDVH / #*
*# / o\ \ Dwang - adresgegevens wijzigen / #*
*# / o\ \ vanuit planon / #*
*# / o\ \ / #*
*# / o\ -------------------------------- #*
*#-----------------------------------------------------------------#*
*###################################################################*
Regards,
Dirk.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Guys,
I found this "gem" in the famous PNPCE LDB
* *********************************************************************
* Type-Pool for DYNAMIC SELECTIONS
* *********************************************************************
* must be declared here (not in TOP-Include) because we need it for
* select-options (pnpdynse & pnpdynsr); declaration in TOP-Include
* would be too late! - don't know why...If SAP doesn't know "why" who does?
Cheers,
Suhas
method _If_Wdr_Internal_Api~get_Assist_Instance.
*===============================================
data:
cref_Ctlr type ref to object.
field-symbols:
<wd_Assist> type data.
cref_Ctlr = f_Ctlr_Inst->Component->get_Delegate( ).
" !!! THIS DEPENDS ON THE GENERATION TEMPLATES !!!
" nice and breezy and yuk a little bit of horroshow
assign cref_Ctlr->('F_ASSIST') to <wd_Assist>.
if ( <wd_Assist> is assigned and <wd_Assist> is bound ).
Result = <wd_Assist>.
endif.
endmethod.
lri_Tom_0->ADD_CHILD( lri_Tom_10 ).
CL_WD_GRID_LAYOUT=>new_grid_layout(
Container = lri_Tom_0
cell_padding = `0`
cell_spacing = `0`
col_count = `1`
stretched_horizontally = Abap_True
stretched_vertically = Abap_False
).
* uff we are thru
Result = lri_Tom_0.
endmethod.Relieving words of a developer after coding about 2k lines of generic context/UI-Elements in WD4A.
I dont remember where I took this from, I know I was doing some work for DSD, but here is the screenshoot I took:
http://a2.sphotos.ak.fbcdn.net/hphotos-ak-ash2/38810_423746673317_551018317_4889825_6644883_n.jpg
'bout time I found another one:
Thanks @ whoever coded this. Made my day
MP56TITS.
FORM its_ping USING p_return TYPE i.
STATICS:
l_service(10) TYPE c,
l_dynnr TYPE sydynnr.
DATA:
l_context_length TYPE i VALUE 0,
BEGIN OF l_value_table OCCURS 1,
fieldname(30) TYPE c,
fieldindex(8) TYPE n,
fieldcont(255) TYPE c,
END OF l_value_table.
IF l_dynnr IS INITIAL.
l_dynnr = sy-dynnr.
ELSE.
IF l_dynnr = sy-dynnr AND
l_service NE 'HAMLET' AND
l_service NE 'JULIA'.
CLEAR l_service.
ENDIF.
ENDIF.
IF l_service IS INITIAL.
* Get the value from ITS
CALL FUNCTION 'ITS_PING'
EXCEPTIONS
its_not_available = 1.
IF sy-subrc = 0.
* There is an ITS
field-get 'PTK_SEIN_ODER_NICHT_SEIN' 1
l_value_table l_context_length.
LOOP AT l_value_table.
l_service = l_value_table-fieldname.
ENDLOOP.
IF l_service = 'HAMLET'.
* The ITS executes the templatebased PR05
ELSEIF l_service = 'MACBETH'.
* The ITS executes the templatebased TP03 WML
ELSE.
* The ITS executes _NOT_ the templatebased PR05
l_service = 'ROMEO'.
ENDIF.
ELSE.
* There is no ITS involved
l_service = 'JULIA'.
ENDIF.
ENDIF.
* Return the value
CASE l_service.
WHEN 'HAMLET'.
* PR05 on ITS via template
p_return = 2.
WHEN 'MACBETH'.
* TP03 on ITS via WML template
p_return = 4.
WHEN 'ROMEO'.
* Something else is on the ITS processing this coding
p_return = 3.
WHEN 'JULIA'.
* Boring normal GUI calls this coding
p_return = 1.
WHEN OTHERS.
* It isn't detected till now what kind of frontend this routine calls
p_return = 0.
ENDCASE.
ENDFORM.
IF sy-subrc >= 2.
* Wenn wir unsere eigenen Bausteine nicht richtig aufrufen können,
* dann haben wir einen Dump verdient.
MESSAGE ID sy-msgid TYPE 'X' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*741i-
IF sy-subrc = 0.Haha . This is what keeps me motivated while debugging several dozens of levels into the callstack.
"If we aren't able to call our very own Modules the right way, then we deserve a dump". God bless you, whoever you are
LSZA0F34
Isn't this one quite common? You start with a return code 0 ("assuming OK"), and further down change it to <> 0 based on circumstances. I also see this in user exits for FI validations, you assume TRUE until you reach a FALSE condition, or vice versa.
Don't want to drag you down though
Thomas
Yes it's quite common. Either doing that or doing it the other way around as you said. Still the comment "assume everything is ok" IMHO makes it kinda funny, because why would anyone comment this approach at all? It's like starting with ret_value = 8, and commenting it with "assume everything will go horribly wrong"
At my current client there is one developer who loves leaving funny comments along the lines of your second version, example from a method setting icons based on return codes: (sorry, available in German only)
* --- wir sind schon blau ... ähm rot - schlimmer geht's nimmer
...
* --- wir sind eben erst rot geworden oder schon gelb gewesen
* schlimmer geht's auch hier nimmer
...
* --- vielleicht waren wir vorher was anderes außer rot oder gelb
* werden aber jetzt gelb
...
* --- na ja hier ist's dann nur noch schön oder farblos
Always a good laugh, and I keep finding more...
Thomas
Well, at least it's not boring. *g* Comments like this never come up, when I stare at code. Sadly. But now I'm kind of fixed on the idea to look through some older abap programs to see, if I can find stuff like that in there, too.
As long as there is nothing in there like "Fingers crossed" or "This works... most of the time."
I love these threads but they hurt to be honest, because we create applications which are licensed. That means we cannot add such "Call Helmut on extention 1234 if it does not work" or "Druf geschiss, da Sau hat 'ne dump verdient im echt" etc handling in the code, despite it being very tempting as my humour regularly gets me into trouble on SCN!
SAP and customer developers have it good... 😉
Cheers,
Julius
What? Mrs. Alertcorner?!
Call Helmut on extention 1234 if it does not work
Ahahaha! This would get me into coding more, I swear.
Since I just do little stuff, I could get away with comments like that. ^^ We have a lot of helpful little apps just for us admins, so there would be room for fun like this (as long as it's still helpful).
And when I look at the easter eggs one can find in software from well known vendors, I don't think all developers of licensed stuff thinks like you, Julius. *g*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.