‎2009 Aug 06 9:50 AM
Dear gurus.
A document number is of 10 digits.
Example
14 0000 3933.
I want this number to break and saved as 143933.
how to do it ?
Regards
Saad Nisar.
‎2009 Aug 06 9:55 AM
‎2009 Aug 06 9:55 AM
‎2009 Aug 06 10:11 AM
This statement fails when i have the document number
14 0000 3020
don't want to omit the zeros in last 4 digits.
regards
Saad Nisar.
‎2009 Aug 06 10:21 AM
okie i just want to know whether the zeros are constant at that position for all doc numbers ?
then.
data:begin of wa_doc,
pos1(2) type c,
pos2(4) type c,
pos3(4) type c,
end of wa_doc.
wa_doc = doc_number.
clear doc_number.
concatenate wa_doc-pos1 wa_doc-pos3 into doc_number.
or
data:length type i,
offs type i,
doc_number type mblnr value '1400001004'.
FIND '0000' IN doc_number MATCH OFFSET offs
MATCH LENGTH length.
REPLACE SECTION OFFSET offs LENGTH length of
doc_number WITH space.
write doc_number.
Edited by: Keshu Thekkillam on Aug 6, 2009 2:59 PM
Edited by: Keshu Thekkillam on Aug 6, 2009 3:05 PM
‎2009 Aug 06 10:42 AM
Thanks Keshu Thekkillam it helped.
can this thing be done in customer name
like the customer name is H. NAZIR TRADING COMPANY
i just want to use H. NAZIR.
can it be done with the same code.
regards
Saad Nisar
‎2009 Aug 06 10:43 AM
‎2009 Aug 06 10:58 AM
‎2009 Aug 06 9:56 AM
Hi,
If all the numbers are of the same format, you can use offset and concatenate. Note that you have to declare the variable as char to do this.
data: temp(12) type c,
temp1(2) type c,
temp2(4) type c,
temp3(8) type c.
temp = '14 0000 3933'.
temp1 = temp+0(2).
temp2 = temp+8(4).
concatenate temp1 temp2 into temp3.
Now temp3 will have the value '143933'.
Regards,
Vik
‎2009 Aug 06 9:57 AM
concatenate docno(2) docno+8(4) into docno.Regards,
Sumit Nene.
‎2009 Aug 06 9:58 AM
HI,
Please tell clearly do you want to delete 3,4,5,6 digits(in ur case 0,0,0,0) or only zeros....For ur example u can do like this
number = 1400003933.
var1 = number+0(2).
var2 = number+6(4).
concatenate var1 var2 into number.
Now ur number is 143933.
Regards,
Nagaraj