01-18-2009 11:05 PM
Hi Gurus ,
there is the code already which updates a ztable when material doc is posted from migo .
at the statement in code
IMPORT sv_goitem TO zpt_goitem FROM MEMORY ID 'pt_goitem'.
if not zpt_goitem[] is initial.
Problem.
" zpt_goitem[] is always empty ,though The P.O has one line .
Is that problem with Import .
below code in the mehtod .
FIELD-SYMBOLS: <gt_extdata> TYPE migo_badi_example_screen_field.
data: zpt_goitem TYPE TABLE OF goitem ,
zgoserial type bapi2017_gm_serialnumber,
zpt_goserial TYPE TABLE OF bapi2017_gm_serialnumber ,
INDXKEY type INDX-SRTFD ,
WA_INDX type INDX.
if sy-title(12) ne 'Cancellation' and
sy-title(7) ne 'Display'.
WA_INDX-AEDAT = SY-DATUM.
WA_INDX-USERA = SY-UNAME.
INDXKEY = is_mkpf-mblnr.
IMPORT sv_goitem TO zpt_goitem FROM MEMORY ID 'pt_goitem'.
if not zpt_goitem[] is initial.
IMPORT sv_goserial to zpt_goserial from MEMORY ID 'PT_GOSERIAL_POST'.
loop at zpt_goitem into zgoitem....
Thanks
Vinay kolla
01-18-2009 11:13 PM
Hi Vinay...
when you are playing with Import and Export you are playing with session memory and not ABAP memory... looks the session that Exports data into the memory id is closed and the memory is getting cleared.. so the your internal table is always null (initial)
01-18-2009 11:49 PM
Thanks for you response Jay .
So are saying not to use the import and export in this case ?
Can you suggest a solution .
Thanks
Vinay
01-18-2009 11:54 PM
if its a variable, then using SET parameters and Get parameters.... else using a Ztable would be preferred.
01-19-2009 6:09 AM
Hi Jay ,
"if its a variable, then using SET parameters and Get parameters.... else using a Ztable would be preferred"
from memory it should get all the line data GI , Can you please elaborate the on the solution .
Appriciate it .
Thanks
Vinay
01-19-2009 2:14 PM
>
get all the line data GI
SPA / GPA doesnt work...
create a Ztable update your entires into it and get those entries using select in your other piece of code... once things are completed... delete entries from the Ztable.