how to get value from keypad of two parameters and store it in different charact

Why would you support entering non-digits, when you only care about some of the digits?

How is the keypad going to return a B?

You need to have a key on the keypad mean "the complete value has been entered; convert the string to a value, and store that value". It is then easy to count the number of times that key is pressed, to know what to do with the value (that is, where to store the value).

How many keys on your keypad? Aside from the 0 to 9, what meaning have you assigned to the other keys?

How will you deal with fat-fingering? I can hardly hammer 3 keys in a row without reaching for the backspace key. Are your users better typists than me? Not that that would be even remotely hard, but you should have a way of dealing with mistakes.