‎2007 Aug 14 4:31 AM
i wanted to compare a character in a field and then if it is true, string is remove and remaining character is diplayed
ex.
table: DATA.
data in the fields are:
INVOICE 123
INV 758
INVOICE NO golath
now i wanted to display only:
123
758
golath
hows that? good points for all whos willing to help
‎2007 Aug 14 6:10 AM
hai
u can do it like this
DATA : V_CHAR1(15) VALUE ' INVOICE 123 ' ,
V_CHAR2(15) VALUE ' INV 758 ' ,
V_CHAR3(25) VALUE ' INVOICE NO golath ' .
SHIFT V_CHAR1 BY 8 PLACES.
SHIFT V_CHAR2 BY 4 PLACES.
SHIFT V_CHAR3 BY 11 PLACES.
write : V_CHAR1 , V_CHAR2 , V_CHAR3.
regard
nawa
‎2007 Aug 14 4:35 AM
‎2007 Aug 14 4:40 AM
not really good in ABAP prog can you be more specific
take not in doing this in query infoset SQ02
‎2007 Aug 14 6:04 AM
Hi,
Please clarify whether you wanted to have the last word of the field content - please be specific; so that I can help you to build the logic.
Regards,
KKG
‎2007 Aug 14 6:13 AM
example 3 datas in field A:
INVOICE 999
INV G L A S S
INVOICE NO FC-9900
ouput data should be:
<b>999
G L A S S
FC-9900</b>
there might be other combination so i posted some..
please do ask if you still cant understand.
thanks!
‎2007 Aug 14 6:21 AM
search INVOICE for field name
if sy-subrc <> 0.
search INV for field name.
if sy-subrc = 0.
find strlen.. and then use offset concept..
‎2007 Aug 14 6:10 AM
hai
u can do it like this
DATA : V_CHAR1(15) VALUE ' INVOICE 123 ' ,
V_CHAR2(15) VALUE ' INV 758 ' ,
V_CHAR3(25) VALUE ' INVOICE NO golath ' .
SHIFT V_CHAR1 BY 8 PLACES.
SHIFT V_CHAR2 BY 4 PLACES.
SHIFT V_CHAR3 BY 11 PLACES.
write : V_CHAR1 , V_CHAR2 , V_CHAR3.
regard
nawa
‎2007 Aug 14 7:02 AM
hello nawanandana,
all data will be extracted from a field
another example: INVOICE 123
INVOICE 123 (this data is from a field not going to declare)
how to remove the "INVOICE" and then ouput 123 only?
‎2007 Aug 14 7:14 AM
if we move a character field to a numeric field, character values are ignored and only numeric values are considered.
try this
data:
w_char(15) value 'INVOICE 123',
w_num(15) type n.
w_num = w_char.
write:
w_num.
‎2007 Aug 14 7:21 AM
hello Rajesh,
thanks for the reply!
wat i mean is how can i remove a character in a field and then display its remaining characters regardless if its numeric or character
‎2007 Aug 14 7:57 AM
Check this code
data:
w_char(30) value 'INVOIcE 123 INVOICE 4312',
w_num(30) type n,
w_value(30),
w_index TYPE sy-index.
w_num = strlen( w_char ).
do w_num times.
w_index = sy-index - 1.
TRANSLATE w_char+w_index(1) TO UPPER CASE.
if w_char+w_index(1) NA sy-abcde.
concatenate w_value w_char+w_index(1)
into w_value.
endif.
enddo.
write:
w_value.
‎2007 Aug 14 7:16 AM
data in the FIELD_A: INVOICE 123, INVOICE 143, 456
if FIELD_A has "INVOICE" then delete and display remaining
output should be:
123
143
456
how to do this in code?
‎2007 Aug 14 7:47 AM
Hi,
Try this,
PARAMETER : FIELD_A(20) TYPE C.
IF FIELD_A CA 'INVOICE'.
TRANSLATE FIELD_A USING 'I N V O I C E '.
CONDENSE FIELD_A NO-GAPS.
ENDIF.
WRITE : FIELD_A.
Regards,
Padmam.
‎2007 Aug 15 1:12 AM