Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Drill down help

Former Member
0 Kudos
112

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

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
77

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.

4 REPLIES 4

Former Member
0 Kudos
77

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.

0 Kudos
77

whats the declaration part for gt_finalfx.

Pls explain.

former_member188685
Active Contributor
0 Kudos
78

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.

0 Kudos
77

Thank you very much yar.

Its working now.

Regards

Rajaram