cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter Text for function modules & Methods of Classes

Former Member
0 Kudos

ABAP editor "Pattern Copy"

does not copy descriptions of parameters? (I might have missed something?)

BUT if it did as HALF-LINE comments

then documentation would be beautiful/meaningful

something rare in ABAP as ABAP editor is not supportive

For example I had to work very hard to add

half-line comments to

call function 'CS_BOM_EXPL_MAT_V2'

exporting

capid = 'PP01' "Application ID

datuv = it_reqn-lfdat "Validity date

emeng = it_reqn-menge "Required quantity

mktls = 'X' "Materials summary read(Materialkurztext lesen)

mehrs = 'X' "Multi-level explosion

mtnrv = it_reqn-matnr "Material

postp = 'L' "Item category

stlal = '01' "Alternative BOM

stlan = '1' "BOM usage

werks = it_reqn-reswk "Receiving Plant

tables

stb = it_stb

exceptions

alt_not_found = 1

call_invalid = 2

material_not_found = 3

missing_authorization = 4

no_bom_found = 5

no_plant_data = 6

no_suitable_bom_found = 7

conversion_error = 8

others = 9.

I did not have patience to copy paste table desc & exception descriptions.

Can anyone please tell me how to get the text of parameters easily.

Also a program that copies a CALL FUNCTION with half-line comments would be great.

Similarly for CALL Methods of ABAP Classes.

Apt Quote-

"Any fool can write code that a computer can understand.

Good programmers write code that humans can understand."

--- Martin Fowler, Refactoring: Improving the Design of Existing Code

I wish ABAP editor created (automatically on some Fn) half-line comments for tables and data-types

ex. MAKT "Material Descriptions

MAKT-MAKTG "Material description in upper case for matchcodes

Same also for MAKT~MAKTG in SELECT Open SQL.

Will some great ABAP Wizard write such an extension to make ABAPERs look "less foolish" from Martin Fowler's valid point of view!

Hopefully Mr. Horst Keller is listening and we will have a "GEEK" for lovely ABAP commented readable code - that is so rare to find.

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

Hi Jayantha,

Getting the short texts for the function modules is no big deal.

They are stored in the table FUNCT.

But then, to put them as half-line comments in the code when we press a button in se38 would mean we have to alter the standard program behind the se38 transaction.(I'm assuming there are no user exits for SE38 Transaction).

May be we can write a logic to simulate the Pattern function. But then is it effort really worth it?

I would rather copy -paste the descriptions against the parameters ..:)(ctrl+y , ctrl + c) and then comment them.

Probably SAP's next release has this. Hopefully.

Till then ctrl + y and ctrl + c for descriptions is the way to go !!!!

Cheers,

Ravi

Former Member
0 Kudos

Thanks Ravi!

After your tip I hacked a bit & found

in Func Group SFUNC

ENLFDIR Additional Attributes for Function Modules

FUNCT Function Module Short Texts

FUPARAREF Parameters of function modules

RSFBTYPEIN Possible Type Specifications

RSFBTYPEIT Text for RSFBTYPEIN

RSINFDIR Inactive table for TFDIR and ENLFDIR

TFTIT Function Module Short Text

TLIBG Person responsible for function class

TLIBT Function Group Short Texts

Joining FUPARAREF & FUNCT using SY-LANGU

should do what I want.

Thanks a LOT!

I want to Give you POINTS! But can't see the button..

Former Member
0 Kudos

" Good programmers write code that humans can understand. "

--- Martin Fowler, Refactoring: Improving the Design of Existing Code

ABAP pretty printer is good for code but not supportive for data declarations.

As a result ABAP code often tends to need more labour to maintain.

I therefore wrote 3 Clipboard utilities

1. YClipJNC based on http://sap.ionelburlacu.ro/abap/sap2/Beautify_Source_Code.html

but improved to include table~column half-line commenting.

Take any ABAP code (should have survived syntax check) including the "." DOT terminator.

Copy to Clipboard & F8 on YClipJNC will create the beautiful version in clipboard

ready for pasting back.

The big advantage is that you can send for beautification only portions of code

- this is vital in maintaining someone else's badly written code.

2. YClip2JNC is for Internal Table declarations only, with existing comments

Aligns everything nicely.

3. YClip3JNC is to create a Commented CALL FUNCTION Pattern.

Try with "CS_BOM_EXPL_MAT_V2"

The pattern is ready in clipboard for pasting appropriately.

These 3 utilities should give a big boost to good clean commented ABAP code.

URLs for the 3 programs

http://www.geocities.com/ojnc/

http://www.geocities.com/ojnc/YClips.zip

====================================================

I discovered a beautiful ABAP Program analyzer SAP Standard Program

RSINCL00 Extended ABAP Program Reference List

This is a 100% XREF listing program and identifies all dead code.

Great Utility and an important find.

Answers (0)