Skip to Content
0
Former Member
Aug 24, 2009 at 12:17 PM

Call transaction in update task

644 Views

Hi,

I'm trying to call t-code V_V2 on update task but the update terminates with error "POSTING_ILLEGAL_STATEMENT". I've tried the same below code but without "In update task" and it worked correctly. Can anyone help me please?

DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

"Open the 1st screen of transaction V_V2...

CLEAR bdcdata.

bdcdata-program = 'SDV03V02'.

bdcdata-dynpro = '1000'.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

"Position the cursor on the material number field...

CLEAR bdcdata.

bdcdata-fnam = 'BDC_CURSOR'.

bdcdata-fval = 'S_MATNR-LOW'.

APPEND bdcdata.

"Enter the material number on its field...

CLEAR bdcdata.

bdcdata-fnam = 'S_MATNR-LOW'.

bdcdata-fval = matnr.

APPEND bdcdata.

"Position the cursor on the plant field...

CLEAR bdcdata.

bdcdata-fnam = 'BDC_CURSOR'.

bdcdata-fval = 'S_WERKS-LOW'.

APPEND bdcdata.

"Enter the plant on its field...

CLEAR bdcdata.

bdcdata-fnam = 'S_WERKS-LOW'.

bdcdata-fval = plant.

APPEND bdcdata.

"Position the cursor on the simulation checkbox field...

CLEAR bdcdata.

bdcdata-fnam = 'BDC_CURSOR'.

bdcdata-fval = 'P_SIMUL'.

APPEND bdcdata.

"Clear the simulation checkbox field...

CLEAR bdcdata.

bdcdata-fnam = 'P_SIMUL'.

bdcdata-fval = ' '.

APPEND bdcdata.

"Execute the program...

CLEAR bdcdata.

bdcdata-fnam = 'BDC_OKCODE'.

bdcdata-fval = 'ONLI'.

APPEND bdcdata.

"A popup window will raise for change confirmation...

CLEAR bdcdata.

bdcdata-program = 'SAPLSPO1'.

bdcdata-dynpro = '100'.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

"Position the cursor on this popup window...

CLEAR bdcdata.

bdcdata-fnam = 'BDC_CURSOR'.

bdcdata-fval = 'SPOP-OPTION1'.

APPEND bdcdata.

"Press the "YES" button...

CLEAR bdcdata.

bdcdata-fnam = 'BDC_OKCODE'.

bdcdata-fval = 'YES'.

APPEND bdcdata.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION_VB' IN UPDATE TASK

EXPORTING

tcode = 'V_V2'

  • SKIP_SCREEN = ' '

MODE_VAL = 'N'

UPDATE_VAL = 'S'

TABLES

USING_TAB = bdcdata

  • SPAGPA_TAB =

  • MESS_TAB =

EXCEPTIONS

CALL_TRANSACTION_DENIED = 1

TCODE_INVALID = 2

OTHERS = 3.