Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create demo to count global and local classes/interfaces attributes, methods and events using WB searcher. #28

Open
fabiopagoti opened this issue Mar 10, 2014 · 2 comments
Assignees

Comments

@fabiopagoti
Copy link
Owner

This new demo is based on DEMO2 - #20

Create a new demo based on ZWB_OBJECTS_DEMO2 (give it the name 7 as it's not used yet).

The purpose of this demo is to show another use of a WB searcher so use any WB searcher which fill the following gap.

This program should have:

  • one select-options valid for both global classes and interfaces.
  • one select-options valir for programs and includes that might have local classes and interfaces.

The user will insert ABAP WB Classes, Interfaces, Programs and Includes and the program should count how many attributes, methods and events each of them have (or in the global classes and interfaces or inside the local classes of the specified programs and includes).

It could be a ALV with the following structure:

[Program name]| Class/Interface Name | Attributes | Methods | Events
| ZCL_xxx | 1 | 2 | 0
| ZIF_xxx | 3 | 5 | 2
Program Name | LCL_xxx | 2 | 2 | 1

Scenario 1 - Global Class

Given
Class CL_A has 3 attributes AND
Class CL_A has 4 methods AND
Class CL_A has 2 events

When
Program ZWB_OBJECTS_DEMO7 is executed

Then
An ALV should be displayed as
Class/Interface Name | Attributes | Methods | Events
CL_A | 3 | 4 | 2

Scenario 2 - Global Interface

Given
Interface IF_B has 5 attributes AND
Interface IF_B has 6 methods AND
Interface IF_B has 7 events

When
Program ZWB_OBJECTS_DEMO7 is executed

Then
An ALV should be displayed as
Class/Interface Name | Attributes | Methods | Events
IF_B | 5 | 6 | 7

Scenario 3 - Local classes/interfaces inside programs/includes

Given
Program/Include ZABC contains local class CL_A AND
Program/Include ZABC contains local interface IF_B AND
Class CL_A has 3 attributes AND
Class CL_A has 4 methods AND
Class CL_A has 2 events
Interface IF_B has 5 attributes AND
Interface IF_B has 6 methods AND
Interface IF_B has 7 events

When
Program ZWB_OBJECTS_DEMO7 is executed

Then
An ALV should be displayed as
Program| Class/Interface Name | Attributes | Methods | Events
ZABC |CL_A | 3 | 4 | 2
ZABC |IF_B | 5 | 6 | 7

Scenario 4 - Regular expressions used in global classes/interfaces select-options

Given
Global classes/interfaces select-options is filled with ZCL_WB* AND
Global classes/interfaces select-options is filled with ZIF_WB* AND

Classes that match the pattern ZCL_WB_* = [CLASSES] AND
[CLASSES]
ZCL_WB_A
ZCL_WB_B
ZCL_WB_C

Interfaces that match the pattern ZIF_WB_* = [INTERFACES]
[INTERFACES]
ZIF_WB_Y

When
Program ZWB_OBJECTS_DEMO7 is executed

Then
An ALV should be displayed as
Class/Interface Name | Attributes | Methods | Events
ZCL_WB_A | x | x | x
ZCL_WB_B | x | x | x
ZCL_WB_C | x | x | x
ZIF_WB_Y | x | x | x

Scenario 5 - Regular expressions used in local classes/interfaces select-options (programs and includes)

Given
programs/includes select-options is filled with Z_WB_ AND

Programs/Includes that match the pattern Z_WB_ = [PROGRAMS] AND
[PROGRAMS]
Z_WB_DEMO1

Program/Include Z_WB_DEMO1 contains local class CL_A AND
Program/Include Z_WB_DEMO1 contains local interface IF_B

When
Program ZWB_OBJECTS_DEMO7 is executed

Then
An ALV should be displayed as
Program| Class/Interface Name | Attributes | Methods | Events
Z_WB_DEMO1 |CL_A | x | x | x
Z_WB_DEMO1 |IF_B | x | x | x


Notes

  • The first column (Program) should only be displayed if there is at least one local class or interface displayed in the ALV
  • Programs/Includes which are inserted in the selection screen (using patterns or not) which doesn't contain any local class/interface should be completely ignored in the output.
@Rodrigobcr
Copy link
Collaborator

Hello, Fábio.
The Demo7 is ready to tests.
Preview:
sem ttulo
sem ttulo2

@fabiopagoti
Copy link
Owner Author

{user mode} Excellent. It looks great!

{functional mode} In this case I would just declare a select-options with the high field. As you are using WB searcher, it should accept ranges like ZCL_A1 to ZCL_A30 for exemple.

{ABAP mode} Other than that seems ok to create a pull request on GitHub. I hope you used Code Inspector and other tools to make sure there is nothing wrong technically with your code. If you didn't I will do it and reject your pull request if you deliver something with no code quality. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants