cancel
Showing results for 
Search instead for 
Did you mean: 

Why do smartforms take so long to activate?

olivier_muff
Explorer
0 Kudos

I have a moderately simple smartform.

Page1

about 10 nodes with a table in main, two graphics

Next Page

Last Page

about 5 nodes

It takes 5 minutes to activate! Anyone know why or if this can be improved? Do most smartforms take soooo long?

Olivier

Accepted Solutions (1)

Accepted Solutions (1)

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Olivier!

I have a rather complex smartform.

Just one page, but a lot of loops and nodes. Most coding is done outside, if some coding is needed, often a call function is used for the task (because there normal navigation is possible again).

The downloaded XML-file has currently about 560 kB, opening in TA smartforms takes about 4 seconds, <b>activation 12 seconds</b>.

So smartforms can be rather fast. I heard of a client, where the PO-smartform was heavily changed and an activation ran 15 minutes.

I would make a runtime analysis (SE30) to figure out this riddle. Maybe somewhere in the generation a loop where or read table is so slow and SAP can make an OSS-performance note.

Regards,

Christian

olivier_muff
Explorer
0 Kudos

Thanks to all.

Christian, I think you are sending me in the right direction. I did an sm50 and a trace to find that there are many sequential reads going on to the table REPOSRC. Doesn't the se30 only work when you are running the form or does it also work on activation?

Regarding the calls to functions. Is your initialization section quite small then? Do you do your calls only as needed within the nodes? Would your recommend a complete consistency check on the generated program to clean it up of unused variables and the like?

Getting a note / patch is not easy for me since I am an external developer.

Regards,

Ollie

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Ollie,

getting a correction from SAP shouldn't be a problem, it's more a question to find something worth changing.

SE30 will record every step you do, so call SE30, start there the TA SMARTFORMS, open the form and activate, leave the TA and have a look at the recording. First of all, is ABAP or DB slower? Incase the DB has more runtime (red graph with more than 50%), then a SQL-trace will give more details. My guess is slower ABAP, then a search for the slow read table or loop where has to be done - and a better way should be possible, otherwise it's only based on a big form.

In my example the data is prepared mainly before the smartform call, the initialization is smaller than 200 lines, calls about 4 FMs and in total maybe 20-30 coding parts are used. Again mainly just some small summarizations, never more than 50 lines.

If number of ABAP lines increases the activation time, also a short test can proove the theory: just copy the content of a big part into a function module, the interface definition should be pretty clear because of the import / export parts in the smartform. If activation is faster afterwards, you found the solution.

Regards,

Christian

olivier_muff
Explorer
0 Kudos

Well it looks like all ABAP. Now to find the offending code! Here are the se30 results.

Temps d'exécution en microsecondes

ABAP 280084,339 = 99.6%

Base donn 978,135 = 0.3%

Système 68,450 = 0.0%

0% 50% 100% 281130,924 = 100,0%

I tried commenting out nearly all the code in the initialization section just to see if activation would be faster. It was not! I really don't have any significant code in the rest of the form. There is one loop that reads through standard texts but the internal table for this is less then 50 entries. Could all the time still be involved with the sequential read of the table that holds all the program names. There must be a way to trace this further.

Best regards,

Olivier

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Olivier!

Thanks for this update of the results - I'm still curios, what makes this so slow for others.

The analysis shows very clearly, database = selects have no impact for the runtime.

It's something with abap-statements (without DB access), so usually read table, loop where, delete for hugh internal tables are the reason. Here also the code generation might take some time.

Try to record a SE30 with more detailed information about the internal table handling; maybe also how long FM and other groups are needing. Then have a closer look into the recording and try to find the slow parts; first in the analysis, then in the coding.

Hope you have success,

Christian

olivier_muff
Explorer
0 Kudos

Hi Christian,

How do I "record a SE30 with more detailed information about the internal table handling?" Does this really make sense since se30 would just be testing the SAP activation code, which I have no control over or ability to change.

In any case, here is the top section of the Hit List from the se30:

Call No. Gross = Net Gross (%) Net (%) Program Name

Runtime analysis 1 281,130,924 0 100.0 0.0

Call Transaction SMARTFORMS 1 281,130,829 3,117 100.0 0.0 SAPMS38T

Program SAPMSSFO 1 281,119,007 9,123 100.0 0.0

Dynpro Entry 3 281,109,987 1,008 100.0 0.0 SAPMSSFO

PAI Dynpro SAPMSSFO 2 279,388,552 852 99.4 0.0 SAPMSSFO

