hallo,
ich wuerde gern im folgenden programm mit doppelclick in eine transaktion abspringen.
weis jemand was ich falsch mache?
danke
TYPE-POOLS: slis.
DATA:
itab_feldkatalog TYPE slis_t_fieldcat_alv,
gs_layout TYPE slis_layout_alv,
wa_feldkatalog TYPE LINE OF slis_t_fieldcat_alv,
g_repid LIKE sy-repid.
DATA: BEGIN OF wa,
nr TYPE likp-vbeln,
codcli TYPE likp-kunnr,
numbol TYPE likp-xabln,
dtausc TYPE likp-wadat_ist,
dtacre TYPE likp-bldat,
ordnr TYPE lips-vgbel,
mat TYPE lips-matnr,
desmat TYPE lips-arktx,
qta TYPE lips-lfimg,
grup TYPE lips-vkgrp,
name TYPE kna1-name1,
sgp TYPE vbuk-kostk,
wm TYPE vbuk-lvstk,
sm TYPE vbuk-wbstk,
age TYPE kna1-lifnr,
age1 TYPE knvp-lifnr,
END OF wa,
itab LIKE TABLE OF wa WITH HEADER LINE.
DATA: BEGIN OF wa1,
nr TYPE likp-vbeln,
codcli TYPE likp-kunnr,
numbol TYPE likp-xabln,
dtausc TYPE likp-wadat_ist,
dtacre TYPE likp-bldat,
ordnr TYPE lips-vgbel,
mat TYPE lips-matnr,
desmat TYPE lips-arktx,
qta TYPE lips-lfimg,
grup TYPE lips-vkgrp,
name TYPE kna1-name1,
sgp TYPE vbuk-kostk,
wm TYPE vbuk-lvstk,
sm TYPE vbuk-wbstk,
age TYPE kna1-lifnr,
age1 TYPE knvp-lifnr,
END OF wa1,
wa_aktuelle_zeile LIKE TABLE OF wa1 WITH HEADER LINE.
SELECT-OPTIONS cliente FOR wa-codcli NO INTERVALS.
SELECT-OPTIONS data FOR wa-dtausc.
SELECT-OPTIONS material FOR wa-mat.
SELECT-OPTIONS gruven FOR wa-grup NO INTERVALS.
*SELECT-OPTIONS agente FOR wa-age NO INTERVALS.
START-OF-SELECTION.
SELECT a~vbeln a~kunnr a~xabln a~wadat_ist a~bldat b~vgbel b~matnr b~arktx b~lfimg b~vkgrp c~name1 d~kostk d~lvstk d~wbstk a~lifnr
INTO TABLE itab
FROM likp AS a
INNER JOIN lips AS b
ON a~vbeln = b~vbeln
INNER JOIN vbuk AS d
ON a~vbeln = d~vbeln
* LEFT OUTER JOIN knvp AS e
* ON a~kunnr = e~kunnr
LEFT OUTER JOIN kna1 AS c
ON a~kunnr = c~kunnr
WHERE a~kunnr IN cliente AND
a~wadat_ist IN data AND
b~matnr IN material AND
b~vkgrp IN gruven. "AND
* e~lifnr IN agente.
*-----------------------------------------------------------------------
* Beginn ALV-Ausgabe
*-----------------------------------------------------------------------
* Feldkatalog fuellen.
PERFORM feldkatalog_fuellen.
* Layout bestimmen.
PERFORM layout_allg_build USING gs_layout.
* Daten als ALV-Liste anzeigen.
PERFORM alv_anzeigen.
END-OF-SELECTION.
*-----------------------------------------------------------------------
* Unterprogramm fuer Ausgabe der ALV-Liste
*-----------------------------------------------------------------------
FORM alv_anzeigen.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_grid_title = 'Report per consegne'
i_callback_user_command = 'CALLBACK'
it_fieldcat = itab_feldkatalog
is_layout = gs_layout
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2 .
IF sy-subrc <> 0.
MESSAGE i000(vaca) WITH 'Nessun dato trovato!'.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------
* Unterprogramm fuer das Fuellen des Feldkatalogs
*---------------------------------------------------------------------
FORM feldkatalog_fuellen.
CLEAR itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'NR'.
wa_feldkatalog-ref_fieldname = 'VBELN'.
wa_feldkatalog-ref_tabname = 'LIKP'.
wa_feldkatalog-seltext_s = 'NR.'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'CODCLI'.
wa_feldkatalog-ref_fieldname = 'KUNNR'.
wa_feldkatalog-ref_tabname = 'LIKP'.
wa_feldkatalog-seltext_s = 'Codice Cli.'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'NAME'.
wa_feldkatalog-ref_fieldname = 'NAME1'.
wa_feldkatalog-ref_tabname = 'KNA1'.
wa_feldkatalog-seltext_s = 'Cliente'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'MAT'.
wa_feldkatalog-ref_fieldname = 'MATNR'.
wa_feldkatalog-ref_tabname = 'LIPS'.
wa_feldkatalog-seltext_s = 'MATNR'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'DESMAT'.
wa_feldkatalog-ref_fieldname = 'ARKTX'.
wa_feldkatalog-ref_tabname = 'LIPS'.
wa_feldkatalog-seltext_s = 'DESCR.MAT.'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'QTA'.
wa_feldkatalog-ref_fieldname = 'LFIMG'.
wa_feldkatalog-ref_tabname = 'LIPS'.
wa_feldkatalog-seltext_s = 'QTA'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'NUMBOL'.
wa_feldkatalog-ref_fieldname = 'XABLN'.
wa_feldkatalog-ref_tabname = 'LIKP'.
wa_feldkatalog-seltext_s = 'Bolla'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'DTACRE'.
wa_feldkatalog-ref_fieldname = 'BLDAT'.
wa_feldkatalog-ref_tabname = 'LIKP'.
wa_feldkatalog-seltext_s = 'Cre. Bolla'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'DTAUSC'.
wa_feldkatalog-ref_fieldname = 'WADAT_IST'.
wa_feldkatalog-ref_tabname = 'USCITA'.
wa_feldkatalog-seltext_s = 'Uscita Mer.'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'SGP'.
wa_feldkatalog-ref_fieldname = 'KOSTK'.
wa_feldkatalog-ref_tabname = 'VBUK'.
wa_feldkatalog-seltext_s = 'SGP'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'WM'.
wa_feldkatalog-ref_fieldname = 'LVSTK'.
wa_feldkatalog-ref_tabname = 'VBUK'.
wa_feldkatalog-seltext_s = 'WM'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'SM'.
wa_feldkatalog-ref_fieldname = 'WBSTK'.
wa_feldkatalog-ref_tabname = 'VBUK'.
wa_feldkatalog-seltext_s = 'SM'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'ORDNR'.
wa_feldkatalog-ref_fieldname = 'VGBEL'.
wa_feldkatalog-ref_tabname = 'LIPS'.
wa_feldkatalog-seltext_s = 'Nr.Ordine'.
APPEND wa_feldkatalog TO itab_feldkatalog.
CLEAR wa_feldkatalog.
wa_feldkatalog-fieldname = 'AGE'.
wa_feldkatalog-ref_fieldname = 'LIFNR'.
wa_feldkatalog-ref_tabname = 'KNA1'.
wa_feldkatalog-seltext_s = 'Agente'.
APPEND wa_feldkatalog TO itab_feldkatalog.
ENDFORM. "feldkatalog_fuellen
*---------------------------------------------------------------------
* Unterprogramm fuer Layoutangaben
*---------------------------------------------------------------------
FORM layout_allg_build USING ls_layout TYPE slis_layout_alv.
ls_layout-zebra = 'X'.
ls_layout-colwidth_optimize = 'X'.
ENDFORM. "layout_allg_build
*&--------------------------------------------------------------------*
*& Form callback
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->R_UCOMM text
* -->RS_SELFIELDtext
*---------------------------------------------------------------------*
FORM callback USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
IF r_ucomm NE '&IC1'.
IF NOT rs_selfield-tabindex IS INITIAL.
READ TABLE itab INTO wa_aktuelle_zeile
INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
SET PARAMETER ID 'VL' FIELD wa_aktuelle_zeile-nr.
CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. "callback