Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ABAP question..

Hello,

I have a requieremnt where I have makde data two characters. For ex: If I enter 23, the output should be 23, if I enter 2 in paramater, the output should be 02. But following code gives one digit when input is one digit.

Parameter: p_num(10) TYPE c.

Data: l_code TYPE char2.

If p_num < 99.

l_code = p_num(2).

endif.

Tags:
Former Member
Former Member replied

Hi,

Move it to a Numc field.

Ex.

DATA: V_NUMC(2) TYPE N.
DATA: V_CHAR(2) TYPE C.

V_CHAR = '2'.
V_NUMC = V_CHAR.
V_char = V_numc.

WRITE: / v_char.

THanks

Naren

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question