Wednesday, July 23, 2008

Change program in QA client ?

Sometimes when DEV client don’t have the proper data and sometimes when SAP do their some weird action (you know what I mean did u ? heheh) then it will takes thousands changes (hehehe is it??) when you do trial n error to repair some programs/tables/something in QA client. And when you found it error you need to go back to DEV client to repair it, and create a Change Request Number, and then transport it again to QA client, and again and again.
Have you ever think how many wasted CRs created just because of it ?

Well, my colleague gave me a tips for this. You can directly change programs/tables in QA client and see the result of it. You can do trial and error right away in your QA client (yes, right away in your QA client, means you don’t need to code in DEV and create CRs and transport). And after you satisfied with the result in QA, you can go back to DEV client, do the same thing with your programs/tables, create CRs and transport it to QA (replaced) and PROD.

This is the tips :

In QA client,

  1. Open 2 session se38, one session for program LSTRDU34 and another is LSTRDU44
  2. Find this FM : TR_EDIT_CHECK_OBJECTS_KEYS
  3. After that FM lines block, find the sy-subrc result, and put a breakpoint on that.
  4. Ok, open new session se38 again, entry your program, or se11 for your tables, or etc.
  5. Click Change program, when the debugger stopped at sy-subrc you’ve set, change the sy-subrc result from 12 or 4, to sy-subrc = 0.
  6. See the result.
  7. You can activate the programs also with this tips.

Enjoy! But be careful, because sometimes (possibly) :

  1. you enjoy changing in QA so much until when you go back to DEV you forgot what things you’ve done in QA hehehe.
  2. This can be done in PROD also, but this is depending on your authorization to change field contents in debugger.

Monday, July 14, 2008

Create MIRO with GL reference and Profitability segment using BAPI

Purpose : Create MIRO with GL reference and Profitability segment using BAPI.
Function Module : BAPI_INCOMINGINVOICE_CREATE

Field used :
*** HEADERDATA – 1 row
MIRO_HEADER-INVOICE_IND = 'X'.
MIRO_HEADER-DOC_TYPE = 'RE'.
MIRO_HEADER-DOC_DATE =
MIRO_HEADER-PSTNG_DATE = SY-DATUM.
MIRO_HEADER-REF_DOC_NO = [ reference PO number from that GR ]
MIRO_HEADER-PO_REF_NO = [ dummy PO – all item deleted ]
MIRO_HEADER-COMP_CODE = [ company code ]
MIRO_HEADER-DIFF_INV = [ vendor code ]
MIRO_HEADER-BUS_AREA = [ business area ]
MIRO_HEADER-CURRENCY = [ currency used on MIRO doc ]
MIRO_HEADER-EXCH_RATE = 1.
MIRO_HEADER-ALLOC_NMBR = [ allocation number, on my case I use same number with ref_doc_no ]
MIRO_HEADER-HEADER_TXT = [header text]


*** TAXDATA – 1 row
MIRO_HEADER-ITEM_TEXT = [header text]
MIRO_TAX-TAX_CODE = [tax code]

*** MATERIALDATA – 1 row [in my case I use only 1 material]
MIRO_MAT-INVOICE_DOC_ITEM = [sequence number]
MIRO_MAT-MATERIAL = [material number]
MIRO_MAT-VAL_AREA = [plant]
MIRO_MAT-DB_CR_IND = 'S'.
MIRO_MAT-ITEM_AMOUNT = [value amount]
MIRO_MAT-QUANTITY = [value quantity]
MIRO_MAT-BASE_UOM = [unit]
MIRO_MAT-BASE_UOM_ISO = [unit]
MIRO_MAT-TAX_CODE = [tax code]

*** GLACCOUNTDATA – multiple row, according to GL account related to journal
MIRO_GL-INVOICE_DOC_ITEM = [line number - sequence]
MIRO_GL-GL_ACCOUNT = [GL account]
MIRO_GL-ITEM_AMOUNT = [GL value amount]
MIRO_GL-DB_CR_IND = 'H'.
MIRO_GL-COMP_CODE = [company code]
MIRO_GL-TAX_CODE = [tax code]
MIRO_GL-BUS_area = [business area]

*** RUN THE BAPI
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
HEADERDATA = miro_header
IMPORTING
INVOICEDOCNUMBER = result_invoice
FISCALYEAR = result_invoice_year
TABLES
ITEMDATA = miro_item
TAXDATA = miro_tax
GLACCOUNTDATA = miro_gl
MATERIALDATA = miro_mat
RETURN = return.

*** INVOICE NUMBER
RESULT_INVOICE
RESULT_INVOICE_YEAR

*** YOU NEED TO COMMIT THE TRANSACTION, OTHERWISE THE INVOICE NUMBER WONT BE SAVED COMPLETELY

IF RESULT_INVOICE NE SPACE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF.

Thursday, July 3, 2008

Checking is there any UserExit attached ?

This program is for checking UserExit attached in a tcode.
-----------------------------------------------------------------------------------
REPORT ZARSTEST .
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. "'SAPLITO0'.
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 IN ('SMOD', 'SXSD')
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'.
READ TABLE jtab with key obj_name = sy-lisel+1(19).
IF jtab-object = 'SMOD'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
ELSE.
SET PARAMETER ID 'EXN' FIELD sy-lisel+1(19).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
ENDIF.


---------------------------------------------------
[Copy from one of my senior colleague, many Thanks ! ]

[Sample] Very Simple ALV and join with conversion MEINS

*&---------------------------------------------------------------------*
*& Report ZMM_OUTPAC
*&
*&---------------------------------------------------------------------*
*& This report is for view outstanding PO qty

*& with material PO type = ZPAC using a Very Simple ALV method
*& (MONITORING OUTSTANDING ORDER PACKAGING REPORT)
*& and a sample how to get converted MEINS (unit of measure) from a select statement

*&---------------------------------------------------------------------*

REPORT zmm_outpac LINE-SIZE 273 LINE-COUNT 35 NO STANDARD PAGE HEADING.

*&---------------------------------------------------------------------*
*& Table description
TABLES : ekko, ekpo, eket, eban, mara, makt, lfa1, mseg, t006a.

*&---------------------------------------------------------------------*
*& Data description
DATA : BEGIN OF itab OCCURS 0,
no(3),
matnr LIKE mara-matnr,
txz01 LIKE ekpo-txz01,
MSEH3 LIKE T006A-MSEH3,
badat LIKE eban-badat,
banfn LIKE ekpo-banfn,
bnfpo LIKE ekpo-bnfpo,
bedat LIKE ekko-bedat,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebeln,
menge LIKE ekpo-menge,
eindt LIKE eket-eindt,
lifnr LIKE ekko-lifnr,
name1 LIKE lfa1-NAME1,
ketpo LIKE tline-tdline,
leado(5),
leadr(5),
kethead LIKE tline-tdline,
END OF itab.

DATA : BEGIN OF vendor_data OCCURS 0,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
END OF vendor_data.
DATA : BEGIN OF history OCCURS 0,
ebeln LIKE mseg-ebeln,
ebelp LIKE mseg-ebelp,
bwart LIKE mseg-bwart,
menge LIKE mseg-menge,
END OF history.

DATA : v_index LIKE sy-tabix,
v_value1 LIKE mseg-menge,
v_nettof LIKE ekpo-menge.
DATA : BEGIN OF tbl_hdr OCCURS 0,
judul(80),
field(80),
panjang(3).
DATA END OF tbl_hdr.

* for ALV
TYPE-POOLS: slis.

CONSTANTS: c_formname_top_of_page TYPE slis_formname
VALUE 'TOP_OF_PAGE'.

DATA: t_fieldcat TYPE slis_t_fieldcat_alv,
t_layout TYPE slis_layout_alv,
t_print TYPE slis_print_alv,
t_sort TYPE slis_t_sortinfo_alv,
t_sp_group TYPE slis_t_sp_group_alv,
t_grid_title TYPE lvc_title,
t_events TYPE slis_t_event,
t_list_top_of_page TYPE slis_t_listheader,
v_progid LIKE sy-repid,
v_save VALUE 'A',
t_variant LIKE disvariant,
v_variant LIKE disvariant.

*&---------------------------------------------------------------------*
*& Selection Screen
PARAMETERS: p_mtart LIKE mara-mtart DEFAULT 'ZPAC' .
PARAMETERS: p_werks LIKE t001w-werks obligatory.
select-options : s_bedat for ekko-bedat.


AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_MTART'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

INITIALIZATION.
s_bedat-low = sy-datlo - 30.
s_bedat-high = sy-datlo.
append s_bedat.



START-OF-SELECTION.
* PERFORM cek_otorisasi.
PERFORM getdata.
IF itab[] IS INITIAL.
MESSAGE i208(00) WITH 'Data not found'.
ELSE.
PERFORM display.
ENDIF.
*&---------------------------------------------------------------------*
*& Form GETDATA
*&---------------------------------------------------------------------*
FORM getdata .
DATA : v_name LIKE thead-tdname.
DATA: lt_tline LIKE tline OCCURS 0 WITH HEADER LINE.
SELECT
a~bedat a~lifnr
b~matnr C~MSEH3 b~menge b~banfn b~bnfpo b~ebeln b~ebelp b~txz01
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ekko AS a
INNER JOIN ekpo AS b ON b~mandt = a~mandt
AND a~ebeln = b~ebeln
INNER JOIN t006a AS C ON C~MSEHI = B~MEINS
and c~spras = sy-langu

WHERE b~mtart = p_mtart AND
b~werks = p_werks and
a~bedat in s_bedat.

CALL FUNCTION 'FI_PROGRESS_INDICATOR'
EXPORTING
percentage = 0
text = 'Collecting data... '.

* GET QTY
SELECT ebeln ebelp bwart menge
INTO CORRESPONDING FIELDS OF TABLE history
FROM mseg
FOR ALL ENTRIES IN itab
WHERE ebeln = itab-ebeln
AND bwart IN ('101', '102').

* vendor name
SELECT lifnr name1
FROM lfa1
INTO CORRESPONDING FIELDS OF TABLE vendor_data
FOR ALL ENTRIES IN itab
WHERE lifnr = itab-lifnr.

* NETTING OFF
LOOP AT itab.
v_index = sy-tabix.
CLEAR : v_value1, v_nettof.
LOOP AT history WHERE ebeln = itab-ebeln AND ebelp = itab-ebelp.
IF history-bwart = '101'.
v_value1 = v_value1 + history-menge.
ELSEIF history-bwart = '102'.
v_value1 = v_value1 - history-menge.
ENDIF.

ENDLOOP.
v_nettof = itab-menge - v_value1.
IF v_nettof <= 0.
DELETE itab.
ELSE.
itab-menge = v_nettof.
MODIFY itab INDEX v_index.
ENDIF.

ENDLOOP.

SORT itab BY ebeln ebelp.
LOOP AT itab.
v_index = sy-tabix.
itab-no = v_index.
SELECT SINGLE badat
FROM eban
INTO itab-badat
WHERE banfn = itab-banfn.

SELECT SINGLE eindt
FROM eket
INTO itab-eindt
WHERE ebeln = itab-ebeln
AND ebelp = itab-ebelp.

READ TABLE vendor_data WITH KEY lifnr = itab-lifnr.
itab-name1 = vendor_data-name1.
* get keterangan PO
"Item PO text
CONCATENATE itab-ebeln itab-ebelp INTO v_name.
PERFORM read_text TABLES lt_tline
USING sy-mandt 'F01' 'EKPO' v_name 132.
READ TABLE lt_tline INDEX 1.
IF sy-subrc = 0.
itab-ketpo = lt_tline-tdline.
ELSE.
itab-ketpo = ''.
ENDIF.

* LEAD PO
itab-leado = sy-datlo - itab-bedat.
* LEAD PR
if itab-badat = '00000000'.
itab-leadr = '-'.
else.
itab-leadr = sy-datlo - itab-badat.
endif.

CLEAR : lt_tline.
REFRESH : lt_tline.
* get keterangan PO HEADER
v_name = itab-ebeln.
PERFORM read_text TABLES lt_tline
USING sy-mandt 'F01' 'EKKO' v_name 132.
READ TABLE lt_tline INDEX 1.
IF sy-subrc = 0.
itab-kethead = lt_tline-tdline.
ELSE.
itab-kethead = ''.
ENDIF.

CLEAR : v_name, lt_tline.
REFRESH : lt_tline.
MODIFY itab INDEX v_index.

* add to ALV

ENDLOOP.
ENDFORM. " GETDATA
*&---------------------------------------------------------------------*
*& Form read_text
*&---------------------------------------------------------------------*
FORM read_text TABLES ft_lines STRUCTURE tline
USING fu_mandt
fu_tdid
fu_tdobject
fu_tdname
fu_length.
DATA: lv_mandt LIKE sy-mandt,
lv_tdid LIKE thead-tdid,
lv_tdobject LIKE thead-tdobject,
lv_tdname LIKE thead-tdname,
lv_length LIKE sy-index.

REFRESH ft_lines.
lv_mandt = fu_mandt.
lv_tdid = fu_tdid.
lv_tdobject = fu_tdobject.
lv_tdname = fu_tdname.
lv_length = fu_length.

CALL FUNCTION 'READ_TEXT'
EXPORTING
client = lv_mandt
id = lv_tdid
language = sy-langu
name = lv_tdname
object = lv_tdobject
TABLES
lines = ft_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc = 0.
CALL FUNCTION 'FORMAT_TEXTLINES'
EXPORTING
formatwidth = lv_length
TABLES
lines = ft_lines
EXCEPTIONS
bound_error = 1
OTHERS = 2.

ENDIF.

ENDFORM. " READ_TEXT
*&---------------------------------------------------------------------*
*& Form DISPLAY
*&---------------------------------------------------------------------*
FORM display .
PERFORM header.
PERFORM createalv.
ENDFORM. " DISPLAY
*&---------------------------------------------------------------------*
*& Form HEADER
*&---------------------------------------------------------------------*
FORM header.
DATA : hdr(1000),
pjg TYPE i,
pstr TYPE i,
tp TYPE i,
k1(50),
k2(50),
k3(50),
k4(50).


PERFORM getjudul CHANGING hdr.
SPLIT hdr AT ',' INTO TABLE tbl_hdr.

LOOP AT tbl_hdr.
CONDENSE tbl_hdr-judul.
pstr = STRLEN( tbl_hdr-judul ).
SPLIT tbl_hdr-judul AT '(' INTO k1 k2.
SPLIT k2 AT ')' INTO k3 k4.
pstr = pstr - STRLEN( k4 ).
pjg = STRLEN( k1 ) + 1.
tp = pjg + 2.

IF tp < pstr.
tbl_hdr-panjang = tbl_hdr-judul+pjg(2).
ELSE.
tbl_hdr-panjang = tbl_hdr-judul+pjg(1).
ENDIF.

tbl_hdr-judul = k1.
tbl_hdr-field = k4.
MODIFY tbl_hdr INDEX sy-tabix.
ENDLOOP.
ENDFORM. " Header

*&---------------------------------------------------------------------*
*& Form CREATEALV
*&---------------------------------------------------------------------*
FORM createalv .
CLEAR v_variant.
v_save = 'A'.
v_variant-report = sy-repid.
t_variant = v_variant.

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = v_save
CHANGING
cs_variant = t_variant
EXCEPTIONS
not_found = 2.

PERFORM f_create_field USING t_fieldcat[].

PERFORM setting_attr.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = t_layout
i_callback_top_of_page = 'TOP-OF-PAGE'
it_fieldcat = t_fieldcat[]
it_special_groups = t_sp_group[]
i_save = v_save
is_variant = v_variant
it_events = t_events[]
TABLES
t_outtab = itab.

ENDFORM. " CREATEALV
*&---------------------------------------------------------------------*
*& Form f_create_field
*&---------------------------------------------------------------------*
FORM f_create_field USING fu_t_fieldcat TYPE slis_t_fieldcat_alv.
DATA: lv_fieldcat TYPE slis_fieldcat_alv.

