Application Development and Automation 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: 
Read only

Dump in using PACK statement...

Former Member
0 Likes
1,501

H iAll,

I'm getting dump as shown below in using Pack statement ....it is much appreciated if someone can help...

my code is something like

Code

   v_dxvbak-vkorg = '0A10'.

SELECT SINGLE vbund

   INTO v_pcoes_vbund

   FROM kna1

  WHERE kunnr = '00000313' .

PACK v_dxvbak-vkorg TO v_pcoes_vkorg.

DUMP

Category               ABAP Programming Error

Runtime Errors         CONVT_NO_NUMBER

Except.                CX_SY_CONVERSION_NO_NUMBER

ABAP Program           Y_TEST

Application Component  Not Assigned

Date and Time          08/07/2013 11:43:11

  Short text

     Unable to interpret "0A10" as a number.

What happened?

     Error in the ABAP Application Program

     The current ABAP program "Y_TEST" had to be terminated because it has

     come across a statement that unfortunately cannot be executed.

What can you do?

     Note down which actions and inputs caused the error.

     To process the problem further, contact you SAP system

     administrator.

     Using Transaction ST22 for ABAP Dump Analysis, you can look

     at and manage termination messages, and you can also

     keep them for a long time.

Thanks in Advance,

Prem

6 REPLIES 6
Read only

Former Member
0 Likes
1,115

Hi Prem Kumar,

PACK statement can only be used for numbers. The dump says it cannot interpret 'A'  as a number. If you had tried Packing 0010 or so, it would not have dumped. Hope this helps!

Read only

Former Member
0 Likes
1,115

You can also do an F1 on the PACK statement and understand its functionality better

Read only

Former Member
0 Likes
1,115

Dear Prem,

Pack is an obselete statement.Instead,Try to use MOVE and SHIFT statements as shown below.

   REPORT  zyyytest.
DATA lvkorg TYPE vkorg.
DATA lvkorg1 TYPE string.
lvkorg = '0A10'.


SELECT SINGLE vbund INTO lvkorg1 FROM kna1 WHERE kunnr = '0000011628' .


*PACK lvkorg TO lvkorg1.
MOVE lvkorg TO lvkorg1.
SHIFT lvkorg1 LEFT DELETING LEADING '0'.

IF sy-subrc = 0 .

ENDIF.

Thanks

Katrice

Read only

0 Likes
1,115

Yes i know pack is obsolete... but it was old logic.....

I tried Move with destination as packed type even that went to dump...your logic with char/string worked..

Read only

Former Member
0 Likes
1,115

You can handle the particular exception in order to avoid dump.

TRY.

    PACK v_dxvbak-vkorg TO v_pcoes_vkorg.

  CATCH cx_sy_conversion_no_number.

    "do something on exception

ENDTRY.

Read only

Former Member
0 Likes
1,115

Thanks all for your quick responses....

Used Move & Shift...