Skip to Content
author's profile photo Former Member
Former Member

Call transaction in update task

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2009 at 12:29 PM

    Hi,

    use the following stmt. instead of calling FM ''ABAP4_CALL_TRANSACTION_VB'

    CALL TRANSACTION 'V_V2' USING BDCDATA MODE 'N' UPDATE 'S'......

    Hope it will work.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2009 at 12:34 PM

    Hi Mohamed,

    Use like this.

    Call Transaction 'V_V2' using Bdcdata mode 'A' update 'A' messages into bdcmsgcoll.

    Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2009 at 12:38 PM

    If you read the abap help for Update task in notes section you will find following sentence.

    "While an update function module is processed in an update work process, you are not allowed to execute the statements SUBMIT, CALL DIALOG, CALL SCREEN, CALL TRANSACTION, COMMIT WORK, ROLLBACK WORK and all other statements that provoke a database commit."

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.