REFRESH fu_t_fieldcat.

LOOP AT tbl_hdr.
CLEAR lv_fieldcat.
lv_fieldcat-col_pos = sy-tabix.
lv_fieldcat-fieldname = tbl_hdr-field.
lv_fieldcat-outputlen = tbl_hdr-panjang.
lv_fieldcat-reptext_ddic = tbl_hdr-judul.
APPEND lv_fieldcat TO fu_t_fieldcat.
ENDLOOP.
ENDFORM. " f_create_field
*&----------------------------------------------------------
*& Form top-of-page
*&----------------------------------------------------------
FORM top-of-page.
*ALV Header declarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
tpmatnr LIKE marc-matnr,
temp(20).


* Title
wa_header-typ = 'H'.
wa_header-info = 'MONITORING OUTSTANDING ORDER PACKAGING REPORT'.
APPEND wa_header TO t_header.

wa_header-typ = 'A'.
IF tpmatnr IS INITIAL.
tpmatnr = 'ALL'.
ENDIF.
CONCATENATE 'Plant : ' p_werks INTO wa_header-info SEPARATED BY space.
append wa_header to t_header.

wa_header-typ = 'A'.
CONCATENATE 'Printed By : ' sy-uname INTO wa_header-info SEPARATED BY space.
APPEND wa_header TO t_header.

wa_header-typ = 'A'.
CONCATENATE sy-datlo+6(2) '.' sy-datlo+4(2) '.' sy-datlo(4) INTO temp.
CONCATENATE 'Printed Date : ' temp INTO wa_header-info SEPARATED BY space.
APPEND wa_header TO t_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
* i_logo = ''.

ENDFORM. " top-of-page
*&---------------------------------------------------------------------*
*& Form SETTING_ATTR
*&---------------------------------------------------------------------*
FORM setting_attr.
* setting variant
* V_VARIANT-VARIANT = P_VAR.
* V_VARIANT-REPORT = SY-REPID.
* V_VARIANT-USERNAME = SY-UNAME.
ENDFORM. "SETTING_ATTR
*&---------------------------------------------------------------------*
*& Form GETJUDUL
*&---------------------------------------------------------------------*
FORM getjudul CHANGING p_hdr.
CONCATENATE 'NO(3)NO,'
'MATERIAL(11)MATNR,'
'MATERIAL DESCRIPTION(40)TXZ01,'
'SATUAN(6)MSEH3,'
'TGL PR(10)BADAT,'
'NO PR(10)BANFN,'
'ITEM PR(8)BNFPO,'
'TGL PO(10)BEDAT,'
'NO PO(10)EBELN,'
'ITEM PO(8)EBELP,'
'SISA(7)MENGE,'
'TGL PERMINTAAN(14)EINDT,'
'SUPPLIER(40)NAME1,'
'KETERANGAN PO(132)KETPO,'
'LEAD PO(7)LEADO,'
'LEAD PR(7)LEADR,'
'KETERANGAN(132)KETHEAD'
INTO p_hdr.
ENDFORM. " GETJUDUL

Friday, May 23, 2008

Change field contents (from SM30) from uppercase to as it is.

One day, my user need to maintain 1 table from SM30, when they entered a description of tax service code, it changed automatically to upper case caps. Actually they need that description as it is.

What I have to change ?

  1. SE11, open the table
  2. Change the field type using a Data Element
  3. Create a Domain from those data element.
  4. This is the important thing : Tick the Lowercase option.

The Lowercase option means let the word as it is, not changed to uppercase caps.

Wednesday, May 7, 2008

Select a table between two clients using RFC Function

1. Create RFC Destination

  • Technical Settings
    Connection Type : 3 Abap Connection
    Target Host : cpidev03
    IP Address : xxxxxxxxx
  • Logon & Security
    Input target Client, user dan password, or u can choose using Current User
  • Test Connection using Connection Test

2. SE37 - Function TABLE_ENTRIES_GET_VIA_RFC RFC
Target sys : input the RFC Destination


You can use WHERE clause in this field :


The result :

The Structure stored in NAMETAB

The Records stored in TABENTRY
1 record will be store in 1 string, so u need to offset them by their structure.



Friday, March 14, 2008

MM : Maintain Message Output Type for Print PO (ME9F)

Maintain Message Output Type for Print PO (ME9F)

  1. SPRO -> Materials Management -> Purchasing -> Messages -> Output Control -> Message Types -> Define Message Types for Purchase Order
  2. Choose : Maintain Message Types for PO
  3. Double click at desired Output type
  4. and double click at Processing Routines in left side menu
  5. There you can find the printing Program, Form Routine and Form/Smartform (you can change this to your customized form)

One of errors that i've found :

  • ME9F error when print ( X )
    Processing log : Error in OPEN_FORM for document 9000000002
    It because the output device from format page ZKUARTO (in form ZFDXMM_PO - form that i use in customizing) , has not been maintained yet.
    OPEN_FORM inidcates initalize form with their format pages and the printer.

MM : Maintain header text PR/PO

I know this from one of my MM module's colleague.

Maintain Header Text PR :
SPRO -> Real Estate -> Tools -> Central Correspondence Maintenance -> Text ID s
To maintain :
PR (me51n/me52n/me53n) text id
- PR Header Text, object name : EBANH, with ID start from B01 - B99
- PR Item Text, object name : EBAN, with ID start from B01 - B99
PO (me21n/me22n/me23n) text id
- PO Header Text, object name : EKKO, with ID start from F01 - F99
- PO Header Text, object name : EKPO, with ID start from F01 - F99

That table also keeps the maintenance Text IDs for other SAP Standard tcode, but i dont have the documentation furthermore.

If you have any documentation about this, feel free to share :)

Thursday, March 13, 2008

Change Excel column name from A, B, C... to 1, 2, 3 ...

One day, when I have to work with Excel file, I just don’t have an idea why the column name that generally named column A, B, C, D … changed to 1, 2, 3, 4, ….. At the first place I don’t really care about it, I only think that it’s weird without having a damn on it.

And the other day, while my colleague copy that excel file, he need it to be change to original name. Then I start googling, and came up to this site.

This is how to change it :

  1. Click on Tools -> Options -> General tab
  2. Mark R1C1 reference style to change the column name into 1, 2 , 3… or unmark to change it to original


I dont know the purpose from this R1C1 reference style options for. Anyone ?

Wednesday, March 12, 2008

At Selection Screen event

Purpose : radiobutton to enable/disable screen input.



REPORT zhny064 .

TABLES : vbrk.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_pil1 TYPE c RADIOBUTTON GROUP gpil DEFAULT 'X'
USER-COMMAND ucomm.
SELECTION-SCREEN COMMENT 4(51) text-001.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK b001 WITH FRAME.
SELECT-OPTIONS: s_vbeln FOR vbrk-vbeln NO-EXTENSION MEMORY ID vf.

SELECTION-SCREEN END OF BLOCK b001.

SELECTION-SCREEN SKIP 2.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_pil2 TYPE c RADIOBUTTON GROUP gpil.
SELECTION-SCREEN COMMENT 4(51) text-002.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK b002 WITH FRAME.
SELECT-OPTIONS: s_vbel1 FOR vbrk-vbeln MEMORY ID vf.
SELECTION-SCREEN END OF BLOCK b002.


AT SELECTION-SCREEN OUTPUT.
IF p_pil1 EQ 'X'.
LOOP AT SCREEN.
IF screen-name CS 'S_VBEL1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name CS 'S_VKBUR' OR screen-name CS 'S_VBELN' .
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.


SM30 - menyisipkan code event pada sm30

Sekedar share mengenai sm30 yang nemu di forum nya sdn.sap.com semoga bermanfaat untuk menyisipkan code event pada sm30 - table generator .
Contoh implementasi untuk check authorization.



Berikut step2 nya:
  1. Masuk ke table generator ( screen ) environment => modification => Events

  2. Click New entries hingga keluar seperti gambar , kemudian di pilih event yang akan disisipkan dengan kode program buatan kita.
    Contoh: event code 05 bisa untuk menginisialasi suatu nilai pada table misal kita ingin menginisial suatu nilai pada table zmm_ship -> ship_code menjadi auto number.

  3. Setelah di pilih event code 05 maka isikan form routine ( ZINIT ) kemudian enter , lalu click icon di sebelah kolom form routine sehingga keluar screen sperti dibawah ini langkah berikutnya isi nama subroutine ZINIT pada include choice dibawah ini.
    Step berikutnya click new entry jika keluar warning seperti dibawah ini :

  4. Seperti terlihat contoh code berikut: Save -> Activate

  5. Done, test it !
  6. SM30. See result!

Jika ada error maka program functions group main harus di activate.

Abap Dictionary - cara licik utk tembak data langsung

Sesuai judulnya, the purpose is to update data from Z table (recomended only in Z table) secara langsung dari SE16/SE11 without User Interface2an.

Hal licik ini sebaiknya ngga dilakukan di Production, kecualiii... kepepet - hehehe, yakin kalo data yg mo dirubah gak ngelink ke table laen (misal z table master - bisa runyam kan!), perubahan ngga nyebabin error (sesuai format/tipe data sesuai), and y penting... bos jgn sampe tau... hehehe, ga enak kan... :">

Caranya :


  1. Call SE16/SE11, entry table name n display
  2. Double click row data yang ingin dirubah, activate debugger ( /h ), then Enter
  3. Press Enter once more, then debugger will show up
  4. Double click field code dan change it from SHOW to EDIT
  5. Change desired fields
  6. Save, Back, and Refresh table
Note : - Hal ini tidak berlaku utk key fields- Loe ga bisa lakukan ini klo loe ga punya otorisasi utk change fields (mostly in Production)

SAP - what's ABAP ?

Untuk temen2 yang belum perna denger soal ABAP. Berikut penjelasan simple dan sesingkat2nya mengenai ABAP. ABAP (Advanced Business Application Programming) merupakan bahasa pemrograman yang digunakan dalam aplikasi SAP (Systems, Applications, and Products (in data processing)).

SAP sendiri merupakan software ERP yang biasanya dipakai di perusahaan2 besar (krn mahallll). Dan ABAP digunakan utk :
  1. bikin report
    walopun di SAP sudah ada report2 standard, tapi kebanyakan tidak memenuhi kebutuhan user.
  2. bikin aplikasi tambahan di SAP yang tidak ada proses standard SAP
    misal : salah satu proses standard di SAP adalah Production Order Create (CO01) - dan yang tidak ada di standard SAP adalah Proses Automatic Create PO yang datanya di provide dari file Excel
  3. bikin user exit, user exit adalah proses tambahan dlm proses standard SAP
    misal : dalam proses create sales order, ada validasi2 tertentu yang tidak ada dlm standard SAP
  4. bikin print'an form
    dlm SAP jg sdh ada form2 standard, misal Invoice. tapi ya kebanyakan memang tidak memenuhi kebutuhan user, dari segi layout terutama.
ABAP, seperti apa ?

ABAP itu bahasanya human banget :) . Contoh dari sintak2 ABAP :


Untuk belajar ABAP seluruhnya emang gak mudah, karena bnyk sekali tekniknya. Tapi klo utk sekedar reporting ato sintak2 sederhana sih mudah2 aja, karena Editor nya dilengkapi dengan error checking pd saat execute.

the Notebook n the problems

In this blog, i try to share things that i keep in my notebook since time i'm working in IT, as a programmer - ABAPer. I consider coding probably one of my hobbies since most of the time i enjoy in doing that - pretty weird huh!

First, i tell u, i'm not a master of code, i just think i like it... but i dont know, i think i can not be a master on it. Maybe... some part of my self sez "i'm a female" and... it's verrrry rare when a female become a master on it. Hihihi.

Second, from this blog i think i can share the problems to. Maybe i can learn from u also ;)

Hopefully i can update this blog constantly.. since i'm not a really consistent person, hehehe.