Write stat below alv report .if i use field catalog.
hi experts,
i want to use write statment after alv report.
note: i am useing fieldcatalog.
i got it if i use standard table with : end_of_list event event.
thank you.
Hi snk,
1. It won't work in GRID display.
2. The reason is when grid comes,
it comes on a screen which has container and the grid control.
3. Write statement is displayed on a special screen,
which is generally used for list output.
Normal screens (where we can put textboxes/checkboxes etc),
do not support write statements.
regards,
amit m.
Similar Messages
-
In alv report can i use control break events? if no .whay?
Hi all,
in alv report can i use control break events? if no .whay?hi,
you can use control break statements in ALV report.
for example: if one PO is having more than one line item, that time you need to display PO only once. -
ALV report with internal in field symbol
Hi Shifu ABAP,
I have ALV report.
My problem is when I tried to do sum using the sum icon. I got a message 'desired operation cannot be performed for column 'Dignostic delay'. Is it because I used field symbol, then when I clicked on the column it didn't recorgnise the field.
FYI.
1)The internal table for my ALV report is stored in field symbol.
2)I dont have a problem to display the report.
3)I had to set 'do_sum' at ALV field category, still doesn't work
My source code to define ALV category.
loop at i_qpcd into wa_qpcd.
CLEAR ls_fieldcat2.
ls_fieldcat2-col_pos = pos2.
ls_fieldcat2-fieldname = wa_qpcd-code.
ls_fieldcat2-reptext_ddic = wa_qpcd-desc.
ls_fieldcat2-just = 'C'.
ls_fieldcat2-do_sum = 'X'.
APPEND ls_fieldcat2 TO gt_fieldcat2.
endloop.
My source code call the ALV FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZMPMR001_Q1OOT'
i_callback_pf_status_set = 'PF_STATUS_SET'
is_layout = ls_layout
it_fieldcat = gt_fieldcat2[]
is_print = ls_print
TABLES
t_outtab = <l_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.
Thanks a lot in advance for your attention.my situation is like this, declare the internal tble
1) data : begin of itab occurs 0,
code like qpcd-code,
desc like QPCT-KURZTEXT,
end of itab.
2) populate the itab like this
code desc
01 desc 1
02 desc 2
03 desc 3
3) take the selected record converted it into new dynamic internal table using field symbol declare as table, now the component of this new table are 01, 02 and 03.
4) populate the new table with some data, so technically my new table structure will be like this
01 02 03
1 0 1
0 0 3
2 2 2
5) display the new table in ALV report, in ALV I tried to sum-up each of column.
6) Question : HOW can I convert the componet 01, 02 and 03 as an integer/numeric field.
Regards
Nislina -
How to display the fields in ALV Output without using Field catalog?
How to display the fields in ALV Output without using Field catalog?
Could you pls tell me the coding?
Akshitha.Hi,
u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
data: itab type table of mara.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = itab
CHANGING
ct_fieldcat = lt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
*Pass that field catalog into the fillowing FM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_grid_title = 'REPORTING'
is_layout = gt_layout
it_fieldcat = lt_fieldcat[]
tables
t_outtab = itab. -
Radio button in ALV without using field catalog
Hi All,
My requirement is i want to create a RFC function module to display the header table.
while executing the function module the output is of alv grid format.
i have used the structure for this.
i didnt create a layout and fieldcatalog.
now i need to add a radio button in that alv grid display.
how to create the radio button without using field catalog.
Thank in Advance.Hi Aishwarya,
You need to use the field catalog for displaying a field as a radio button in ALV grid.
Please refer to this link for doing so. [Radio buttons in ALV Grid|http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT]
You can use LVC_FIELDCATALOG_MERGE wherein you can use your structure and the Icon for Radiobutton.
Refer to this link -[Radiobuttons in ALV Grid 2|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02535ce-9eaf-2910-ae8c-f2f2afc1c8e7?quicklink=index&overridelayout=true]
Best Regards,
Sharmila
Edited by: Sharmila Subramanian on Mar 18, 2011 12:34 PM -
Convert Normal Report of Write statements to alv list display by usg at new
Hi Experts,
I have one Report in which Data is fetched and displayed using WRITE Stmts now
i want to modify this Report to alv_list_display but prob is with at new command..Suppose when ever new customer is triggered it have to display the data of that particular customer in new page.....
And also format of output in old resport is little bit tricky i want to knw can we format the same output using alv_list_display.
At Header Level data is dispalyed in 4 parts column wise and under those 4colums
Items have been displayed. but i have 20 fields which are to b displayed same as old one. under those 4 colums when i use alv_list_display.
Naveen Kumarhi,
try this code
this program is first of all header level data will be printed
when you click on any header level it show all the items under that head
Data Extract from Tables ZFII_COST, BSIS.
Program Name :ZFII_COSTING_REPORT_DISPLAY
Object ID :E7
Functional Analyst :VENKAT
Programmer :venkatesh
Start date :07/05/2007
Initial CTS :HFDK901345
Description :
Includes :n/a
Function Modules :REUSE_ALV_GRID_DISPLAY , *
CONVERSION_EXIT_ALPHA_INPUT
FTI_FISCAL_YEAR_MONTH_GET
Logical database :n/a
Transaction Code :n/a
External references :n/a
Modification Log
Date | Modified by | CTS number | Comments
07/05/2007 | venkaetsh | HFDK901345 | Initial version
REPORT ZFII_COSTING_REPORT_DISPLAY NO STANDARD PAGE HEADING
MESSAGE-ID ZFI.
TYPE-POOLS: FTIS.
FOR THE ALV DISPLAY.
TYPE-POOLS: SLIS.
DATA:
G_REPID LIKE SY-REPID,
GWA_SORT TYPE SLIS_SORTINFO_ALV,
GIT_SORT TYPE SLIS_T_SORTINFO_ALV,
GIT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GIT_EVENTS TYPE SLIS_T_EVENT,
GFL_LAYOUT TYPE SLIS_LAYOUT_ALV,
GIT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV ,
GWA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
GIT_XS_EVENT TYPE SLIS_ALV_EVENT,
G_POS TYPE I VALUE 1.
DATA:
G_REPID LIKE SY-REPID,
GWA_SORT TYPE SLIS_SORTINFO_ALV,
GIT_SORT TYPE SLIS_T_SORTINFO_ALV,
GIT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GIT_EVENTS TYPE SLIS_T_EVENT,
GFL_ITEMSLAYOUT TYPE SLIS_LAYOUT_ALV,
GIT_ITEMSFIELDCAT TYPE SLIS_T_FIELDCAT_ALV ,
GWA_ITEMSFIELDCAT TYPE SLIS_FIELDCAT_ALV,
GIT_XS_EVENT TYPE SLIS_ALV_EVENT,
G_ITEMSPOS TYPE I VALUE 1.
DECLARING THE VARIABLES.
DATA:
G_BUKRS TYPE T001-BUKRS.
TABLE FOR THE INITIAL FETCHING
TYPES: BEGIN OF T_COST.
INCLUDE STRUCTURE ZFII_COST.
TYPES: CNSTDGLACC TYPE ZFII_COSTING-CNSTDGLACC.
TYPES: END OF T_COST.
TYPES: T_IT_COST TYPE STANDARD TABLE OF T_COST.
DATA: GIT_COST TYPE T_IT_COST.
DATA: GWA_COST TYPE T_COST.
TYPES: BEGIN OF T_CONSOL.
INCLUDE STRUCTURE ZFII_COSTING.
TYPES: END OF T_CONSOL.
TYPES: T_IT_CONSOL TYPE STANDARD TABLE OF T_CONSOL.
DATA: GWA_CONSOL TYPE T_CONSOL.
DATA: GIT_CONSOL TYPE T_IT_CONSOL.
*TYPES: BEGIN OF T_SENDDATA.
INCLUDE STRUCTURE ZFII_COSTINGDETAILS.
*TYPES: END OF T_SENDDATA.
*TYPES: T_IT_SENDDATA TYPE STANDARD TABLE OF T_SENDDATA.
*DATA: GIT_SENDDATA TYPE T_IT_SENDDATA.
*DATA: GWA_SENDDATA TYPE T_SENDDATA.
TYPES: BEGIN OF T_BSIS,
HKONT TYPE BSIS-HKONT,
SHKZG TYPE BSIS-SHKZG,
DMBTR TYPE BSIS-DMBTR,
KOSTL TYPE BSIS-KOSTL,
END OF T_BSIS.
TYPES: T_IT_BSIS TYPE STANDARD TABLE OF T_BSIS.
DATA: GIT_BSIS TYPE T_IT_BSIS.
DATA: GWA_BSIS TYPE T_BSIS.
DATA: GIT_TOTALBSIS TYPE T_IT_BSIS.
DATA: GWA_TOTALBSIS TYPE T_BSIS.
DATA: G_FTIS_DATUM TYPE FTIS_DATUM.
DATA: G_FTIS_GJAHR TYPE FTIS_GJAHR.
DATA: G_FTIS_MONAT TYPE FTIS_MONAT.
ranges
RANGES: R_HKONT FOR BSIS-HKONT.
data: g_KOSTL type BSIS-KOSTL.
DESIGNING OF THE SELECTION SCREEN STARTS.
DATA: G_YEARMONTH TYPE ZFII_COST-YEARMONTH.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME. " TITLE TEXT-001.
PARAMETERS: P_COCODE TYPE T001-BUKRS DEFAULT 'H901'.
SELECT-OPTIONS: S_MONYR FOR G_YEARMONTH OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
DESIGN OF THE SELECTION SCREEN ENDS.
INITIALIZATION.
clearing and refreshing all the variables
and the tables used in the programme.
INITIALIZATION.
PERFORM CLEAR_REFRESH.
AT SELECTION-SCREEN.
event to validate the values entered
and fetching the data
if no data found error message will be shown
AT SELECTION-SCREEN.
PERFORM VALIDATE_VALUES.
*start of selection.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM CHANGE_DATA.
PERFORM DISPLAY_ALV.
*& Form CLEAR_REFRESH
text
--> p1 text
<-- p2 text
FORM CLEAR_REFRESH .
CLEAR: G_REPID.
G_REPID = SY-REPID.
CLEAR:
GWA_COST, G_POS,
G_BUKRS, GWA_TOTALBSIS,
R_HKONT, G_FTIS_DATUM.
REFRESH:
GIT_BSIS, GIT_COST.
ENDFORM. " CLEAR_REFRESH
*& Form VALIDATE_VALUES
text
--> p1 text
<-- p2 text
FORM VALIDATE_VALUES .
SELECT SINGLE
BUKRS FROM
T001 INTO G_BUKRS
WHERE BUKRS = P_COCODE.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-000.
ENDIF.
ENDFORM. " VALIDATE_VALUES
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA .
SELECT
MANDT
COMPCODE
YEARMONTH
DEPARTMENT
CNSTDGLACC
GLCODEFROM
GLCODETO
AMOUNT
FLAG
TYPE
FROM ZFII_COST
INTO TABLE GIT_COST
WHERE COMPCODE = P_COCODE
and YEARMONTH in S_MONYR.
IF SY-SUBRC NE 0.
MESSAGE I000 WITH TEXT-001.
STOP.
ELSE.
SELECT
MANDT
CNSTDGLACC
GLCODEFROM
GLCODETO
FLAG
FROM ZFII_COSTING
INTO TABLE GIT_CONSOL.
IF SY-SUBRC NE 0.
MESSAGE I000 WITH TEXT-003.
STOP.
ENDIF.
ENDIF.
ENDFORM. " GET_DATA
*& Form Change_data
text
--> p1 text
<-- p2 text
FORM CHANGE_DATA .
IF GIT_CONSOL IS NOT INITIAL.
IF GIT_COST IS NOT INITIAL.
sort GIT_CONSOL.
LOOP AT GIT_COST INTO GWA_COST.
READ TABLE GIT_CONSOL INTO GWA_CONSOL
WITH KEY GLCODEFROM = GWA_COST-GLCODEFROM
GLCODETO = GWA_COST-GLCODETO
BINARY SEARCH.
IF SY-SUBRC EQ 0.
GWA_COST-CNSTDGLACC = GWA_CONSOL-CNSTDGLACC.
MODIFY GIT_COST FROM GWA_COST.
ENDIF.
CLEAR: GWA_CONSOL, GWA_COST.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " Change_data
*& Form DISPLAY_ALV
text
--> p1 text
<-- p2 text
FORM DISPLAY_ALV .
GFL_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
GFL_LAYOUT-ZEBRA = 'X'.
PERFORM FILL_FIELDCAT.
PERFORM SORT_FIELDS.
PERFORM CALL_GRID.
ENDFORM. " DISPLAY_ALV
*& Form FILL_FIELDCAT
text
--> p1 text
<-- p2 text
FORM FILL_FIELDCAT .
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'COMPCODE' " InTab Field Name
'GIT_COST' " InTab Name
'5' " Output Length
'Company code' " Column Name Text
' ' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'YEARMONTH' " InTab Field Name
'GIT_COST' " InTab Name
'8' " Output Length
'Year & Month' " Column Name Text
' ' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'CNSTDGLACC' " InTab Field Name
'GIT_COST' " InTab Name
'8' " Output Length
'G/L Account code' " Column Name Text
' ' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'CNSTDGLACC' " InTab Field Name
'GIT_COST' " InTab Name
'8' " Output Length
'Cnsl GL' " Column Name Text
' ' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'DEPARTMENT' " InTab Field Name
'GIT_COST' " InTab Name
'4' " Output Length
'Department' " Column Name Text
' ' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'GLCODEFROM' " InTab Field Name
'GIT_COST' " InTab Name
'8' " Output Length
'From GL' " Column Name Text
'' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'GLCODETO' " InTab Field Name
'GIT_COST' " InTab Name
'8' " Output Length
'To GL' " Column Name Text
'' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'FLAG' " InTab Field Name
'GIT_COST' " InTab Name
'2' " Output Length
'Flag' " Column Name Text
'' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'TYPE' " InTab Field Name
'GIT_COST' " InTab Name
'2' " Output Length
'Type' " Column Name Text
'' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_POS = G_POS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[] " Field Catalog
G_POS " Column Position
'AMOUNT' " InTab Field Name
'GIT_COST' " InTab Name
'18' " Output Length
'Amount' " Column Name Text
'CURR' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
'X' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
ENDFORM. " FILL_FIELDCAT
*& Form init_field_catalog
text
-->P_GIT_FIELDCAT text
-->PV_POS text
-->PV_FIELDNAME text
-->PV_TABNAME text
-->PV_OUTPUT text
-->PV_SELTEXT text
-->PV_DATATYPE text
-->PV_KEY text
-->PV_ROW text
-->PV_HOTSPOT text
-->PV_EMPHASIZE text
-->PV_SUM text
-->PV_CHECKBOX text
-->PV_INPUT text
FORM INIT_FIELD_CATALOG USING P_GIT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV
PV_POS LIKE GWA_FIELDCAT-COL_POS
PV_FIELDNAME LIKE GWA_FIELDCAT-FIELDNAME
PV_TABNAME LIKE GWA_FIELDCAT-TABNAME
PV_OUTPUT LIKE GWA_FIELDCAT-OUTPUTLEN
PV_SELTEXT LIKE GWA_FIELDCAT-SELTEXT_M
PV_DATATYPE LIKE GWA_FIELDCAT-DATATYPE
PV_KEY LIKE GWA_FIELDCAT-KEY
PV_ROW LIKE GWA_FIELDCAT-ROW_POS
PV_HOTSPOT LIKE GWA_FIELDCAT-HOTSPOT
PV_EMPHASIZE LIKE GWA_FIELDCAT-EMPHASIZE
PV_SUM LIKE GWA_FIELDCAT-DO_SUM
PV_CHECKBOX LIKE GWA_FIELDCAT-CHECKBOX
PV_EDIT LIKE GWA_FIELDCAT-EDIT
PV_INPUT LIKE GWA_FIELDCAT-INPUT.
DATA: LT_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
LT_FIELDCAT-OUTPUTLEN = PV_OUTPUT.
LT_FIELDCAT-COL_POS = PV_POS.
LT_FIELDCAT-FIELDNAME = PV_FIELDNAME.
LT_FIELDCAT-TABNAME = PV_TABNAME.
LT_FIELDCAT-SELTEXT_L = PV_SELTEXT.
LT_FIELDCAT-KEY = PV_KEY.
LT_FIELDCAT-ROW_POS = PV_ROW.
LT_FIELDCAT-HOTSPOT = PV_HOTSPOT.
LT_FIELDCAT-EMPHASIZE = PV_EMPHASIZE.
LT_FIELDCAT-DO_SUM = PV_SUM.
LT_FIELDCAT-CHECKBOX = PV_CHECKBOX.
LT_FIELDCAT-INPUT = PV_INPUT.
LT_FIELDCAT-EDIT = PV_EDIT.
LT_FIELDCAT-DATATYPE = PV_DATATYPE.
APPEND LT_FIELDCAT TO P_GIT_FIELDCAT.
CLEAR LT_FIELDCAT.
ENDFORM. " init_field_catalog
*& Form SORT_FIELDS
text
--> p1 text
<-- p2 text
FORM SORT_FIELDS .
GWA_SORT-SPOS = 1. " Sort order
GWA_SORT-FIELDNAME = 'COMPCODE'.
GWA_SORT-TABNAME = 'GIT_COST'.
GWA_SORT-UP = 'X'.
x_sort-subtot = 'X'. " Sub total allowed
APPEND GWA_SORT TO GIT_SORT.
CLEAR GWA_SORT.
GWA_SORT-SPOS = 2. " Sort order
GWA_SORT-FIELDNAME = 'YEARMONTH'.
GWA_SORT-TABNAME = 'GIT_COST'.
GWA_SORT-UP = 'X'.
x_sort-subtot = 'X'. " Sub total allowed
APPEND GWA_SORT TO GIT_SORT.
CLEAR GWA_SORT.
GWA_SORT-SPOS = 3. " Sort order
GWA_SORT-FIELDNAME = 'CNSTDGLACC'.
GWA_SORT-TABNAME = 'GIT_COST'.
GWA_SORT-UP = 'X'.
x_sort-subtot = 'X'. " Sub total allowed
APPEND GWA_SORT TO GIT_SORT.
CLEAR GWA_SORT.
GWA_SORT-SPOS = 4. " Sort order
GWA_SORT-FIELDNAME = 'DEPARTMENT'.
GWA_SORT-TABNAME = 'GIT_COST'.
GWA_SORT-UP = 'X'.
x_sort-subtot = 'X'. " Sub total allowed
APPEND GWA_SORT TO GIT_SORT.
CLEAR GWA_SORT.
ENDFORM. " SORT_FIELDS
*& Form CALL_GRID
text
--> p1 text
<-- p2 text
FORM CALL_GRID .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = '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 =
I_GRID_SETTINGS =
IS_LAYOUT = GFL_LAYOUT
IT_FIELDCAT = GIT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GIT_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
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 = GIT_COST
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. " CALL_GRID
*& Form SET_PF_STATUS
text
-->EXTAB text
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB. "#EC CALLED
SET PF-STATUS 'ZFII_PF_STATUS'. " OF PROGRAM 'SAPLKKBL'.
ENDFORM. "set_pf_status
*& Form USER_COMMAND
Called from within the ALV processes.
PV_UCOMM contains the sy-ucomm from ALV
SELFIELD is a structure that contains all the data required to
process a user selection. The following is an example
of the SELFIELD structure and sample values:
TRIGGERS WHEN THE USER CLICK THE
FORM USER_COMMAND USING PV_UCOMM LIKE SY-UCOMM "#EC NEEDED
SELFIELD TYPE SLIS_SELFIELD. "#EC NEEDED
CASE PV_UCOMM.
WHEN '&IC1'.
when the user double clicks on any record this will show the
READ TABLE GIT_COST INTO GWA_COST INDEX SELFIELD-TABINDEX.
entire list of g/l accounts for which we calculated the sum.
IF SY-SUBRC EQ 0.
CLEAR: g_KOSTL.
g_KOSTL = GWA_COST-DEPARTMENT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = GWA_COST-DEPARTMENT
IMPORTING
OUTPUT = g_KOSTL.
CLEAR: R_HKONT.
REFRESH: R_HKONT.
R_HKONT-SIGN = 'I'.
R_HKONT-OPTION = 'BT'.
R_HKONT-LOW = GWA_COST-GLCODEFROM.
R_HKONT-HIGH = GWA_COST-GLCODETO.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = R_HKONT-LOW
IMPORTING
OUTPUT = R_HKONT-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = R_HKONT-HIGH
IMPORTING
OUTPUT = R_HKONT-HIGH.
append r_hkont.
PERFORM DISPLAY_DETAILS.
ENDIF.
when OTHERS.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form display_details
text
--> p1 text
<-- p2 text
FORM DISPLAY_DETAILS .
PERFORM GET_VALUES_BSIS.
PERFORM FILL_FIELDCAT_ITEMS.
PERFORM DISPALY_ITEMS.
ENDFORM. " display_details
*& Form FILL_FIELDCAT_items
text
--> p1 text
<-- p2 text
FORM FILL_FIELDCAT_ITEMS .
CLEAR: GIT_ITEMSFIELDCAT. ", GWA_ITEMSFIELDCAT.
REFRESH: GIT_ITEMSFIELDCAT.
GFL_ITEMSLAYOUT-COLWIDTH_OPTIMIZE = 'X'.
GFL_ITEMSLAYOUT-ZEBRA = 'X'.
CLEAR: G_ITEMSPOS.
G_ITEMSPOS = G_ITEMSPOS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_ITEMSFIELDCAT[] " Field Catalog
G_ITEMSPOS " Column Position
'HKONT' " InTab Field Name
'GIT_TOTALBSIS' " InTab Name
'10' " Output Length
'G/L Account' " Column Name Text
' ' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_ITEMSPOS = G_ITEMSPOS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_ITEMSFIELDCAT[] " Field Catalog
G_ITEMSPOS " Column Position
'KOSTL' " InTab Field Name
'GIT_TOTALBSIS' " InTab Name
'10' " Output Length
'Cost Center' " Column Name Text
' ' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
' ' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
G_ITEMSPOS = G_ITEMSPOS + 1.
PERFORM INIT_FIELD_CATALOG USING GIT_ITEMSFIELDCAT[] " Field Catalog
G_ITEMSPOS " Column Position
'DMBTR' " InTab Field Name
'GIT_TOTALBSIS' " InTab Name
'18' " Output Length
'Amount' " Column Name Text
'CURR' " Datatype
' ' " Key?
' ' " Row Position
' ' " Hotspot
' ' " Emphasize
'X' " Do_sum field?
' ' " checkbox
' ' " EDIT
' '. " input
ENDFORM. " FILL_FIELDCAT_items
*& Form get_values_bsis
text
--> p1 text
<-- p2 text
FORM GET_VALUES_BSIS .
clear: " G_FTIS_DATUM,
G_FTIS_GJAHR, G_FTIS_MONAT.
G_FTIS_DATUM+0(6) = gwa_cost-YEARMONTH.
G_FTIS_DATUM+6(2) = '01'.
CALL FUNCTION 'FTI_FISCAL_YEAR_MONTH_GET'
EXPORTING
I_BUKRS = 'H901'
I_BUDAT = G_FTIS_DATUM
I_DZTERM = FTIS_DATUM-INITIAL
I_GJAHR = FTIS_GJAHR-INITIAL
IMPORTING
E_GJAHR = G_FTIS_GJAHR
E_MONAT = G_FTIS_MONAT.
IF NOT GIT_COST IS INITIAL.
CLEAR: GWA_BSIS, GWA_TOTALBSIS.
REFRESH: GIT_BSIS, GIT_TOTALBSIS.
SELECT
HKONT
SHKZG
DMBTR
KOSTL
FROM BSIS
INTO TABLE GIT_BSIS
WHERE BUKRS = P_COCODE
AND HKONT in R_HKONT
AND GJAHR = G_FTIS_GJAHR
AND MONAT = G_FTIS_MONAT
AND KOSTL eq g_KOSTL.
IF SY-SUBRC EQ 0.
LOOP AT GIT_BSIS INTO GWA_BSIS.
SHIFT GWA_BSIS-HKONT LEFT DELETING LEADING '0'.
GWA_TOTALBSIS-HKONT = GWA_BSIS-HKONT.
GWA_TOTALBSIS-KOSTL = GWA_BSIS-KOSTL.
IF GWA_BSIS-SHKZG = 'H'.
GWA_TOTALBSIS-DMBTR = GWA_BSIS-DMBTR * -1.
ELSE.
GWA_TOTALBSIS-DMBTR = GWA_BSIS-DMBTR.
ENDIF.
APPEND GWA_TOTALBSIS TO GIT_TOTALBSIS.
CLEAR: GWA_TOTALBSIS, GWA_BSIS.
ENDLOOP.
SORT GIT_TOTALBSIS ASCENDING BY HKONT KOSTL.
ENDIF.
ENDIF.
ENDFORM. " get_values_bsis
&---- -
Hello,
I have a requirement where I am displaying the ALV using grid.
Have a button on top.
After ALV display, I select the row and press the button.
The processing takes place like (Delivery creation).
After this delivery creation, I have to display the log output.
But the log has to be using the normal Write Statement.
Like : Write: 'Delivery created : 1001;.
I am trying this but my write is not working.
The code isgetting executed when seen in debug but nothing displayed on screen.
Any idea??
PranuHi,
add the below command in the ALV exporting..
... user_command = 'USER_COMMAND'..
and paste the code at the last ..
FORM user_command USING r_ucomm TYPE sy-ucomm
ls_selfield TYPE slis_selfield.
IF sy-ucomm = 'YOur button'.
LEAVE TO SCREEN 0.
endif.
ENDFORM. "USER_COMMAND
Regards,
Prabhudas -
Write statement after alv display
Hi Experts,
My requirement is that i am displaying an output of ALV List display, in the List display i have a button which undergoes updation of records in Ztable.After pressing the button now i have to display Total no of records in write statement in which i should not have ALV display(i need 2 screens ).
Regards,
Vikram Sukumar<li>I don't know how you are doing but I am able to display. try this sample program for double click event.
REPORT ztest_notepad.
DATA: BEGIN OF it_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
adrnr TYPE t001-adrnr,
END OF it_t001.
TYPE-POOLS:slis.
DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat.
DEFINE fieldcat.
wa_fieldcat-fieldname = &1.
wa_fieldcat-tabname = &2.
wa_fieldcat-seltext_m = &3.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
END-OF-DEFINITION.
START-OF-SELECTION.
SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001 UP TO 10 ROWS.
fieldcat: 'BUKRS' 'IT_T001' 'BUKRS',
'BUTXT' 'IT_T001' 'BUTXT',
'ADRNR' 'IT_T001' 'ADRNR'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_t001.
*& Form USER_COMMAND
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
IF r_ucomm = '&IC1'.
WRITE 'Venkat'.
ENDIF.
ENDFORM. "USER_COMMAND
Thanks
Venkat.O -
Subtotals in ALV report for ALPHA-NUMERIC field
Hi Experts,
I have problem while subtotalling values in ALV report.
I have 8 fields in my fieldcatalog. Now, I have to do the subtotal based on 3rd field having name 'ABC'. This field is having type CHAR & having lenght 3.
Now I wanted to do subtotalling for field 7 & 8 as 'NETWR' & 'MENGE' based on 3rd field.
How we can do the subtotal?Hi,
Refer this code
*& Form sub_display_data
text
FORM sub_display_data .
*--To sort the output through material number
DATA : lwa_sort TYPE slis_sortinfo_alv.
DATA : lit_sort TYPE slis_t_sortinfo_alv.
*--Pass the values to the table
lwa_sort-fieldname = 'PERNR'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '1'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = 'X'. "Subtotal
APPEND lwa_sort TO lit_sort.
*--Pass the values to the table
lwa_sort-fieldname = 'WORKDATE'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '2'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = ' '. "Subtotal
APPEND lwa_sort TO lit_sort.
*--Pass the values to the table
lwa_sort-fieldname = 'WEKLY'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '3'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = ' '. "Subtotal
APPEND lwa_sort TO lit_sort.
wa_layout-colwidth_optimize = 'X'.
IF NOT it_final2[] IS INITIAL.
*--Call the function module to display the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = wa_layout
i_callback_program = v_repid
it_fieldcat = it_fieldcat1[]
i_default = c_chk
i_save = c_save
it_sort = lit_sort
TABLES
t_outtab = it_final2
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.
ELSE.
*--Message No data found
MESSAGE i888 WITH text-017.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " sub_display_data
Regards,
Prashant -
Doubt in using field catalog merge function
hi all,
When I am using the function maodule reuse_alv_fieldcatalog_merge for building the field catalog in alv list,it was giving abend message as
'Field catalog is empty'.
what might be the reason for such message?can some one help me out with the solution to get rid of that.
I cant populate the catalog manually because I need to display nearly 40 fields in the output.
Thanks in advance.hI
Supports the creation of the field catalog for the ALV function modules
based either on a structure or table defined in the ABAP Data
Dictionary, or a program-internal table.
The program-internal table must either be in a TOP Include or its
Include must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for
rapid prototyping since the following restrictions apply:
o Performance is affected since the code of the table definition must
always be read and interpreted at runtime.
o Dictionary references are only considered if the keywords LIKE or
INCLUDE STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields
are output in the list by default whereas the remaining fields are only
available in the field selection.
If the field catalog is passed with values, they are merged with the
'automatically' found information.
Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
display it using the basic ALV grid functionality(including column total). The example details the main
sections of coding required to implement the ALV grid functionality:
Data declaration
Data retrieval
Build fieldcatalog
Build layout setup
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
* gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
* i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
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
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL -
Problem in Submit Statement of Alv Report
Hi All Experts,
i make one report,my requirement is when i execute my report then it displays 100 records, i select 20 records from 100 records
then based upon 20 records execute the another report with out slection screen. i know the process through the submit statement,but it doesn't give exact output 20 of 20 based upon selected entries.
my Code is:SUBMIT ZPS_PROJ_CN41N USING SELECTION-SCREEN '1000' WITH SELECTION-TABLE RSPAR_TAB
AND RETURN.
give suggistions and correct syntax of submit statement.
Thanks.Hi,
= 'EQ ' for parameters
In for range or selct-options
SUBMIT <Report name>
WITH r_budat IN s_budat " Selection screen parameters
WITH kostl IN s_kostl
WITH kstar IN s_kstar
AND RETURN.
"With Variant
SUBMIT <Report Name>
USING SELECTION-SET 'BPC TEST' "BPC set is Varaint name for report
EXPORTING LIST TO MEMORY AND RETURN.
"capturing the output to another report
SUBMIT <Report name>
WITH r_budat IN s_budat " Selection screen parameters
WITH kostl IN s_kostl
WITH kstar IN s_kstar
EXPORTING LIST TO MEMORY AND RETURN.
Prabhudas -
Has any one developed state wise VAT report(Tamil nadu) using XLreporter
In the XL reporter we have the statuary reports. In that we have the VAT report. The template of that report is in the format of the central government of India. But the format of state government report for tamil nadu varies from that of the central government one at a large extent.
Has any one developed the VAT report for the state government?
If so, please help me in this matter.....
please give me suggestions. what can we do in this issue?
please help me......VAT Reports are generated only through XL Reporter. You can edit the report to the appropriate format.
Open the Report Organiser -> Select Report and Right Click and Select 'Edit' this opens the report defonition in Excel. Do the required modifications and save it. -
ALV int report using field catalog merge
Hi folks,
Can anyone here please provide me an alv interactive report?
K.Kiran.report zialv_edit_simple1 .
include <icon>.
Definition of Grid event-handler class
class lcl_grid_event_receiver definition.
public section.
methods:
toolbar for event toolbar
of cl_gui_alv_grid
importing e_object
e_interactive
,user_command for event user_command
of cl_gui_alv_grid
importing e_ucomm
. " Period
endclass.
*mplementation of Grid event-handler class
class lcl_grid_event_receiver implementation.
Method for handling all creation/modification calls to the toolbar
method toolbar.
data : ls_toolbar type stb_button.
Define Custom Button in the toolbar
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'EDIT' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move 'EDIT' to ls_toolbar-text.
move icon_change_text to ls_toolbar-icon.
move 'Click2Edit' to ls_toolbar-quickinfo.
append ls_toolbar to e_object->mt_toolbar.
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'UPDA' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move 'UPDATE' to ls_toolbar-text.
move icon_system_save to ls_toolbar-icon.
move 'Click2Update' to ls_toolbar-quickinfo.
append ls_toolbar to e_object->mt_toolbar.
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'EXIT' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move 'EXIT' to ls_toolbar-text.
move icon_system_end to ls_toolbar-icon.
move 'Click2Exit' to ls_toolbar-quickinfo.
append ls_toolbar to e_object->mt_toolbar.
endmethod.
Method to handle user commands from toolbar
method user_command.
case e_ucomm .
when 'EDIT'.
perform set_input.
when 'UPDA'.
perform refresh_disp.
perform update_table.
when 'EXIT'.
leave program.
endcase.
endmethod.
endclass.
Declarations
parameters:
p_intab type dfies-tabname default 'SAPLANE'.
data :
dref type ref to data,
it_grid_fcat type lvc_t_fcat,
struct_grid_lset type lvc_s_layo,
tab_info like table of dfies.
field-symbols :
<fs_tab> like line of tab_info,
Output Structure****
<it_disptab> type table.
data :
ok_code like sy-ucomm
,save_ok like sy-ucomm
Container Object [grid_container]
,grid_container type ref to cl_gui_custom_container
Control Object [grid]
,grid type ref to cl_gui_alv_grid
Event-Handler Object [grid_handler]
,grid_handler type ref to lcl_grid_event_receiver
. " period
Begin of process logic
start-of-selection.
call screen '0100'.
*& Module STATUS_0100 OUTPUT
PBO module ...Displays the Grid
module status_0100 output.
A L V G R I D
if grid_container is initial.
create object grid_container
exporting
container_name = 'CCONTAINER1'.
create object grid
exporting
i_appl_events = 'X'
i_parent = grid_container.
create object grid_handler.
set handler:
grid_handler->user_command for grid,
grid_handler->toolbar for grid .
*Assigning the input value to <fs_tab>-tabname
assign p_intab to <fs_tab>-tabname .
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = <fs_tab>-tabname
changing
ct_fieldcat = it_grid_fcat.
*Creating internal table
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_grid_fcat
importing
ep_table = dref.
assign dref->* to <it_disptab>.
perform populate_grid_data .
call method grid->set_ready_for_input
exporting
i_ready_for_input = 0.
*Enabling the grid to edit mode,
*setting table name as title of the grid
struct_grid_lset-edit = 'X'. "To enable editing in ALV
struct_grid_lset-grid_title = p_intab.
call method grid->set_table_for_first_display
exporting
is_layout = struct_grid_lset
changing
it_outtab = <it_disptab>
it_fieldcatalog = it_grid_fcat
. " Period
endif.
endmodule.
*& Module USER_COMMAND_0100 INPUT
module user_command_0100 input.
****User Commands are handled as events in method user_command.
endmodule. " USER_COMMAND_0100 INPUT
*& Form EXIT_PROGRAM
form exit_program.
call method grid_container->free.
call method cl_gui_cfw=>flush.
leave program.
endform. " EXIT_PROGRAM
*& Form populate_grid_data
form populate_grid_data.
select * from (p_intab) into corresponding fields of table <it_disptab>.
endform. " populate_grid_data
FORM refresh_disp *
form refresh_disp.
call method grid->refresh_table_display.
endform.
FORM update_table *
form update_table.
modify (p_intab) from table <it_disptab>.
call method grid->set_ready_for_input
exporting
i_ready_for_input = 0.
endform.
FORM set_input *
form set_input.
call method grid->set_ready_for_input
exporting
i_ready_for_input = 1.
endform.
Screen Logic :
process before output.
module status_0100.
process after input.
module user_command_0100. -
Running the ALV report in Background using layout variant
Hello Everyone,
I am facing a problem in downloading a text file to the Application server.
My requirement is, when the user downloads a file with the layout variant, the file should have only the columns which was selected in the variant.
Can anybody give me a optimized solution for this issue.
Regards,
VasanthHi,
How are you downloading the file to the app server, using which internal table? How are you building that internal table?
What you need to do is to build a internal table dynamically with only those columns that are a part of the layout variant. Then move the data from the original internal table into this and then download the dynamica internal table to the app server.
Regards,
Ravi
Note : Please mark the helpful answers -
In ALV report list edit a field and insert our own text
Hi
In a report when I am in third list using ALV a field which is disabled should be enabled and have to insert the new value in it and save.
please tell me how to do it using classes and methods and also using ALV's.
Promise to reward points.
Regards
MacSee these threads
Re: Making selected alv rows editable
Re: selective edit in ALV grid
Regards,
Ravi
Maybe you are looking for
-
Moving iTunes library to external hard drive
I would like to free up some space on my internal hard drive and move my iTunes music, movies and videos to an external hard drive. Can this be done and iTunes still access the files to play or sync them to my iPad when needed? If so, what do I need
-
How can I execute a statement before a VO is running
JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660 I use ADF BC how can I execute a statement before a VO is running
-
Tutorial: The Players demo – Flex, PostgreSQL, PHP/AMF working together
Digital Showcase LLC has developed this Tutorial and Demo on database entry and update taking advantage of the extended graphics that Flex/Flash offers, to produce a rich, compelling user interface for presenting Database usage, leveraging PHP and A
-
I am using Premiere CS4 to edit footage shot on my Sony HXR-NX5U, which shoots AVCHD files on a memory card. The maximum file size on the memory card is 2GB, so the camera automatically starts another file once it reaches the 2GB limit. When I drag
-
Sync your IPhone to two computers.
Hello, I just got my Iphone and have synced it to my home computer and even downloaded some music to my phone. During the Week I work away from my home and use a laptop. When I synced my phone to the laptop it and go to music it says it will erase my