‎2008 Jul 17 10:41 AM
Hi Gurus,
I have a problem in data conversion..
IF ls_zixtsvcreq-zixfempnb EQ '|'.
MOVE ' ' TO ls_zixtsvcreq-zixfempnb.
ENDIF.
This code produces dump as ls_zixtsvcreq-zixfempnb is a numeric value which cant interpret Pipe(|) sign.
Is there any method to convert the pipe into numc value or the solution for the desired results.
Please reply.
Regards,
Rahul
‎2008 Jul 17 10:53 AM
First move the value (ltest) into the character value (ltest1)then compare .
move ltest to ltest1.
IF ltest1 EQ '|'.
MOVE ' ' TO ltest.
ENDIF.
‎2008 Jul 17 2:16 PM
Hi Shilpi,
Its not working..
Suggest other solution
Regards,
Rahul
‎2008 Jul 17 2:25 PM
hiii
you are getting dump because you are having type of ls_zixtsvcreq-zixfempnb as numeric.it will not take '|' as numeric value...but then also you want to do the same then convert that field in type C field once...then after moving value again convert it in numeric field.
data: ltest type C.
ltest = ls_zixtsvcreq-zixfempnb
IF ltest EQ '|'.
MOVE ' ' TO ltest.
ENDIF.
ls_zixtsvcreq-zixfempnb = ltest.regards
twinkal
Edited by: twinkal patel on Jul 17, 2008 3:26 PM
‎2008 Jul 17 2:28 PM
Twinkal,
i think you should know shilpi already has given same reply as you gave.you suppose to provide some other not just post same by simply modify them.
Amit.
‎2008 Jul 18 10:18 AM
‎2008 Jul 17 2:27 PM
Hi,
Please check it
here the numeric field is L_OUT
data: l_str1 TYPE string,
l_out TYPE n LENGTH 2 VALUE 12.
l_str1 = '|'.
IF l_str1 = '|' .
MOVE '' to l_out.
ENDIF.
WRITE: l_out.
You can not make l_out as blank because it a numeric field.
‎2008 Jul 18 10:33 AM
Hi,
i wrote the below code and executed it is working fine.
but one thing i observed is in the parameter num value we can give only numbers as it is of type n.
but it is working fine for the else part. it did not go to dump.
data: cha type c.
parameter num type n.
cha = num.
if cha eq 'l'.
write: 'hi'.
else.
write: 'wrong'.
endif.