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: 

ABAP4_CALL_TRANSACTION for VA01

Former Member
0 Kudos

Hi ,

I am Using VA01 to create a Credit Memo Request and when I am saving the Credit memo request then I am using an Exit USEREXIT_SAVE_DOCUMENT to generate a debit memo request which should have all the values same as the previous screen in credit memeo request . I am using the below FM to again call VA01 Tcode in the exit .

The values are being updated in the Internal table itab_spagpa but they are not coming in the VA01 Screen. Am I missing some thing ?

FORM userexit_save_document.

  • Order Type

wa_spagpa_tab-parid = 'AAT'.

wa_spagpa_tab-parval = 'DR'.

APPEND wa_spagpa_tab TO itab_spagpa.

  • Sold To party

wa_spagpa_tab-parid = 'VF'.

wa_spagpa_tab-parval = vbak-xblnr.

APPEND wa_spagpa_tab TO itab_spagpa.

wa_spagpa_tab-parid = 'VAG'.

wa_spagpa_tab-parval = vbak-kunnr.

APPEND wa_spagpa_tab TO itab_spagpa.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'

EXPORTING

TCODE = 'VA01'

SKIP_SCREEN = 'X'

TABLES

SPAGPA_TAB = itab_spagpa.

.

ENDIF.

ENDFORM. "USEREXIT_SAVE_DOCUMENT

1 REPLY 1

Former Member
0 Kudos

I'm not sure, but I don't think calling the transaction from within the userexit is correct. The data isn't phisically stored yet so when SAP triggers VA01 it will still get the old (current) database results (I believe the data you changed is still in memory, till the userexit module is finished).

Sorry I don't have anything to tell you to solve your problem, just for a possible reason of why it's happening.

What if you remove the ABAP4_CALL_TRANSACTION from the userexit, and access VA01 manually, afterwards? Do the values get updated?

Avraham