Application Development and Automation 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: 
Read only

Output data in file

Former Member
0 Likes
1,995

Hello Experts ,

i need to output data in output file.

the file formate should look like this :

Art Sold-to party Sales Order Delivery Doc.

R 1064505 1509026 84846578

R 1064505 1509026 84846578

i used concatenate statement.

CONCATENATE 'ART'

'SOLD-TO PARTY'

'SALES ORDER'

'DELIVERY DOC'

'BILLING DOC'

INTO LV_STRING SEPARATED BY SPACE RESPECTING BLANKS.

CONCATENATE GT_AUART

GT_DATA-KUNAG

GT_DATA-AUBEL

GT_DATA-VGBEL

INTO gt_string SEPARATED BY SPACE.

i am getting error ".", "IN BYTE MODE", "SEPARATED BY ...", or "IN CHARACTER MODE" expected after "LV_STRING".

i used respecting blanks without separated by space also. than also i am geting same error.

Please let me knw any other statement to output data in file in above formate

Thanks in advance ,

best regards,

sai

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,959

So how we can do this requirement.

Thanks and regards,

Zubera

17 REPLIES 17
Read only

former_member209217
Active Contributor
0 Likes
1,959

RESPECTING BLANKS ADDITION is not there for older versions.Its available in ECC

Regards,

Lakshman

Read only

Former Member
0 Likes
1,960

So how we can do this requirement.

Thanks and regards,

Zubera

Read only

0 Likes
1,959

which version you are using

Read only

0 Likes
1,959

CONCATENATE 'ART'
'SOLD-TO PARTY'
'SALES ORDER'
'DELIVERY DOC'
'BILLING DOC'
INTO LV_STRING SEPARATED BY SPACE .
write lv_string.

On execution you will get the below output.I think this is what you are looking for....

Output :ART SOLD-TO PARTY SALES ORDER DELIVERY DOC BILLING DOC

Regards,

Lakshman.

Read only

0 Likes
1,959

Hi,

You can define workarea of a structure.

The length of fields in the structure should be correctly defined.

Move the header texts to each field.

Now workarea contains the texts at specific positions.

If you are downloading some file, you can declare all fields of that itab as char, and insert these header texts as itab's first line.

Regards,

Nisha Vengal.

Read only

Former Member
0 Likes
1,959

we are using ECC 5.0 only...

i used separated by space option but not working. if i use separaetd by space i am not geting proper formate.

Read only

0 Likes
1,959

In Which format you are getting the output. which format do u want?

Please post the output you are getting

Read only

Former Member
0 Likes
1,959

Thanks for your reply lakshmikanth. if you give mail id will send file formate.....

field is separated by tabs... and exactly below fieldname field value shoudl display.

Regards,

Sai

Read only

0 Likes
1,959

If you want tab space in between the values use this value


CONCATENATE 'ART'
'SOLD-TO PARTY'
'SALES ORDER'
'DELIVERY DOC'
'BILLING DOC'
INTO LV_STRING SEPARATED BY  CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB . "----------->Tab Space .

Read only

Former Member
0 Likes
1,959

lakshimkanth thanks for your reply

i am geting this formate

ART SOLD-TO PARTY SALES ORDER DELIVERY DOC

R 0001004306 0000029033 0080042942 0090023253

R 0001006900 0000029049 0080042957 0090023267

but i need the form field seperated by tab and exatcly below frst character header the first character item should display

it would be great if you give me mail id i can send u file formate.

Thanks in advance,

best regards,

sai

Read only

Former Member
0 Likes
1,959

INTO LV_STRING SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB .

if i use this statement also i am geting same error ".", "IN BYTE MODE", "SEPARATED BY ...", or "IN CHARACTER MODE"

expected after "LV_STRING".

thanks

Read only

0 Likes
1,959

Hi sainath,

why don't you use an structure and export this into your external file?

Regards, Dieter

Read only

0 Likes
1,959

In ECC versions its mandatory to specify the mode and thats exactly what the error is telling you. There wont be any harm if you add character mode or byte mode


CONCATENATE 'ART'
'SOLD-TO PARTY'
'SALES ORDER'
'DELIVERY DOC'
'BILLING DOC'
INTO LV_STRING SEPARATED BY  CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB IN CHARACTER MODE .

Vikranth

Read only

Former Member
0 Likes
1,959

i got output but not exact output

ART SOLD-TO PARTY SALES ORDER DELIVERY DOC BILLING DOC

R 0001006900 0000029049 0080042957 0090023267

upto her i got correct but after not geting proper

ACTUAL BILLING DATE SOLD-TO PARTY DESC FILIALE SHIP-TO PARTY CUSTOMER

20090326 REIFF-Reifen-+Auto(KUMHO) 0ruse 0001004306 ss

20090605 DIPROPNEU S.A. Jung 0001006900 SSS 000010

after using

this statement

INTO LV_STRING SEPARATED BY

CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB .

Read only

Former Member
0 Likes
1,959

this is corect formate i needed

Art Sold-to party Sales Order Delivery Doc. Billing Doc. Actual Billing Date Sold-to party Desc.

R 1064505 1509026 84846578 92895891 19.10.2009 Pit Auto Teile GmbH

Filiale Ship-to Party Customer P/O Billing Doc. Item Material Material Desc. Billing Qty Net Price

0127 1064516 Pit A.T.0127 KHWi09-1000010 1816313 KH 165/70 R14 Q04L 7400 ;EC 4000 3063

Read only

0 Likes
1,959

Hi,

did you try defining a structure?

regards, Dieter

Read only

Former Member
0 Likes
1,959

Thnaks problem solved