‎2012 Mar 29 10:06 AM
Hello All,
We implemented BADI 'BADI_SD_BILLING' and an update function module will be called with update task mode in the method 'INVOICE_DOCUMENT_ADD' .
Initially, a global internal table will be populated in another function module of the same function group and it will be exported. But when we tried to use that table data in update function module, it is not available. We tried with SET PARAMETER ID, EXPORT & IMPORT TO MEMORY ID and other options. But none of them are useful. We cannot use shared memory as it will be accessible for all users. We would need to access this data only to a specific user and that too for that specific session. Could you please suggest us the possible approach to access this global table.
Thank you very much.
Regards,
Sri
‎2012 Mar 29 10:26 AM
Well Update function module execution is controlled by update work process and not the dialog work procees. So, you are not getting the values.
Can't you modify the function module interface ( I am assuming the update function module is a Z-fm ) to pass the table data while calling the Update FM itself( registering it with IN UPDATE TASK)?
‎2012 Mar 29 10:32 AM
We tried by sending that global table as an importing parameter for Update FM. But it was also failed. Any more possible options?
‎2012 Mar 29 10:33 AM
When the function module will be submitted it will not use the values of the function group in the current luw. You could try using a perform at commit, in the form, read the data stored by the firszt function module, use a "read" fonction module for that, and call in update task the actual update tasl function module.
* somewhere during transaction
CALL FUNCION "Z_CALCULATE_DATA'. " store data in FG TOP
* somewhere (else) during transaction
PERFORM FORM_AT_COMMIT ON COMMIT.
* Transaction validation
COMMIT WORK.
* Form
FORM FORM AT COMMIT.
CALL FUNCTION 'Z_READ_DATA'. " read data back from FG
CALL FUNCTION 'Z_UPDATE_DATA' IN UPDATE TASK. " pass the data in parameters
Regards,
Raymond
‎2012 Mar 29 10:39 AM
After the update task FM call, the COMMIT WORK will be called in the standard code. Do you want me to call it before the update FM call too?
‎2012 Mar 29 10:48 AM
‎2012 Mar 29 11:00 AM
you need to declare the variable correctly in the function group..
in the function module menu Goto -> Global data .. you will reach the top include for both the FMs..
make sure they both are pointing to the same location and having same variable names...
‎2012 Mar 29 11:46 AM
Yes, I have declared in top include itself. But the table does not contain the data in update FM.
‎2012 Mar 29 3:31 PM
Hi
The functions in update task can not read data from the transaction LUW. Try to export and import the data into shared memory or shared buffer or in better way you can use shared objects technology
Check this link http://help.sap.com/erp2005_ehp_02/helpdata//EN/14/dafc3e9d3b6927e10000000a114084/frameset.htm
‎2012 Apr 02 10:37 AM
Hello All,
Solved the issue by creating one normal function module and exporting the relevant table from it. Then enhanced the update FM with one more paramter in Tables so that the same data is available within Update FM.
Regards,
Sri
‎2021 Jul 08 1:32 PM
As it was mentioned earlier, the update task does not see memory from LUW.
The best solution is to add parameter to function module called in update.
If that is not an option you may also try to create own function module that exports parameters to memory. If this custom function module is called first, in update mode, then in your destination update function module you will be able to useIMPORT FROM MEMORY ID, data will be there.