‎2006 Dec 25 8:49 AM
hi experts,
I m new to abap and I've been given to copy a standard program to make some changes in it.
But before i could do changes i thought of first copying the standard program and creating a transaction for it to see if it works as standard or not.
Now when i run the report usig this transaction it gives error "Transaction code not defined".
On clicking on its help the detail error says: "You have called up the program without defining a corresponding transaction code. This is probably beacause variant maintenance has been called up using se38. It is not possible to create variants using this transaction."
The standard program is RKAEP000. and only its transaction cpb1 needs to be copied with screen 120 which should be assigned to the transaction as in standard.
how should i handle it?
Please help.
‎2006 Dec 25 12:38 PM
‎2006 Dec 25 9:21 AM
Create a Z-(or Y-) transaction using SE93 t-code.
Steps are
1. Put the proposed name of the t-code(must start with Z or Y) and click on "Create".
2. Give a "Short Text". Select Start Object "Program and Selection Screen(Report Transaction)"
3. Enter the program name.
‎2006 Dec 25 9:22 AM
when you copied the program from standard one you have to see that which is the main screen or youare using the selection screen.
after u got that screen no you have to mention the screen no in that creation of the t-code.
hope it will help you malhotra.
‎2006 Dec 25 9:41 AM
hi,
Use Transactional Variants
Check
http://help.sap.com/saphelp_nw04s/helpdata/en/7d/f639f8015111d396480000e82de14a/content.htm
Regards,
Santosh
‎2006 Dec 25 9:55 AM
i've checked that screen 120 is of type selection screen but when i copy this to my z program its type changes from selection screen to normal screen. And moreover it doesnot allow me to change its type. as the radiobutton of seletion screen is disabled.
please help.
‎2006 Dec 25 12:35 PM
Hello Annie
If you look at the coding of report RKAEP000 you see that at event
AT SELECTION-SCREEN OUTPUT.the routine <b>TRANSACTION_INIT</b> is called.
FORM transaction_init
*&---------------------------------------------------------------------*
USING value(v_tcode) LIKE p_tcode
*&---------------------------------------------------------------------*
CHANGING c_item_group TYPE kaep_item_group
c_rep_object TYPE kaep_rep_object
c_update TYPE kaep_flag
c_sign_apc LIKE rkact_cl-sign_ap
c_title LIKE rsmpe-titcode.
*----------------------------------------------------------------------*
CLEAR gd.
IF sy-batch IS INITIAL OR c_item_group IS INITIAL. "note 193499
"parameters must be filled in batch mode
CALL FUNCTION 'K_LINE_ITEM_LOGICAL_KEY_GET'
EXPORTING
i_tcode = v_tcode
IMPORTING
e_item_group = c_item_group
e_rep_object = c_rep_object
e_update = gd-update
EXCEPTIONS
unknow_transaction = 1.<b> IF sy-subrc = 1.
MESSAGE e496(kb).
ENDIF.</b>
CALL FUNCTION 'K_LINE_ITEM_APC_SIGN_GET'
EXPORTING
i_item_group = c_item_group
IMPORTING
e_sign_apc = c_sign_apc.
ENDIF.
CONCATENATE c_item_group c_rep_object c_update INTO c_title.
gs_display_variant-report = self.
gs_display_variant-handle = c_item_group.
gs_display_variant-log_group = c_rep_object.
ENDFORM. " TRANSACTION_INITThe function module K_LINE_ITEM_LOGICAL_KEY_GET does not know your transaction and therefore returns an error.
To overcome this problem you can change the coding in your copied report as following:
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
*&---------------------------------------------------------------------*
* Transaction initialization must be done here because parameters are
* not filled at INITIALIZATION when called via SUBMIT
*&---------------------------------------------------------------------*
CHECK sscrfields-ucomm(2) NE 'UC'.
IF p_tcode IS INITIAL.
p_tcode = sy-tcode.
ENDIF.
GET PARAMETER ID 'TPB' FIELD p_valtyp.
IF sy-subrc NE 0.
GET PARAMETER ID 'VTP' FIELD p_valtyp.
ENDIF.
PERFORM transaction_init
USING 'CPB1' " p_tcode
CHANGING p_item
p_obj
gd-update
gd-sign_apc
gd-title.
...Simply replace the variable <i>p_tcode</i> with the original transaction code.
Regards
Uwe
‎2006 Dec 25 12:38 PM
‎2006 Dec 25 6:20 PM
Hello Annie
As mentioned before the coding
IF sy-subrc = 1.
MESSAGE e496(kb). " Transaction code not defined
ENDIF.gives you the error message.
Thus, if you modify the PERFORM <i>transaction_init</i> as described above the report should work.
See the coding of function module <b>K_LINE_ITEM_LOGICAL_KEY_GET</b> to get the allowed transactions:
FUNCTION K_LINE_ITEM_LOGICAL_KEY_GET.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_TCODE) LIKE SY-TCODE DEFAULT SY-TCODE
*" EXPORTING
*" VALUE(E_ITEM_GROUP) TYPE KAEP_ITEM_GROUP
*" VALUE(E_REP_OBJECT) TYPE KAEP_REP_OBJECT
*" VALUE(E_UPDATE) TYPE KAEP_FLAG
*" EXCEPTIONS
*" UNKNOW_TRANSACTION
*"----------------------------------------------------------------------
CLEAR E_UPDATE.
CASE I_TCODE.
* documents
WHEN 'KSB5'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = CON_REP_OBJECT-DOCUMENTS.
WHEN 'KABP'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_PLAN.
E_REP_OBJECT = CON_REP_OBJECT-DOCUMENTS.
* cost centers
WHEN 'KSB1'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = OBJEKTART_KS.
WHEN 'KSBP'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_PLAN.
E_REP_OBJECT = OBJEKTART_KS.
WHEN 'KSB2'.
E_ITEM_GROUP = CON_ITEM_GROUP-COMMITMENTS.
E_REP_OBJECT = OBJEKTART_KS.
WHEN 'KSB8'.
E_ITEM_GROUP = CON_ITEM_GROUP-BUDGET.
E_REP_OBJECT = OBJEKTART_KS.
* orders
WHEN 'KOB1' OR 'KRMI'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = OBJEKTART_OR.
WHEN 'KOBP'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_PLAN.
E_REP_OBJECT = OBJEKTART_OR.
WHEN 'KOB4'.
E_ITEM_GROUP = CON_ITEM_GROUP-BUDGET.
E_REP_OBJECT = OBJEKTART_OR.
WHEN 'KOB5'. " IM-Auftraege EP Aufteilung
E_ITEM_GROUP = CON_ITEM_GROUP-SETTLEMENT.
E_REP_OBJECT = OBJEKTART_OR.
E_UPDATE = CON_ON.
WHEN 'KOB6'. " IM-Auftraege EP Anzeige
E_ITEM_GROUP = CON_ITEM_GROUP-SETTLEMENT.
E_REP_OBJECT = OBJEKTART_OR.
E_UPDATE = CON_OFF.
WHEN 'KOB7'. " IM-Auftraege EP Abgang
E_ITEM_GROUP = CON_ITEM_GROUP-RETIREMENT.
E_REP_OBJECT = OBJEKTART_OR.
E_UPDATE = CON_ON.
WHEN 'KOB2'.
E_ITEM_GROUP = CON_ITEM_GROUP-COMMITMENTS.
E_REP_OBJECT = OBJEKTART_OR.
WHEN 'KOB3' OR 'KKFB'.
E_ITEM_GROUP = CON_ITEM_GROUP-DEVIATION.
E_REP_OBJECT = OBJEKTART_OR.
WHEN 'KOB8'.
E_ITEM_GROUP = CON_ITEM_GROUP-RESULT_ANALYSIS.
E_REP_OBJECT = OBJEKTART_OR.<b>* business processes
WHEN 'CPB1'.</b>
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = OBJEKTART_BP.
WHEN 'CPBP'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_PLAN.
E_REP_OBJECT = OBJEKTART_BP.
* cost objects
WHEN 'KKCS'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = OBJEKTART_HP.
WHEN 'KKCP'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_PLAN.
E_REP_OBJECT = OBJEKTART_HP.
WHEN 'KKCA'.
E_ITEM_GROUP = CON_ITEM_GROUP-DEVIATION.
E_REP_OBJECT = OBJEKTART_HP.
* sales orders
WHEN 'KVBI'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = OBJEKTART_VB.
WHEN 'KVBO'.
E_ITEM_GROUP = CON_ITEM_GROUP-COMMITMENTS.
E_REP_OBJECT = OBJEKTART_VB.
WHEN 'KKAA'.
E_ITEM_GROUP = CON_ITEM_GROUP-RESULT_ANALYSIS.
E_REP_OBJECT = OBJEKTART_VB.
* projects
WHEN 'CJI3' OR 'CJ74'. "projects actual line items
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJI4' OR 'CJ7M'. "projects plan line items
E_ITEM_GROUP = CON_ITEM_GROUP-COST_PLAN.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJI5' OR 'CJ76'. "projects obligo line items
E_ITEM_GROUP = CON_ITEM_GROUP-COMMITMENTS.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJI6'.
E_ITEM_GROUP = CON_ITEM_GROUP-SKF_ACTUAL.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJI7'.
E_ITEM_GROUP = CON_ITEM_GROUP-SKF_PLAN.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJI8'. "projects budget line items
E_ITEM_GROUP = CON_ITEM_GROUP-BUDGET.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJI9'. "projects strc. plan line items
E_ITEM_GROUP = CON_ITEM_GROUP-STRC_PLAN.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJIA' OR 'CJT2'. "projects cash act. line items
E_ITEM_GROUP = CON_ITEM_GROUP-FINANCE_ACTUAL.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJIB'. "projects cash plan line items
E_ITEM_GROUP = CON_ITEM_GROUP-FINANCE_PLAN.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJIC' OR 'CJ70'. " IM-Projekte EP Aufteilung
E_ITEM_GROUP = CON_ITEM_GROUP-SETTLEMENT.
E_REP_OBJECT = OBJEKTART_PD.
E_UPDATE = CON_ON.
WHEN 'CJID' OR 'CJ72'. " IM-Projekte EP Anzeige
E_ITEM_GROUP = CON_ITEM_GROUP-SETTLEMENT.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJIE' OR 'CJ7N'. " IM-Projekte EP Abgang
E_ITEM_GROUP = CON_ITEM_GROUP-RETIREMENT.
E_REP_OBJECT = OBJEKTART_PD.
E_UPDATE = CON_ON.
WHEN 'CJIF'. "projects res. anal. line items
E_ITEM_GROUP = CON_ITEM_GROUP-RESULT_ANALYSIS.
E_REP_OBJECT = OBJEKTART_PD.
WHEN 'CJIG'. "projects cash documents
E_ITEM_GROUP = CON_ITEM_GROUP-FINANCE_ACTUAL.
E_REP_OBJECT = CON_REP_OBJECT-DOCUMENTS.
* real estate objects "TH40C
WHEN 'FOEP0001' "real estate actual line items "TH40C
OR 'FOEPA001' "TH40C
OR 'FOEPV001'. "TH40C
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL. "TH40C
E_REP_OBJECT = OBJEKTART_IW. "TH40C
WHEN 'FOEP0002' "real estate com. line items "TH40C
OR 'FOEPA002' "TH40C
OR 'FOEPV002'. "TH40C
E_ITEM_GROUP = CON_ITEM_GROUP-COMMITMENTS. "TH40C
E_REP_OBJECT = OBJEKTART_IW. "TH40C
WHEN 'FOEP0003' "real estate plan line items "TH40C
OR 'FOEPA003' "TH40C
OR 'FOEPV003'. "TH40C
E_ITEM_GROUP = CON_ITEM_GROUP-COST_PLAN. "TH40C
E_REP_OBJECT = OBJEKTART_IW. "TH40C
WHEN OTHERS.
RAISE UNKNOW_TRANSACTION.
ENDCASE.
ENDFUNCTION.Regards
Uwe
‎2006 Dec 25 8:05 PM
Hi,
For creating a custom transaction code using SE 93 u can do it,
go to SE93, and give the name starting with Z or Y and rest of ur,
then the in se38 the standard program also copy with Z or Y, then assign the Z or Y program to the custom Z or Y transaction, I hope it will solve ur issue.
Regards,
Nagaraju.
‎2006 Dec 26 9:28 AM
Thanks so much Uwe, u solved my problem.
i've awarded u ur points.