2008 Mar 25 7:38 AM
Hi Experts
In ALV, am doing drill down for a two fields that
belnr and gjahr (document and fiscal year). But its not working, pls explain how to do drill down for combining two fields.
FORM user_command USING r_ucomm LIKE sy-ucomm
r_selfield TYPE slis_selfield.
DATA belnr TYPE lfa1-lifnr.
DATA BUKRS TYPE BSIK-BUKRS.
DATA GJAHR TYPE BSIK-GJAHR.
IF r_selfield-fieldname = 'BELNR'.
belnr = r_selfield-value.
SET PARAMETER ID 'BLN' FIELD belnr.
SET PARAMETER ID 'BUK' FIELD bukrs.
SET PARAMETER ID 'GJR' FIELD GJAHR.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM.
Thanks in advance.
Regards
rajaram
2008 Mar 25 8:29 AM
I assume your inernal table is it_output.
i modified the code.
just check it. I inserted the Read table part.
and changed in set parameter.
FORM user_command USING r_ucomm LIKE sy-ucomm
r_selfield TYPE slis_selfield.
DATA belnr TYPE lfa1-lifnr.
DATA BUKRS TYPE BSIK-BUKRS.
DATA GJAHR TYPE BSIK-GJAHR.
IF r_selfield-fieldname = 'BELNR'.
belnr = r_selfield-value.
read table it_output index r_selfield-tabindex.
SET PARAMETER ID 'BLN' FIELD belnr.
SET PARAMETER ID 'BUK' FIELD it_output-bukrs.
SET PARAMETER ID 'GJR' FIELD it_output-GJAHR.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM.
2008 Mar 25 7:40 AM
Hi,
Try this
FORM f_user_command USING iv_ucomm LIKE sy-ucomm
it_selfield TYPE slis_selfield.
DATA: BEGIN OF lt_buztab OCCURS 30,
bukrs LIKE bseg-bukrs, " Co Code
belnr LIKE bseg-belnr, " Doc No
gjahr LIKE bseg-gjahr, " fiscal Year
buzei LIKE bseg-buzei, " Line item
koart LIKE bseg-koart, " Kontoart
umskz LIKE bseg-umskz, " SHB-Kennzeichen
bschl LIKE bseg-bschl, " Posting key
bstat LIKE bkpf-bstat, " Buchungsstatus
mwart LIKE bseg-mwart, " Steuerart,
mwskz LIKE skb1-mwskz, " Steuerkategorie,
flaen(1) TYPE c, " X = Posten geaendert
END OF lt_buztab.
*to hold the line item for the doc
DATA:lv_buztab_line LIKE sy-tabix.
*each time refresh the table for new doc drill down
REFRESH lt_buztab.
*determine the current line
READ TABLE gt_finalfx INDEX it_selfield-tabindex.
IF sy-subrc = 0.
*append the data for drill down to line item
lv_buztab_line = gt_finalfx-buzei.
lt_buztab-buzei = gt_finalfx-buzei.
lt_buztab-bukrs = gt_finalfx-zz_bukrs.
lt_buztab-gjahr = gt_finalfx-gjahr.
lt_buztab-belnr = gt_finalfx-zz_belnr.
APPEND lt_buztab.
ELSE.
MESSAGE e004.
ENDIF.
*message if no line exists
IF lv_buztab_line IS INITIAL.
MESSAGE e004 .
ENDIF.
*call the dialog to drill down for line item instead of overview
CALL DIALOG 'RF_ZEILEN_ANZEIGE'
EXPORTING
buztab FROM lt_buztab
buztab_line FROM lv_buztab_line
tcode FROM 'FB03'
* x_commit
IMPORTING
buztab TO lt_buztab.
* x_commit.
ENDFORM. "f_user_command
Thanks,
Sriram Ponna.
2008 Mar 25 8:17 AM
2008 Mar 25 8:29 AM
I assume your inernal table is it_output.
i modified the code.
just check it. I inserted the Read table part.
and changed in set parameter.
FORM user_command USING r_ucomm LIKE sy-ucomm
r_selfield TYPE slis_selfield.
DATA belnr TYPE lfa1-lifnr.
DATA BUKRS TYPE BSIK-BUKRS.
DATA GJAHR TYPE BSIK-GJAHR.
IF r_selfield-fieldname = 'BELNR'.
belnr = r_selfield-value.
read table it_output index r_selfield-tabindex.
SET PARAMETER ID 'BLN' FIELD belnr.
SET PARAMETER ID 'BUK' FIELD it_output-bukrs.
SET PARAMETER ID 'GJR' FIELD it_output-GJAHR.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM.
2008 Mar 25 9:18 AM