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

to convert quan field to char

Hi ,

I have a field I_MARC-EISBE which is of type quan.

If this field EISBE is initial , I need to give blank field but not 00.000

Similarily VBBE-VMENG is initial , i need to to give blank field but not 0.000

How to convert quan to char and give blank????

Points will be rewarded

Thnaks in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:13 AM

    data: quan like VBBE-VMENG

    data:char(16).

    char = quan.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:14 AM
    chk this FM  CEVA_CONVERT_FLOAT_TO_CHAR
    
    or
    
    data : v_char(25).
    
    v_char = I_MARC-EISBE.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 10:14 AM

    Move the quantity value into a variable of type Characrter, please try NUMC too.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:33 AM

    data: v1(16) type c.

    move quantity to v1.

    write:/ v1.

    alos, try checking CEVA_CONVERT_FLOAT_TO_CHAR fm

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:34 AM

    Execute the code and see if this works for u .

    data : val1 like vbbe-vmeng,
           val2(13) type c.
    val1  = 2.
    val1 = val1 * 0.
    write:/ val1.
    
    move val1 to val2.
    
    if val2 eq 0.  "---> Condition if zero
    val2 = space.
    write:/ 'hi', val2.
    endif.

    val2 from 0.00 to space .

    regards,

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:35 AM

    Hi Jayasree,

    As abap uses internal Conversions between any Basic Data types, you can create a variable and assign this quant field to it, for whatever result type you want.

    If you are trying to display the EISBE (Please refere the Piece of code i given below).

    For your information refer Conversin Routine (CONVERSION_EXIT_QUANT_INPUT or CONVERSION_EXIT_QUANT_OUTPUT ) these routines converts Decimal (1) to Decimal (2) and vice versa.

    **********************************070108 (DZ8Z6L)

    tables: marc,

    vbbe.

    data: begin of t_marc occurs 0,

    matnr like marc-matnr,

    werks like marc-werks,

    eisbe like marc-eisbe,

    end of t_marc.

    select matnr

    werks

    eisbe

    from marc

    into corresponding fields of table t_marc.

    loop at t_marc.

    if sy-tabix = 2.

    t_marc-eisbe = '22.22'.

    endif.

    write:/ t_marc-matnr,

    t_marc-werks,

    t_marc-eisbe no-zero.

    endloop.

    For any further detaisl let me know... 😊

    Regards,

    Manjunatha

    Message was edited by:

    MANJUNATHA KS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 11:09 AM

    hI Jayashree,

    DATA : V_EISBE(100) TYPE C.

    IF I_MARC-EISBE IS INITIAL.

    V_EISBE = I_MARC-EISBE.

    ENDIF.

    IF I_VBBE-VMENG IS INITIAL.

    V_VMENG = I_VBBE-VMENG.

    ENDIF.

    WRITE : V_EISBE,

    V_VMENG.

    Thanks

    Vikranth Khimavath

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 11:21 AM

    hi,

    try this.

    Take a character field of length which can acccomdate Quantity field and use Move statement.

    data: v1(16) type c. 
    
    move quantity to v1. 
    
    write:/ v1.

    Regards

    Anver

    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.