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

multiply and cancatenate

hi this is my program:

plz correct this program, my requriemnet is i want to multiply eisbe and stprs and get in i_tab-calc with preceding $ symbol , am getting this but , getting space between $ symbol and i_tab-calc values.

tablles : marc, mbew.

data : Begin of I_TAB occurs 0,

matnr like marc-matnr,

werks like marc-werks,

eisbe like marc-eisbe,

stprs like mbew-stprs,

calc type p decimals 2,

result like marc-eisbe,

End of I_tab.

data : test(13) type c.

data : a type c value '$'.

data : val(13) type c.

Select a~matnr a~werks a~eisbe b~matnr b~stprs

into corresponding fields of table i_tab from MARC as a

inner join mbew as b

on a~matnr = b~matnr.

loop at i_tab.

i_tab-calc = i_tab-eisbe * i_tab-stprs .

test = i_tab-calc.

*append i_tab.

CONCATENATE a test into val separated by ''.

i_tab-result = val.

*cancatenate '$' i_tab-calc

modify i_tab.

write : / i_tab-result.

endloop.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 07:29 AM

    Hi,

    Change the following code as:

    CONCATENATE a test into val .

    Hope this helps.

    Reward if helpful.

    Regards,

    Sipra

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 19, 2008 at 07:31 AM

    Sathesh,

    First create one variable of type C length 10.

    Now once you multiply the two fields mentioned above.

    Then do the the concatenate '$' and the result value into the Charcter variable

    This will solve your problem

    &***************Reward point if helpful**************&

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 07:33 AM

    To avoid the space condense test and concatenate it with a. then you will not get any space.

    Thanks,

    Rajinikanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 07:37 AM

    Hi,

    Avoid giving separated by ' '.

    give it as ...CONCATENATE '$' test into val.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 07:43 AM

    Try this ... think this will solve ur problem ...

    data:

    temp(20) type c.

    LOOP AT i_tab.

    i_tab-calc = i_tab-eisbe * i_tab-stprs .

    write:

    i_tab-calc to temp.

    condense temp.

    CONCATENATE a temp INTO temp .

    WRITE : / temp.

    clear temp.

    ENDLOOP.

    Take that Temp field in your internal table intead...

    Edited by: Srinivas Ganta on Jun 19, 2008 1:13 PM

    Edited by: Srinivas Ganta on Jun 19, 2008 1:14 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 08:04 AM

    Hi.

    ur code will work correctly but there r two mistakes, firstly increase the length of ' val ' variable.

    Secondly write concatenate statement with little bit modification, u wrote as separated by '' reather than writing like that write as separated by SPACE .

    PLZ Reward points, if helpful.

    Regards.

    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.