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

Send data from one User Exit to other

Hi,

There are two User Exits in VA01 transaction

1.USEREXIT_MOVE_FIELD_TO_VBEP

2.USEREXIT_SAVE_DOCUMENT

The first Exit will get called for each line item while the second exit will get called at the time of saving.

For ex: According to my requirement I would like to store details of all the items.

Those details will be available only when the control is in EXIT1.And I need to acess all those details in EXIT2.

How we can do this?

Thanks in advance

Swathi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    Posted on Sep 19, 2007 at 08:40 AM

    Hi,

    I suggest go for second userexit...USEREXIT_SAVE_DOCUMENT..U iwll find the temporary structures like XVBAK,XVBAP,XVBKD like this..where the data is stored...for line items u will get data In XVBAP.so try to use these structures ..

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 08:40 AM

    Hi ,

    In the Second exit you will have all the details of order table XVBAK,XVBAP ,XVBEP ,XVBUK ETC ,everything .

    Yoiu can use that to do ur calcuations so the second exit has everything available.

    Please reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 08:42 AM

    Dear Swathi,

    Assuming that you're referring to the same document (same LUW) then you can use ABAP memory to store your data.

    Please refer to SAP Help for keyword EXPORT / IMPORT

    Ps: Do not forget to free the memory after you import and make sure that you create a unique key to identify your data.

    😊

    Dian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 08:43 AM

    Hi,

    Usually you will have the data available in the second exit. In case it is not available, you can make use of EXPORT/IMPORT statements.

    In the first exit, use EXPORT data TO memarea.

    In the second exit, use IMPORT data FROM memareaa

    Please refere F1 help for exact syntax.

    Rewards, if helpful!!!

    Thanks,

    Basav

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 09:25 AM

    Swathi,

    If you are trying to pass less amount of data ( say a date or may be a Qty) , IMPORT/EXPORT FROM/TO MEMORY is a good option.

    But , as these are the Sub routine Exits, and get called frequently( even on Enter in the Sales Order Schedule line screens), I will suggest you to use Function Group and Function Modules for exchanging data.

    You create a Function Group, inside that create two Function Modules. From both the exits you can pass the data to the Function group ( you can always create a Top Include and declare some global data across the function modules ). So you can create your own internal tables for storing the data of XVBEP, XVBAK and XVBAP. This will be simpler and error free.

    Hope it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 09:29 AM

    Hi

    Thanku,

    I need details from XVBKD which are not acessible in second Exit.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You can do that this way using IMPORT/EXPORT.

      data : t_all LIKE xvbkd OCCURS 0.

      From the first exist where you can capture XVBKD , do this -

      data : t_all like XVBKD occurs 0.

      IMPORT t_all FROM MEMORY ID 'Z_XVBKD_EXP'.

      IF SY_SUBRC EQ 0.

      • Means we have existing data there. gr8.

      ENDIF.

      • Now append existing XVBKDs to t_all.

      APPEND lines of XVBKD to t_all.

      *We are exporting updated data there.

      EXPORT t_all TO MEMORY ID 'Z_XVBKD_EXP'.

      Where you dont have the XVBKD.Simply IMPORT the memory data

      data : t_get like XVBKD occurs 0.

      IMPORT t_mem FROM MEMORY ID 'Z_XVBKD_EXP'.

      This will take care of all the data records.

      But I would suggest you to go for Function groups - As you are playing with internal table records - There is a chance that this Export and Import might fail. Its much safer to go for Function grp/FM combination - it will be much safer.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 10:01 AM

    Hi,

    But that will not suffice my requirement..

    My req is like we need to append records to Memory ID..

    for ex: lets take an internal table itab1 this we can export to MID

    but second time this internal table itab1 will have some other records & those records should get appended to MID.

    Thanks

    Swathi

    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.