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

overlap two zeros

Former Member
0 Likes
1,201

hi sap,

i have RFC where the remote system sends the notification number for an ex : 0019833737.

if they send like the above it works fine. but when they dont give that two '00' s it will not work

so how can i say to my RFC to add those two zeros before it process the action.

how can i say to the prog specifically add 2 zeros if the remote system does not give 2zeros?

they import notification number : such as 100003837.

buy system accepts it is is like : 00100003837.

how can i do it can you all please help me?

thank you,

laya.

10 REPLIES 10
Read only

Former Member
0 Likes
1,134

Hi,

Chcek this FM CONVERSION_EXIT_ALPHA_INPUT ...it adds the leading Zero's

Read only

Former Member
0 Likes
1,134

Hi,

If the system accepts the data only if it is preccedded by 2 zeros, then before sending the data chk if the data begins with 2 zeros if not then concatenate 2 zeros to the data.

Thanks,

Harini

Read only

Former Member
0 Likes
1,134

See, in most of the cases, where data type is character and we store some value with leading zeroes, system shows the values trimming the leading zeroes, but when we are going to store values, it accepts only with leading ZEROS.

Other values if system stores the values, you will not be able to access the data depending upon this field value.

So in such cases SAP has given a CONVERSION EXIT Function Module.

CONVESRION_EXIT_ALPHA_INPUT.

Try using this FM within your code always for Customer Number, Material Number, Vendor Number, Notification Number, Equipment Number etc.

Regds,

Anil

Read only

0 Likes
1,134

hi anil

so far i have not used the FM CONVESRION_EXIT_ALPHA_INPUT.

Can you please tell me as to how use it.

the field name is QMNUM

view name is viqmel

this is my select statement select QMNUM

TPLNR

QMDAT

EQUNR

  • *PLTXT

STRMN

LTRMN

PRIOK

MSAUS

QMTXT

from viqmel into CORRESPONDING FIELDS OF TABLE ZPM_STRUCT "ZIOMS_SAP

where qmnum = zQmnum.

so how can use it can you pls give me little more code pls

Read only

0 Likes
1,134

Hi Laya,

Try like this.

TPLNR

QMDAT

EQUNR

  • *PLTXT

STRMN

LTRMN

PRIOK

MSAUS

QMTXT

from viqmel into CORRESPONDING FIELDS OF TABLE ZPM_STRUCT "ZIOMS_SAP

where qmnum = zQmnum.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INTPUT'

EXPORTING

INPUT = QMNUM

IMPORTING

OUTPUT = QMNUM.

Regards,

Vijay

Read only

0 Likes
1,134

hi vijay,

i am using the database view which is VIQMEL it does not have the ALPHA.

as result when i use the FM it is giving me the runtime error.

what should i do to avoid this?

thanks in advance

laya.

Read only

0 Likes
1,134

hi anil,

i have used the FM as it is a VIEW it is not having the FM that which u asked me to use it... so what can we do to get the results

is there any way to achieve this target.

regards,

laya.

Read only

0 Likes
1,134

HI Laya again,

this is working.

DATA : pm_struct LIKE viqmel OCCURS 0 WITH HEADER LINE.

SELECT qmnum

tplnr

qmdat

equnr

  • *PLTXT

strmn

ltrmn

priok

msaus

qmtxt

FROM viqmel INTO CORRESPONDING FIELDS OF TABLE pm_struct "ZIOMS_SAP

WHERE qmnum = '000000000001'.

LOOP AT pm_struct.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = pm_struct-qmnum

IMPORTING

output = pm_struct-qmnum.

ENDLOOP.

Regards,

Vijay

Read only

0 Likes
1,134

Munna,

Simply go with below logic if Conversion_Alpha Exit won't work for you. I belive QMNUM length is 11 characters.

Qmnum = 100003837.
 OVERLAY QMNUM WITH '00000000000'. 
Result: 00100003837

Read only

Former Member
0 Likes
1,134

resolved