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

Concatenate statement:

In my code along with other fields i want to concatenate the currrency field also but i do in the same procedure done for other fields short dump is coming specifiying select query is not proper.the below is my code.NAFAP field is the currency field.

SELECT DISTINCT anla~bukrs

anla~anln1

anla~anln2

anla~txt50

anlz~werks

anlp~kostl

anla~anlkl

anla~anltp

anlb~ndurj

anlb~ndurp

anla~aktiv

t001~waers

anlc~gjahr

anlc~afabe

anlc~nafap

anlb~afabg

anlb~safbg

INTO TABLE gi_master

FROM anla

INNER JOIN anlb

ON ( anlabukrs = anlbbukrs AND

anlaanln1 = anlbanln1 AND

anlaanln2 = anlbanln2 )

INNER JOIN anlc

ON ( anlabukrs = anlcbukrs AND

anlaanln1 = anlcanln1 AND

anlaanln2 = anlcanln2 )

INNER JOIN anlz

ON ( anlabukrs = anlzbukrs AND

anlaanln1 = anlzanln1 AND

anlaanln2 = anlzanln2 )

INNER JOIN anlp

ON ( anlabukrs = anlpbukrs AND

anlaanln1 = anlpanln1 AND

anlaanln2 = anlpanln2 )

INNER JOIN t001

ON ( anlabukrs = t001bukrs )

WHERE anla~bukrs IN s_bukrs.

*If there are no entries in the table.

IF sy-subrc <> 0.

MESSAGE e023 WITH 'No values found'.

ENDIF.

&----


*& Form download_unix

OPEN DATASET p_uxfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

DATA: lv_line TYPE string.

DATA: lv_char TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

EXIT.

ENDIF.

LOOP AT gi_master INTO gw_master.

CONCATENATE gw_master-bukrs

gw_master-anln1

gw_master-anln2

gw_master-txt50

gw_master-werks

gw_master-kostl

gw_master-anlkl

gw_master-anltp

gw_master-ndurj

gw_master-ndurp

gw_master-aktiv

gw_master-waers

gw_master-gjahr

gw_master-afabe

gw_master-nafap

gw_master-afabg

gw_master-safbg

INTO lv_line SEPARATED BY ','.

TRANSFER lv_line TO p_uxfile.

CLEAR lv_line.

ENDLOOP.

CLOSE DATASET p_uxfile.

The value passed

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Oct 21, 2008 at 08:51 AM

    You cannot concatenate amount fields. Move them to a temporary character field first.

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 08:52 AM

    before concatenating Currency convert it ot CHAR or string and then concat. You cannot directly concatenate numbers or values.

    Regards,

    Bhupal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 09:00 AM

    Hi,

    First assign the currency amount field to a character or string and then use the concatenate statement. It will be done.

    Thanks & 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.