Skip to Content
0
Former Member
Apr 21, 2009 at 03:22 PM

CALL TRANSACTION 'VF02' for message processing

835 Views

Hello everyone.

I find myself in a little problem.

I have to create for a specific order, a billing document (proforma invoice) and, after it is created, I have to display the output options for this document (2 output messages are generated).

The problem is that I want it to pass the first OK code (the document selection) and only stop at the "Output messages" screen, yet it does not. What it happens is that it calls the bdcdata in foreground, so it waits for me to confirm the ok-code before it shows the messages.

Anyway, here is the call transaction code.

FORM call_transaction  USING    p_vbeln LIKE vbrk-vbeln.

  DATA: lt_bdcdata TYPE TABLE OF bdcdata WITH HEADER LINE.
  DATA: messtab TYPE TABLE OF bdcmsgcoll.

  lt_bdcdata-program  = 'SAPMV60A'.
  lt_bdcdata-dynpro   = '0101'.
  lt_bdcdata-dynbegin = 'X'.
  APPEND lt_bdcdata.
  CLEAR  lt_bdcdata.

  lt_bdcdata-fnam     = 'BDC_CURSOR'.
  lt_bdcdata-fval     = 'VBRK-VBELN'.
  APPEND lt_bdcdata.

  lt_bdcdata-fnam     = 'VBRK-VBELN'.
  lt_bdcdata-fval     = p_vbeln.
  APPEND lt_bdcdata.

  lt_bdcdata-fnam     = 'BDC_OKCODE'.
  lt_bdcdata-fval     = '=DRCK'.
  APPEND lt_bdcdata.
  CLEAR  lt_bdcdata.

  lt_bdcdata-program  = 'SAPLVMSG'.
  lt_bdcdata-dynpro   = '0200'.
  lt_bdcdata-dynbegin = 'X'.
  APPEND lt_bdcdata.
  CLEAR  lt_bdcdata.

  lt_bdcdata-fnam     = 'BDC_CURSOR'.
  lt_bdcdata-fval     = 'NAST-KSCHL(01)'.
  APPEND lt_bdcdata.

  CALL TRANSACTION 'VF02' USING lt_bdcdata
                             MESSAGES INTO messtab.
  WRITE 'done'.
ENDFORM.                    " CALL_TRANSACTION

I'm sure it's nothing, yet I can't seem to fix it.

PS: I have tried to call it in various modes and if it's in mode 'E' or 'N', for example, it does not stop the the message subscreen, but returns to my main programs.

Please give me a hint on what I'm doing wrong.

Thanks.