I’m reading Ken Beck’s “Test-Driven Development by example” (a review when I’ll finish it) and I tried to find if there’s a way to adapt it to ABAP.
Yes, it does. Mainly because SAP launched ABAP Unit, a test environment appliable to both programs and classes.
In programs is easy to implement: you must just define a local class FOR TESTING and go on.
In classes… it’s the same, but a bit trickier: take a look at this link from SAP
Let’s try it.
Great class to show your HTML strings via dialog box or within a custom container.
Just a trick: if you will use both options within the same program, it will fail if you don’t reset your browser AND the custom container.
It means that you must create a global (sigh) variable for the custom container:
DATA: browser TYPE REF TO cl_gui_custom_container.
And before the call to the dialog version you must free it:
IF browser IS BOUND.
CALL METHOD browser->free
OTHERS = 0. "nasty
The nasty thing here is the cleansing of SY-SUBRC even when errors occured. You can find a way to make it cleaner, I bet.
But it’s up to you to do it.
I had to use a custom help in a program because I was not able to do it properly with the standard matchcode (I failed miserabily trying to pass the F4 a pre-filter). I had to do a workaround, and I must prevent my failing memory to forget it forever… here we come, just a bit of plain code.
Just a few, because I want not to forget it…
– RS_ALL_VARIANTS_4_1_REPORT: providing the name of the report (sy-repid), and just by putting ‘*’ in the TEXT parameter, you will get a table with all the variants of the program.
– RS_VARIANT_CATALOG: (online only?) by providing a program’s name, the system will show a pop-up window with the variants’ list of the program. The user can select one of them, who will be returned in the exporting parameters.
– RS_VARIANT_CONTENTS: just tell this beauty the program and its variant’s name, and it will give you a VALUTAB table parameter with its variable contents.
Don’t waste your time with this post. Here I will write some things I’m never able to remember, and I’m tired of re-search each time I need them. Don’t expect to find passwords 😛
I had to find the algorism for determine the checksum character of a BarCode39 string. It’s easy to do, and I though when I did it to not post the code here because it’s trivial.
But hey, I found the scrap piece of paper where I took my initial notes, and well, I’m in a sharing mood.
I had to give up my search… maybe I’ll be able to finish it or find the answer into the net someday. Until them, I’ll let you read my (lack of?) progress.