Skip to Content
author's profile photo Former Member
Former Member

prefix zero to alphanumeric characters

Hi All,

Can anyone suggest me any Function module is there to prefix zero to an alphanumeric charcter. I have been trying conversion_exit_alpha_input FM for this purpose but it works fine only for numerics. plaese let me know any FM exists for alphanumeric characters which serves the purpose.

Thanks in Advance

Rijish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Oct 23, 2006 at 12:42 PM

    yes

    w_size2 = strlen( w_data )

    w_size = size - w_size2

    concatenate w_zero+0(w_size) w_data into w_data.

    something like that

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 12:45 PM

    U can use the below code.

    data : lcons(18) type c value '000000000000000000',

    lstring(36) type c.

    ==>lval is your value.

    concatenate lcons lval to lstring.

    write lstring(18) to lval.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 12:50 PM

    Hi,

    i make it in this way:

    REPORT ZGRO_TEST.

    data: test(18).

    *

    data: test1(18).

    data: strlen type i.

    data: i type i.

    *

    test1 = '12wer'.

    *

    strlen = strlen( test1 ).

    I = 18 - strlen.

    *

    test = '000000000000000000'.

    test+i = test1.

    • leading zero.

    *

    write: / test.

    write: / test1.

    Regards, dieter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 12:56 PM

    Hi,

    You can use the below code.

    report abc.

    data: v_size1(2) type n,

    v_size2(2) type n.

    constants: c_zeroes(18) type c value '000000000000000000'.

    parameters: p1(18) type c.

    shift p1 left deleting leading space.

    v_size1 = strlen( p1 ).

    if v_size1 lt 18.

    v_size2 = 18 - v_size1.

    shift p1 right deleting trailing space.

    p1+0(v_size2) = c_zeroes.

    endif.

    write p1.

    Also, note that the v_size2 is to be calculated as per your requirement.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.