Monday, September 24, 2012
at
9:49 PM
|
From Release 4.0 the previously 1-character language key has 2-characters as in ISO Code 639. For example, English is now 'EN' insead of 'E', Hebrew is 'HE' instead of 'B' and Korean is 'KO' instead of '3'.
Script :
data : lv_output(1).
call function 'CONVERSION_EXIT_ISOLA_INPUT'
exporting
input = 'ID' " ID -> Indonesia
importing
output = lv_output.
write lv_output.
Posted by
Shanto
Labels:
ABAP,
ABAP Function
Sunday, March 4, 2012
at
7:07 PM
|
Sometimes we need to change the printer spool into default, we can use tcode su01 or su10.
Please see capture below.
Posted by
Shanto
Labels:
ABAP
Tuesday, November 22, 2011
at
1:20 AM
|
In SAP ABAP you can read file with open dataset,
The command used to read a file on the application server is as follows.
OPEN DATASET ... FOR INPUT
Please see example code below.
REPORT YSANTO_12 .
data: lv_fname(100),
  lv_msg like sy-msgv1.
data: begin of gi_data occurs 0,
      txt(255),
  end of gi_data.
lv_fname = '/home/data/data.txt'.
open dataset lv_fname for input message lv_msg in text mode encoding default.
if sy-subrc = 0.
  do.
  read dataset lv_fname into gi_data-txt.
  if sy-subrc <> 0.
    exit.
  endif.
  append gi_data.
  clear gi_data.
  enddo.
else.
  write 'File does not exist!'.
endif.
close dataset lv_fname.
Posted by
Shanto
Labels:
ABAP
Sunday, November 20, 2011
at
11:08 PM
|
Here is an example of how to FTP a file from the Application server to a remote server using standard SAP functions.
REPORT YSANTO_12 .
data: begin of gi_data occurs 0, line(132) type c, end of gi_data.
data: lv_password(20) type c, lv_key type i value 26101957, lv_pwd_len type I, lv_handle type I.
START-OF-SELECTION.
lv_password = 'password'.
describe field lv_password length lv_pwd_len in character mode.
call 'AB_RFC_X_SCRAMBLE_STRING' id 'SOURCE' field lv_password id 'KEY' field lv_key id 'SCR' field 'X' id 'DESTINATION' field lv_password id 'DSTLEN' field lv_pwd_len.
call function 'FTP_CONNECT' exporting user = 'userid' password = lv_password host = 'host' rfc_destination = 'SAPFTP' importing handle = lv_handle exceptions not_connected = 1 others = 2.
check sy-subrc = 0.
call function 'FTP_COMMAND' exporting handle = lv_handle command = 'dir' " for get file -> exe commnad 'asci' tables " then exe command 'get sourcefile targetfile'. data = gi_data exceptions tcpip_error = 1 command_error = 2 data_error = 3 others = 4.
call function 'FTP_DISCONNECT' exporting handle = lv_handle exceptions others = 1.
Posted by
Shanto
Labels:
ABAP,
ABAP Function
Friday, November 4, 2011
at
12:51 AM
|
What is Data Archiving? Data Archiving is a decongestion process used to delete large volume of data that is no longer needed from a database and storing same outside the database in a format that allows for data retrieval and analysis when need be. The emphasis here are on “deleting” and “storing”. It is common knowledge that if a database is left to grow unmaintained, there is a possibility of having performance bottlenecks and high database maintenance cost. Hence, one of the ways to maintain the database is to delete records that can be termed obsolete. The word “obsolete” is relative. For the archiving process to be complete, data has to be stored using a defined method.
How is data archived? The data archiving run follows a sequence of steps. A brief overview is provided below. 1. Creation of the archive file: During an archive run, the write program first creates archive files which initiates the reading process (from the database) and the consequent writing process (to the archive file)
2. Storage of the archive file: After successful run of step 1, the created archive files are stored. A number of methods can be leveraged to store an archive file. Archived files can be stored hierarchically, optically or manually. It is important to state that SAP does not recommend the manual storage of archive file. This is as a result of some standardization issues
3. Deletion of data: This step terminates the archive run. Before data is deleted from the database, the program first read the content of the archive file. It is after this task, that the program deletes the corresponding entry from the database.
Benefits of Data Archiving 1. Reduced Backup and Restore time 2. Reduced access time for tables 3. Reduced database administration cost 4. Reduced downtime for system upgrade 5. Reusability of data
Ref : http://it.toolbox.com/blogs/sap-library/introduction-to-sap-data-archiving-27976
Posted by
Shanto
Labels:
ABAP
Monday, October 11, 2010
at
12:59 AM
|
Posted by
Shanto
Labels:
ABAP
Thursday, October 7, 2010
at
1:34 AM
|
Bagaimana merubah page orientation (Portrait/Landscape) di SmartForm.
1. Pertama buka smartform ( tcode smartforms ). 2. Klik 2x TEST, Klik "Output Options" tab, Disana akan terlihat print attributes kemudian pilih Page Format.
Capture Screen :
Posted by
Shanto
Labels:
ABAP
Wednesday, October 6, 2010
at
5:58 AM
|
Fungsi DateDiff adalah mengembalikan jumlah interval antara dua tanggal itu di VB, sedangkan di ABAP kita bisa mengunakan fungsi DAYS_BETWEEN_TWO_DATES.
Contoh :
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES' EXPORTING i_datum_bis = '20080401' i_datum_von = '20080327' i_stgmeth = 2 IMPORTING e_tage = output_interval.
Posted by
Shanto
Labels:
ABAP
Friday, September 24, 2010
at
3:25 AM
|
Tabel Penting di Modul Production Planning (PP)
Work center CRHH - Work center hierarchy CRHS - Hierarchy structure CRHD - Work center header CRTX - Text for the Work Center or Production Resource/Tool CRCO - Assignment of Work Center to Cost Center KAKO - Capacity Header Segment CRCA - Work Center Capacity Allocation TC24 - Person responsible for the work center
Routings/operations MAPL - Allocation of task lists to materials PLAS - Task list - selection of operations/activities PLFH - Task list - production resources/tools PLFL - Task list - sequences PLKO - Task list - header PLKZ - Task list: main header PLPH - Phases / suboperations PLPO - Task list operation / activity PLPR - Log collector for tasklists PLMZ - Allocation of BOM - items to operations
Bill of material STKO - BOM - header STPO - BOM - item STAS - BOMs - Item Selection STPN - BOMs - follow-up control STPU - BOM - sub-item STZU - Permanent BOM data PLMZ - Allocation of BOM - items to operations MAST - Material to BOM link KDST - Sales order to BOM link
Production orders AUFK - Production order headers AFIH - Maintenance order header AUFM - Goods movement for prod. order AFKO - Order header data PP orders AFPO - Order item RESB - Order componenten AFVC - Order operations AFVV - Quantities/dates/values in the operation AFVU - User fields of the operation AFFL - Work order sequence AFFH - PRT assignment data for the work order(routing) JSTO - Status profile JEST - Object status AFRU - Order completion confirmations
PRT’s production orders AFFH - PRT assignment data for the work order CRVD_A - Link of PRT to Document DRAW - Document Info Record TDWA - Document Types TDWD - Data Carrier/Network Nodes TDWE - Data Carrier Type
Planned orders PLAF - Planned orders
KANBAN PKPS - Kanban identification, control cycle PKHD - Kanban control cycle (header data) PKER - Error log for Kanban containers
Reservations RESB - Material reservations RKPF - Header
Capacity planning KBKO - Header record for capacity requirements KBED - Capacity requirements records KBEZ - Add. data for table KBED (for indiv. capacities/splits)
Planned independent requirements PBIM - Independent requirements for material PBED - Independent requirement data PBHI - Independent requirement history PBIV - Independent requirement index PBIC - Independent requirement index for customer req.
Ref : http://www.sap-basis-abap.com/pp/the-table-names-of-sap-pp-module.htm
Posted by
Shanto
Labels:
ABAP
Tuesday, June 22, 2010
at
5:40 AM
|
Di SAP tanda negative di default diletakan setelah angka, dalam suatu kasus kadang-kadang kita ingin meletakan sebelum angka. Ada sebuah function yang bisa di gunakan untuk memindahkan tanda negative tersebut agar di depan.
REPORT YSANTO_01.
data: lv_kbetr type i, lv_kbetr_c(13).
lv_kbetr = -1000.
write lv_kbetr to lv_kbetr_c.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT' CHANGING VALUE = lv_kbetr_c.
write / lv_kbetr. write / lv_kbetr_c.
Posted by
Shanto
Labels:
ABAP
Monday, April 12, 2010
at
10:51 PM
|
Kadang-kadang kita sering mendebug mencari user exit pada tcode tertentu, dan ini sangat membutuhkan waktu yang lama. Ternyata user exit bisa di list dengan program simple di bawah.
REPORT ysanto_11 .
TABLES : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir. TABLES : tstct.
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE. DATA : field1(30). DATA : v_devclass LIKE tadir-devclass.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR' AND object = 'PROG' AND obj_name = tstc-pgmna.
MOVE : tadir-devclass TO v_devclass. IF sy-subrc NE 0.
SELECT SINGLE * FROM trdir WHERE name = tstc-pgmna. IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir WHERE pname = tstc-pgmna. SELECT SINGLE * FROM enlfdir WHERE funcname = tfdir-funcname.
SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR' AND object = 'FUGR' AND obj_name EQ enlfdir-area.
MOVE : tadir-devclass TO v_devclass. ENDIF. ENDIF.
SELECT * FROM tadir INTO TABLE jtab WHERE pgmid = 'R3TR' AND object = 'SMOD' AND devclass = v_devclass.
SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu AND tcode EQ p_tcode.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE: /(19) 'Transaction Code – ', 20(20) p_tcode, 45(50) tstct-ttext.
SKIP.
IF NOT jtab[] IS INITIAL.
WRITE:/(95) sy-uline. FORMAT COLOR COL_HEADING INTENSIFIED ON. WRITE:/1 sy-vline, 2 'Exit Name', 21 sy-vline , 22 'Description', 95 sy-vline. WRITE:/(95) sy-uline.
LOOP AT jtab. SELECT SINGLE * FROM modsapt WHERE sprsl = sy-langu AND name = jtab-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF. WRITE:/1 sy-vline, 2 jtab-obj_name HOTSPOT ON, 21 sy-vline , 22 modsapt-modtext, 95 sy-vline. ENDLOOP.
WRITE:/(95) sy-uline. DESCRIBE TABLE jtab.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON. WRITE:/ 'No of Exits:' , sy-tfill.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.
ELSE. FORMAT COLOR COL_NEGATIVE INTENSIFIED ON. WRITE:/(95) 'Transaction Code Does Not Exist'. ENDIF.
AT LINE-SELECTION. GET CURSOR FIELD field1. CHECK field1(4) EQ 'JTAB'. SET PARAMETER ID 'MON' FIELD sy-lisel+1(10). CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.


