Skip to Content
0
Former Member
Oct 21, 2008 at 08:48 AM

Concatenate statement:

73 Views

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