cancel
Showing results for 
Search instead for 
Did you mean: 

Ex "Pattern Engine" not working - book "Adv. BSP programming"

reedtzj
Active Participant
0 Kudos

Hi colleagues,

I have made some "Basis friends" and they helped me to successfully import the delivered transport files from this excellent book. This is in a R/3 4.7 SP55 system.

I have read, carefully, all included documentation regarding what would not work in a 6.20 system and made needed adjustments where appropriate.

I have gone through all included packages and activated them. The errors that have occured match those mentioned as "problems" on the CD when using 6.20 and not 6.40 as technical platform.

Now, I really like the "Pattern engine" approach in chapter 13 written by Brian McKellar. I also read his initial blog, of course, at the time he wrote it.

I am currently writing an application where I would like to use something similar and reuse of code is, as always, a good idea.

Problem is that I can not run the application described in chapter 13, go.do, it will just give me an error message something like this:

---

Business Server Page (BSP) Error

What happened?

Call of BSP page terminated due to error.

Note

Following error text processed in system:

Error Type:

Your SAP Business Server Pages Team

---

Anyone faced the same problem with this one?

All other applications do work flawlessly that should work on 6.20 level.

Thomas/Brian - any suggestions (if you read this...).

Regards, Johan

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There is something wrong with that example. I might have broken it when I brought it into the transport system. In YCL_PE_ESS_CONT_HOLIDAY DO_INIT we fill the PE_STEPS internal table. We are using the same text for the description and view name. First of all I made these translatable texts. If you translate the descriptions, you will obviously have problems unless you change the names of the views. You might want to change these to plain text literals.

The other problem is that I forgot to append '.htm' to the end of the view names. Go to class YCL_PE_ESS_CONTROLLER method DO_REQUEST. Down around line 112 we have the logic where you read the pe_steps and call the view name. I added the following line of code so that the view name will be correct:

concatenate name '.htm' into name.

Sorry about the bug. Let me know if that doesn't solve the problem for - however it did correct things in my 04S system.

reedtzj
Active Participant
0 Kudos

Thomas,

Thanks a lot! Saved me some debugging sessions...

I did not translate anything but used EN as language so far so no problem with the view naming. When I read through the code earlier I noted this elegant "double" use of the descriptions and view names but I for sure missed that the .htm was missing.

Your second advise solved the problem and made the application work as intended. Great!

To share the solution for any other users of the book I paste the needed code change here in class YCL_PE_ESS_CONTROLLER method DO_REQUEST:

---


*             <xhtmlb:overflowContainer>
              DATA: overflowcontainer TYPE REF TO cl_xhtmlb_overflowcontainer.
              overflowcontainer = cl_xhtmlb_overflowcontainer=>factory( width = '100%' height = '130px' ).
              WHILE page_context->element_process( element = overflowcontainer ) = if_bsp_element=>co_element_continue.
 
*               Actual content, call correct view
                DATA: view TYPE REF TO if_bsp_page.
                READ TABLE me->pe_steps INDEX me->pe_step_current INTO name.
<b>                CONCATENATE name '.htm' INTO name.        "Bug fix - Thomas Jung via SDN</b>
                view = me->create_view( view_name = name ).
                view->set_attribute( name = 'pe'    value = me ).
                view->set_attribute( name = 'model' value = me->pe_model ).
                me->call_view( view ).
 
*             </xhtmlb:overflowContainer>
              ENDWHILE.

Regards, Johan

Answers (0)