cancel
Showing results for 
Search instead for 
Did you mean: 

How to Trim SAP position numbers

Former Member
0 Kudos

Hi gurus

The invoice line number, which must go into a NUMBER (4) column in our Oracle database. So 000010, 000020 is not going to work. How can i trim to start with 1, and increment by 1. Thanks

PM

Accepted Solutions (0)

Answers (3)

Answers (3)

zameerf
Contributor
0 Kudos

Do you want to get input(Invoice line number) from source and send to database?

If so, you can simply use FormatNumber function to mention 4 characters.

If your requirement is to set Invoice line number for each of the target items, then try to use Arithmetic->counter function specifying the increment value.

udo_martens
Active Contributor
0 Kudos

Hi Peter,

if you are sure that the sequence is like 000010, 000020... you can divide by 10 and delete the zeros with function "formatNum".

But you can use function "index" as well. Then there will be no correlation between invoice line number and Oracle column, but it will work as well for line numbers like 000025.

Regards,

Udo

Former Member
0 Kudos

Hello Peter,

You need to write Java UDF to trim the trailing zeros or leading zeros.You can use an statistic standard function index in your mapping for incrementing the invoice line no.

For UDF:

http://wiki.sdn.sap.com/wiki/display/Java/Remove+Leading+and+Trailing+Zeros+from+a+String

For index :

http://wiki.sdn.sap.com/wiki/display/XI/Standard+Functions+in+PI+7.0

Regards,

SHRI