Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Pernr and parnr field conversion

0 Kudos

Hello Everyone,

My query is how do I convert the field parnr (length 12) of ihpa table to field pernr (length 😎 of pa0000 table?

4 REPLIES 4

former_member751591
Participant
0 Kudos

Thank you for asking a question in the SAP Community! Your question is very important to us. It would be helpful for you to take the Community Tutorial which provides tips for preparing questions that draw the best responses from our members. Plus, by organizing your Community profile using Profile Tutorial you will encourage more readers to respond to your questions!

Thank you!

former_member738480
Discoverer
0 Kudos

HI shyam_shukla ,

you can use lpad function in hana query and fetch

Exact syntax is if you want to pass pernr of 8 in length to parnr of length 12 use the LPAD syntax.

Example :

ihpa.parnr = lpad(pa0000.pernr,12,'0')

From the above 12 Denotes the Total length to be formed to match parnr's [12] from its original length of

pernr[8 -> 12].

0 Denotes the no. of Zeros going to get appended in front.


Hope this Helps ..
Thanks .


basantmhr
Participant
0 Kudos

I don't think that this is possible without the loss of data. Are you willing to have inconsistent data ?

raymond_giuseppi
Active Contributor
0 Kudos

For pre-hana versions, look at FM such as PM_PARTNER_LENGTH to convert values.