Module(PAI) USER_COMMAND_0100 2 279,377,667 348 99.4 0.0 SAPMSSFO

Perform USER_COMMAND_0100 2 279,377,652 1,567 99.4 0.0 SAPMSSFO

Call Func. FB_CHANGE_FORM 1 279,375,250 2,631 99.4 0.0 SAPMSSFO

Perform FORM_BUILDER_CALL 1 278,698,644 45 99.1 0.0 SAPLSTXB

Call Screen 0100 1 278,679,235 18,981 99.1 0.0 SAPLSTXB

Dynpro Entry 5 278,660,254 3,246 99.1 0.0 SAPLSTXB

PAI Dynpro SAPLSTXB 8 278,379,704 3,423 99.0 0.0 SAPLSTXB

Module(PAI) FCODE_0100 4 278,187,810 194 99.0 0.0 SAPLSTXB

Perform FCODE_0100 3 278,186,453 131 99.0 0.0 SAPLSTXB

Perform SF_ACTIVATE 1 278,165,712 83 98.9 0.0 SAPLSTXB

Perform SF_GLOBAL_CHECK 1 276,579,018 13,476 98.4 0.0 SAPLSTXB

Syn-Check for IT_1998 119 275,341,806 = 275,341,806 97.9 97.9 SAPLSTXB

Perform CHECK_ABAP_PARAMS_CODING 55 223,269,948 182,808 79.4 0.1 SAPLSTXB

Perform CHECK_NODE 79 151,311,230 8,026 53.8 0.0 SAPLSTXB

Perform CHECK_TEXT_ANYTYPE 29 123,544,316 4,450 43.9 0.0 SAPLSTXB

Perform CHECK_NODE_TEXT 23 105,187,610 629 37.4 0.0 SAPLSTXB

Perform CHECK_NODE_SECTION 18 87,146,879 4,936 31.0 0.0 SAPLSTXB

Perform NODE_NAVIGATE 11 84,794,252 304 30.2 0.0 SAPLSTXB

Perform CHECK_NODE_EVENT 5 84,794,226 168 30.2 0.0 SAPLSTXB

Perform CHECK_ABAP_CONDITIONS 16 60,543,477 8,406 21.5 0.0 SAPLSTXB

Perform CHECK_TEXT_SYMBOLS 16 40,123,607 1,498 14.3 0.0 SAPLSTXB

Perform CHECK_ABAP_PARAMS 16 40,102,282 1,305 14.3 0.0 SAPLSTXB

Perform CHECK_NODE_CONDITION 1 18,204,681 90 6.5 0.0 SAPLSTXB

Perform CHECK_NODE_GRAPHIC 5 13,761,059 180 4.9 0.0 SAPLSTXB

Perform CHECK_ABAP_GLOBALS 5 12,880,069 3,364 4.6 0.0 SAPLSTXB

Perform CHECK_GRAPHIC 2 4,997,414 198 1.8 0.0 SAPLSTXB

Perform CHECK_NODE_COMMAND 1 4,596,650 84 1.6 0.0 SAPLSTXB

Perform CHECK_TEXT_INCLUDE 1 2,755,738 261 1.0 0.0 SAPLSTXB

Perform CHECK_REFFIELDS 1 2,463,981 98 0.9 0.0 SAPLSTXB

Perform CHECK_SPOOL_ATTRIBUTES 1 2,462,838 119 0.9 0.0 SAPLSTXB

Call Func. AC_FLUSH_CALL_INTERNAL 25 1,871,262 7,231 0.7 0.0 SAPLOLEA

Rfc OLE_FLUSH_CALL 11 1,842,171 1,718,872 0.7 0.6 SAPLOLEA

Perform(Ext) HANDLE_FLUSH_PBO 6 1,765,759 166 0.6 0.0 SAPMSSYD

Call Func. AC_SYSTEM_FLUSH 6 1,765,489 83 0.6 0.0 SAPFGUICNTL

Call Func. AC_FLUSH_CALL 6 1,765,406 749 0.6 0.0 SAPLOLEA

Module(PBO) %_CTL_OUTPUT 2 1,687,696 56 0.6 0.0 SAPMSSFO

Perform(Ext) %_CTL_OUTPUT 2 1,687,640 176 0.6 0.0 SAPMSSFO

Perform GENERATE 1 1,021,014 63 0.4 0.0 SAPLSTXB

Perform GENERATE_FUNCTION_POOL 1 767,811 217 0.3 0.0 SAPLSTXB

