cancel
Showing results for 
Search instead for 
Did you mean: 

RE: Suppress or stripping of some digits in XI with out effecting others

Former Member
0 Kudos

In POS, the Employee Id (of the Store Rep) who does the sale is his PEIN. The design of POS does not allow the employee to work in more than 1 store. Therefore we-are exploring a "corrective" solution which - ideally would not affect POS+ as follows:

XYZ team will "pass" an employee ID which is made of his PEINstorecode (which would fit in the 12 digits alphanumeric employee code in POS Employee table). In other words, the new employee ID in POS+ will have the official PEIN (7 digitis) suffixed with storeId as the next 5 digits

All sales transactions will carry this "new" employee ID. HOWEVER, when the sales transactions is passed over to XI , "a code fix"/or/ a data transformation / or / data mapping whithin XI (?) would have to be effected within XI to "strip" the extra 5 StoreId digits?

In the "hypothetical" scenario I described, the the input file from POS+ to XI will display an Employee id with the new format as " PEIN Nostoreidincremental digit" (74digitsx)

In my XML example ,

<StoreID>4152</StoreID>

<TransactionID>8962</TransactionID>

<RegisterTransNumber>2607</RegisterTransNumber>

<TransactionCode>101</TransactionCode>

<EmployeeID>6020540</EmployeeID>

ithe new Employee ID will show : 602054041521 with the last digit incrementing from 1 to 9 .

What can be done in XI to parse the information and get it back to an Employee ID as for example EmployeeID>6020540 , so that the remaining XI, SAP , SAP BW streams is left intact? Please advise on this

How can we resolve this in XI?

Thanks in advance

Amar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Amarnath,

If your input is 602054041521 then you need to have your output as 6020540. So basically you need to have the first 7 digits. If this is want you want then you can use a substring(0..7). You can also use an if else to check the length.

Or

Do you want to remove the last 5 numbers from the input.

Regards,

---Satish

Former Member
0 Kudos

Hi Amarnath,

Your questions seems to be confusing. The bottom line is if you have an employee id: 602054041521 then you need to send as 6020540. Is this want you want?

If yes then you need a udf.

Regards,

---Satish

Former Member
0 Kudos

Exactly sathish what you said is correct. i think we don't have any predefined function for this? can you please help to write the udf?

Former Member
0 Kudos

Hi Amarnath,

If you want to remove the last 5 then create a value UDF with one input argument 'a' and name as removelastfive and add this code:

Imports: java.;*

//write your code here

String str = a.substring(0, a.length()-5);

return str;

Then you map like this:

input --> removelastfive(udf) --> output.

Regards,

---Satish

Former Member
0 Kudos

Thanx a lot satish