07-30-2008 12:24 PM
hi friends,
i have completely developed one interactive ALV report in which PO line items are calling ME22n and corresponding changes are getting reflected back to alv list.but what i have observed is it does not reflect the changes immediately..When i save the me22n transaction and alv list comes back,at that time that values does not change in the list..but when i put a break-point and go slowly then the reflection does come..or when i write "wait up to 1 seconds." then also it works..But can't it reflect immediately..
Thanks,
Gaurav
07-30-2008 12:26 PM
07-30-2008 12:28 PM
hi,
see my code.
case r_ucomm.
when '&IC1'. "for double click
*if rs_selfield-fieldname = 'VBELN'.
read table it_main index rs_selfield-tabindex.
set parameter id 'BES' field it_main-ebeln.
call transaction 'ME22N' and skip first screen.
*endif.
*when 'REFRESH'.
rs_selfield-refresh = 'X'.
rs_selfield-exit = 'X'.
*wait up to 1 seconds.
perform fetch_data.
refresh it_fieldcat.
PERFORM fieldcat1.
PERFORM display_ALV.
07-30-2008 1:01 PM
>
> hi,
> see my code.
>
> case r_ucomm.
> when '&IC1'. "for double click
> *if rs_selfield-fieldname = 'VBELN'.
> read table it_main index rs_selfield-tabindex.
>
> set parameter id 'BES' field it_main-ebeln.
> call transaction 'ME22N' and skip first screen.
> *endif.
> *when 'REFRESH'.
> rs_selfield-refresh = 'X'.
> rs_selfield-exit = 'X'.
> *wait up to 1 seconds.
> perform fetch_data.
> refresh it_fieldcat.
> PERFORM fieldcat1.
>
> PERFORM display_ALV.
Please add the following statement before calling the transaction and check if it works
SET UPDATE TASK LOCAL.
07-30-2008 1:05 PM
07-30-2008 12:29 PM
Since you are updating the data and coming back every thing is in one session so you can say commit work or else
use wait up to 1 seconds.
07-30-2008 12:31 PM
hi vijay,
commit work is not working and i dont want to use wait up to 1 sec..pls suggest different..
Thanks,
Gaurav
07-30-2008 12:37 PM
As you can not know when the update process will come at end, ME22N may already have called a COMMIT WORK without WAIT (So maybe already be finished or may yet need a long time on a huge order on a slow server or at rush hour)
As it is a CALL TRANSACTION you are not in the same LUW (Forget to use COMMIT WORK in your LUW, no hope)
Try to lock the purchase order (with WAIT) until the purchase order is locked by you, then release it and read the data before refreshing the ALV. (The update process keeps the order locked until the final database commit)
Use Function modules ENQUEUE_EMEKKOE (DO until locked) and then DEQUEUE_EMEKKOE. (or MM_ENQUEUE_DOCUMENT and a COMMIT WORK or DEQUEUE_ALL)
You may collect messages from transaction call, so in case of error message, don't try to lock the purchase order (Imagine that if someone else is locking the purchase order, then the call transaction fails and then if you try to lock the order yourself, not very useful)
Regards
07-30-2008 12:30 PM
Hi,
Use method refresh_table_display just after where u want updation..... dont pass any parameter to this method.
Thanks & Regards
Ashu Singh