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

space removed from character data type when move to internal table issue...

Hi Friends,

I converted material code and other details into internal table which have corresponding data types.But in internal table,I can see material code as left justified ,but after that space was removed.For example if material code is 'ABC' then rest of the space(material char(18)) are removed.But I need remaining spaces.I tried to concatenate material code with spaces (caoncatenate matnr ` ` int etc .. )at right side and moved to another internal table.Its working.But the problem is material codes have different values like one material 'ABC' and another like '123893-h' etc.So I need to calculate the space(out of char 18) dynamiclly and need to put space based on material code value.

<< Moderator message - Everyone's problem is important >>

.Thank you all..

Regards,

Kumaran..

Edited by: Rob Burbank on Oct 26, 2010 11:18 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 26, 2010 at 03:56 PM

    Hi Ramkumaran,

    You have not told the purpose of having these spaces.

    is it for transfering to a file?

    If that is the case, use a table with fixed lenght lines instead of many fields.

    i.e. try something like this

     DATA : i_tab type standard table of BUSDATA, 
    wa_tab type BUSDATA.
    
    wa_tab+0(10) = material number.
    wa_tab+10(10) = material code.
    wa_tab+20(4) = company code...
    ..
    append wa_tab to i_tab.
    

    Thanks

    Vimal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 26, 2010 at 03:19 PM

    Find the string length for matnr .eg. strlen(matnr) and then concatenate spaces (18-strlen),

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 26, 2010 at 03:24 PM

    Hello,

    For release > ECC 6.0 you can use the addition RESPECTING BLANKS with the CONCATENATE command :-)\

    [http://help.sap.com/abapdocu_70/en/ABAPCONCATENATE.htm#&ABAP_ADDITION_3@3@]

    BR,

    Suhas

    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.