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: 

Debug ABAP program

Former Member
0 Kudos

Hello:

I have a WebService and I followed the instructions in order to call it from the ABAP side. So now I have a proxy.

I created a simple ABAP program to test this WS call but it seems it's not working quite well. For external debug purposes, on the WS side I write text files. Those logs indicate me that the WS is indeed being called and exited succesfully.

The WS returns an array of Objects which I assume is translated as a table on ABAP.

I also have some "write" statements on the ABAP program and they indicate me that no exceptions are being thrown. However, when I set the breakpoint just after the call, the table shows it has no "rows" in it, as if the WS retuned something empty.

This is the code:


*&---------------------------------------------------------------------*
*& Report  Z_WS_EXTERNAL_TES
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT  Z_WS_EXTERNAL_TES.
DATA: MDM_PROXY TYPE REF TO ZEXTERNALCO_MDMWEB_SERVICES_VI .
TRY.
    CREATE OBJECT MDM_PROXY
      .
  CATCH CX_AI_SYSTEM_FAULT .
ENDTRY.
data: OUTPUT type ZEXTERNALGET_CANDIDATES_OUT_DO .
data: INPUT type ZEXTERNALGET_CANDIDATES_IN_DOC .
TRY.
write 'Step 1 '.
    CALL METHOD MDM_PROXY->GET_CANDIDATES
      EXPORTING
        INPUT  = input
      IMPORTING
        OUTPUT = output.
write 'Step 11 '.
  CATCH CX_AI_SYSTEM_FAULT .
    write 'Step 2 '.
  CATCH CX_AI_APPLICATION_FAULT .
    write 'Step 3 '.
write 'END'.
ENDTRY.

The outcome of the program prints:

Step 1 Step 11 END

The breakpoint is set on the line that Prints the string "Step 11". The debug stops there, I click on GLOBALS and the OUTPUT structure doesn't have anything inside..

Any ideas?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

No exceptions are raised because the program executed the method call successfully (even though the OUTPUT structure was not necessarily populated). Are you populating the INPUT structure with the correct values so it can populate the output structure?

Sudha

3 REPLIES 3

Former Member
0 Kudos

No exceptions are raised because the program executed the method call successfully (even though the OUTPUT structure was not necessarily populated). Are you populating the INPUT structure with the correct values so it can populate the output structure?

Sudha

0 Kudos

Hello

Thanks for the answer. Right now the WS returns test data even if no parameters are provided (at least that what I get on the WebServices Navigator)

Does it need any parameters for the WS proxy to be initialized?

Thanks

Alejandro

0 Kudos

I have passed some parameters but it's the same............ maybe a matter of scope?

Thanks