Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to call an eCATT programmatically with import parameters

Former Member
0 Kudos

Hi there,

I am using function module ECATT_EXECUTE to call test scripts from within ABAP test code, like below. Unfortunately, I am not able to pass my actual import parameter values. It seems that the interface does not provide a way to pass import parameters to the eCATT.

Although posted in November, this is still an issue for me. Does anybody know an answer?

call function 'ECATT_EXECUTE'

exporting

to_execute = lt_script

display_log = space

i_supress_output = 'X'

importing

executed = lt_executed

logid = ls_logid

trace_prot = lt_trace

exceptions

nothing_to_do = 1

too_many_scripts_called = 2

others = 3.

Does anybody reading this have a solution?

Thanks and regards,

Rüdiger

Edited by: Rüdiger Plantiko on Jan 17, 2008 3:05 PM

Edited by: Rüdiger Plantiko on Jan 17, 2008 3:05 PM

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Rüdiger

I think we both agree that the VARIANT_ID of the excuted test configuration is apparently the only variable IMPORTING parameter we can change.

Therefore, I would try change an existing variant within your test configuration or create a new one BEFORE calling function module ECATT_EXECUTE.

In transaction SECATT you can download and upload (and thereby change) your test configuration.

If you find a way to do this without download to the local PC but within your report then you can execute your test configuration with any VARIANT (corresponding to the previously set IMPORTING parameter) you want.

I guess you will find appropriate standard functions within package SECATT or sub-packages.

Example:



...
START-OF-SELECTION.

" Read test configuration, delete specific variant 'XYZ' if exists already
" Add new variant 'XYZ' to test configuration, save to DB

  COMMIT WORK AND WAIT.

" Now call your test configuration with variant 'XYZ'
  CALL FUNCTION 'ECATT_EXECUTE'
  ...

Regards,

Uwe

8 REPLIES 8

uwe_schieferstein
Active Contributor
0 Kudos

Hello Rüdiger

I do not think that you can feed the function module with importing parameters directly but you have to provide either an internal parameter source (e.g. field VARIANT_ID of TO_EXECUTE, variant of your test configuration) or an external data source (by filling IT_VAR_EXT which presumably points to test data files on the local PC).

Kind Regards,

Uwe

PS: Greetings to Oliver.

0 Kudos

Hi Uwe,

thanks for your quick reply.

Parameter source from PC will not work, since my test suites are running daily as a batch job.

The VARIANT_ID would force me to create a variant with fixed parameters. But, say, I have a test chain with several steps, and some of these steps generate new numbers (document numbers, ... ).

Wouldn't it be overdone to save these temporary data in a data container, only for the purpose to feed them into the next test script?

I thought of a workaround in the meanwhile. Since the tests are running on a 1-server development system, I could

- put the data into a shared memory segment (export lv_ebeln as ebeln to shared memory id 'Z_ECATT_123_EBELN'.)

- and then read this segment in an ABAP block at the beginning of the script.

But the proper way would be to pass the data somehow directly to ECATT_EXECUTE...

Thank you and regards (and eventually see you at MGB ... ).

Rüdiger

uwe_schieferstein
Active Contributor
0 Kudos

Hello Rüdiger

I think we both agree that the VARIANT_ID of the excuted test configuration is apparently the only variable IMPORTING parameter we can change.

Therefore, I would try change an existing variant within your test configuration or create a new one BEFORE calling function module ECATT_EXECUTE.

In transaction SECATT you can download and upload (and thereby change) your test configuration.

If you find a way to do this without download to the local PC but within your report then you can execute your test configuration with any VARIANT (corresponding to the previously set IMPORTING parameter) you want.

I guess you will find appropriate standard functions within package SECATT or sub-packages.

Example:



...
START-OF-SELECTION.

" Read test configuration, delete specific variant 'XYZ' if exists already
" Add new variant 'XYZ' to test configuration, save to DB

  COMMIT WORK AND WAIT.

" Now call your test configuration with variant 'XYZ'
  CALL FUNCTION 'ECATT_EXECUTE'
  ...

Regards,

Uwe

0 Kudos

Dear Uwe,

thank you for your suggestion. I will think about it, although you will agree that the best solution would be a direct parameter passover.

With more time at my disposal, I will try to understand how the delegation object PARAMS of class CL_APL_ECATT_TEST_CONFIG works. Properly prepared before the call of ECATT_EXECUTE, I might get what I want.

Thanks and regards,

Rüdiger

Former Member
0 Kudos

Hello all,

inserting the desired parameters into tables ECTD_VAR and ECTD_DATA might do the trick.

At least transaction SECATT shows up the inserted records as internal variants that might be passed to ECATT_EXECUTE using parameter IT_VAR_TO_EXEC? I will try...

Regards,

Matthias

0 Kudos

Matthias,

thank you for your answer which works out the ideas of Uwe Schieferstein in this thread.

But you will surely agree that a direct passover would be preferable instead of saving the parameters to the database first...

Thank you,

Rüdiger

0 Kudos

Hello Rüdiger,

direct passover would be fine - well, I've come to get used to finding workarounds in SAP though. Maybe, the function module will support the missing parameters in some forthcoming release.

Btw I switched over to tables ECTC_VAR / ECTC_DATA and pass obj_type = 'ECTC' to ECATT_EXECUTE, since test configurations can directly be executed.

You don't happen to know what has to be done, if the call of ECATT_EXECUTE results in a dump? After correctly executing the test configuration. Looks like eCatt tries to put the resulting log to nowhere. Perhaps I have to initialize some kind of a log receiver first or set some option in the start profile? I passed DISPLAY_LOG = SPACE, and SUPPRESS_OUTPUT = 'X'.

Dump was:


Laufzeitfehler         OBJECTS_OBJREF_NOT_ASSIGNED
Datum und Zeit         05.03.2008 17:37:00


 Zeile Quelltext

     1 METHOD http_send_and_receive .
     2
     3   DATA: l_errortext       TYPE string.
     4   DATA: l_http_subrc      TYPE sy-subrc.
     5 *----------------------------------------------------------------
     6
 >>>>>   im_http_client->request->set_data( data = im_request ).
     8

(...)

Aktive Aufrufe/Ereignisse

Nr.   Art          Programm                            Include                             Zeile
      Name

    6 METHOD       CL_HTTP_TESTZONE_RESULT=======CP    CL_HTTP_TESTZONE_RESULT=======CM00Q     7
      CL_HTTP_TESTZONE_RESULT=>HTTP_SEND_AND_RECEIVE
    5 METHOD       CL_HTTP_TESTZONE_RESULT=======CP    CL_HTTP_TESTZONE_RESULT=======CM00O    16
      CL_HTTP_TESTZONE_RESULT=>HTTP_REQUEST_NEWRESULTID
    4 METHOD       CL_HTTP_TESTZONE_RESULT=======CP    CL_HTTP_TESTZONE_RESULT=======CM00T    34
      CL_HTTP_TESTZONE_RESULT=>SEND_TO_RESULT_REPOSITORY
    3 METHOD       CL_APL_ECATT_LOG_TO_RESREP====CP    CL_APL_ECATT_LOG_TO_RESREP====CM001   400
      CL_APL_ECATT_LOG_TO_RESREP=>GET_LOG_DATA
    2 FUNCTION     SAPLECATT_EXECUTE                   LECATT_EXECUTEU01                     888
      ECATT_EXECUTE
    1 EVENT        ZDSD_SL_VIA_CATT                    ZDSD_SL_VIA_CATT                       26
      START-OF-SELECTION

Regards + have a nice weekend,

Matthias

Former Member
0 Kudos

Hi,

did you figure out where this OBJECTS_OBJREF_NOT_ASSIGNED is coming from?

i have the same behaviour no feedback for the LogId and this dump coming up.