PDA

Ver la Versión Completa : Problema con BADI's


gstortoni
28/02/07, 13:42:09
Hola gente, tengo un pequeño pero muy molesto problema con una BADI.

Necesito agregar a la Transaccion TS01 una Pestaña nueva.
El tema es que quiero utilizar la badi: FTR_CUSTOMER_EXTENT.

Le he creado la definicion... la implementacion.... pero nada no me resulta.. me estoy guiando segun un ejemplo que encontre en un foro de SDN.sap y por lo sugerido aca esta deberia ser mi solucion.. pero no me funciona... dejo el codigo y mis dudas sobre este.

To add a new custom tab in TM_XX transactions you have to follow these steps:
1. (SE80) Create a dynpro as SUBSCREEN, with the structure (fields, tablecontrols...) you want in the new tab, located in a modul-pool.
Example: Program: ZCFM001
Dynpro: 1010

2. (SE18) Create your custom implementation of BADI FTR_CUSTOMER_EXTENT. This will create a Z class where you can program the new tab management.
Example: Implementation: ZAMPLIACIOTM001
Class: ZCL_IM_AMPLIACIOTM001

3. (SE24) Implement method EVT_APPLICATION_START of your new class. This method is called when the transaction is going to be painted, and manages (among other things) which tabs need to be shown. In general terms, you will have to assign your dynpro to a function code.
This BADI offers you 2 custom function codes, and so, the ability to add two custom tabs. These function codes are OPEN_TRTM_CUST_01 and OPEN_TRTM_CUST_02.
To add your dynpro to a function code, you have to identify this relationship in the internal table (parameter) PC_TAB_BADI_TABS. This is the table that contains the custom tabs to be added.
To do this, you have to add the following piece of code:

DATA: LS_BADI_TABS TYPE FTROP_BADI_SUBSCREEN.

* 4.1. Modify the tab structure.
LS_BADI_TABS-REPID = ZCFM001. "Report
LS_BADI_TABS-TEXT_TAB = 'New Tab'. "Text (max. 30 CHAR) to display
LS_BADI_TABS-DYNNR = '1010'. "Subscreen

* 4.2. Add the new tab.
MODIFY PC_TAB_BADI_TABS
FROM LS_BADI_TABS
TRANSPORTING REPID DYNNR TEXT_TAB
WHERE FCODE = 'OPEN_TRTM_CUST_01'.


mi pregunta es la siguiente en realidad son muchas preguntas:

1.- El codigo este donde debo agregarlo en el metodo EVT_APPLICATION_START?

2.- como sabe la trx ts01 que la badi FTR... va a implementar mi Codigo?...

son dudas chiquitas pero que hoy por hoy me hacen doler la cabeza :D


MUCHAS GRACIAS A TODOS.

abap_25
22/01/10, 13:29:05
Hola, que tal.
Yo pude agregar una nueva pestaña a la transaccion TS01, el problema que tengo ahora es que no se como agregar campos a esa subscreen (tab).
me parece que se hace por codigo.
Tu fuiste capaz de hacer eso?
favor de ayudarme.
Muchas gracias