christian_wohlfahrt
Active Contributor
0 Kudos

Hi,

of course we can get a change of standard code. It might take some weeks, but usually SAP is glad to get some hints how to improve their coding. I can create the message, but currently I'm missing the time to make the research.

In SE30 basis screen, you can define a variant, choose 'create' or 'change'.

First part is a 'program' tab. There you can already try to restrict for a specific program, but seems to be of no help here.

In second tab: de-activate all SQL-related stuff, record function modules and subroutines, de-activate Dynpro, activate internal tables - especially this is important.

Then run a new trace with this settings - more buttons in the overview (afterwards) will appear, you should be able to see more details, maybe something like internal tables it_434 'most time'. By jumping into the source code, you can identify the name in the coding, make a where-used list...

Please go on (maybe read some help to SE30)!

Christian

olivier_muff
Explorer
0 Kudos

Hi Christian,

I am back to this again and tried your suggestions.

Here some results:

Transaction SMARTFORMS = SAP Smart Forms Hre 11:25:17

Program. SMARTFORMS Date 21.03.07

Utilis. me

Temps d'exécution en microsecondes

ABAP 229369,542 = 94.3%

Base donn 13,639,079 = 5.6%

Système 162,009 = 0.1%

0% 50% 100% 243170,630 = 100,0%

Sorted by net time

Appel Nombre Brut = Net Brute % Nette % Programme Type

Syn-Check for IT_1392 92 219,571,422 = 219,571,422 90.3 90.3 SAPLSTXB

Delete Report /1BCDWB/SAPLSF00000352 2 13,263,825 = 13,263,825 5.5 5.5 SAPLSEU2 BD

Call M. CL_OO_INCLUDE_NAMING=>IF_OO_CLASS_INCL_NAMING~GET_MTDNAME_BY_INCLUDE 327 3,169,406 3,167,799 1.3 1.3 SAPLSEQ0

Rfc OLE_FLUSH_CALL 5 1,205,226 1,101,795 0.5 0.5 SAPLOLEA

Call Func. DDIF_FIELDINFO_GET 80 991,196 749,508 0.4 0.3 SAPLSEUH

Perform SAVE_LTEXT 1 547,623 546,661 0.2 0.2 SAPLSTXBX

Call Func. SSF_SAVE_FORM 1 826,579 225,804 0.3 0.1 CL_SSF_FB_SMART_FORM==========CP

Perform READ_PATTERN_INFO 702 197,357 188,678 0.1 0.1 RSAQGENI

Perform PH_CHECK_LIKEFIELD 80 1,180,960 188,278 0.5 0.1 SAPLSEUH

Perform SEARCH_COMPONENT 5,526 220,487 138,244 0.1 0.1 SAPLSTXBX

Read Table IT_127 31,764 123,548 = 123,548 0.1 0.1 SAPLSTXBX

Wait for RFC 5 103,431 = 103,431 0.0 0.0 SAPLOLEA

Perform X031L_TO_DFIES 3,743 84,192 = 84,192 0.0 0.0 SAPLSDIFRUNTIME

Call GET_PREDEF_TYPES 80 78,732 = 78,732 0.0 0.0 SAPLSANA

Insert Report /1BCDWB/LSF00000352F01 2 73,794 = 73,794 0.0 0.0 SAPLSTXB BD

Perform FILL_DATA 4,879 115,674 62,858 0.0 0.0 SAPLSTXB

Append IT_1392 27,523 59,483 = 59,483 0.0 0.0 SAPLSTXB

Load Report SAPLSTXB 1 59,404 = 59,404 0.0 0.0 SAPMSSFO Syst

Perform READ_DATE_ITEM 5,526 352,214 46,880 0.1 0.0 SAPLSTXBX

Call Func. RS_GET_ALL_INCLUDES 1 3,329,654 44,950 1.4 0.0 SAPLSEU2

Loop at IT_128 1,152 215,528 44,292 0.1 0.0 SAPLSTXBX

Call Func. SSF_READ_STYLE 52 49,831 41,939 0.0 0.0 SAPLSTXB

Call Func. RS_PROGNAME_SPLIT 388 3,274,751 41,927 1.3 0.0 SAPLSEDA

Perform PROGRAM_ACTUALIZE 1 143,534 38,659 0.1 0.0 SAPLSEWB

Perform %EXPAND_LINE 2,276 70,901 38,159 0.0 0.0 SAPLSTXB

