2007 Jan 05 7:52 PM
Hi,
Documentation for this BADI says we cannot access global fields defined in class as methods are called at different time,so I am trying to Use EXPORT/IMPORT to pass on internal table to Update Method.
I am using this in Before Update Method
select * into table it_itab from i_tab where regio = 'XX'.
read table it_itab into it_itab1 index 1.
it_itab1-regio = 'ABC'.
MODIFY it_itab FROM it_itab1 INDEX 1.
EXPORT it_itab from it_itab TO MEMORY ID 'XXXX'.
ENDIF.
and Code in Update Method , will read from Memory id 'XXXX'.
IMPORT it_itab to it_itab FROM MEMORY ID 'XXXX'.
INSERT i_tab1 FROM it_itab.
free memory id 'XXXX'.
But it is inserting blank record into i_tab1, any idea why??
Thanks
Lakhbir
Hi,
Documentation for this BADI says we cannot access global fields defined in class as methods are called at different time,so I am trying to Use EXPORT/IMPORT to pass on internal table to Update Method.
I am using this in Before Update Method
select * into table it_itab from i_tab where regio = 'XX'.
read table it_itab into it_itab1 index 1.
it_itab1-regio = 'ABC'.
MODIFY it_itab FROM it_itab1 INDEX 1.
EXPORT it_itab from it_itab TO MEMORY ID 'XXXX'.
ENDIF.
and Code in Update Method , will read from Memory id 'XXXX'.
IMPORT it_itab to it_itab FROM MEMORY ID 'XXXX'.
INSERT i_tab1 FROM it_itab.
free memory id 'XXXX'.
But it is inserting blank record into i_tab1, any idea why??
Thanks
Lakhbir
2007 Jan 05 7:55 PM
Hi,
Try this..
If you are using internal table to export & import..Use INSERT ..FROM TABLE.. to move the values to the database..
<b>INSERT i_tab1 FROM TABLE it_itab.</b>
Thanks,
Naren
2007 Jan 05 8:07 PM
Hi,
I think values are not passes on the Internal table from memory.
Any idea what could be wrong with EXPORT/IMPORT
Thanks
2007 Jan 05 8:36 PM
Hi,
Set the update debugging flag and check if the IMPORT statement is not populating the internal table..
Thanks,
Naren
2007 Jan 05 8:42 PM
I am sorrym, But how to set Update Debugging flag.
Thanks
Lakhbir
2007 Jan 05 8:45 PM
Hi,
Before pressing the save button in the MIGO transaction..
Press /h
Then press save button..
It will take you the debugging screen..
In the menu choose..Settings -> Update debugging..
You will get a message "Update debugging switched on"..
Thanks,
Naren
2007 Jan 05 10:05 PM
Thanks Naren
But Import is not reading the Values from Memory ID even EXPORT is successful.
return code sy-subrc = 0.
This might be because METHOD'S with the class are called at different time and in different roll area, but we are exporting to ABAP Memory.
Any idea why it is not able to read from Memory ID.
2007 Jan 05 10:10 PM
Hi,
Question->Why can't you directly do the select and insert in the MB_DOCUMENT_UPDATE method..Instead of selecting the data in the method MB_DOCUMENT_BEFORE_UPDATE and then export it to the memory..and then import it in the method MB_DOCUMENT_UPDATE..
Add the below code directly in the method MB_DOCUMENT_UPDATE..
select * into table it_itab from i_tab where regio = 'XX'.
read table it_itab into it_itab1 index 1.
it_itab1-regio = 'ABC'.
MODIFY it_itab FROM it_itab1 INDEX 1.
INSERT i_tab1 FROM it_itab.
Thanks,
Naren
2007 Jan 05 10:17 PM
Yes, I can do that but was trying to do something otherway, I had to POST an FI document so doing calculations & checking in BEFORE method and if eberything is fine Just do POST in Update mode.
I ahd lenghty calculation to .. so just to minimize the delay in Update Task.
Anyway I think we cannot access Memory id In Update mode will have to live with this.
Thanks Alot for your help Naren.
Lakhbir
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |