This is a month of badi, I guess. Then, I’ve just realized that warning message is not work in badi. What if we have a requirement that we need to raise warning message?
Well, firstly, the reason that warnng message is not work in badi is its characteristic. How to say? Let’s imagine about when we get the warnning message, we have to hit enter again and the message will be gone and we can continue our process. It didn’t stop everything like Message type E or A.
So, as I said at the beginning that what will we do if we need to display warnning message? I have 2 solutions for this problem.
1. If this issue is related to FI module, they have T-code which is so-called validation. T-code ob28, you may search more on the internet and you may found that we can configure in the program, which company code, which field and we can put ABAP code plus with any type of error message.
2. In my case, I didn’t work on FI issue! As discussed with SD functional, he told me that SD will have other type of configure which is called ‘Incompletion Log’ but it is impossible for me because I’m working on the badi of customer ><" Lastly, I create new function group and new function module and I put warning message in the new function. It works! Yeah
แก้ไขตารางด้วย SE11 แก้ไขข้อมูลระดับDBด้วย SE14 และแก้ไข maintenance view ด้วยSE54
December 25, 2011
ก่อนหน้านี้เคยสร้างztable แล้วก็เคยทำให้สามารถแก้ไขข้อมูลได้ (Maintenance Table) ดูวิธีการสร้างได้จาก Entry เก่า (การสร้างตาราง สร้างหน้าจอ Table Maintenance และสร้าง T-code สำหรับ maintain) แต่ทีนี้ถ้าต้องการจะเพิ่ม column อีกอันนึง จะทำยังไง ถ้าเป็นตารางปกติก็แค่
1. SE11 เพิ่ม field / activate
2. SE14 adjust and activate data in database
ประมาณนั้น แต่สำหรับตารางที่ใช้สำหรับเป็น Maintenance View นั้น มันไม่เพียงพอค่ะ!!! เพราะอะไร เพราะว่า เราจะไม่สามารถทำให้มัน Completely Active ได้ พอเรากด Activate มันจะเป็นแค่ Partly Active เท่านั้น พอเข้าไปดูใน Log อันนี้อาจจะขึ้นอยู่กับหลายๆเคส แต่เคสที่เราเจอคือ ไปติดว่ามี Generated View ที่น่าจะเคยโดน gen ของเก่า แล้ว เราไม่สามารถแก้ไขได้ งงเง้กมาเนินนาน แต่ตอนนั้นก็ไม่ได้นึกเอ๊ะใจว่ามันเป็นตารางที่สามารถ maintenance ได้ จนกระทั้ง functional ส่งมาว่า เนี้ย เค้าต้องการอัพเดทน table แบบนี้ๆๆๆ ด้วยความมึน ก็เลยไปกด Activate ที่ sandbox … ปรากฏว่าผ่านวะค่ะ!!! Table มัน Active แล้ว เย้! แต่พอไปดูใน SM30 field ที่เพิ่มยังไม่ปรากฏ = =” ในส่วนนี้ต้องใช้ t-code SE54 ใส่ชื่อ Table ไป เลือก Generated Object และ กดปุ่ม Create/change จากนั้นจะเข้ามาในหน้าที่เหมือนสรุปโดยรวม ให้กดปุ่ม Change หรือ ไอคอน ดินสอ จากนั้น มันจะถามว่าเราต้องการทำอะไร ต้องการสร้าง View ใหม่เหรอ บลาบลา ในที่นี้เพิ่ม field ใหม่ ก็เลยเลือกว่า Add field บลาบลา จากนั้น โปรแกรมก็ถามต่อว่า แล้ว… จะให้แก้ไขตรงไหนบ้าง เราก็ติ๊กหมดจ้า สี่อัน มี screen key normal field อะไรอีกอันจำไม่ได้ แล้วพอกด OK เสร็จ มันก็ regenerate view เก่าให้ เป็นอันเสร็จ จบเรื่องกันซะที
โดยสรุปคือ
1. SE11 เพิ่ม field / activate
2. SE14 adjust and activate data in database — ไม่สำเร็จ?
3. SE54 / Generated Object / Create, change / คลิกปุ่ม Change หรือ ดินสอ / เลือกสิ่งที่ต้องการ / นั่นแหละ Go gO GO
Official Reference: BC Generate Table Maintenance Dialogue Page 23
Decimal(s) in each Currency and Command ‘WRITE’
December 10, 2011
ไม่ได้มาอัพนาน แต่ก็ยังอัพในส่วนของ t-code/program อยู่เรื่อยๆ วันนี้จะพูดถึงคำสั่งเกี่ยวกับ Currency ถ้าทำระบบที่อยู่แค่ประเทศเดียวก็คงไม่มีปัญหาอะไร แต่ถ้าเราต้องdealกับประเทศอื่นๆ ก็อาจจะเจอปัญหาประมาณนี้…
- ญี่ปุ่น ไม่มีจุดทศนิยมในค่าเงินเยน
- ตูนีเซีย ไม่มีจุดทศนิยมสองหลักแบบค่าเงินบาทไทย ค่าเงินเค้าตัวย่อ TND อ่ะ
- ปกติเงินบาท ใช้เป็น 10,000.00 แต่บางที่เค้าใช้เป็น 10.000,00 อ้ะ ><”
Standard Table ที่เก็บจำนวนจุดทศนิยมคือ Table TCURX แต่ทั้งนี้ทั้งนั้นก็ขึ้นอยู่กับ Configure ด้วย…
มาถึงกรณีที่ ถ้าเราต้องทำReport/Form หรืออะไรก็ตามที่ต้องโชว์ค่าเงินที่หลากหลาย จะทำยังไง ตอนนี้ได้พบเจอมาสองวิธี
1. เป็นวิธีที่อาจจะใช้มาก่อนคำสั่งใหม่ๆเกิดขึ้น(คิดเอง555 เพราะไปเห็นมาว่าใช้ตั้งแต่สมัยยุคสองพันต้นๆ ^^”) คือ รับค่ามาจาก Table ดังกล่าวแล้ว หาร10 หรือ คูณ10 เอา ><” ข้อเสียคือ ถ้ามันหลายค่าเงินมาก และจำนวนlineเยอะมาก คงต้อง Loop & Check Table กันจ้าละหวั่นเลยทีเดียว และก็ต้องมานั่งป้อนคำสั่งเกี่ยวกับ ‘.’ และ ‘,’ ด้วย
2. ใช้คำสั่ง WRITE f CURRENCY c. อ่านเพิ่มเติม คลิกที่นี่ ไม่เพียงแค่นั้น ถ้าเป็นในเรื่องของปริมาณ ก็สามารถ WRITE f UNIT u ได้เหมือนกัน อ่านเพิ่มเติมได้จากลิงค์เดียวกันเลย เป็นคำสั่งที่ไฮโซมาก ในส่วนของค่า UNIT นี่ จะไปgetค่ามาจาก Standard Table T006
เพิ่มเติม
- ตัวแปลที่จะแปลงนี้ต้องดู ประเภท ของ Data Variable ด้วย
- ตัวเลขที่เอาไปแปลงนั้นก็จะหยิบมาใช้ทุกตัว เช่น 48.00 แปลงเป็น JPY จะได้เป็น 4.800 แปลงเป็น TND จะได้เป็น 4,800 แปลงเป็น EUR จะได้เป็น 48.00
- คำสั่งนี้ไม่สามารถแปลงตัวเลขที่มี ‘,’ ได้
Vertical Line in SAPscript
September 19, 2011
ABAP SAP, SAPScript, Vertical Line Leave a comment
Referred to this link: http://forums.sdn.sap.com/thread.jspa?threadID=403315&tstart=0
I’ve no experience about this but if I have to deal with this in the future, I should try to
1. use box; with the statement like this
BOX XPOS ’1.0′ CM WIDTH 0 TW FRAME 10 TW
2. Use system vertical line. Seems like another headache issue for this command line; &SYST-VLINE&. (Remark. Insert->symbols->System symbols->syst->vline)
How to add the second step on the Job Schedule?
August 31, 2011
ฺBASIS external command, job schedule, SAP, sm37, Step 2 Leave a comment
I was assigned to collaborate with Basis about sending generated file from my server to Head Quarter. Here is the step that I’ve done in the test systems.
1. Schedule your job but don’t select ‘Immediate’. Just input the time like tomorrow.
2. Go to SM37.
3. Select Job name that we’ve just scheduled.
4. At menu bar. Job > Change (or Ctrl+F1)
5. Double click on the Job name that we’ve just scheduled.
6. New window will appear. Click Step button.
7. Click New (icon Paper)
8. Select External command/External Program and input the command name
ie. Name: Z_PPR_SEND
Operating Sys: HP-UX
Target Server: ASPGxxxxxx
9. Click Save button.
10. Go back to previous page.
11. Click “Start condition”.
12. Click “Immediate” to start the job then.
Forbidden statements within Function Module
August 24, 2011
ABAP COMMIT, Function Module, SAP 1 Comment
Within an update function module started using COMMIT WORK, the execution of statements that lead to a database commit is not permitted. In particular, the following are forbidden:
COMMIT WORK
ROLLBACK WORK
SUBMIT
CALL TRANSACTION
LEAVE TO TRANSACTION
CALL DIALOG
CALL SCREEN
credit:
http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm
http://forums.sdn.sap.com/thread.jspa?threadID=1665041
Shell Script by Basis and what’s next?
August 3, 2011
วันนี้ได้ฟังLectureจากพี่Basisคนนึงเกี่ยวกับเรื่อง Script ใน Server ของ SAP
ประเด็นแรก สมมุติว่าเราต้องการส่งไฟล์จาก Server ของเราไปอีก Server นึง ง่ายสุดคือทำในระดับ OS ก็คือเขียน Shell Script (xx.sh) นั่นเอง ไม่เคยเขียน Shell Script แต่พอจะเดาได้ว่าหน้าตามันคงคล้ายๆพวก batch อะไรประมาณนั้นมั้ง การเขียน Shell Script จะ Secure มากกว่าภาษาอย่าง ABAP
ประเด็นต่อมา ถ้าเราต้องการจะส่งไฟล์ จาก Server A ไป Server B เราต้องรู้ข้อมูลที่สำคัญ 3 ประการดังนี้
1. เลขIP อาจจะเป็นตัวเลขหรือตัวหนังสือ
2. Port ของ Open FT
3. F Track OpenFT Admission เป็นตัวบ่งบอกว่าไฟล์จาก Server A เมื่อส่งไป B จะไปอยู่ที่ไหน
ประเด็นสุดท้าย Script นี้อาจจะสั่งให้รันได้โดยการใช้ SM37 สั่งให้รัน Script หลังจากรัน Background Job ต่อเป็น Step ที่สอง ต่อไป
ปวดหัวกับ SAPScript ว่าด้วยเรื่องการเอารูปภาพขนาดใหญ่ขนาดหน้าA4ขึ้น
July 29, 2011
ABAP Image, SAP, SAPScript, SE78 Leave a comment
ตามหัวเรื่อง เนื่องด้วยว่าเป็นโคตรNewbie ของSAPScript ได้รับการAssignมาว่าให้เอาหน้าA4 ประมาณ 3,8 หน้า อัพเข้า SE78 แล้วก็แปะลงหน้าว่างๆของ SAPScript ก็ทำตาม IA เสร็จแล้วแต่… ภาพไม่ขึ้น!!! นั่งงมเป็นอาทิตย์ๆเลย แล้วก็เลขได้เหตุผลมาสรุปเป็นข้อๆดังนี้ (ขอขอบคุณพี่ยู้กับพี่สินนะคะ)
1. รูปภาพ ต้องดูว่าขนาดความกว้างและสูงพอดีกรอบรึเปล่า ดูว่าวินโดว์นั้นกว้างยาวเท่าไหร่ ต้องดูหน่วยด้วย
2. รูปที่ใช้ได้มี .TIF & .BITMAP (24 bits)
3. ต้องระวังเรื่อง resolution ด้วย อาจจะใช้ resolution ประมาณ 200
4. หน้าA4 = 20.99 cm x 29.71 cm
5. ตอนเขียน command SAPScript การกด Shift + F8 จะทำให้เราสามารถเปลี่ยนจากหน้าแรกไปหน้าที่สองได้
6. การเขียน command บน SAPScript ต้องระวังการขึ้นบรรทัดใหม่ มันอาจจะผิดได้ !
7. Debug SAPScript โดยปกติแล้ว จะรันตาม Pageและ Windows ภายใน Page
SELECT SINGLE vs SELECT… UP TO 1 ROW
July 18, 2011
ABAP SAP, SELECT, SELECT SINGLE, UP TO 1 ROW Leave a comment
ความแตกต่างระหว่าง SELECT SINGLE และ SELECT … UP TO 1 ROW
(to be continued)
OSS Notes, what is it?
July 13, 2011
ABAP OSS Notes, SAP 2 Comments
In my own explanation, it’s like the KM of SAP people. However, this valuable knowledge required the user that is available for the people who got certification for SAP (or some people got it from their company)
How to read an OSS Notes?
1. Go to https://websmp104.sap-ag.de/notes http://service.sap.com/notes (Thanks to Dominik
)
2. Login with your username and password
3. Find the note that you want. If you have OSS Note number, it’s easier for you to find
Next, in the OSS Note, Some notes also provided if our SAP system installed Package Name xxxx or not. How to find it?
1. At the Menu Tab of SAP, System -> Status
2. Click on magnifying glass
3. Click on Tab SupPack
4. Find the number of Package on OSS Note