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: 

Z report doesn't fill the bdcmsgcoll table while CALL TRANSACTION

Former Member
0 Kudos
467

Hi Gurus,

I am performing a CALL TRANSATION on a Z transaction (= which is Z report)  and once succeded, the message table is empty (type standard table  bdcmsgcoll .)

My question: How can I fill the internal table of type bdcmsgcoll in my Z report ? I've tried to debug of course and tried to look for a FM, but I am still without a clear answer. Everyone is mentioning how to fill internal table bdcdata to launch the CALL TRANSACTION, but no messages could be found to know how to populate (bdcmsgcoll table)  it in Z reports while called for background call.

Any clue about this?

Thanks a lot,

Daniel

*** Code extract of the calling transaction which will performed my Z report

(...)

  lstr_ctu_params-dismode  = 'P'.
  lstr_ctu_params-updmode = 'S'.

  CALL TRANSACTION 'Z_MY_TRANSACTION'
      USING lt_bdcdata
      OPTIONS FROM lstr_ctu_params
      MESSAGES INTO lt_messtab.

  IF sy-subrc <> 0.

(...)

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
159

If your called transaction/report does not raise any success or error message (MESSAGE statement) there is not much to do...

Regards,

Raymond

7 REPLIES 7

raymond_giuseppi
Active Contributor
0 Kudos
160

If your called transaction/report does not raise any success or error message (MESSAGE statement) there is not much to do...

Regards,

Raymond

0 Kudos
159

Hi Raymond,

thanks a lot for your quick and clear complement.

It means that I can only fill one line in the "lt_messtab" indirectly while raising one success or failure message? This was also my understanding. But whether the parameter is a table, so I was hopping to be able to insert few logs to trace my program flow into it and evaluate the result once back to the main program.

Is your answer a final statement or could maybe someone else find a 'trick' to fullfill this bdcmsgcoll table?

Many thanks,

Daniel

0 Kudos
159

Hi

Which kind of messages you're using to trace your program?

I've tried to simulate a transaction by BDC and warning messages are in lt_messtab

Max

0 Kudos
159

Hi Max,

I was using usual debbuging tool and also started system debugger... try to find my way out through Program  SAPMSSYD, RSDBRUNT to check if I can find way to step in this message table.

I believe this table is manage on C++ side of SAP which we do not have access... of course.

The  lt_messtab table is filled by the system while proceeding transaction in batch input in background mode, but the way how it is wrapped, makes it not possible to us to put our own logs inside. This is more or less my understanding.

I hope I could answer to your question.

Cheers,

Daniel

0 Kudos
159

The IT_MESSTAB is filled with the messages raised by the program (so your z-program) you're simulating by BDC.

It's not possibile to insert some messages not managed by the program called in BDC.

So if you need to trace the flow of your program, you should change it in order to place some messages in the strategic points of the program.

Max

Former Member
0 Kudos
159

Hi,

After executing the program if your transaction is not throwing any success or warning or error messages,your internal table will be always empty.

Regards,

Swapna

0 Kudos
159

Hi Max and Swapna,

Many thanks for your effort.

I could finally understand your comments regarding "throwing messages" !

(I was looking at the wrong place at the beginning)

Here is the coding sample which works really fine in my Z report.

IF sy-binpt = 'X'.

  IF lt_my_table IS NOT INITIAL.

    MESSAGE 'Success!' TYPE 'I' DISPLAY LIKE 'S'.

  ELSE.

    MESSAGE 'Error!' TYPE 'I'  DISPLAY LIKE 'E''.

  ENDIF.

endif.

Theses messages are filling automatically the "lt_messtab" fields. I could even take advantage of all there fields.

Many thanks again!

Daniel