12-18-2009 7:41 PM
Hi All,
I have a requirement where i need to read the data in entered in the handling units in the pack screen before the delivery is saved. I tried calling the FM 'WS_DELIVERY_CREATE' on USEREXIT_SAVE_DOC/USER_EXIT_REFRESH_DOC. I am getting a DUMP 'Division by 0 (type P) in program "SAPFV50P" .' I debugged the process and found that the dump is in:
program: SAPFV50P
include: FV50XFLP_ILIPS_ANLEGEN
row: 29. ( xlips_high_posnr = ( lips-posnr / tvlk-incpo ) * tvlk-incpo ). Here tvlk-incpo = 0.
But when i call the same FM from SE38 with the same delivery# it runs fine and the handling units data is in the table ET_CREATED_HUS and the value tvlk-incpo is never 0.
Not sure where i am making a mistake. Can anyone tell me? Or any other FM that serves my purpose of reading HU data?
Thanks in advance,
12-18-2009 9:45 PM
The abap statement does not make sense.
xlips_high_posnr = ( lips-posnr / tvlk-incpo ) * tvlk-incpo
posnr & incpo are both type numc length 6.
Here is my recommendation to catch the divide by zero error.
data: l_oref type REF to cx_root.
data: l_text type string.
TRY.
clear l_text.
xlips_high_posnr = lips-posnr / tvlk-incpo.
CATCH cx_sy_zerodivide INTO v_oref.
l_text = l_oref->get_text( ).
CLEANUP.
* Put your code to do further processing if it is divide by zero
ENDTRY.
12-18-2009 9:45 PM
The abap statement does not make sense.
xlips_high_posnr = ( lips-posnr / tvlk-incpo ) * tvlk-incpo
posnr & incpo are both type numc length 6.
Here is my recommendation to catch the divide by zero error.
data: l_oref type REF to cx_root.
data: l_text type string.
TRY.
clear l_text.
xlips_high_posnr = lips-posnr / tvlk-incpo.
CATCH cx_sy_zerodivide INTO v_oref.
l_text = l_oref->get_text( ).
CLEANUP.
* Put your code to do further processing if it is divide by zero
ENDTRY.
12-19-2009 8:04 AM
When tvlk-incpo = 0 in
( xlips_high_posnr = ( lips-posnr / tvlk-incpo ) * tvlk-incpo ).
result will be unknown and dump is coming.
Please handel this error, your problem will be solved.