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: 

replacement for fuction CONVERSION_EXIT_ALPHA_INPUT SAP Function module

Former Member
0 Kudos
628

hi folks..

do we have any replacement in terms of codes for the fuction CONVERSION_EXIT_ALPHA_INPUT SAP Function module.. i know the use of this fuction module as it converts data in numeric format to character format which is only accpetable in SAP.. cant we do it manualy using the abap codes.. or else it is the only option to do so????

6 REPLIES 6

prince_isaac
Active Participant
0 Kudos
336

Hi

Manually you could use the code as below


DATA: lv_lifnr TYPE lifnr VALUE '0000000945'.

SHIFT lv_lifnr LEFT DELETING LEADING 0.

has the same effect as the function CONVERSION_EXIT_ALPHA_INPUT but i would suggest using the function.

regards

Isaac Prince

0 Kudos
336

thanks for your reply..

but the code seems to be like converting character format "00000951" to numeric format as "951".. you have asked to delete the leading zeroes nd shift to the left side.. i think i have got it right... so please revert me back on this...

0 Kudos
336

Hi Ram,

I guess Isaac got a little confused, anyways try the below code, forgot to add...just curious to know the reason behind your post...any specific reason why you want to avoid the FMs.


DATA: l_vbeln TYPE vbeln VALUE '12345',
      l_overlay TYPE vbeln VALUE '0000000000'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = l_vbeln
 IMPORTING
   OUTPUT        = l_vbeln.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    input         = l_vbeln
 IMPORTING
   OUTPUT        = l_vbeln.

* Code to replace Conversion exit alpha input
SHIFT l_vbeln RIGHT DELETING TRAILING space.
OVERLAY l_vbeln WITH l_overlay.

* Code to replace Conversion exit alpha output
SHIFT l_vbeln LEFT DELETING LEADING '0'.
IF sy-subrc EQ 0.

ENDIF.

Regards,

Chen

Edited by: Chen K V on Jun 2, 2011 2:17 PM

Edited by: Chen K V on Jun 2, 2011 2:18 PM

0 Kudos
336

thanks chen for your kind reply..

now its clear.. i thought i can do this way.. but im new to abap and had little confusion with the code.. im an abap resource but got into data migration project .. yesterday we had a training session on LSMW... we have used this fuction.but one of my collegue said that this fuction is changed by an abaper to some other code format without using any function..i just got curious to know the another way.. thats why i have posted it here.. :). .thanks for spending your valuable time in answering me ...

0 Kudos
336

Hi

Now im totaly confussed o_0..

Anyway wellcome to ABAP Kumar.

Prince Isaac

Former Member
0 Kudos
336

Hi,

You can try this,

I know it is not a smart solution, but i can think only this...

data: w_text_1(100) VALUE '123LOKESH37647TAREY'.

         REPLACE ALL OCCURRENCES OF '0' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '1' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '2' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '3' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '4' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '5' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '6' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '7' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '8' IN w_text_1 WITH ' '.
         REPLACE ALL OCCURRENCES OF '9' IN w_text_1 WITH ' '.

Edited by: Lokesh Tarey on Jun 2, 2011 11:01 AM