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

unpack stmt

Former Member
0 Likes
527

Hi

I have used unpack keyword to convert number to char.

But sometimes the input is character.

So when it executes unpack stmt, it gives me a dump error

Bcox vendor is alpha numeric.

How to check for that

But if i give vendor code as 25, it should take as '0000000025'

if i give vendor as 'A001', it should not consider this stmt

UNPACK it_gatehdr-lifnr TO w_lifnr1.

waht is the solution for this..

Cheers

Christina

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
482
if i give vendor as 'A001', it should not consider this stmt

UNPACK it_gatehdr-lifnr TO w_lifnr1.


if not vendor CA sy-abcde.
UNPACK it_gatehdr-lifnr TO w_lifnr1.
else..
 som thing else...
endif.

Hi

I have used unpack keyword to convert number to char.

But sometimes the input is character.

So when it executes unpack stmt, it gives me a dump error

Bcox vendor is alpha numeric.

How to check for that

But if i give vendor code as 25, it should take as '0000000025'

if i give vendor as 'A001', it should not consider this stmt

UNPACK it_gatehdr-lifnr TO w_lifnr1.

waht is the solution for this..

Cheers

Christina

2 REPLIES 2
Read only

former_member156446
Active Contributor
0 Likes
483
if i give vendor as 'A001', it should not consider this stmt

UNPACK it_gatehdr-lifnr TO w_lifnr1.


if not vendor CA sy-abcde.
UNPACK it_gatehdr-lifnr TO w_lifnr1.
else..
 som thing else...
endif.

Read only

Former Member
0 Likes
482

Hi,

use this..

 IF it_gatehdr-lifnr GT 0.
              UNPACK it_gatehdr-lifnr TO w_lifnr1.
          ENDIF. 

With Rgds,

S.Bharani