After a long break i am writing again here.
Last week i come across a simple requirement to update a field when a product retail price ends with '7'.
for Example : if a product ABC has price as 10.97, then i have to flag that product in master data attribute table.
for this requirement i have used the following code.
Please note that you cannot directly use this code in BW 7 transformations.
I've used this code in SE38 (ABAP Editor) to make it easy for understanding purposes.
REPORT ZPVTEST.
parameters: p type p decimals 2.
data: str type string.
data: len type i.
data: last_digit type string.
str = p.
shift str right deleting trailing space.
shift str left deleting leading space.
len = strlen( str ).
len = len - 1.
last_digit = str+len(1).
write:/ last_digit.
No comments:
Post a Comment