Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error when use concatenate in se38

Former Member
0 Kudos

Hi ,

I want to generate a file for which i have written a code to populate the fields of an internal table.

Now when the fields have got values, i am trying to use only the necessary fields and put them in a file, so that i can load that file into a data source.

for this i am tring to use Concatenate statement. i am using it in this manner:

CONCATENATE

wa_zempl_spi-/bic/ZEMPL_SPI

wa_zempl_spi-/BIC/ZPGEOID

wa_zempl_spi-/bic/zptsr_id

wa_zempl_spi-/bic/zplow

wa_zempl_spi-/bic/zpmid

wa_zempl_spi-/bic/zphigh

wa_zempl_spi-/bic/ZPFSTRLOW

wa_zempl_spi-/bic/ZPFSTRHGH

wa_zempl_spi-/BIC/ZPSNTRLOW

wa_zempl_spi-/BIC/ZPSNTRHGH

wa_zempl_spi-/BIC/ZPTHTRLOW

wa_zempl_spi-/BIC/ZPTHTRHGH

wa_zempl_spi-/BIC/ZPTRITILE

INTO FINAL_WA SEPARATED BY '|'.

CONCATENATE FINAL_WA '|' INTO FINAL_WA1.

          • transfer this final_wa to the ssfile1 which is the desired output file. ****

TRANSFER FINAL_WA TO SSFILE1.

Final_wa has type of a structure which i have declared. i cannot use string since most of the fields are floating numbers. Please provide solution for the same.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

data:

wa_zempl_spi-/bic/ZEMPL_SPIc type string,

wa_zempl_spi-/BIC/ZPGEOIDc type string,

wa_zempl_spi-/bic/zptsr_idc type string,

wa_zempl_spi-/bic/zplowc type string,

wa_zempl_spi-/bic/zpmidc type string,

wa_zempl_spi-/bic/zphighc type string,

wa_zempl_spi-/bic/ZPFSTRLOWc type string,

wa_zempl_spi-/bic/ZPFSTRHGHc type string,

wa_zempl_spi-/BIC/ZPSNTRLOWc type string,

wa_zempl_spi-/BIC/ZPSNTRHGHc type string,

wa_zempl_spi-/BIC/ZPTHTRLOWc type string,

wa_zempl_spi-/BIC/ZPTHTRHGHc type string,

wa_zempl_spi-/BIC/ZPTRITILEc type string.

move wa_zempl_spi-/bic/ZEMPL_SPI to wa_zempl_spi-/bic/ZEMPL_SPIc.

move wa_zempl_spi-/BIC/ZPGEOID to wa_zempl_spi-/BIC/ZPGEOIDc.

move wa_zempl_spi-/bic/zptsr_id to wa_zempl_spi-/bic/zptsr_idc.

move wa_zempl_spi-/bic/zplow ...............................

move wa_zempl_spi-/bic/zpmid..............................

move wa_zempl_spi-/bic/zphigh......................

move wa_zempl_spi-/bic/ZPFSTRLOW.......................

move wa_zempl_spi-/bic/ZPFSTRHGH....................

move wa_zempl_spi-/BIC/ZPSNTRLOW....................

move wa_zempl_spi-/BIC/ZPSNTRHGH................

move wa_zempl_spi-/BIC/ZPTHTRLOW.............

move wa_zempl_spi-/BIC/ZPTHTRHGH....................

move wa_zempl_spi-/BIC/ZPTRITILE..............

CONCATENATE

wa_zempl_spi-/bic/ZEMPL_SPIc

wa_zempl_spi-/BIC/ZPGEOIDc

wa_zempl_spi-/bic/zptsr_idc

wa_zempl_spi-/bic/zplowc

wa_zempl_spi-/bic/zpmidc

wa_zempl_spi-/bic/zphighc

wa_zempl_spi-/bic/ZPFSTRLOWc

wa_zempl_spi-/bic/ZPFSTRHGHc

wa_zempl_spi-/BIC/ZPSNTRLOWc

wa_zempl_spi-/BIC/ZPSNTRHGHc

wa_zempl_spi-/BIC/ZPTHTRLOWc

wa_zempl_spi-/BIC/ZPTHTRHGHc

wa_zempl_spi-/BIC/ZPTRITILEc

INTO FINAL_WA SEPARATED BY '|'.

CONCATENATE FINAL_WA '|' INTO FINAL_WA1.

13 REPLIES 13

Former Member
0 Kudos

Hello,

You can take the CHAR8000 and one more thing u are just moving the records.

Declare the variable has

data: y_v_record TYPE char2000

CONCATENATE all the records in this variable.

Then

TRANSFER Y_V_Record to the file location.

Try this it will work

Edited by: Santosh Marupally on May 11, 2009 7:55 AM

0 Kudos

The thing is that the fields that i am tring to concatenate are not char fields.

