‎2007 May 01 7:25 PM
Hi Guys,
I have to copy the standard report KSB1 and have to make the changes to it. But problem is when I am copying the program RKAEP000 to ZRKAEP000 and try to execute the program it gives the error Transaction Code Does not Defined
Then I tried to execute the standard program RKAEP000 it gave me the same error, but when I am executing through transaction code KSB1 then it is fine.
Then I tried to copy the T-code KSB1 to ZKSB1 then executed the ZKSB1, it gave me same error. Now I am not able to find where the program is checking for the t-code ZKSB1.
Will appreciate you guys response.
Thanks,
Rohit
‎2007 May 01 7:49 PM
See below FM,and you are getting problem in this FM.
Keep Break point in this FM or RKAEPINI ( Include ) keep break Point here.
now run your transaction.
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.
IF sy-subrc = 1.
MESSAGE e496(kb).
ENDIF.
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 01 7:40 PM
see this piece of code in form transaction_init in include RKAEPINI.
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.
maybe u can just comment this check.
‎2007 May 01 7:43 PM
better copy that FM to a Z function module,
and add this code.
WHEN 'ZKSB1'.
E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.
E_REP_OBJECT = OBJEKTART_KS.
and call this Z FM from your program. just to make sure it works exactly as KSB1.
‎2007 May 01 7:49 PM
See below FM,and you are getting problem in this FM.
Keep Break point in this FM or RKAEPINI ( Include ) keep break Point here.
now run your transaction.
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.
IF sy-subrc = 1.
MESSAGE e496(kb).
ENDIF.
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 01 8:21 PM
Thank you guys it worked. Now I have to add LIFNR (Vendor) field to the output of the custom program. I have to get LIFNR for the corresponding purchase order.
Can you please let me know how to proceed to add LIFNR to the output ALV grid.
I can get the LIFNR from the EKKO table.
Appreciate your response.
Thanks,
Rohit
‎2007 May 01 8:56 PM
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = c_field_structure
i_client_never_display = 'X'
CHANGING
ct_fieldcat = ct_default_fieldcat.
after this, append ur LIFNR also to field catalog.
also select from ekko and pass to the internal table which is being passed to reuse_alv_*display FM
‎2007 May 01 9:03 PM
Hi Sujamol,
Yeah I can do it but I am not able to find where to do changes in program RKAEP000 to make it work.
Rohit
‎2007 May 01 9:11 PM
‎2007 May 01 9:13 PM
search for this block in that.
-
this is piece existing in that program..
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = c_field_structure
i_client_never_display = 'X'
CHANGING
ct_fieldcat = ct_default_fieldcat.
just after this add ur field catalog..to append this ct_default_fieldcat.
Was this your question ?
‎2007 May 02 1:41 PM
I have added the following code, but it is not adding the LIFNR column
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = c_field_structure
i_client_never_display = 'X'
CHANGING
ct_fieldcat = ct_default_fieldcat.
ls_field_cat-col_pos = '182'.
ls_field_cat-fieldname = 'LIFNR'.
ls_field_cat-seltext_l = 'Vendor'.
APPEND ls_field_cat to ct_default_fieldcat.
Field catalog has almost 181 columns so I have added it at the 182 position. Other thing is to get the LIFNR I required the purchase order number. I am able to see the purchase order in the output but not able to find out from which internal table I have to extract it.
‎2007 May 01 8:01 PM
As a start, try commenting out the call to FM K_LINE_ITEM_LOGICAL_KEY_GET, and set the values of c_item_group to COAC and c_rep_object to KS manually. And clear gd-update.
Rob
‎2014 Jul 08 7:21 AM
Hi Rohit,
Can you please provide the steps which you followed in creating Z program and adding logic to add new fields?
Have a similar requirement.
Thanks.