‎2006 Dec 22 1:35 AM
Hi I'm new to abap(particularly real time work) rt now I had a spec to solve i got the program related to it and i think i got an idea what to do
the program is abt: gr/ir detail report
The output has to be displayed in the ALV Grid format with the Selection screen appearing on the output. In The Output Subtotals for Vendor, Plant, Period, Material, Valuation Class, Purchase Order,Cost Center, Cost Element and receipt Date are displayed after sorting the data by same fields.
like
the spec is
updating yxxxx report to allow for field drill downs directly from the reports
particularly fields ebeln and belnr
now
my idea is
we can keep hotspots
or
we can mention it in at-line selection
so that
when we double click it redirects it
now
I'm not getting how to start where to start and where to keep it
can anyone help me.
Thanks in advance
‎2006 Dec 22 1:39 AM
‎2006 Dec 22 1:39 AM
‎2006 Dec 22 1:42 AM
For example, if you are using the function module, you can implement drill down like this. Implement this test program.
report zrich_0001.
* Global ALV Data Declarations
type-pools: slis.
* Internal Tables
data: begin of itab occurs 0,
matnr type mara-matnr,
maktx type makt-maktx,
end of itab.
start-of-selection.
perform get_data.
perform call_alv.
*********************************************************************
* Form GET_DATA
*********************************************************************
form get_data.
select mara~matnr makt~maktx
into corresponding fields of table itab
from mara
inner join makt
on mara~matnr = makt~matnr
up to 20 rows.
endform.
************************************************************************
* CALL_ALV
************************************************************************
form call_alv.
data: ifc type slis_t_fieldcat_alv.
data: xfc type slis_fieldcat_alv.
data: repid type sy-repid.
repid = sy-repid.
clear xfc. refresh ifc.
clear xfc.
xfc-reptext_ddic = 'Material Number'.
xfc-fieldname = 'MATNR'.
xfc-tabname = 'ITAB'.
xfc-outputlen = '18'.
append xfc to ifc.
clear xfc.
xfc-reptext_ddic = 'Material Description'.
xfc-fieldname = 'MAKTX'.
xfc-tabname = 'ITAB'.
xfc-outputlen = '40'.
append xfc to ifc.
* Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_user_command = 'HANDLE_USER_COMMAND'
it_fieldcat = ifc
tables
t_outtab = itab.
endform.
***********************************************************************
* FORM handle_User_Command *
***********************************************************************
form handle_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
case rs_selfield-FIELDNAME.
when 'MATNR'.
set parameter id 'MAT' field rs_selfield-value.
set parameter id 'WRK' field '0001'. "<- Your plant here
call transaction 'MD04' and skip first screen.
endcase.
endcase.
endform.
Regards,
Rich Heilman
‎2006 Dec 22 2:07 AM
REUSE_ALV_VARIANT_F4
REUSE_ALV_GRID_DISPLAy
REUSE_ALV_FIELDCATALOG_MERGE
REUSE_ALV_VARIANT_EXISTENCE
REUSE_ALV_COMMENTARY_WRITE
REUSE_ALV_EVENTS_GET
These all alvs are used.
‎2006 Dec 22 2:29 AM
‎2006 Dec 22 2:51 AM
Report zalvreport.
Type-pools : slis.
DATA : BEGIN OF ITAB OCCURS 0,
Here declare whatever colums you want.
END OF ITAB.
data: itab_fldcat type SLIS_T_FIELDCAT_ALV,
wa_fldcat type SLIS_FIELDCAT_ALV.
data : itab_events type SLIS_T_EVENT,
Wa_events type SLIS_ALV_EVENT.
data : ITAB_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV.
data : ITAB_COMMENTS TYPE SLIS_T_LISTHEADER,
WA_COMMENTS TYPE SLIS_LISTHEADER.
data : itab_exit type SLIS_T_EVENT_EXIT,
wa_exit type slis_event_exit.
data : wa_layout type SLIS_LAYOUT_ALV.
data : v_repid type sy-repid,
v_pagno(4) type n,
v_date(8) type c.
start-of-selection.
v_repid = sy-repid.
select (required columns) table itab from (database tables).
perform get_field_catalog.
perform modify_field_catalog.
perform get_events.
perform build_comments.
perform sort_list.
perform grid_display.
FORM GET_FIELD_CATALOG.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'ITAB Internal tables name shold be quoted in caps
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = itab_fldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
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.
FORM GRID_DISPLAY.
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 =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'You provide required title Information'
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = ITAB_FLDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab
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. " grid_display
Now you have first list output with ALV. If you want to continue sublist create one more catalog name and call once again reuse_alv_fieldcatalog_merge function module under at line-selection. Means repeat same process once again. If you want your company log on alv output mail me back.
Regarding subtotals you can find Generic function on ALV output . there you find subtotals button. Select your required column and press subtotals button.
Have a cool day
Chinna
‎2006 Dec 22 12:12 PM
Main thing is I got this program and now I have to
update
purchase order: EBELN
account document: BELNR
spec is asking to drill down these 2 fields particularly.
can anyone help me
‎2006 Dec 22 1:52 PM
Hi Nagini garu,
do you mean these 2 column values shold come on detailed list when u double click on purchase order. (or) u need to update with new data in to dbtable.....
chinna
‎2006 Dec 22 2:18 PM
2 column values shold come on detailed list when u double click on purchase order.
So like the purchase order number. When you double click that number,
it takes you to that PO
‎2006 Dec 22 2:55 PM
Hi Nagini garu,
Here is a example of ALV drill down report.
http://www.sap-img.com/abap/an-interactive-alv-report.htm
hope this will solve your problem
Sekhar