On ALV report in1 column I want to put Icon on every row of that column.
On ALV report there is 1 column I want to put Icon on every row of that column.That ALV program uses object oriented concept all class and methods.
I want to use that icon on that row. That icon name is ICON_OKAY
In my program when I assign values to internal table at that time I am assigning that ICON_OKAY value to that row as follow.
Itab-
Itab-icon = ICON_OKAY.
Append itab.
please follow below procedure to display icon in ALV
1) In corresponding fieldcatelog entry do
fieldcatalog-icon = 'X'
2) While filling the internal table fill the corresponding key value of icon , for example ICON_OKAY value is '@0V@' so statement would be
Itab-icon = '@0V@'
to get list of corresponding key for icon open include <ICON> in se38
Similar Messages
-
ALV Report - displaying column name in two fields.
Dear All,
I am working on ALV report , report is ready but now i have to format it according to client requirment, in which have to show column name in two row like.
supppose there is field by name
"Date of receipt of processed Goods"
can i display it like
"Date of receipt of
processed Goods "
Assured points for suitable answer.
Looking foward to your response.
Best Regards,
Gulrez AlamHi Ellery,
As Philipp said, there is no need for populating the field using PL/SQL. You would just need to go to the Paper Layout in the Reports Editor, click on "Text" in the Drawing toolbar, drag it to the appropriate place in your layout to create the field, and write what you want in that field. Below that, you can create the field(s) which will display the actual totals. I'm assuming that creating the totals field is not a problem.
Navneet. -
In my ALV report I am displaying SO & DN as separate columns. I want to give them each a different color.
In my BUILF_FIELDCATALOG, I tried the following but that gives them the same color i.e. blue. I would like to give them different colors. Also it puts them side by side even though when I comment the code out for the delivery, it goes back to the correct column.
WHEN 'VBELN_VA'.
wa_fieldcatalog-seltext_l = 'Order No.'.
wa_fieldcatalog-reptext_ddic = 'Order No.'.
wa_fieldcatalog-emphasize = 'X'.
wa_fieldcatalog-key = 'X'.
MOVE: wa_fieldcatalog-seltext_l TO wa_fieldcatalog-seltext_m,
wa_fieldcatalog-seltext_l TO wa_fieldcatalog-seltext_s.
ADD 1 TO wa_fieldcatalog-col_pos.
WHEN 'VBELN_VL'.
wa_fieldcatalog-seltext_l = 'Delivery'.
wa_fieldcatalog-reptext_ddic = 'Delivery'.
* wa_fieldcatalog-emphasize = 'X'.
* wa_fieldcatalog-key = 'X'.
MOVE: wa_fieldcatalog-seltext_l TO wa_fieldcatalog-seltext_m,
wa_fieldcatalog-seltext_l TO wa_fieldcatalog-seltext_s.
ADD 1 TO wa_fieldcatalog-col_pos.Use the following Form to color the cells after building the field catalog ....
[code]
*& Form SET_CELL_COLORS
text
FORM SET_CELL_COLORS.
LOOP AT ITAB.
L_INDEX = SY-TABIX.
IF ITAB-VGBEL = 'DELETED'.
LS_CELLCOLOR-FNAME = 'VGBEL'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '1'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
ENDIF.
IF ITAB-FACT = 'XXXXXX'.
LS_CELLCOLOR-FNAME = 'FACT'.
LS_CELLCOLOR-COLOR-COL = '3'.
LS_CELLCOLOR-COLOR-INT = '1'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
ENDIF.
LS_CELLCOLOR-FNAME = 'CL_QUANT'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
ENDLOOP.
ENDFORM. " SET_CELL_COLORS
/code] -
ALV Report dynamically fields i want to display
Hi experts,
how to declare dynamical fields in ALV reports not in oops.can i use fieldcat merge function mod for this requirement.pls write the code if possible.Hi,
how to declare dynamical fields in ALV reports not in oops. ? I didnt understand what exactly you mean ? Do you want to build an internal table which is of dynamic in nature ?
can i use fieldcat merge function mod for this requirement. No
pls write the code if possible. No one writes the code here. Paste your code here !! If there any mistakes, any one of the SDNer will let you know !!
If you want the internal table to be dynamically created, check the following link:
Re: Dynamic Table with Validation
Regards
Kannaiah -
I want to put an icon in the dock, for Directory Utility or it's Yosemite heir. Can't see it in Core Services. Is it now a hidden file? Spare me the lecture on the evils of the root user please. My usual idea is to enable root temporarily.
Hi Robert,
Hmmm, I'm still seeing it in my System > Library > CoreServices > Applications.
You can also try the steps in this article, which still apply.
OS X Mavericks: Enable and disable the root user
Take care,
Nubz -
HT1918 i have multiple itunes accounts and want to put them all as one is that possible
i have multiple apple id's thus accounts is there anyway to put them all as one account under one apple id
Sorry, but it is not possible to merge Apple IDs.
Regards. -
Skip 1 Line in ALV report.....
Hi Experts,
I have made ALV report in which user wants one blank line after each row.
How to skip one line after each row in ALV ?
YusufHi Yusuf,
It is really a typical requirement.
There is a solution to that.
In the internal table that you are passing to the function module, append a blank line to that itself.
Like:
LOOP AT itab INTO wa.
APPEND wa TO itab3.
CLEAR wa.
APPEND wa TO itab3.
ENDLOOP.
REFRESH itab.
itab[] = itab3[].
But remember not to do sorting after that or not to pass the sorting table parameters.
If you have an extra line at the bottom you can delete that by reading the number of lines through the describe statement and delete the last row of the table.
Try this hiope this will work.
Reward points if found useful.
Thanks & regards
Abhijit -
Two line column heading in ALV Report
Hi Experts,
My requirement is that I have to create an ALV report with columns having two lines of headings. Like a main heading called Consultants under which 5 to 10 columns of departments(Dept Num, Num of Ppl , Manager etc. ) and then Contractors(Name, Address Etc ) underwhich there would be 5 to 10 departments. Right now my report has the depts of...
How can i do that . If u would suggest by CL_SALV_TABLE then it would be great.
Thanks a lot !
Saui don't think you can do it using cl_gui_alv_grid or cl_salv_table.
-
How to change header value dynamiclly in procedural alv report?
Hi experts,
I develop one report (using procedural alv ).I gave 3 input check boxes (ex : in 1st checkbox 10days in 2nd check box 20 days
in 3rd check box 30 days they entered like this in the input checkboxes in days 10,20,30.In o/p report 3 columns i maintained like this . Column1 column2 column 3
from 0 to 10 days from 11 to 20 days from 21 to 30 days.
I want to display alv report o/p like this in the respective columns.
For example they enter 15 25 35 (i/p)
o//p in alv report
Column1 column2 column 3
from 0 to 15 days from 16 to 25 days from 26 to 35 days.
i want to change days dynamically in alv header .Pls give me the code using procedural alv report.
If u want i will give u detail.pls help me in this.I assume the main issue is chaniging ALV header dynamically, isn't it? For this you need to use field seltext_m of fieldcatalog for particular column. So you can contruct header dynamically by string concatenation like
parameters: pa_1st(2) type n, "i.e. 15
pa_2nd(2) type n, "i.e 25
pa_3rd(2) type n. "i.e. 35
"first field
concatenate '0' 'to' pa_1st into it_fieldcatalog-seltext_m.
"next field
add 1 to pa_1st.
concatenate pa_1st 'to' pa_2nd into it_fieldcatalog-seltext_m.
"last field
add 1 to pa_2nd.
concatenate pa_2nd 'to' pa_3rd into it_fieldcatalog-seltext_m.
Refer [Sample ALV: Heading in ALV|http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm] for more information.
Regards
Marcin -
How to add the dril down functionality in alv report.
Hi All,
I have a ALV report and now i want to add drill down functionality in this ALV report.
See my code below:
FORM f0002_build_field_catalog.
Build the field catalog
CLEAR ws_layout.
ws_layout-colwidth_optimize = 'X'.
ws_layout-edit = ' '.
ws_field_catalog-col_pos = '1'.
ws_field_catalog-fieldname = 'BUKRS'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Company Code'.
ws_field_catalog-seltext_m = 'CCode'.
ws_field_catalog-seltext_s = 'CCode'.
ws_field_catalog-fix_column = 'X'.
ws_field_catalog = 'X'.
ws_fieldcat-ref_tabname = 'VBKPF'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '2'.
ws_field_catalog-fieldname = 'BELNR'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Document no.'.
ws_field_catalog-hotspot = 'V'.
ws_field_catalog-seltext_m = 'Doc.no.'.
ws_field_catalog-seltext_s = 'Doc.no.'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '3'.
ws_field_catalog-fieldname = 'GJAHR'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Year'.
ws_field_catalog-seltext_m = 'Year'.
ws_field_catalog-seltext_s = 'Year'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '4'.
ws_field_catalog-fieldname = 'BSTAT'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Status'.
ws_field_catalog-seltext_m = 'Status'.
ws_field_catalog-seltext_s = 'Status'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '5'.
ws_field_catalog-fieldname = 'FLAG'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Open/Cleared'.
ws_field_catalog-seltext_m = 'Open/Cleared'.
ws_field_catalog-seltext_s = 'Open/Cleared'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '6'.
ws_field_catalog-fieldname = 'BLART'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Doc.Type.'.
ws_field_catalog-seltext_m = 'Doc.Type'.
ws_field_catalog-seltext_s = 'Doc.Type'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '7'.
ws_field_catalog-fieldname = 'WRBTR'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Total Amount'.
ws_field_catalog-seltext_m = 'Total Amount'.
ws_field_catalog-seltext_s = 'Total Amount'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '8'.
ws_field_catalog-fieldname = 'WAERS'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Currency.'.
ws_field_catalog-seltext_m = 'Currency'.
ws_field_catalog-seltext_s = 'Currency'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '9'.
ws_field_catalog-fieldname = 'LIFNR'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Vendor'.
ws_field_catalog-seltext_m = 'Vendor'.
ws_field_catalog-seltext_s = 'Vendor'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '10'.
ws_field_catalog-fieldname = 'NAME1'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Vendor Name'.
ws_field_catalog-seltext_m = 'Name 1'.
ws_field_catalog-seltext_s = 'Name 1'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '11'.
ws_field_catalog-fieldname = 'UZAWE'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Payment Method Supplement'.
ws_field_catalog-seltext_m = 'PmtMthSuppl'.
ws_field_catalog-seltext_s = 'PmtMthSuppl'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
ws_field_catalog-col_pos = '12'.
ws_field_catalog-fieldname = 'XBLNR'.
ws_field_catalog-tabname = 'I_OUTPUT'.
ws_field_catalog-seltext_l = 'Reference'.
ws_field_catalog-seltext_m = 'Ref. No.'.
ws_field_catalog-seltext_s = 'Ref. No.'.
APPEND ws_field_catalog TO lt_fieldcat.
CLEAR: ws_field_catalog.
g_variant-report = sy-repid.
CLEAR struct_extab.
MOVE '&XPA' TO struct_extab-fcode.
APPEND struct_extab TO i_extab.
MOVE '&OMP' TO struct_extab-fcode.
APPEND struct_extab TO i_extab.
Display the list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = ws_repid
i_callback_user_command = 'HANDLE_USER_COMMAND'
is_layout = ws_layout
it_fieldcat = lt_fieldcat[]
it_excluding = i_extab[]
i_default = 'X'
i_save = 'U' "For user variants
is_variant = g_variant
TABLES
t_outtab = i_output.
ENDFORM. "f0002_build_field_catalog
*& Form f0038_pf_status
text
-->I_EXTAB text
FORM f0038_pf_status USING i_extab TYPE slis_t_extab. "#EC CALLED
CLEAR struct_extab.
MOVE '&XPA' TO struct_extab-fcode.
APPEND struct_extab TO i_extab.
MOVE '&OMP' TO struct_extab-fcode.
APPEND struct_extab TO i_extab.
SET PF-STATUS 'Z_PFSTATUS2' EXCLUDING i_extab.
ENDFORM. "f0038_pf_status
Pls tell me how i use this below dril down ability functionality in my code.
See the requirement below.
The Document Number, aka Accounting Document Number (BELNR) of each row will take the user to the appropriate document to edit as follows:
For Parked documents:-
If VBKPF-AWTYP (Reference Procedure) = RMRP, then the drilldown functionality should be to MIR4 using the Object ID in VBKPF- AWKEY. In this scenario the Object ID represents a Invoice Document Number, not an Accounting Document Number. Not the Object ID is a combination of Invoice Document Number and Fiscal Year
If VBKPF-AWTYP = Any other value, then the drilldown functionality should be to FBV2 using the Object ID in VBKPF-AWKEY. In this scenario the Object ID represents a true Accounting Document Number. Note the Object ID is a combination of Company Code (VBKPF-BUKRS), Accounting Document Number (VBKPF-BELNR) and Fiscal Year (VBKPF-GJAHR)
For Posted, not Cleared documents:-
Drilldown ability should be to FB02. The combination of Company Code (BSIK-BUKRS), Accounting Document Number (BSIK-BELNR) and Fiscal Year (BSIK-GJAHR) will be used to open/drilldown to the correct document in FB02.
For Cleared documents:-
Drilldown ability should be to FB03. The combination of Company Code (BSIK-BUKRS), Accounting Document Number (BSIK-BELNR) and Fiscal Year (BSIK-GJAHR) will be used to open/drilldown to the correct document in FB03.
Its very urgent, pls help on this.
Thanks!
VipinPls refer :
https://wiki.sdn.sap.com/wiki/display/Snippets/ABAPInteractiveALVwithCallTransaction%28usingParameterID%29
https://wiki.sdn.sap.com/wiki/display/Snippets/ABAPInteractiveALV+Program
Regards,
Anish Thomas
Pls reward all useful answers -
Hi experts....
I want to put data in first row in alv report. I am using reuse_alv_list_display for alv report output.
I used "FIELDCAT_LN-ROW_POS = '1'. '
but it doesn't make any effect in output.
please help me.
thank you.Hi..
Code is like this...
*& Report Z_MATERIAL_ANALYSIS
Report Z_MATERIAL_ANALYSIS.
TYPE-POOLS: SLIS , VRM.
DATA: G_REPID LIKE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
i_sort TYPE slis_t_sortinfo_alv,
gs_layout TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
DATA: gs_variant LIKE disvariant,
g_save.
TABLES : MSEG , MKPF.
DATA : BEGIN OF ITAB1 OCCURS 0,
601_602 LIKE MSEG-MENGE,
END OF ITAB1.
DATA : BEGIN OF ITAB OCCURS 0,
LGORT LIKE MSEG-LGORT,
BWART LIKE MSEG-BWART,
ZEILE LIKE MSEG-ZEILE,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
MATNR LIKE MSEG-MATNR,
WERKS LIKE MSEG-WERKS,
SHKZG LIKE MSEG-SHKZG,
MBLNR LIKE MKPF-MBLNR,
BUDAT LIKE MKPF-BUDAT,
SIGN(2),
101_102 LIKE MSEG-MENGE,
301 LIKE MSEG-MENGE,
311 LIKE MSEG-MENGE,
321 LIKE MSEG-MENGE,
601_602 LIKE MSEG-MENGE,
641_642 LIKE MSEG-MENGE,
653 LIKE MSEG-MENGE,
671 LIKE MSEG-MENGE,
END OF ITAB.
DATA: TOTAL_PLUS,
TOTAL_MINUS,
TOTAL.
SELECT-OPTIONS : MATNR FOR MSEG-MATNR,
DAT FOR MKPF-BUDAT.
PARAMETERS : LGORT LIKE MSEG-LGORT,
WERKS LIKE MSEG-WERKS,
BWART LIKE MSEG-BWART.
SELECT MSEG~MATNR
MSEG~LGORT
MSEG~BWART
MSEG~ZEILE
MSEG~MENGE
MSEG~MEINS
MSEG~WERKS
MSEG~SHKZG
MKPF~MBLNR
MKPF~BUDAT
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM MSEG
INNER JOIN MKPF ON MSEGMBLNR = MKPFMBLNR
WHERE MSEG~MATNR IN MATNR
AND MSEG~LGORT EQ LGORT
AND MKPF~BUDAT IN DAT
AND MSEG~WERKS EQ WERKS.
*LOOP AT ITAB.
*IF ITAB-BWART EQ
*WRITE : / 'MATNR', 10 'LGORT',20 'BWART', 30 'ZEILE',40 'MENGE',50
*'101102', 60
*'MEINS', 70 'MBLNR', 80 'BUDAT'.
LOOP AT ITAB.
IF ITAB-BWART = '101' OR ITAB-BWART = '102'.
SELECT MENGE INTO (ITAB-101_102) FROM MSEG WHERE MATNR = ITAB-MATNR
AND MBLNR = ITAB-MBLNR
AND LGORT = ITAB-LGORT
AND WERKS = ITAB-WERKS
AND ZEILE = ITAB-ZEILE.
MODIFY ITAB.
ENDSELECT.
ENDIF.
IF ITAB-BWART = '601' OR ITAB-BWART = '602'.
SELECT MENGE INTO (ITAB-601_602) FROM MSEG WHERE MATNR = ITAB-MATNR
AND MBLNR = ITAB-MBLNR
AND LGORT = ITAB-LGORT
AND WERKS = ITAB-WERKS
AND ZEILE = ITAB-ZEILE.
AND BWART IN ('601','602').
MODIFY ITAB.
ENDSELECT.
ENDIF.
IF ITAB-BWART = '641' OR ITAB-BWART = '642'.
SELECT MENGE INTO CORRESPONDING FIELDS OF TABLE ITAB1 FROM MSEG
WHERE MATNR = ITAB-MATNR
AND MBLNR = ITAB-MBLNR
AND LGORT = ITAB-LGORT
AND WERKS = ITAB-WERKS
AND ZEILE = ITAB-ZEILE.
MODIFY ITAB.
ENDSELECT.
ENDIF.
ENDLOOP.
LOOP AT ITAB.
IF ITAB-SHKZG = 'H'.
ITAB-SIGN = '+'.
MODIFY ITAB.
ELSE.
ITAB-SIGN = '-'.
MODIFY ITAB.
ENDIF.
ENDLOOP.
*LOOP AT ITAB.
*WRITE : /
ITAB-MATNR,
ITAB-LGORT,
ITAB-BWART,
ITAB-ZEILE,
ITAB-MENGE,
ITAB-TOT ,
ITAB-101_102,
ITAB-SIGN,
ITAB-601_602.
ITAB-SIGN.
ITAB-MEINS,
ITAB-MBLNR,
ITAB-BUDAT,
ITAB-SHKZG.
*AT LAST.
*SUM.
*WRITE : / ITAB-101_102.
*ENDAT.
*ENDLOOP.
PERFORM BUILD.
PERFORM CALL_ALV.
FORM BUILD.
DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
REFRESH GT_FIELDCAT.
*CLEAR GT_FIELDCAT.
CLEAR FIELDCAT_LN.
FIELDCAT_LN-FIELDNAME = '101_102'.
FIELDCAT_LN-TABNAME = 'ITAB'.
FIELDCAT_LN-ROW_POS = '1'.
FIELDCAT_LN-COL_POS = '1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_LN.
FIELDCAT_LN-FIELDNAME = '301 '.
FIELDCAT_LN-TABNAME = 'ITAB'.
FIELDCAT_LN-NO_OUT = 'X'.
FIELDCAT_LN-SELTEXT_L = 'Description'.
FIELDCAT_LN-OUTPUTLEN = 22.
FIELDCAT_LN-DO_SUM = 'X'. "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_LN.
FIELDCAT_LN-FIELDNAME = '601_602'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-ROW_POS = '1'.
FIELDCAT_LN-COL_POS = '1'.
*FIELDCAT_LN-NO_OUT = 'X'.
FIELDCAT_LN-SELTEXT_L = 'Base qty'.
FIELDCAT_LN-NO_ZERO = 'X'.
FIELDCAT_LN-just = 'C'.
*FIELDCAT_LN-DO_SUM = 'X'. "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
g_repid = sy-repid.
gs_variant-report = g_repid.
g_save = 'A'.
ENDFORM.
FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
*GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
ENDFORM.
FORM CALL_ALV.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_STRUCTURE_NAME = 'ITAB'
IS_LAYOUT = gs_layout
i_save = g_save
is_variant = gs_variant
IT_FIELDCAT = GT_FIELDCAT[]
IT_SORT = I_SORT
IT_EVENTS = GT_EVENTS[]
IS_PRINT = GS_PRINT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. -
Print Preview and Export not working FROM ALV Report
Hi
I have this ALV report which is working fine. But when I try to do a print preview it doesn't show the columns which r sorted. The columns r there but the data starts from the one which is not sorted so the layout is all messed up. In the ALV report the columns that r sorted groups them into one, I mean they just show only one time rest of the row for the same thing is blank it doesn't repeat the same data in those column. I am not sure whether that's causing it or not.
Please help.Hi Anwarul,
do not sort passing parameters for sorting. Create a layout (called ALV variant) or do the sorting online clicking columns(s) and sort icons. It will not change when displayed in print preview.
What function/object do you use?
Regards,
Clemens -
Hi,
I have developed a ALV report .
I also want to take the print out of this report.
How can i do this.Hi,
Refer this code
DATA : wa_variant TYPE disvariant, "Work area for variant
wa_variant1 TYPE disvariant, "Work area for variant
wa_layout TYPE slis_layout_alv, "Work area for layout
wa_print TYPE slis_print_alv, "Work area for print
*& Form sub_alv_display *
This form displays the output using REUSE_ALV_GRID_DISPLAY *
function module *
FORM sub_alv_display .
*--Local Internal Table
DATA : li_sort TYPE slis_t_sortinfo_alv.
*--Define print list
wa_print-no_print_listinfos = c_chk.
wa_print-no_coverpage = c_chk.
*--If the No zero stock lines is checked in the selection screen
IF p_sline IS NOT INITIAL.
DELETE i_final WHERE einme = c_zero.
ENDIF.
IF NOT i_final[] IS INITIAL.
*--Call the function module to display the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
is_layout = wa_layout
it_fieldcat = i_fieldcat
i_default = c_chk
i_save = c_save
is_variant = wa_variant
it_events = i_events
is_print = wa_print
it_sort = li_sort
TABLES
t_outtab = i_final
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.
*--No data found for the given selection criteria.
MESSAGE i001.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. "sub_alv_display
Regards,
Prashant -
What's the coolest, slickest way to present multiple ALV reports?
Greetings and good day, everyone.
Okay, I'm working on an update program, and the users have identified at least three different reports they would like coming out of this thing. One report is a list of transactions that fail internal logic checking, the second report is a list of transactions that pass internal logic checking but fail to update via a BAPI, and a third report is a list of transactions that pass checks and process correctly (i.e. update the database) via the BAPI.
At first, still being a newbie, I was wondering how I was going to create multiple ALV reports. I know I could do this using the WRITE statement, writing each report one after the other, but they have asked for the ALV report so they can do all the ad-hoc manipulating, sorting, etc. that ALV provides.
I came up with these options:
1. Instead of filling my single screen with the container control for an ALV report, as I usually do, this time I could put three containers on the screen. However, I know that cramps space, and I don't know if they'll be able to adjust or move things around other than scrolling.
2. Display a single ALV report on the screen, but have buttons somehow on the top that somehow take the user to other screens for the other reports.
3. First give the user a screen with all the buttons for the reports. They choose one, and the ALV report displays. They can click back to return to this screen, then choose a different report.
Nobody else in the office has done anything like this yet using the ALV, so I've got a chance to break some new ground internally and do something slick. Which option is best, and if so, do you have examples or general guidelines of how I do it? I've not had dialog programming, although I do understand the concepts from VB/Delphi experience over 10 years ago. I think I lean toward option 2, but I figured this couldn't be new ground in the SAP world and surely someone's done exactly this sort of thing.
Please help! ALL helpful responses, as always, are awarded points! Thanks so much!
DaveDave,
These are all good suggestions. I would just remember to keep in mind when designing your report two different things.
1. Can your program be run in foreground or background? If it has to be run in background due to data volumes you will lose all interactive capabilities of ALV. You might also not be able to do three different ALVs on the screen in background.
2. I am not sure if I understand your option 3 but if you are talking about the user selecting the options before the load the data, they might have to attempt to load the data multiple times to get all of the report.
My recommendation ( I think somebody already mentioned this) is to have a single ALV with a column on your report that the user can then sort or filter by. This way you are not limited to a program that has to be run in foreground.
Chris -
How to use drill down ability in ALV report.
Hi All,
I have a ALV report and now i want to add drill down functionality in this ALV report.
See the requirement below.
The Document Number, aka Accounting Document Number (BELNR) of each row will take the user to the appropriate document to edit as follows:
For Parked documents:-
If VBKPF-AWTYP (Reference Procedure) = RMRP, then the drilldown functionality should be to MIR4 using the Object ID in VBKPF- AWKEY. In this scenario the Object ID represents a Invoice Document Number, not an Accounting Document Number. Not the Object ID is a combination of Invoice Document Number and Fiscal Year
If VBKPF-AWTYP = Any other value, then the drilldown functionality should be to FBV2 using the Object ID in VBKPF-AWKEY. In this scenario the Object ID represents a true Accounting Document Number. Note the Object ID is a combination of Company Code (VBKPF-BUKRS), Accounting Document Number (VBKPF-BELNR) and Fiscal Year (VBKPF-GJAHR)
For Posted, not Cleared documents:-
Drilldown ability should be to FB02. The combination of Company Code (BSIK-BUKRS), Accounting Document Number (BSIK-BELNR) and Fiscal Year (BSIK-GJAHR) will be used to open/drilldown to the correct document in FB02.
For Cleared documents:-
Drilldown ability should be to FB03. The combination of Company Code (BSIK-BUKRS), Accounting Document Number (BSIK-BELNR) and Fiscal Year (BSIK-GJAHR) will be used to open/drilldown to the correct document in FB03.
Its very urgent, pls help on this.
Thanks!
VipinHi Vipin,
Please look at the reference code.
You need to use the FM 'REUSE_ALV_EVENTS_GET' and in the user command event u need to pass the name of the form that u need to write.
Please find the ollowing code:
REPORT ZSOURAVICON NO STANDARD PAGE HEADING.
type-pools: slis.
tables: vbap.
data: begin of itab occurs 0,
chk,
lights,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
matnr like vbap-matnr,
kwmeng like vbap-kwmeng,
end of itab.
data: P_LIGNAM TYPE SLIS_FIELDNAME VALUE 'LIGHTS'.
data: v_repid like sy-repid.
data: t_fld type slis_t_fieldcat_alv,
ws_fld like t_fld with header line,
t_sort type slis_t_sortinfo_alv,
ws_sort like t_sort with header line,
ws_layout type slis_layout_alv,
t_event type slis_t_event,
ws_event like t_event with header line,
c_topup TYPE slis_t_listheader,
ws_topup like c_topup with header line.
constants: c_top type slis_formname value 'TOP_OF_PAGE',
c_pfs type slis_formname value 'PF_STATUS_SET',
c_ucomm type slis_formname value 'USER_COMMAND'.
initialization.
v_repid = sy-repid.
select vbeln posnr matnr kwmeng from vbap into corresponding fields of
table itab.
loop at itab.
if itab-kwmeng lt 500.
itab-lights = '2'.
elseif itab-kwmeng = 500.
itab-lights = '1'.
else.
itab-lights = '3'.
endif.
modify itab.
endloop.
HERE WE ARE POPULATING THE FIELD CATALOG
ws_fld-col_pos = '3'.
ws_fld-fieldname = 'VBELN'.
ws_fld-KEY = 'X'.
ws_fld-tabname = ITAB.
ws_fld-reptext_ddic = 'SALES DOC'.
append ws_fld to t_fld.
clear ws_fld.
ws_fld-col_pos = '4'.
ws_fld-fieldname = 'POSNR'.
ws_fld-tabname = 'ITAB'.
ws_fld-reptext_ddic = 'SALES ITEM'.
append ws_fld to t_fld.
clear ws_fld.
ws_fld-col_pos = '5'.
ws_fld-fieldname = 'MATNR'.
ws_fld-tabname = 'ITAB'.
ws_fld-reptext_ddic = 'MATERIAL NO'.
append ws_fld to t_fld.
clear ws_fld.
ws_fld-col_pos = '6'.
ws_fld-fieldname = 'KWMENG'.
ws_fld-tabname = 'ITAB'.
ws_fld-reptext_ddic = 'UNIT'.
ws_fld-do_sum = 'X'.
append ws_fld to t_fld.
clear ws_fld.
ws_sort-spos = '1'.
ws_sort-fieldname = 'MATNR'.
ws_sort-tabname = 'ITAB'.
ws_sort-subtot = 'X'.
append ws_sort to t_sort.
clear ws_sort.
ws_layout-zebra = 'X'.
ws_layout-detail_popup = 'X'.
ws_layout-f2code = '&ETA'.
ws_layout-totals_text(60) = 'TOTAL'.
ws_layout-subtotals_text(60) = 'SUB TOTAL'.
ws_layout-box_fieldname = 'CHK'.
ws_layout-lights_fieldname = P_LIGNAM.
ws_layout-box_tabname = ITAB.
ws_layout-edit = 'X'.
clear ws_event.
ws_event-name = c_top.
ws_event-form = c_top.
append ws_event to t_event.
ws_event-name = c_pfs.
ws_event-form = c_pfs.
append ws_event to t_event.
clear ws_event.
ws_event-name = c_ucomm.
ws_event-form = c_ucomm.
append ws_event to t_event.
clear ws_event.
CLEAR ws_topup.
ws_topup-typ = 'H'.
ws_topup-info = 'Purchase Order Report'.
APPEND ws_topup TO c_topup.
CLEAR ws_topup.
ws_topup-typ = 'H'.
ws_topup-info = 'An ALV Report '.
APPEND ws_topup TO c_topup.
ws_topup-TYP = 'S'.
ws_topup-KEY = 'CURRENT PROGRAM NAME:'.
ws_topup-INFO = v_repid.
APPEND ws_topup TO c_topup.
CLEAR ws_topup.
ws_topup-TYP = 'S'.
ws_topup-KEY = 'DATE:'.
write SY-DATUM to ws_topup-INFO.
APPEND ws_topup to c_topup.
CLEAR ws_topup.
ws_topup-TYP = 'S'.
ws_topup-KEY = 'TIME:'.
write SY-UZEIT to ws_topup-INFO.
APPEND ws_topup TO c_topup.
CLEAR ws_topup.
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_STRUCTURE_NAME =
IS_LAYOUT = ws_layout
IT_FIELDCAT = t_fld
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = t_sort
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = t_event
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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
FORM top_of_page *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = c_topup
I_LOGO = 'LOGO'
I_END_OF_LIST_GRID =
ENDFORM.
FORM PF_STATUS_SET *
--> RT_EXTAB *
FORM PF_STATUS_SET using rt_extab type slis_t_extab.
set pf-status 'STD'. "EXCLUDING RT_EXTAB.
set pf-status 'STANDARD'.
endform.
FORM user_command *
form USER_COMMAND using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
data: begin of itab_temp occurs 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
kwmeng like vbap-kwmeng,
end of itab_temp.
DATA: t_fld1 TYPE SLIS_T_FIELDCAT_ALV,
ws_fld1 LIKE t_fld1 WITH HEADER LINE.
case r_ucomm.
when 'SHOW'.
loop at itab where chk = 'X'.
move-corresponding itab to itab_temp.
append itab_temp.
clear itab.
endloop.
ws_fld1-col_pos = '1'.
ws_fld1-fieldname = 'VBELN'.
ws_fld1-tabname = ITAB_TEMP.
ws_fld1-reptext_ddic = 'SALES DOC'.
ws_fld1-key = 'X'.
append ws_fld1 to t_fld1.
clear ws_fld1.
ws_fld1-col_pos = '2'.
ws_fld1-fieldname = 'POSNR'.
ws_fld1-tabname = ITAB_TEMP.
ws_fld1-reptext_ddic = 'SALES ITEM'.
ws_fld1-key = ' '.
append ws_fld1 to t_fld1.
clear ws_fld1.
ws_fld1-col_pos = '3'.
ws_fld1-fieldname = 'MATNR'.
ws_fld1-tabname = ITAB_TEMP.
ws_fld1-reptext_ddic = 'MATERIAL NO'.
ws_fld1-key = ' '.
append ws_fld1 to t_fld1.
clear ws_fld1.
ws_fld1-col_pos = '4'.
ws_fld1-fieldname = 'KWMENG'.
ws_fld1-tabname = ITAB_TEMP.
ws_fld1-reptext_ddic = 'UNIT'.
ws_fld1-key = ' '.
ws_fld1-do_sum = 'X'.
append ws_fld1 to t_fld1.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = 'my report'
I_SELECTION = ' '
I_ZEBRA = ' '
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_CHECKBOX_FIELDNAME =
I_LINEMARK_FIELDNAME =
I_SCROLL_TO_SEL_LINE = 'X'
I_TABNAME = ITAB_TEMP
I_STRUCTURE_NAME = 'VBAP'
IT_FIELDCAT = t_fld1
IT_EXCLUDING =
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_USER_COMMAND =
IS_PRIVATE = GS_PRIVATE
IMPORTING
ES_SELFIELD = RS_SELFIELD
E_EXIT = G_EXIT
TABLES
T_OUTTAB = ITAB_TEMP[]
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.
endcase.
ENDFORM.
Thanks and Regards,
Saurabh
Maybe you are looking for
-
Hi all, i am displaying the vendor address in PO form by passing the address number to the address node in smart form. My problem is communication details like Telephone number, Fax and email id is not printing in the output. I want to print the co
-
Changing the Default scale of Bones
i need to change the scale of the bone object flash draws. Is it in the preferences? (not expecting much help because the knowledge with using the flash cs5 rigging system is very limited.)
-
Firefox will not start and I already tried ALL the suggestions.
Hi, Firefox is my favorite browser that I've been using for years and all of a sudden it won't start. I've already tried the following and it will not open at all, ever. I'm on windows 7 and have never had a problem before. 1. I disabled my anti-viru
-
I'm not really sure how to approach a GUI issue I'm facing. I've been playing around with JLayeredComponents but a.) can't get them working and b.) I'm not even sure that that would be the ideal solution, so... I'm trying to create a JDialog. From a
-
Hi I am trying to create a program that spans on the entire screen i've set the pane size to the same size of the screen and set the origin to 0,0 My problem is that the tab control which almost spans on the entire screen is out of the borders and ca