Application Development and Automation 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: 
Read only

how to write logic

Former Member
0 Likes
656

hi folks ..

how can i write logic for below requirement

CONCATENATE 'KS' p_kokrs record-bdc00 INTO g_objnr.

if record-bdc00 contain only numbers and letters ex: 81A650 is sholdnot do anything

if record-bdc00 contain only number ex: 370940 inthis case i need to add 4 zeros before the number i.e 000030940

please explain

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
633

The only thing needed in this case is your field p_kokrs record-bdc00 should be of type NUMC (N)

Regards,

Atish

hi folks ..

how can i write logic for below requirement

CONCATENATE 'KS' p_kokrs record-bdc00 INTO g_objnr.

if record-bdc00 contain only numbers and letters ex: 81A650 is sholdnot do anything

if record-bdc00 contain only number ex: 370940 inthis case i need to add 4 zeros before the number i.e 000030940

please explain

5 REPLIES 5
Read only

Former Member
0 Likes
633

Hi Neeru,

In this case use below FM.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = p_kokrs record-bdc00

IMPORTING

OUTPUT = p_kokrs record-bdc00

.

Regards,

Atish

Read only

Former Member
0 Likes
634

The only thing needed in this case is your field p_kokrs record-bdc00 should be of type NUMC (N)

Regards,

Atish

Read only

0 Likes
633

Hi atish

thanks for your reply

but before calling the FM how can i check that filed contatains only numbers or combination of numbers and characters?

Read only

0 Likes
633

Hi neeru,

Sorry missed to add that.

IF p_kokrs record-bdc00 CA sy-abcde.

  • Do not Call FM

ELSE.

--CALL FM

ENDIF.

Regards,

Atish

Read only

0 Likes
633

thanks for your help

wrking fine