Call Func. SSF_READ_STYLE 8 74,181 37,377 0.0 0.0 SAPLSTXBR

Insert Report /1BCDWB/LSF00000352U01 1 36,686 = 36,686 0.0 0.0 SAPLSTXB BD

Perform WRITE_DATE_ITEM 5,516 145,033 35,554 0.1 0.0 SAPLSTXBX

Call M. CL_WB_CROSSREFERENCE=>PROGRAM_INDEX 1 68,086 34,202 0.0 0.0 SAPLSEWB

Commit Work 1 34,013 = 34,013 0.0 0.0 SAPLSTXB BD

Perform CREATE_LINK 1,138 49,717 33,663 0.0 0.0 SAPLSTXBX

Perform READ_NAME 5,473 39,338 32,215 0.0 0.0 SAPLSTXBX

Call Func. SSF_READ_DATE 1,189 197,188 31,845 0.1 0.0 CL_SSF_FB_OUTATTR=============CP

Perform COMPUTE_VARIANT_TABLES 1 219,868 31,818 0.1 0.0 SAPLSTXB

Perform PA_INSERT_PARAMETER 1 31,903 31,480 0.0 0.0 SAPMS38L

Call Func. FUNCTION_POOL_CREATE 1 282,273 30,834 0.1 0.0 SAPLSTXB

Delete Report /1BCDWB/LSF00000352U01 2 30,689 = 30,689 0.0 0.0 SAPMS38L BD

Call Func. SSF_SAVE_DATE 1,189 85,133 30,400 0.0 0.0 CL_SSF_FB_OUTATTR=============CP

Read Table IT_65 779 29,498 = 29,498 0.0 0.0 SAPLSTXBX

Insert Report /1BCDWB/LSF00000352UXX 4 29,417 = 29,417 0.0 0.0 SAPMS38L BD

Call Func. DDIF_NAMETAB_GET 82 170,196 28,876 0.1 0.0 SAPLSDIFRUNTIME

Perform(Ext) IMPORT 1 28,703 = 28,703 0.0 0.0 SAPLSTXB

Call Screen 0100 1 241,283,125 28,647 99.2 0.0 SAPLSTXB

Perform(Ext) FU_DELETE_FUNCTION 1 174,742 28,181 0.1 0.0 SAPLSUNI

Perform ED_INSERT_TRDIR 6 27,950 = 27,950 0.0 0.0 SAPMS38L

Sorted by Brut time

Appel Nombre Brut = Net Brute % Nette % Programme

Runtime analysis 1 243,170,630 0 100.0 0.0

Call Transaction SMARTFORMS 1 243,170,514 4,168 100.0 0.0 SAPMS38T

Program SAPMSSFO 1 243,159,635 24,524 100.0 0.0

Perform USER_COMMAND_0100 2 241,999,441 1,920 99.5 0.0 SAPMSSFO

Call Func. FB_CHANGE_FORM 1 241,938,100 442 99.5 0.0 SAPMSSFO

Perform FORM_BUILDER_CALL 1 241,300,250 46 99.2 0.0 SAPLSTXB

Call Screen 0100 1 241,283,125 28,647 99.2 0.0 SAPLSTXB

Perform FCODE_0100 2 241,007,900 453 99.1 0.0 SAPLSTXB

Perform SF_ACTIVATE 1 240,981,405 78 99.1 0.0 SAPLSTXB

Perform SF_GLOBAL_CHECK 1 221,721,573 4,918 91.2 0.0 SAPLSTXB

Syn-Check for IT_1392 92 219,571,422 = 219,571,422 90.3 90.3 SAPLSTXB

Perform CHECK_ABAP_PARAMS_CODING 44 171,465,741 11,500 70.5 0.0 SAPLSTXB

Loop at IT_2081 1 123,788,890 591 50.9 0.0 SAPLSTXB

Perform CHECK_NODE 59 123,787,517 2,817 50.9 0.0 SAPLSTXB

Perform CHECK_TEXT_ANYTYPE 22 96,261,997 2,066 39.6 0.0 SAPLSTXB

Perform CHECK_NODE_TEXT 18 82,612,118 483 34.0 0.0 SAPLSTXB

Loop at IT_758 8 73,753,377 131 30.3 0.0 SAPLSTXB

Perform CHECK_NODE_SECTION 18 73,712,684 1,464 30.3 0.0 SAPLSTXB

Loop at IT_411 9 71,481,557 256 29.4 0.0 SAPLSTXB

Loop at IT_541 9 71,477,841 193 29.4 0.0 SAPLSTXB

