cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate statement:

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

ThomasZloch
Active Contributor
0 Kudos

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

Thomas

Former Member
0 Kudos

How to do it..am not aware of it..please help

Former Member
0 Kudos

Hi,

Before concatenating just move the currency field into a charecter field then use concatenating the way you want.


<charecter field1> = <your currency field1>
<charecter field2> = <your currency field2>

CONCATENATE <charecter field1> <charecter field2> INTO <charecter field3>

GauthamV
Active Contributor
0 Kudos

hi,

create a variable of type c and use move statement in loop of internal table to pass the values to it.

ThomasZloch
Active Contributor
0 Kudos

Declare another structure similar to gw_master, where you define any non-character field of gw_master as character with a sufficient length. Then use MOVE or WRITE TO statement to fill that new structure before concatenating it.

Thomas

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

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

Thanks & Regards

Former Member
0 Kudos

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

Regards,

Bhupal