04-25-2007 7:51 PM
Hello friends, I am using the function Module,
PM_ORDER_DATA_READ with a loop and endloop.
The first time when this function module triggers i see no problem and everything works fine.
But when it triggers the second time in the loop, it gives a short dump.
Any suggestions.
Ster
Below is the code.
LOOP AT t_resb.
CLEAR : v_ktext,v_ingpr,v_objnr,v_lgpbe,v_bismt,
v_mmsta,v_text,v_maktx, v_iloan, v_kostl.
CALL FUNCTION 'PM_ORDER_DATA_READ'
EXPORTING
order_number = t_resb-aufnr
* CALL_FROM_NOTIF =
* IMPORTING
* WCAUFVD =
* WILOA =
* WRIWO1 =
TABLES
* IAFFHD =
iafvgd = t_oper
iresbd = tmp_resb
* IRIPW0 =
* OP_PRINT_TAB =
ihpad_tab = t_ihpad
* IHSG_TAB =
* IHGNS_TAB =
* KBEDP_TAB =
EXCEPTIONS
order_not_found = 1
itab_error = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH : t_oper, tmp_resb, t_ihpad.
CLEAR: t_oper, tmp_resb, t_ihpad.
ENDLOOP.
04-25-2007 7:53 PM
Use CLEAR t_resb beore ENDLOOP.
Regards,
Amey
Message was edited by:
Amey Potale
04-25-2007 7:55 PM
04-25-2007 7:58 PM
Try using work area i.e. loop at ITAB into workarea.
and then pass workarea field to your fucntion module.
Regards,
Amey
04-25-2007 8:06 PM
Thanks Amey, No improvement.
Let me tel you something i did and find the same error while exevuting the FM in se37.
When i execute for the forst time it works fine and came back and execute for the second time goes to dump and have the same error. However during the execution of FM in se37 if i come out completely out of the screen and reexecute it it dosent go to dup. Si ai am confused whats the problem.
Ster
04-25-2007 8:11 PM
That means it is not committing the work.
try to add COMMIT WORK after your function module.
and if you have very less no. of records in internal table than also try to add WAIT of 1 or 2 seconds.
Regards,
Amey
PS: Not sure on this, but I guess it should work.
04-25-2007 8:12 PM
You can try putting a FREE MEMORY statement before ENDLOOP.
~Suresh
04-25-2007 8:22 PM
Thanks suresh. if I put free memory before endloop would it effect other user in the company using the same system.
Ster.
04-25-2007 8:41 PM
04-25-2007 8:46 PM
FREE MEMORY deletes all data cluster from the ABAP memory, so it's not a SAP Memory so you can use that.
Regards,
Amey
04-25-2007 9:08 PM
04-25-2007 11:08 PM