Register Login
 

 
Subject: Export Data ออกมาเป็น text file แล้วข้อมูลที่ได้ไม่นำ space มาด้วย

Add Reply   
Page 1 of 3123 > >>
Author Messages
thaisap.com (guest)

02/08/2008 12:25 PM Quote Reply Alert 
เช่นข้อมูลที่ต้องการให้ออกมาใน text file 'ABCD '<br>แต่ที่ได้มาจะมาแค่ 'ABCD' <br>รบกวนช่วยแนะนำด้วยครับ<br>
chanin_22@yahoo.com (guest)

02/08/2008 12:25 PM Quote Reply Alert 
ใช้ Function Module ตัวไหน parameters อะไรหละครับ
dungte@hotmail.com (guest)

02/08/2008 12:26 PM Quote Reply Alert 
FORM export_data_text_file.
OPEN DATASET filename FOR OUTPUT IN TEXT MODE MESSAGE msg_text.
IF sy-subrc <> 0.
WRITE:/ 'File can not open : ' , msg_text.
EXIT.
ENDIF.
LOOP AT t_load.
TRANSFER t_load TO filename.
ENDLOOP.
CLOSE DATASET filename.
ENDFORM.
chanin_22@yahoo.com (guest)

02/08/2008 12:26 PM Quote Reply Alert 
ถ้าจำไม่ผิดในแต่ละฟิวด์ต้องมี filler กั้นที่เป็น type 'X' น่ะครับ เช่น

data: begin of t_load occurs 0,
a(10),
f01 type x,
b(10),
f02 type x,
c(10),
f03 type x,
d(10).
data: end of t_load.

ลองดูนะครับ
dungte@hotmail.com (guest)

02/08/2008 12:26 PM Quote Reply Alert 
คุณนินครับ ที่ผมทำอยู่ผมใช้ field เดียวขนาด 355 เลย
เนื่องจากแต่ละ record จะมีความยามไม่เท่ากัน
และ record ที่ยาวที่สุด 355 ครับ

DATA: BEGIN OF t_load OCCURS 0,
text1(355) TYPE c,
END OF t_load.

DATA : w_space TYPE x.

WRITE '001' TO t_load-text1+0(3).
WRITE 'milo320' TO t_load-text1+3(12).
WRITE v_ref TO t_load-text1+15(32).
WRITE w_cdate TO t_load-text1+47(8).
WRITE w_ctime TO t_load-text1+55(6).
WRITE 'BCM ' TO t_load-text1+61(5).
WRITE w_space TO t_load-text1+95(1).

ผมลองใช้ตัวแปลที่เป็น type x write ลงใป
ค่าที่ได้ตำแหน่งที่ 96 จะเป็นตัว 0
แต่ที่ผมต้องการคือ หลังจาก BCM แล้วจะต้องเป็น space
ไปจนถึงตำแหน่งที่ 96 ครับ
chanin_22@yahoo.com (guest)

02/08/2008 12:27 PM Quote Reply Alert 
อืมมไม่แน่ใจนะครับถ้างั้นตำแหน่งที่ 96 เราใช้ '#' แทนได้ไหมครับเผื่อบอกว่าหมดบรรทัด
dungte@hotmail.com (guest)

02/08/2008 12:27 PM Quote Reply Alert 
ไม่ได้ครับ เค้าให้เว้นว่างเป็น space ครับ
chanin_22@yahoo.com (guest)

02/08/2008 12:28 PM Quote Reply Alert 
ไม่แน่ใจ(อีกทีนะครับ) ตรงตัวแปร w_space type x value '1'.
dungte@hotmail.com (guest)

02/08/2008 12:28 PM Quote Reply Alert 
ถ้าใช้ value 1 อย่างที่คุณนิน แนะนำตำแหน่งที่ 96 ก็จะเป็นเลข 1
ก็ยังไม่ถูกเพราะว่าต้องการให้เป็น space ไปจนถึงตำแหน่งที่ 96 ครับ

DATA : w_space TYPE x value '1'.

001milo320 xxxxxx xxxxxxxxxxxx xxxxxxxxx 20060208081632BCM 1
nook (guest)

02/08/2008 12:28 PM Quote Reply Alert 
ลองใช้แบบนี้ได้ไหมค่ะ
เช่น line+96(1) = ................................
ตรง ............. ให้กด
altพร้อม016 มันจะได้เป็น ' '
เป็นแบบนี้อ่ะ ' space '
nook (guest)

02/08/2008 12:29 PM Quote Reply Alert 
alt พร้อม 0160 พิมพ์ผิด
dungte@hotmail.com (guest)

02/08/2008 12:29 PM Quote Reply Alert 
เมื่อกด alt 0160 แล้ว cursor จะเลื่อนไป 1 ตำแหน่ง

จะ Syntax error
Field " " is unknow ครับ
nook (guest)

02/08/2008 12:29 PM Quote Reply Alert 
มี single quote ปิด หัว-ท้าย ด้วยนะค่ะ
จะไม่เกิด error แต่ไม่แน่ใจว่า จะเป็นไปอย่าง ที่ต้องการหรือเปล่านะ
ลองดูนะค่ะ
dungte@hotmail.com (guest)

02/08/2008 12:30 PM Quote Reply Alert 
ทำแบบที่คุณ nook แนะนำได้อย่างที่ต้องการแล้ว
ขอบคุณ k.nook และ คุณนิน ด้วยนะครับ
chanin_22@yahoo.com (guest)

02/08/2008 12:30 PM Quote Reply Alert 
ไม่เป็นไรครับ
12 (guest)

10/06/2009 3:00 PM Quote Reply Alert 
0160 คืออะไรครับ
yrxkpbsotr (guest)

02/06/2010 5:22 PM Quote Reply Alert 
hhLdiC tgdsodltavyn, [url=http://bjtewfcewnxp.com/]bjtewfcewnxp[/url], [link=http://dbaqoipfbsvv.com/]dbaqoipfbsvv[/link], http://hcihigdtzgey.com/
emailaddress (guest)

02/08/2010 1:06 AM Quote Reply Alert 
propecia wcqzm ultram cqsz accutane =-(( online cialis >:O buy levitra online jypv ultram halvo aciphex buy online gbygvl
dependongroup (guest)

03/05/2010 12:16 PM Quote Reply Alert 
xanax ouij buy phentermine online snad what is valium qfsijx aciphex uskvc carisoprodol 7574
nadejda (guest)

03/05/2010 4:14 PM Quote Reply Alert 
valium 2510 ambien 8-PP doxycycline 262 tramadol propecia 24099
Add Reply
Page 1 of 3123 > >>

Forums > Thai Sap > ABAP > Export Data ออกมาเป็น text file แล้วข้อมูลที่ได้ไม่นำ space มาด้วย

Quick Reply
Username:  
Subject:  
Body:

 



ActiveForums 3.6