Application Development and Automation 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: 
Read only

Save test data without debug

Former Member
0 Likes
3,350

Hi guys,

Does anybody know if is possible to make save test data from function module without debug?

Saving test data with New ABAP Debugger - CRM - SCN Wiki

Let me explain why I need it. In the company where I work there are some legacy systems (.net, java) that uses SAP Connector to consume RFCs. It works very well, but sometimes when something wrong happens, it's very annoying to debug it. Those systems uses dialog user, and I tried in a lot of ways debug it but the only way that's possible is when I insert a infinite loop in that function module.

To avoid do that everytime I need, I did a table and a class to check if RFC is "enabled" to debug in this table. (inserting that loop and allowing me to debug via SM50).

This idea could be better if I could save test data without need to enter in debug.

Thanks!

6 REPLIES 6
Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
2,081

In SE37 enter function name -> Test/execute -> fill input data -> SAVE test data

Or you are searching for something else?

-- Tomas --
Read only

0 Likes
2,081

Thanks for your answer, but I need something a bit different.

Is there any function module that I could use to save these data? I want to do that to avoid debug and get these data.

This is the method code that I mentioned before:


METHOD verificar_debug.

  DATA:

     t_stack TYPE abap_callstack.

  DATA:

     w_stack     TYPE abap_callstack_line,

     w_rfc_debug TYPE yrfc_debug         .

  DATA:

     v_nome_rfc TYPE tfdir-funcname.

  CALL FUNCTION 'SYSTEM_CALLSTACK'

    EXPORTING

      max_level = 0

    IMPORTING

      callstack = t_stack.

  READ TABLE t_stack

  INTO w_stack

  WITH KEY blocktype = 'FUNCTION'.

  IF sy-subrc = 0.

    v_nome_rfc = w_stack-blockname.

  ELSE.

    RETURN.

  ENDIF.

* Tabela de parametrização para loop infinito em RFCs

  SELECT SINGLE * FROM yrfc_debug

    INTO w_rfc_debug

    WHERE rfc = v_nome_rfc.

  WHILE w_rfc_debug-debug IS NOT INITIAL.

    IF w_rfc_debug-debug IS INITIAL.

      EXIT.

    ENDIF.

  ENDWHILE.

ENDMETHOD.

Read only

0 Likes
2,081

Ok, you edited your requirement.

This blogpost looks like exactly the solution you need:

But I have no experience with this report.

-- Tomas --
Read only

Former Member
0 Likes
2,081

Hi,

If you use a dialog user you can set an external break-point for another user.

In se38 Utilities-->Settings

Then tab Abap editor, subtab Debugging

Change User to the RFc user.

When you place an external break-point, it will debug that user for an hour.

Kind regards, Rob Dielemans

Read only

0 Likes
2,081

Thansk Rob, I've tried it several times and doesn't work in this case with system and communication user

Read only

karthikeyan_p3
Contributor
0 Likes
2,081

Hi Thiago,

You can make use of ASSERT statement in your program. Please follow the below wiki

Checkgroups - ABAP Development - SCN Wiki

The checkpoint group can be activated or de-activated on the fly using SAAB transaction. The inputs to the RFC function module can be saved as a log using assert statement. The log can be viewed later in SAAB.

For more information

Activatable Checkpoints - ABAP - Analysis Tools - SAP Library

Thanks,

Karthikeyan