Perform CHECK_NODE_EVENT 3 71,443,749 137 29.4 0.0 SAPLSTXB

Perform NODE_NAVIGATE 7 71,443,703 115 29.4 0.0 SAPLSTXB

Loop at IT_984 1 61,012,940 5,524 25.1 0.0 SAPLSTXB

Loop at IT_609 9 38,831,708 292 16.0 0.0 SAPLSTXB

Perform CHECK_ABAP_CONDITIONS 11 36,297,118 1,052 14.9 0.0 SAPLSTXB

Loop at IT_443 9 27,983,971 215 11.5 0.0 SAPLSTXB

Perform CHECK_TEXT_SYMBOLS 11 26,930,225 759 11.1 0.0 SAPLSTXB

Perform CHECK_ABAP_PARAMS 11 26,915,720 784 11.1 0.0 SAPLSTXB

Loop at IT_481 9 25,612,827 420 10.5 0.0 SAPLSTXB

Perform CHECK_ABAP_GLOBALS 5 22,989,241 468 9.5 0.0 SAPLSTXB

Loop at IT_715 9 18,424,132 264 7.6 0.0 SAPLSTXB

Perform GENERATE 1 18,118,233 66 7.5 0.0 SAPLSTXB

Perform GENERATE_FUNCTION_POOL 1 17,889,819 1,063 7.4 0.0 SAPLSTXB

Perform DELETE_FUNCTION_POOL 1 16,944,972 708 7.0 0.0 SAPLSTXB

Call Func. FUNCTION_POOL_DELETE 1 16,755,712 3,082 6.9 0.0 SAPLSTXB

Perform DELETE_FUNCTION_POOL_INCLUDES 1 16,752,580 1,571 6.9 0.0 SAPLSUNI

Call Func. RS_DELETE_PROGRAM 1 16,726,224 311 6.9 0.0 SAPLSUNI

Perform CHECK_NODE_GRAPHIC 4 13,650,621 142 5.6 0.0 SAPLSTXB

Perform DELETE_PROGRAM 1 13,293,608 1,683 5.5 0.0 SAPLSEU2

Delete Report /1BCDWB/SAPLSF00000352 2 13,263,825 = 13,263,825 5.5 5.5 SAPLSEU2

Loop at IT_696 9 9,293,278 215 3.8 0.0 SAPLSTXB

Loop at IT_633 9 6,825,879 159 2.8 0.0 SAPLSTXB

Loop at IT_577 9 6,797,319 223 2.8 0.0 SAPLSTXB

Loop at IT_512 9 5,101,294 110 2.1 0.0 SAPLSTXB

Perform CHECK_GRAPHIC 2 4,941,119 178 2.0 0.0 SAPLSTXB

I hope this helps some. I did not notice any new buttons appearing but there are a number of IT's now listed in the results.

If you do post a change request. Here are some other bugs and anoyances that I would like to see addressed:

Other problems with smart forms

-

-


1. Global Definitions - Initialization section

- no clean way to add and remove parameters. Gaps seem to cause no problems. Some add/remove buttons like on the Global Data section would be nice.

2. Print preview problems

- bug with color graphics: See my Thread: smartform preview dump when color graphics in form - crash on page down if color graphics in form.

- Loop texts do not line up vertically in the preview - looks ragged on left. Printing seeems fine though.

3. Double click on compile errors does nothing - even worse it sometimes puts line breaks in odd places in your initialization code.

4. Cannot copy windows from one smartform to another

Best regards,

Olivier

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Most of times after update statistics in DB this will resolve.

Shanaka.

Former Member
0 Kudos

The activation takes so long because the Smartform FM is being generated.

The FM is completely re-created each time you activate.

If you go to Environment -> Function Module Name , you can get the name and take it to SE37 to look at the code. You will see that the FM is rather large.

Former Member
0 Kudos

Hi Olivier,

Generally whenever a smartform is designed,the compiler writes an internal code for it.So while u activate it, u might feel that only a page of form is getting activated but infact the entire code is written and then is activated.The same is the case whenever it is changed.The entire code is rewritten or check with ur server,Either your server might be slow.

Reward points if found useful..

Former Member
0 Kudos

Hi!

Because SMARTForms are executing a lot of unneccessary and slow checks. In our system it is compiled in 1 minute, but it is very slow also. I don't like the long compile time, that's why I don't use them if I can.

Use SAPScripts, it knows almost everything, what smartforms do. Just with a different way.

Regards

Tamá