they are amount fields i.e. floating point decimals. So in this case if i declare final_wa as char, then it gives me error in the amount fields saying it is not char. So can i still use concatenate in this case, if yes then how.?

0 Kudos

Hi,

declare variables with type char with sufficient length to move numbers with decimals and floating point and then move them to the concern character fiels and then concatenate

Former Member
0 Kudos

I hope you are trying to transfer data to Application server .

Define one variable

data: outab(1500) type c.

MOVE final_wa TO outtab.

TRANSFER outtab to ssfile1

Regards,

Ajay

Former Member
0 Kudos

Hi Hardik,

For this First you need to move all your values to charecter format, then try to concatente.

hope it works

Thanks

former_member188827
Active Contributor
0 Kudos

u can use concatenate for strings or type c varaibles or for sturctures whose all fields are type c

0 Kudos

ok if my structure contains certain fields with data type as amount, then i cannot use concatenate?

If i still can, then do i have to declare those fields as char?

Former Member
0 Kudos

Hi,

For using 'Concatenate' statment all the fileds that are going to concatenate must of char type or with similar type like string. Other wise concatenate will show error

Former Member
0 Kudos

Hi,

data:

wa_zempl_spi-/bic/ZEMPL_SPIc type string,

wa_zempl_spi-/BIC/ZPGEOIDc type string,

wa_zempl_spi-/bic/zptsr_idc type string,

wa_zempl_spi-/bic/zplowc type string,

wa_zempl_spi-/bic/zpmidc type string,

wa_zempl_spi-/bic/zphighc type string,

wa_zempl_spi-/bic/ZPFSTRLOWc type string,

wa_zempl_spi-/bic/ZPFSTRHGHc type string,

wa_zempl_spi-/BIC/ZPSNTRLOWc type string,

wa_zempl_spi-/BIC/ZPSNTRHGHc type string,

wa_zempl_spi-/BIC/ZPTHTRLOWc type string,

wa_zempl_spi-/BIC/ZPTHTRHGHc type string,

wa_zempl_spi-/BIC/ZPTRITILEc type string.

move wa_zempl_spi-/bic/ZEMPL_SPI to wa_zempl_spi-/bic/ZEMPL_SPIc.

move wa_zempl_spi-/BIC/ZPGEOID to wa_zempl_spi-/BIC/ZPGEOIDc.

move wa_zempl_spi-/bic/zptsr_id to wa_zempl_spi-/bic/zptsr_idc.

move wa_zempl_spi-/bic/zplow ...............................

move wa_zempl_spi-/bic/zpmid..............................

move wa_zempl_spi-/bic/zphigh......................

move wa_zempl_spi-/bic/ZPFSTRLOW.......................

move wa_zempl_spi-/bic/ZPFSTRHGH....................

move wa_zempl_spi-/BIC/ZPSNTRLOW....................

move wa_zempl_spi-/BIC/ZPSNTRHGH................

move wa_zempl_spi-/BIC/ZPTHTRLOW.............

move wa_zempl_spi-/BIC/ZPTHTRHGH....................

move wa_zempl_spi-/BIC/ZPTRITILE..............

CONCATENATE

wa_zempl_spi-/bic/ZEMPL_SPIc

wa_zempl_spi-/BIC/ZPGEOIDc

wa_zempl_spi-/bic/zptsr_idc

wa_zempl_spi-/bic/zplowc

wa_zempl_spi-/bic/zpmidc

wa_zempl_spi-/bic/zphighc

wa_zempl_spi-/bic/ZPFSTRLOWc

wa_zempl_spi-/bic/ZPFSTRHGHc

wa_zempl_spi-/BIC/ZPSNTRLOWc

wa_zempl_spi-/BIC/ZPSNTRHGHc

wa_zempl_spi-/BIC/ZPTHTRLOWc

wa_zempl_spi-/BIC/ZPTHTRHGHc

wa_zempl_spi-/BIC/ZPTRITILEc

INTO FINAL_WA SEPARATED BY '|'.

CONCATENATE FINAL_WA '|' INTO FINAL_WA1.

0 Kudos

Thanks a lot ... i will try this...

Just one last question can i simply a work area into an appliaction server file so that i do not need to use concatenate.?

0 Kudos

Thanks a lot ... i will try this...

Just one last question can i simply transfer a work area into an appliaction server file so that i do not need to use concatenate.?

something like this:

LOOP AT IT_TARGET INTO wa_zempl_spi.

TRANSFER wa_zempl_spi TO SSFILE1.

Now wa_zempl_spi contains all my required fields (amount fields) in addition to other fields

0 Kudos

Hi,

You can do that, but whennever you are displaying the data you need to get the data by accessing each field only. By using concatenate you can able to display whatever way you want to display.

0 Kudos

Hi, yes you can use simply a work area to transfer data in application server...

Regards,

Siddarth