‎2010 Mar 08 2:27 AM
i have a requirement where an Order has 2 material and each material have 2 VAT tax. I need to write a text in the output. and I stored the text in string ZMESSAGE1.
read table vattab where matnr = mat1 and kschl = 'VAT1'.
if sy-subrc ne 0. "Create a a new entries
l_vatper = itab-kbetr.
vatab-amt = itab-kwert.
l_strlen = STRLEN( wa_customers-zmessage1 ) + 1.
if wa_customers-zmessage1 IS INITIAL.
CONCATENATE 'VAT at ' l_vatper '%' vatab-amt l_delim
INTO wa_customers-zmessage1+l_strlen(20)
SEPARATED BY space.
ELSE.
CONCATENATE wa_customers-zmessage1 'VAT at ' l_vatper '%' vatab-amt l_delim
INTO wa_customers-zmessage1+l_strlen(20)
SEPARATED BY space.
endif.
append vatab.
else. "Modify the existing entries with amount field changed
vatab-amt =vatab-amt + itab-kwert.
MODIFY vatab TRANSPORTING AMT.
Now my question is " I need to UPDATE MESSAGE TEXT " ZMESSAGE1 with the new vatab-amt'
eg: VAT AT 4 % 120.00 - original message text
Now my amt = 140
so my final message text should be VAT AT 4% 260.00
Is there any way where I can modify the existing text???
any help..
hope it is clear
thanks
‎2010 Mar 08 3:13 AM
Hi,
<li>Try this way.
Thanks
Venkat.O
REPORT ztest_notepad.
DATA:str TYPE string VALUE 'VAT AT 4 % 120.00'.
DATA:new TYPE string VALUE '260.00'.
DATA:off TYPE i.
DATA:len TYPE i.
DATA:remain_len TYPE i.
FIND '%' IN str MATCH OFFSET off.
off = off + 2.
len = STRLEN( str ).
remain_len = len - off.
REPLACE str+off(remain_len) IN str WITH new.
WRITE str.
‎2010 Mar 08 3:13 AM
Hi,
<li>Try this way.
Thanks
Venkat.O
REPORT ztest_notepad.
DATA:str TYPE string VALUE 'VAT AT 4 % 120.00'.
DATA:new TYPE string VALUE '260.00'.
DATA:off TYPE i.
DATA:len TYPE i.
DATA:remain_len TYPE i.
FIND '%' IN str MATCH OFFSET off.
off = off + 2.
len = STRLEN( str ).
remain_len = len - off.
REPLACE str+off(remain_len) IN str WITH new.
WRITE str.