Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Handling units in the pack screen

karuna_gangireddy
Contributor
0 Kudos

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,

1 ACCEPTED SOLUTION

maulik
Contributor
0 Kudos

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.

2 REPLIES 2

maulik
Contributor
0 Kudos

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.

Former Member
0 Kudos

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.