VA01 BDC_OKCODE /00 not working as expected

Viewed 697

In my report I am calling the transaction VA01 with BDC data, and everything works as expected, the data is being filled correctly, but bdc_okcode /00 does not work.

I simply add the ok-code to the internal table:

gs_bdcdata-fnam = 'BDC_OKCODE'.
gs_bdcdata-fval = '/00'.
APPEND gs_bdcdata TO gt_bdcdata.

...

CALL TRANSACTION 'VA01' USING gt_bdcdata.

I get a popup that shows the ok code.

enter image description here

My expectation is that it should navigate to the next dynpro.

Also I tried to record the transaction through the transaction SHDB to see if I have to do something differently but the BDC data is basically the same. Playing back the recording shows the same popup with the code.

How can I solve that?

1 Answers

The MODE addition is not used by the CALL TRANSACTION. If one of the additions MODE or OPTIONS FROM is not used, the effect is the same as if mode had the content "A". Which means the call transaction stops by each screen.

It has to be called like this:

DATA lv_mode TYPE char1 VALUE 'N'. "N - BI won't stop, E - will stop by error, A - will stop at every screen

CALL TRANSACTION 'VA01' 
     USING gt_bdcdata
     MODE lv_mode.

A better option is to use the OPTIONS FROM addition, this gives you more opportunities:

DATA: ls_options TYPE ctu_params.

ls_options-dismode = 'N'. "see explanation above

CALL TRANSACTION 'VA01' 
     USING gt_bdcdata
     OPTIONS FROM ls_options.
Related