Ref : http://www.sap-img.com/ab038.htm
Posted by
Shanto
Labels:
ABAP
Thursday, April 8, 2010
at
2:40 AM
|
Posted by
Shanto
Labels:
ABAP
Wednesday, February 17, 2010
at
12:23 AM
|
Gw sempat di tanya apakah table sap datanya bisa langsung di edit, gw bilang ngk tau sepengalaman gw sih belum pernah, maklumlah newbie. setelah beberapa hari gw iseng googgling nah kan ketemu
 Caranya langsung aja ke SE16N kemudian masukan tablenya sebelum di execute ketikan &sap_edit langsung di enter akan muncul message : SAP editing function is activated kemudian execute dan..... table langsung bisa edit.
Tapi PERHATIAN ini jangan dilakukan kalau memang kita tidak tau tabel-table yang berhubungan.
http://www.kowboyz.nl/blog/edit-sap-tables/
Posted by
Shanto
Labels:
ABAP
Tuesday, February 16, 2010
at
7:46 PM
|
Tugas berikutnya fixing report jamsostek ada nik yang tampil double dan ada yang tidak tampil. berati harus di debug dong. pertama setelah form muncul kemudian pilih seleksinya sebelum di execute ketik /h enter ( akan muncul debug switch on ). berarti siap di execute.
abrakedabra. munculah script abap nya, setelah di debug secara internal table nilainya sudah benar dan kemudian gw cek smartformsnya nah ini dia ketemu ternyata yang seharusnya  membaca internal table sequance 1, 2, 3 dst tetapi pada saat halaman berikutnya akan balik ke sequance 1 kemudian sequance sebelumnaya + 1 sehingga nik yang sebelumnya tidak muncul dan nik pada saat balik ke sequance 1 menuncul kembali. Setelah di coba beberapa cara akhirnya di ketemukan caranya : yaitu menambahkan Table Line di Main Area yang berfungsi memaksa balik ke sequance yang sebenarnya.
Tugas Done.
Posted by
Shanto
Labels:
ABAP
Setelah mendapat traning secukupnya tiba saatnya untuk mejalankan tugas : Request yang diminta, tolong di tampilkan artike detail bom dengan total qty bom, qty dan value per sloc.
Tabel yang berhubungan : 1. MAST -> Article to BOM Link 2. STPO -> BOM item 3. MAKT - > Article Descriptions 4. MBEW -> Article Valuation 5. MARD -> Storage Location Data for Article 6. MARA -> General Article Data 7. STAS -> BOMs - Item Selection
Link Table :

Result Report :

Tugas Done.
Posted by
Shanto
Labels:
ABAP
|
|