Skip to Content
0
Former Member
Jan 07, 2007 at 12:23 PM

need help!!!!!!!!!

19 Views

I have created this ALV grid display prog. And in output when i click on belnr(document number) it should took me to the T.code FB03. Now tell me how i will do that. And what are the code needed for that and whre do i need to put that code.

Thanks....

For ur refrence code is given below:-

&----


*& Report ZFI_CASH_RECEIPT_LAYOUT_DEMO

*&

&----


*&

*&

&----


REPORT zfi_cash_receipt_layout_demo.

TABLES: bsis,bsak,lfa1, ZST_CASH_RECP.

TYPE-POOLS: slis.

DATA: BEGIN OF it_table OCCURS 0.

include structure ZST_CASH_RECP.

data : end of it_table.

  • bldat LIKE bsis-bldat,

  • budat LIKE bsis-budat,

  • hkont LIKE bsis-hkont,

  • wrbtr LIKE bsis-wrbtr,

  • bukrs LIKE bsis-bukrs,

  • augdt LIKE bsak-augdt,

  • lifnr LIKE bsak-lifnr,

  • augbl LIKE bsak-augbl,

  • belnr LIKE bsak-belnr,

  • END OF it_table.

DATA: i_fieldcat TYPE slis_t_fieldcat_alv,

wa_fieldcat TYPE slis_fieldcat_alv,

v_repid TYPE sy-repid.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_budat FOR bsis-budat OBLIGATORY.

PARAMETERS: p_bukrs LIKE bsis-bukrs OBLIGATORY DEFAULT '1000'.

SELECT-OPTIONS : s_hkont FOR bsis-hkont,

s_bschl FOR bsis-bschl.

SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.

  • PERFORM build_fieldcatlog.

CLEAR: v_repid.

v_repid = sy-repid.

START-OF-SELECTION.

SELECT a~bldat

a~budat

a~belnr

a~bukrs

a~gjahr

a~buzei

a~hkont

a~wrbtr

a~waers

b~augdt

b~lifnr

b~augbl

b~belnr

lfa1~name1

INTO CORRESPONDING FIELDS OF TABLE it_table

FROM ( ( bsis AS a INNER JOIN bsak AS b

ON abukrs = bbukrs )

inner join lfa1 on

blifnr = lfa1lifnr )

WHERE bbukrs = p_bukrs AND bblart IN ('KR','RE') AND ahkont IN s_hkont and abudat in s_budat AND a~bschl IN s_bschl.

IF sy-subrc <> 0.

MESSAGE s000(zmess_cash_receipt).

ELSE.

PERFORM display_alv_report.

ENDIF.

END-OF-SELECTION.

&----


*& Form BUILD_FIELDCATLOG

&----


  • text

----


FORM build_fieldcatlog .

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'BLDAT'.

wa_fieldcat-seltext_m = 'BLDAT.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'BUDAT'.

wa_fieldcat-seltext_m = 'BUDAT.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'BELNR'.

wa_fieldcat-seltext_m = 'BELNR.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'HKONT'.

wa_fieldcat-seltext_m = 'HKONT.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'WRBTR'.

wa_fieldcat-seltext_m = 'WRBTR.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'AUGDT'.

wa_fieldcat-seltext_m = 'AUGDT.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'LIFNR'.

wa_fieldcat-seltext_m = 'LIFNR.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'it_TABLE'.

wa_fieldcat-fieldname = 'AUGBL'.

wa_fieldcat-seltext_m = 'AUGBL.'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

ENDFORM. " BUILD_FIELDCATLOG

&----


*& Form DISPLAY_ALV_REPORT

&----


  • text

----


FORM display_alv_report.

v_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = v_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

I_STRUCTURE_NAME = 'ZST_CASH_RECP'

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

  • it_fieldcat = i_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • i_save = 'A'

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = it_table

EXCEPTIONS

program_error = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. "DISPLAY_ALV_REPORT