on 05-19-2011 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found by the extended code check today. I guess the author wanted to leave his ELSEIF options open here.
IF lv_wbsta EQ 'C'.
<bunch of code>
ELSEIF lv_wbsta NE 'C' .
<bunch of code>
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could have a look at Ilya's collection over in the other place: The SAP Fan Club Forums &bull; View topic - The benefits of open source. (Serious fun for April ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Finally I stumbled over something worthy of this thread.
It's from the method "READ_MOLGA_BY_PERSA" and gives a lesson for life: It's all customization's fault!
IF t500p IS INITIAL.
* If persa does not exist either customization is flawed or
* infotype 0001 data is messed up. Since we do not know
* which infotype 0001 could be the problem we blame
* everything on customization.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From CL_HRASR00_DISPATCHER method FSCN_INIT...
line 196: * It has to be proved if this is really useless!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These NWBC testers are quite territorial.....HANDS OFF!!!!
The role Z_NWBC_TEST_ROLE (not sure why SAP released a Z role) was a bit more polite....
Dear SAP User,
this is SAP NWBC 3.X test role for SAP AG internal use only.
Version SAP.AG.INTERNAL.000.YI3.V3.0
Do not change it!
Owner: SAP NWBC Development
Changes need to be approved: SAP NWBC QM
Changes violating QM approval will be taken to the first and the second
escalation level in case not immediately reverted.
Regards, Laimis, SAP NWBC QM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rofl. Not really the right thread for this, but thank you nevertheless 😆
I wonder what questions are asked in the exam. I bet there's something like:
Q: Thesis: You are asked a question which you don't know the answer to, what do you respond?
A: The human resources expediently institutionalize a competent and well-planned sign-off. Our integrative, goal-oriented, realignments structure an active and tactical trend. As a result, siloed workshops interactively deliver maximum impact.
(>'-')> YOU PASS! <('-'<)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FUNCTION ME_TRANSFER_EKPO_TO_BUFFER.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(PI_EBELN) LIKE EKKO-EBELN
*" VALUE(PI_ALL_POSITIONS) TYPE C DEFAULT SPACE
*" TABLES
*" PI_EKPO STRUCTURE EKPO
*" EXCEPTIONS
*" RECORD_ALREADY_EXISTS
*"----------------------------------------------------------------------
*
* Die Verwendung dieses FB's ist sehr gefaehrlich, da er den
* Lesebauseinen Phantomdaten unterschiebt.
* Der FB ist eine Spezialloesung und wird nur von
* FB ME_TRANSFER_PO_TO_BUFFER aufgerufen. Dieser wiederum wird
* nur in der form Buchen in MM06EF0B fuer den Fall Bestellung aus WE
* gerufen.
*
* DO NOT USE THIS FB UNLESS YOU KNOW WHT YOU ARE DOING.
* YOU ONLY KNOW WHAT YOU ARE DOING, IF YOU DO NOT USE IT.
*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I never got a chance to come across such funny comments in any of the codes i had seen.
Until now.
An FI validation had a pretty exclusive condition.
It was set to be executed only if user was "Santa Claus" or "Snowwhite"
Now that's an imaginary innovative condition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Came across this one today. I read the statement as check whether girlfriend is called by Lord.
The variable declaration shows that gf means global field, and lord means Lean Order Process.
*----------------------------------------------------------------------*
* check partner if existent, if not search ...
*----------------------------------------------------------------------*
* --> piv_role partner role
* <--> prv_partner partner number
* --> pis_sdorgdata sd org data
*----------------------------------------------------------------------*
FORM check_and_search_partner USING value(piv_role) TYPE parvw_4
prv_partner TYPE partner_vb
value(pis_sdorgdata) type sdorgdata.
DATA: lv_determined_partner TYPE sd_partner_parnr,
lv_determined TYPE xfeld,
lv_partner TYPE sd_partner_parnr.
check gf_called_by_lord is initial.
IF prv_partner <> space OR prv_partner <> '0'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And another one found. Lo and behold, this is pretty much representative for the entire module of FI-TV...
LFITP_SYNCHRONIZEF01
* especially let not survive TE-cluster data coming "
* from TE-cluster import in this routine "
* No! Only let not survive TE-cluster result tables coming "
* from TE-cluster import in this routine "
* NoNo! let all TE-cluster result tables coming "
* from TE-cluster import in this routine survive.... "
All three entries are from the same developer (I removed his token behind the comment to avoid exposing him to...whomever).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wonderful - made me laugh -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure whether to laugh or cry over this one: Function module WB_TREE_SELECT_CLASS
* >>>>>>>>>>>>>>>>>>>* are there interfaces including the current interface
* ("Umfassende Interfaces")?
data: l_ifinfo type ref to cl_oo_if_relations,
l_ifname type seoclass-clsname,
l_comprising_interfaces type seor_comprisings_r.
clear l_comprising_interfaces.
l_ifname = class.
data: wa_vseocompri type vseocompri.
select * from vseocompri
into corresponding fields of wa_vseocompri
where refclsname = l_ifname
* AND version = '0' " '0': inactive, '1': active
.
if sy-subrc = '0'.
append wa_vseocompri to l_comprising_interfaces.
endif.
endselect.
** this is the official API to get the including interfaces, but it
** delivers strange results and I don't understand the logics behind:
* CREATE OBJECT l_ifinfo
* EXPORTING
* clsname = l_ifname
* w_references = seox_true
* w_implementings = seox_true
* w_comprisings = seox_true
* w_subclasses = seox_true
* EXCEPTIONS
* not_existing = 1
* is_class = 2
* OTHERS = 3
* .
* IF sy-subrc = 0.
* l_comprising_interfaces = l_ifinfo->comprised_by .
* ENDIF.
1) Let's not use the API because I don't understand it
2) Sy-subrc check within the SELECT... ENDSELECT
3) SELECT... ENDSELECT with append, instead of INTO TABLE
Who's writing SAP code nowadays?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They're equivalent SP levels according to SAP note 1653343 oddly enough, but I don't know the respective release dates.
Loving this thread as I was a programmer once upon a time myself (outside of the SAP space entirely) and always enjoyed these little Easter eggs. When I started in the SAP world I had the impression you'd never see similar stuff in ABAP code as they took themselves far too seriously 🙂
I found this today while searching for SAP logos on Google!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
RMDATIND material master load program:
IF SY-SUBRC <> 0 AND FOUND = X.
" einen erzeugen (leer): Sonst kriegt Mechthilde keinen V-Status
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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*
Yet another one found 😆
* these are the adventures of the new spaceship BERID;
* she intrudes into MRP areas where no man has gone before;
PERFORM DISPO_AREA_SET TABLES P_ATPCSX
P_ATPMATX.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found this gem in 'BAPI_FLIGHT_GETLIST'
BAdI 1 for Customer specific coding ***********************
At this point there should be a BAdI that the customer can use to *
check the data in the parameter ExtensionIn. *
Unfortunately there was no time to define and implement the BAdI in *
this release. This will be done at a later time. *
We are aware that this is inconsistent with the existence of the *
ExtensionIn. However, this BAPI is for learning purposes only and *
not productive. Therefore we think it better to show how to define *
the ExtensionIn (even though it can not be used here) instead of *
leaving it out. ("Showing some is better than nothing") *
End of BAdI 1 *********************************************
"Showing some is better than nothing" ... Lol
http://www.pictureupload.de/originals/pictures/160911164546_wellplayedsap.gif
Translation: "1 entries have been found! Do you want to sort the result?"
Well played SAP, well played...
This is the one which caught my eye today
CL_ABAP_ZIP=>CRC32( ).
* Do the calculations by hand. This is going to be slow. This is going to be a pain.
* What is a man to do?
CONSTANTS: magic_nr(4) TYPE x VALUE 'EDB88320',
mFFFFFFFF(4) TYPE x VALUE 'FFFFFFFF',
m7FFFFFFF(4) TYPE x VALUE '7FFFFFFF',
m00FFFFFF(4) TYPE x VALUE '00FFFFFF',
m000000FF(4) TYPE x VALUE '000000FF',
m000000(3) TYPE x VALUE '000000'.
IF XSTRLEN( crc32_map ) = 0.
DO 256 TIMES.
DATA: c(4) TYPE x, low_bit(4) TYPE x.
c = sy-index - 1.
DO 8 TIMES.
low_bit = '00000001'. low_bit = c BIT-AND low_bit. " c & 1
c = c DIV 2. c = c BIT-AND m7FFFFFFF. " c >> 1 (top is zero, but in ABAP signed!)
IF low_bit IS NOT INITIAL.
c = c BIT-XOR magic_nr.
ENDIF.
ENDDO.
CONCATENATE crc32_map c INTO crc32_map IN BYTE MODE.
ENDDO.
ENDIF.
Cheers,
Suhas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, lots of this has been posted here in months and years past.
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.