Placing ALV grid on subscreen-URGENT
Hi,
I have a selection screen in my report program. I have placed a custom container in the selection screen in which I have placed an ALV grid.
Now my requirement is to place this ALV grid on a subscreen and define this subscreen in my selection screen.
I have included the following code in my report and also created a new subscreen 0100.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK sub FOR 197 LINES,
END OF BLOCK sub.
INITIALIZATION.
sub-prog = sy-repid.
sub-dynnr = 100.
Please let me know how do I place the ALV grid on the subscreen.
Thanks & Regards,
Srilakshmi B
Hi,
1.goto se51.give the module pool name and scrren no.
2.Select the custom container and give name only.
3.use that name in the report.
Regards,
Shiva.
Similar Messages
-
Hi all,
I have a subscreen with ALV grid in module pool program.
The main screen has two subscreens (one is header and other is items/reports)
from the main screen, the ALV Grid subscreen can be called in two ways.
1. from application tool bar (show report button) - ALV grid will be displayed in Items/Reports subscreen.
2. In Items/Reports subscreen, while displaying items there is a requirement to display same ALV grid subscreen report on hotspot of particular item.
ALV Grid in subscreen displaying only first come first serve for subscreen, if the subscreen called from application toolbar button then the ALV grid from items hotspot call not displaying and vice versa.
Not sure where i am doing wrong, but if i free the container, alv and re-generate all the objects its working fine but user doesn't like the flickering display of conatiner when it re-generating.
Any suggestions would help.
Regards
SyedHi Aruna Kumara,
Thanks for the reply.
I have only one ALV grid instance.
Process Flow from Application toolbar
Main Screen: 100
PBO:
CALL SUBSCREEN C_REPORT INCLUDING SY_REPID '0300'.
SUBSCREEN: 300
PBO:
IF CONTAINER IS NOT BOUND.
CREATE Container. with container name
CREATE ALV_Grid. passing container created
BUILD FIELDCAT.
CREATE EVENTS.
CALL METHOD SET_DISPLAY_TABLE_FIRST.
ELSE.
REFRESH_TABLE_DISPLAY.
FLUSH. "tried with without flush too.
ENDIF.
Process Flow from Items:
Items table is a subscreen 200 in main screen.
When the desired item click thru hotspot, a Modal dialog screen 250 open with subscreen element.
In event hotspot_click.
CALL SCREEN 250 STARTING AT ...ENDING AT.
PBO of 250:
CALL SUBSCREEN C_REPORT INCLUDING SY-REPID '0300'.
SubScreen 0300:
PBO as describe above, as the container already bound next time it refreshes the table display. But i see a blank screen in Popup.
Hope this helps.
Regards
Syed -
Problem with Excel button in ALV Grid...URGENT
Hi All,
I have developed a report in ALV Grid. As we all know that by default we get few buttons in ALV Grid, like summation, sorting download, etc.. In that we have one excel button. When i click that excel button the output of the report should give the output in excel sheet. But this is not working.
The report is running fine except the excel button.
Do anyone of u have any idea how to do that?
Its very urgent...
Regards,
Parvez.Go through the code and Execute it on your system, I think this will do for you.
In this code I used 3 radio buttons in my selection screen:
If u selects the first radio button your out put shows into to the Excel sheet.
If u selects the second radio button your out put shows the in the Editor screen.
If u clicks the third radio button your output shows into the Excel as well as in the Editor.
*& DATA DECLARATION *
TABLES: MARA, "GENERAL MASTER DATA
MARC, "PLANT DATA FOR MATERIAL
MARD, "STORAGE LOCATION DATA FOR MATERIAL
MBEW, "MATERIAL VALUATION
MVKE, "SALES DATA FOR MATERIAL
MAKT, "MATERIAL DESCRIPTION
EKKO, "PURCHASING DOCUMENT HEADER
EKPO, "PURCHASING DOCUMENT ITEM
VBAK, "SALES DOCUMENT HEADER DATA
VBAP. "SALES DOCUMENT ITEM DATA
TYPE-POOLS : SLIS.
DATA: VT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
V_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
V_LAYOUT TYPE SLIS_LAYOUT_ALV,
BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR, "MATERIAL NUMBER
MBRSH LIKE MARA-MBRSH, "INDUSTRY SECTOR
MEINS LIKE MARA-MEINS, "BASE UNIT OF MEASURE
MATKL LIKE MARA-MATKL, "MATERIAL GROUP
END OF I_MARA,
BEGIN OF I_MARC OCCURS 0,
MATNR LIKE MARC-MATNR, "MATERIAL NUMBER
WERKS LIKE MARC-WERKS, "PLANT
LVORM LIKE MARC-LVORM, "FLAG MATERIAL FOR DELETION AT PLANT
"LEVEL
DISPO LIKE MARC-DISPO, "MRP CONTROLLER
END OF I_MARC,
BEGIN OF I_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR, "MATERIAL NUMBER
MAKTX LIKE MAKT-MAKTX, "MATERIAL DESCRIPTION
SPRAS LIKE MAKT-SPRAS, "LANGUAGE KEY
END OF I_MAKT,
BEGIN OF I_MVKE OCCURS 0,
MATNR LIKE MVKE-MATNR, "MATERIAL NUMBER
VKORG LIKE MVKE-VKORG, "SALES ORGANIZATION
VTWEG LIKE MVKE-VTWEG, "DISTRIBUTION CHANNEL
END OF I_MVKE,
BEGIN OF I_MARD OCCURS 0,
MATNR LIKE MARD-MATNR, "MATERIAL NUMBER
LGORT LIKE MARD-LGORT, "STORAGE LOCATION
LABST LIKE MARD-LABST, "VALUATED STOCK WITH UNRESTRICTED USE
END OF I_MARD,
BEGIN OF I_EKPO OCCURS 0,
EBELN LIKE EKPO-EBELN, "PURCHASING DOCUMENT NUMBER
EBELP LIKE EKPO-EBELP, "ITEM NUMBER OF PURCHASING DOCUMENT
MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
END OF I_EKPO,
BEGIN OF I_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
END OF I_VBAP,
BEGIN OF I_OUT OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
LVORM LIKE MARC-LVORM,
DISPO LIKE MARC-DISPO,
MBRSH LIKE MARA-MBRSH,
MEINS LIKE MARA-MEINS,
MATKL LIKE MARA-MATKL,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
LGORT LIKE MARD-LGORT,
LABST LIKE MARD-LABST,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
END OF I_OUT,
BEGIN OF I_HEADING OCCURS 0,
TEXT1(20),
TEXT2(20),
TEXT3(20),
TEXT4(20),
TEXT5(20),
TEXT6(20),
TEXT7(20),
TEXT8(20),
TEXT9(20),
TEXT10(20),
TEXT11(40),
TEXT12(20),
TEXT13(20),
TEXT14(20),
TEXT15(20),
TEXT16(20),
TEXT17(20),
END OF I_HEADING.
*& S E L E C T I O N - S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR. "OBLIGATORY.
PARAMETERS: P_WERKS LIKE MARC-WERKS. "OBLIGATORY.
SELECT-OPTIONS: S_LGORT FOR MARD-LGORT,
S_DISPO FOR MARC-DISPO,
S_EBELN FOR EKPO-EBELN .
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-101.
PARAMETERS : RB1 RADIOBUTTON GROUP G1,
RB2 RADIOBUTTON GROUP G1,
RB3 RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
*& S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
SELECT MATNR WERKS LVORM DISPO FROM MARC
INTO CORRESPONDING FIELDS OF TABLE I_MARC
WHERE MATNR IN S_MATNR
AND DISPO IN S_DISPO
AND WERKS = P_WERKS.
IF I_MARC[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARC'.
EXIT.
ENDIF.
PERFORM PURCHASEDATA_VALIDATION.
PERFORM SALESDATA_VALIDATION.
SELECT MATNR LGORT LABST FROM MARD INTO TABLE I_MARD
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR
AND WERKS EQ P_WERKS
AND LGORT IN S_LGORT.
IF I_MARD[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARD'.
EXIT.
ENDIF.
SELECT MATNR VKORG VTWEG FROM MVKE INTO TABLE I_MVKE
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
IF I_MVKE[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MVKE'.
EXIT.
ENDIF.
LOOP AT I_MARC.
MOVE-CORRESPONDING I_MARC TO I_OUT.
CLEAR MARC.
SELECT SINGLE MATNR MBRSH MEINS MATKL FROM MARA
INTO CORRESPONDING FIELDS OF MARA
WHERE MATNR = I_OUT-MATNR.
IF SY-SUBRC = 0.
MOVE: MARA-MBRSH TO I_OUT-MBRSH,
MARA-MEINS TO I_OUT-MEINS,
MARA-MATKL TO I_OUT-MATKL.
ELSE.
CONTINUE.
ENDIF.
SELECT SINGLE MATNR MAKTX SPRAS FROM MAKT
INTO CORRESPONDING FIELDS OF MAKT
WHERE MATNR = I_OUT-MATNR.
IF SY-SUBRC = 0.
MOVE: MAKT-MAKTX TO I_OUT-MAKTX,
MAKT-SPRAS TO I_OUT-SPRAS.
ELSE.
CONTINUE.
ENDIF.
LOOP AT I_EKPO WHERE MATNR = I_MARC-MATNR.
MOVE: I_EKPO-EBELN TO I_OUT-EBELN,
I_EKPO-EBELP TO I_OUT-EBELP.
ENDLOOP.
LOOP AT I_VBAP WHERE MATNR = I_MARC-MATNR.
MOVE: I_VBAP-VBELN TO I_OUT-VBELN,
I_VBAP-POSNR TO I_OUT-POSNR.
ENDLOOP.
LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR.
MOVE: I_MARD-LABST TO I_OUT-LABST,
I_MARD-LGORT TO I_OUT-LGORT.
ENDLOOP.
LOOP AT I_MVKE WHERE MATNR = I_MARC-MATNR.
MOVE: I_MVKE-VKORG TO I_OUT-VKORG,
I_MVKE-VTWEG TO I_OUT-VTWEG.
APPEND I_OUT.
ENDLOOP.
CLEAR I_OUT.
ENDLOOP.
PERFORM OPTIONS.
FORM OPTIONS *
FORM OPTIONS.
IF RB2 = 'X'.
PERFORM FIELDCAT.
PERFORM OUTPUT.
ELSE.
IF RB1 = 'X'.
PERFORM HEADINGS.
PERFORM DLOAD.
ELSE.
IF RB3 = 'X'.
PERFORM HEADINGS.
PERFORM DLOAD.
PERFORM FIELDCAT.
PERFORM OUTPUT.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. "OPTIONS
FORM HEADINGS *
FORM HEADINGS.
I_HEADING-TEXT1 = 'MATNR'.
I_HEADING-TEXT2 = 'WERKS'.
I_HEADING-TEXT3 = 'LVORM'.
I_HEADING-TEXT4 = 'DISPO'.
I_HEADING-TEXT5 = 'MBRSH'.
I_HEADING-TEXT6 = 'MEINS'.
I_HEADING-TEXT7 = 'MATKL'.
I_HEADING-TEXT8 = 'VKORG'.
I_HEADING-TEXT9 = 'VTWEG'.
I_HEADING-TEXT10 = 'SPRAS'.
I_HEADING-TEXT11 = 'MAKTX'.
I_HEADING-TEXT12 = 'LGORT'.
I_HEADING-TEXT13 = 'LABST'.
I_HEADING-TEXT14 = 'EBELN'.
I_HEADING-TEXT15 = 'EBELP'.
I_HEADING-TEXT16 = 'VBELN'.
I_HEADING-TEXT17 = 'POSNR'.
APPEND I_HEADING.
ENDFORM. "HEADINGS
FORM DLOAD *
FORM DLOAD.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\MATSTK.XLS'
FILETYPE = 'DAT'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = I_HEADING
EXCEPTIONS
FILE_WRITE_ERROR = 1.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\MATSTK.XLS'
FILETYPE = 'DAT'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = I_OUT.
ENDFORM. "DLOAD
FORM FIELDCAT *
FORM FIELDCAT.
V_FIELDCAT-COL_POS = '1'.
V_FIELDCAT-FIELDNAME = 'MATNR'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-HOTSPOT = 'X'.
V_FIELDCAT-REF_FIELDNAME = 'MATNR'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '2'.
V_FIELDCAT-FIELDNAME = 'WERKS'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'WERKS'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '3'.
V_FIELDCAT-FIELDNAME = 'LVORM'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'LVORM'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '4'.
V_FIELDCAT-FIELDNAME = 'DISPO'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'DISPO'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '5'.
V_FIELDCAT-FIELDNAME = 'MBRSH'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MBRSH'.
V_FIELDCAT-REF_TABNAME = 'MARA'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '6'.
V_FIELDCAT-FIELDNAME = 'MEINS'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MEINS'.
V_FIELDCAT-REF_TABNAME = 'MARA'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '7'.
V_FIELDCAT-FIELDNAME = 'MATKL'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MATKL'.
V_FIELDCAT-REF_TABNAME = 'MARA'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '8'.
V_FIELDCAT-FIELDNAME = 'VKORG'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'VKORG'.
V_FIELDCAT-REF_TABNAME = 'MVKE'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '9'.
V_FIELDCAT-FIELDNAME = 'VTWEG'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'VTWEG'.
V_FIELDCAT-REF_TABNAME = 'MVKE'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '10'.
V_FIELDCAT-FIELDNAME = 'SPRAS'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'SPRAS'.
V_FIELDCAT-REF_TABNAME = 'MAKT'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '11'.
V_FIELDCAT-FIELDNAME = 'MAKTX'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MAKTX'.
V_FIELDCAT-REF_TABNAME = 'MAKT'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '12'.
V_FIELDCAT-FIELDNAME = 'LGORT'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'LGORT'.
V_FIELDCAT-REF_TABNAME = 'MARD'.
V_FIELDCAT-SELTEXT_L = 'STRG LOCT'.
V_FIELDCAT-OUTPUTLEN = 10.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '13'.
V_FIELDCAT-FIELDNAME = 'LABST'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-SELTEXT_M = 'STOCK'.
V_FIELDCAT-OUTPUTLEN = 15.
V_FIELDCAT-REF_FIELDNAME = 'LABST'.
V_FIELDCAT-REF_TABNAME = 'MARD'.
V_FIELDCAT-DO_SUM = 'X'.
V_LAYOUT-TOTALS_TEXT = 'TOTAL STOCK:'.
V_FIELDCAT-HOTSPOT = 'X'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '14'.
V_FIELDCAT-FIELDNAME = 'EBELN'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-HOTSPOT = 'X'.
V_FIELDCAT-REF_FIELDNAME = 'EBELN'.
V_FIELDCAT-REF_TABNAME = 'EKPO'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '15'.
V_FIELDCAT-FIELDNAME = 'EBELP'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'EBELP'.
V_FIELDCAT-REF_TABNAME = 'EKPO'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '16'.
V_FIELDCAT-FIELDNAME = 'VBELN'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-HOTSPOT = 'X'.
V_FIELDCAT-REF_FIELDNAME = 'VBELN'.
V_FIELDCAT-REF_TABNAME = 'VBAP'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '17'.
V_FIELDCAT-FIELDNAME = 'POSNR'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'POSNR'.
V_FIELDCAT-REF_TABNAME = 'VBAP'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
ENDFORM. "FIELDCAT
FORM OUTPUT *
FORM OUTPUT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = 'CLICK ON MATERIAL/PURDOC/SALESDOC FOR DETAILS'
I_CALLBACK_USER_COMMAND = 'DISPLAYDETAILS'
IS_LAYOUT = V_LAYOUT
IT_FIELDCAT = VT_FIELDCAT1
TABLES
T_OUTTAB = I_OUT.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. "OUTPUT
FORM TOP-OF-PAGE *
FORM TOP-OF-PAGE.
DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = 'REPORT FOR : '.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-INFO = 'MATERIAL DETAILS'.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-INFO = 'PURCHASE ORDER DETAILS'.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-INFO = 'SALES ORDER DETAILS'.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'GEAR'
IT_LIST_COMMENTARY = T_HEADER.
ENDFORM. "TOP-OF-PAGE
*& FORM PURCHASEDATA_VALIDATION *
FORM PURCHASEDATA_VALIDATION.
SELECT EBELN EBELP MATNR
FROM EKPO
INTO TABLE I_EKPO
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR
AND EBELN IN S_EBELN
AND WERKS EQ P_WERKS.
IF I_EKPO[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA IS SELECTED FROM TABLE EKPO'.
EXIT.
ENDIF.
DATA: T_EKPO LIKE I_EKPO OCCURS 0 WITH HEADER LINE.
T_EKPO[] = I_EKPO[].
REFRESH I_EKPO.
FREE I_EKPO.
LOOP AT T_EKPO.
SELECT SINGLE EBELN FROM EKKO INTO EKPO-EBELN
WHERE EBELN = T_EKPO-EBELN.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING T_EKPO TO I_EKPO.
APPEND I_EKPO.
CLEAR I_EKPO.
ELSE.
CONTINUE.
ENDIF.
ENDLOOP.
SORT I_EKPO.
ENDFORM. "PURCHASEDATA_VALIDATION
*& FORM SALESDATA_VALIDATION *
FORM SALESDATA_VALIDATION.
SELECT VBELN POSNR MATNR
FROM VBAP
INTO CORRESPONDING FIELDS OF TABLE
I_VBAP FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
DATA: T_VBAP LIKE I_VBAP OCCURS 0 WITH HEADER LINE.
T_VBAP[] = I_VBAP[].
REFRESH I_VBAP.
FREE I_VBAP.
LOOP AT T_VBAP.
SELECT SINGLE VBELN FROM VBAK INTO VBAK-VBELN
WHERE VBELN = T_VBAP-VBELN.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING T_VBAP TO I_VBAP.
APPEND I_VBAP.
CLEAR I_VBAP.
ELSE.
CONTINUE.
ENDIF.
ENDLOOP.
SORT I_VBAP.
ENDFORM. "SALESDATA_VALIDATION -
How to get f4 help in alv grid in container-urgent
hi,
how to get f4 help in alv grid in container using abap objects
ganeshHi Ganesh,
Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
Here is part of the header documentation:
*& Report BCALV_GRID_F4_HELP *
Purpose:
~~~~~~~~
This report illustrates the use of f4-Help in an alv grid control.
Background:
~~~~~~~~~~~
There a two possibilities to implement an f4-Help in the alv grid
control: one can either use standard f4-help or write one by Hand.
For the former there is nothing to do at all. This report shows how
to implement user-defined f4-help.
I am sure you will find within this report the solution you are looking for.
Reward points if this Helps.
Manish -
Problem while alv grid display exporting to excel sheet
Hi,
I have done an ALV report using reuse_alv_grid _display , out put is fine , but when i click on excel view icon i could only see an excel sheet without any data ., but when i use export to local file and choose spread sheet its giving the data in excel, but the user wants to click only the excel view icon.
Best RegardsHi,
Check this link
[Problem with Excel button in ALV Grid...URGENT;
Regards,
Sathish Reddy. -
Hi,
I have a problem with the display of a ALV grid in a subscreen. I am going to try to explain my problem and maybe somebody knows any solution.
In a regular screen I have a subscreen that should show the ALV, I am following all the steps like callling the subscreen, creating the container for the ALV grid, ... but it doesn' show anything.
I have tried some things to check if the calling of the subscreen works, so I just call any other subscreen and it works. Also I have tried to call two alv in the same screen using the custom control and it works.
I have changed the subscreen into screen and I have added the status and so on and by itself it also works.
Does anybody know what can be missing??
Thanks very muchHmm, works fine for me. Below code a litte bit tweaked but working one. Try it:
"ABAP program
DATA: g_custom_container TYPE REF TO cl_gui_custom_container,
g_alv_grid_ref TYPE REF TO cl_gui_alv_grid,
gt_sflight TYPE sflight OCCURS 0.
SELECT * FROM sflight INTO TABLE gt_sflight UP TO 10 ROWS.
CALL SCREEN 0100.
MODULE pbo_0200 OUTPUT.
IF g_custom_container IS INITIAL.
"create custom container
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'CUSTOM_AREA'.
CREATE OBJECT g_alv_grid_ref
EXPORTING
i_parent = g_custom_container.
CALL METHOD g_alv_grid_ref->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = gt_sflight.
ELSE.
CALL METHOD g_alv_grid_ref->refresh_table_display.
ENDIF.
ENDMODULE. "PBO_0200
"Main screen 0100 - type normal
"here on layout ensure subsreen area called SUB_AREA is placed
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN sub_area INCLUDING sy-repid '0200'.
PROCESS AFTER INPUT.
CALL SUBSCREEN sub_area.
"Subscreen - type subscreen (please check that in attributes)
"here custom control named CUSTOM_AREA was placed in layout
PROCESS BEFORE OUTPUT.
MODULE pbo_0200.
Hope this helps
Marcin -
Hi ,
How can I display ALV grid display in subscreen area that is called in main screen .?
Thanx in advance .Hi Pallavi,
Use these parameters in Alv Fm
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
Hope this will help you.
Regards,
Vijay -
ALV Grid Subscreen to Display Text
Folks,
I am really sorry I am creating a new thread for this because I can see it has been discussed a lot but I am finding it hard to clearly identify what needs to be done from all the posts.
I have an ABAP with a selection screen, it runs and generates an ALV output, on that ALV output I have a column called COMMENT, in the column COMMENT there is a string of text which can be very large. Since I can not change the row height on the ALV grid I am going to implement a work-around where when the user double-clicks on the comment, it pops up a screen displaying the full text.
I presume I need to call a subscreen to get this to happen but I can not see how to do this and any help would be greatly appreciated.
Many Thanks,
Colm
P.S. Here is how I catch the double click.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
DATA: w_ans(1).
CASE r_ucomm. "The users command
WHEN '&IC1'. "Double Click
*Doc drill down
IF rs_selfield-fieldname = 'COMMENT'.
READ TABLE gt_output INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
*Call the screen here displaying the full note text
ENDIF.I feel so foolish, I was trying to re-invent the wheel and didn't think before I asked. Apologies and Thanks.
However, if for some reason I didn't want to use the POPUP_TEXT FM, is there a way I could have called the subscreen?
Here is the code I used if anyone is interested:
DATA: w_ans(1),
lt_text TYPE TABLE OF trtab,
ls_title TYPE c,
crlf(2) TYPE c VALUE cl_abap_char_utilities=>cr_lf.
CASE r_ucomm. "The users command
WHEN '&IC1'. "Double Click
*Doc drill down
IF rs_selfield-fieldname = 'COMMENT'.
READ TABLE gt_output INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
SPLIT gt_output-comment AT crlf INTO TABLE lt_text.
CALL FUNCTION 'LAW_SHOW_POPUP_WITH_TEXT'
EXPORTING
titelbar = ls_title
line_size = 132
TABLES
list_tab = lt_text. -
ALV grid on TABSTRIP- Subscreen
Hi,
How to display ALV grid screen on Tabstrip- Subscreen.
Please send sample code.
Thanks in advance.
-MohanIts not going to be different that what you do on a normal screen. I am assuming that you are using OO ALV control.
Here you do this on the sub screen instead of the main screen. Take a look at my weblog.
/people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls--part-i
regards,
Ravi
Note :Please close the thread if this resolves the issue -
Hide alv grid PR custom subscreen
Hello All,
I have a custom subscreen on PR ( bulit via screen exit) with ALV grid and some screen elements ( to get input data from user) on it.
In create and change PR mode, I need to get the input ( could be multiple rows with the help of create next icon )from user and update ALV grid with the input values. But in PR display mode, I need to hide the ALV grid.
I tried using desctructor method FREE, but dint work.
Any suggestions?
Thanks,
ChandraI have a similiar problem:
I have a dynpro where there are different possibilities for ALV grids to be shown. I have 10 containers (that's the maximum number of ALV grids that can appear) and want to use the highest first. Now, it might be that I want to show another ALV in a container I have had an ALV before, therefore I must hide / delete / destroy the previous ALV in this container.
I use the FREE( ) method of the alv controls, I clear and free all references, but still, even after leaving and accessing the dynpro again, the ALV is shown. That's why I'd need some help here too...
Thanks in advance, Christopher -
Deactivate buttons in ALV GRID being called in subscreen
Hi,
In a screen, when a specific tab is selected (tab strip), the subscreen area is filled with ALV GRID. I need to deactivate few buttons on the ALV GRID. How can that be done??
Advance ThanksHi Aadarsh,
Check out the following program.
Global data definitions for ALV
To allow the declaration of gr_event_handler before the
lcl_event_receiver class is defined, decale it as deferred in the
start of the program
CLASS lcl_event_handler DEFINITION DEFERRED.
Object reference
ALV Grid instance reference
DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid,
Custom container instance reference
gr_ccontainer TYPE REF TO cl_gui_custom_container,
Event class reference
gr_event_handler TYPE REF TO lcl_event_handler. "IC210507+
Internal Table
Field catalog table
DATA: gt_fieldcat TYPE lvc_t_fcat,
Internal table holding list data
gt_list TYPE STANDARD TABLE OF sflight,
Table to be filled up for excluding some of the standard function
buttons
gt_exclude TYPE ui_functions. "IC210507+
Work area
Layout structure
DATA: gs_layout TYPE lvc_s_layo,
Field catalog structure
gs_fcat TYPE lvc_s_fcat,
Exclude button structure
gs_exclude TYPE ui_func, "IC210507+
Structure to add button in the ALV toolbar
gs_toolbar TYPE stb_button. "IC210507+
Variables
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm,
Name of the custom control added on the screen
gv_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
Begin of IC210507
Local classes
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION.
METHODS:
To add new functional buttons to the ALV toolbar
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
To implement user commands
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS. "lcl_event_handler DEFINITION
End of IC210507
Calling the screen where ALV output is displayed
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
PBO
MODULE status_0100 OUTPUT.
ALV display
PERFORM display_alv.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
PAI
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
IF save_ok EQ 'EXIT'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form display_alv
ALV display
FORM display_alv.
PERFORM get_data.
PERFORM create_alv.
ENDFORM. " display_alv
*& Form get_data
Fetch data to be displayed in the list
FORM get_data.
SELECT * FROM sflight
INTO TABLE gt_list.
ENDFORM. " get_data
*& Form create_alv
Create and set or Refresh ALV
FORM create_alv.
Checking whether an instance of the container (or ALV Grid) exists.
IF gr_alvgrid IS INITIAL.
If not, creating and setting ALV for the first display.
Creating custom container instance
CREATE OBJECT gr_ccontainer
EXPORTING
container_name = gv_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
Creating ALV Grid instance
CREATE OBJECT gr_alvgrid
EXPORTING
i_parent = gr_ccontainer
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
Begin of IC210507
Creating an instance for the event handler
CREATE OBJECT gr_event_handler.
Registering handler methods to handle ALV Grid events
SET HANDLER gr_event_handler->handle_user_command FOR gr_alvgrid.
SET HANDLER gr_event_handler->handle_toolbar FOR gr_alvgrid.
End of IC210507
Preparing field catalog.
PERFORM prepare_field_catalog CHANGING gt_fieldcat.
Preparing layout structure
PERFORM prepare_layout CHANGING gs_layout.
Excluding Unwanted Standard Function Buttons
PERFORM exclude_tb_functions CHANGING gt_exclude. "IC210507+
Method to display ALV grid
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
To exclude buttons the exclusion table must be passed to the following
field
it_toolbar_excluding = gt_exclude "IC210507+
CHANGING
it_outtab = gt_list
it_fieldcatalog = gt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
To make ALV show our additional buttons, we must call the method
set_toolbar_interactive for the ALV Grid instance after the instance
is created.
CALL METHOD gr_alvgrid->set_toolbar_interactive. "IC210507+
ELSE.
If an instance of the container (or ALV Grid) exists, refreshing it.
CALL METHOD gr_alvgrid->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2.
ENDIF.
ENDFORM. " create_alv
*& Form prepare_field_catalog
Subroutine to populate field catalog
<--P_GT_FIELDCAT Table to describe the field catalog
FORM prepare_field_catalog CHANGING p_gt_fieldcat TYPE lvc_t_fcat.
Generating the field catalog semi automatically
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = p_gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
LOOP AT p_gt_fieldcat INTO gs_fcat.
CASE gs_fcat-fieldname.
WHEN 'CARRID'.
gs_fcat-outputlen = '10'.
gs_fcat-coltext = 'Airline Carrier ID'.
MODIFY p_gt_fieldcat FROM gs_fcat.
WHEN 'FLDATE'.
gs_fcat-just = 'C'.
gs_fcat-hotspot = 'X'.
MODIFY p_gt_fieldcat FROM gs_fcat.
ENDCASE.
ENDLOOP.
ENDFORM. " prepare_field_catalog
*& Form prepare_layout
Preparing layout structure
<--P_GS_LAYOUT Layout structure
FORM prepare_layout CHANGING p_gs_layout TYPE lvc_s_layo.
p_gs_layout-zebra = 'X' .
p_gs_layout-grid_title = 'Flight Info System'.
p_gs_layout-smalltitle = 'X'.
ENDFORM. " prepare_layout
Begin of IC210507
*& Form exclude_tb_functions
Excluding Unwanted Standard Function Buttons
<--P_GT_EXCLUDE Table to be filled up to exclude buttons
FORM exclude_tb_functions CHANGING p_gt_exclude TYPE ui_functions.
MC_FC_ are names for functions directly and the names beginning with
MC_MB_ are for the function menus including some subfunctions as menu
entries.
In this case 'Maximum' and 'Minimum' options under 'Sum' button & 'Print'
button are excluded
gs_exclude = cl_gui_alv_grid=>mc_fc_maximum.
APPEND gs_exclude TO p_gt_exclude.
gs_exclude = cl_gui_alv_grid=>mc_fc_minimum.
APPEND gs_exclude TO p_gt_exclude.
gs_exclude = cl_gui_alv_grid=>mc_fc_print.
APPEND gs_exclude TO p_gt_exclude.
ENDFORM. " exclude_tb_functions
*& Class (Implementation) lcl_event_handler
Event handler for the ALV Grid instance.
CLASS lcl_event_handler IMPLEMENTATION.
Handle Toolbar
METHOD handle_toolbar.
PERFORM handle_toolbar USING e_object e_interactive .
ENDMETHOD . "handle_toolbar
Handle User Command
METHOD handle_user_command .
PERFORM handle_user_command USING e_ucomm .
ENDMETHOD. "handle_user_command
ENDCLASS. "lcl_event_handler
*& Form handle_toolbar
Subroutine called from event handler method for event toolbar.
This is to add a new button in the ALV application toolbar
-->P_E_OBJECT
-->P_E_INTERACTIVE
FORM handle_toolbar USING p_e_object TYPE REF TO cl_alv_event_toolbar_set
p_e_interactive.
Begin of 'Adding a new Button'
CLEAR gs_toolbar.
Function code
MOVE 'EXIT' TO gs_toolbar-function.
Button type that will be added to the toolbar
gs_toolbar-butn_type = 0.
Icon for the button
From the type group ICON in SE11, we can get the value to be passed
for icon
gs_toolbar-icon = '@2N@'.
Quick info for the button
MOVE 'Exit' TO gs_toolbar-quickinfo.
Text for the button
MOVE 'Exit' TO gs_toolbar-text.
Adds the button as disabled if set to X
MOVE ' ' TO gs_toolbar-disabled.
Appending the structure to the table attribute mt_toolbar of the object
APPEND gs_toolbar TO p_e_object->mt_toolbar.
End of 'Adding a new Button'
Begin of 'Disabling an existing standard Button'
LOOP AT p_e_object->mt_toolbar
INTO gs_toolbar
Identify which button to disable from the function code
In this case disabling the 'Filter' button
WHERE function = '&MB_FILTER'.
Set the 'DISABLED' field to disable a button
gs_toolbar-disabled = 'X'.
MODIFY p_e_object->mt_toolbar FROM gs_toolbar.
ENDLOOP.
End of 'Disabling an existing standard Button'
ENDFORM. " handle_toolbar
*& Form handle_user_command
Implement any new function
-->P_E_UCOMM text
FORM handle_user_command USING p_e_ucomm TYPE syucomm.
IF p_e_ucomm EQ 'EXIT'.
LEAVE PROGRAM.
ENDIF.
ENDFORM. " handle_user_command
End of IC210507
Award points if found useful.
Regards
Indrajit. -
Urgent : how to select the rows in the ALV Grid Control
How to select the rows in the ALV Grid control,
I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
If anyone have the solution please help me out
<b>Its very Urgent</b>Hi Bharath,
Go through this hope u can understand.
SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
A Multiple columns, multiple rows with selection buttons.
B Simple selection, listbox, Single row/column
C Multiple rows without buttons
D Multiple rows with buttons and select all ICON
Setting and getting selected rows (Columns) and read line contents
You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
Data declaration:
DATA:
Internal table for indexes of selected rows
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
Example 1: Reading index of selected row(s) and using it to read the grid table
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a valid line'.
EXIT.
ENDIF.
LOOP AT gi_index_rows INTO g_selected_row.
READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
ENDIF.
ENDLOOP.
Example 2: Set selected row(s).
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines > 0.
CALL METHOD go_grid->set_selected_rows
exporting
it_index_rows = gi_index_rows.
ENDIF.
Reward points if helpful.
Thanks
Naveen khan -
Urgent : Problem with Editable ALV Grid for Quantity and Currency Fields
Hi All,
I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
When user changes these values these values are not changing properly .
For the quantity field the domain is MENG13 with 3 deciamal places and here if we enter 500 it takes it as 0.500 .
The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
Here also it takes last 2 digits after decimal places by default.
Please advice how to get proper values in this case from ALV editable fields.
Thanks and Regards
Harshad
Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AMfor all the currency field , it will display like that only.
u have to manipulate uin program before displaying.
if they are giving 500, in program multiply with 100 and move it to table.
when u are getting from table, divinde and display.
this is what I am doing.
Reward if helpfull. -
Pls help me this is an urgent requirement on ALV GRID
Hi all
Here i am sendig my requirement pls help me on coding ..
Report Assignment For ELTPs:
Selection criteria :
Circle id : Select option without interval and mandatory
SPR Id : Select option without interval
Project Status : Parameter
Output required in ALV Grid format with the below structure :
cProjects ID SPR ID Project Name Circle ID Circle Description Delegation Status No. of CU Projects CU-PO Share FLCB FLCB
NAME FLCL ID FLCL Name FLCL Email ID
1232007
1230
ABCD No 0
1242007
1240
ABCD Partial 2
1112007
1241
XYZ
2222007
1242
WXY
1252007
1250
EFGH Full 1
3332007
1251
DEF
Requirement :
1. The report should list all the CFU projects and the corresponding CU projects circle wise based on the circles entered on the selection screen and which have the SPR ids and Project status on the selection screen.
2. If SPR id or Project status is not entered then all the projects to be considered for the given circle/s.
3. It should display the details of the CFU project first. The corresponding CU projects should be listed below that CFU project in the successive rows.
4. For example, project 1232007 is a CFU project which does not have any CU under it. Hence, another CFU project 1242007 is displayed in the second row. It has 2 CU projects under it. The details of those two CU projects are displayed in the 3rd and 4th rows.
5. Total share given to the CU circle (by adding different PO shares to that circle in that project) by the CFU project should be displayed in the field CU-PO Share.
6. For CU projects, the fields Delegation Status, No. of CU projects and CU-PO share should be space.
7. FLCB, FLCL ID, FLCL name and FLCL email need to given for all the projects in all the rows.
Tables to be referred: ZSCP_PROJECT, ZSCP_CIRCLE_M, ZSCP_PJ_CL_PO_MP, ZSCP_PRJ_LINK, USR21,
ADR6, BUT000,CGPL_TEXT.
[<b>b]Here i done the coding the but the error showing that field catolog is not found..
pls check this and kindly send the code .....</b></b>
REPORT Z_64328_TEST .
TYPE-POOLS : SLIS.
TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,
USR21,ADR6, BUT000.
SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.
SELECT-OPTIONS : S_SPR_ID FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.
PARAMETERS : P_STAT LIKE ZSCP_PROJECT-PRJ_STAT.
DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
G_REPID TYPE SY-REPID,
TEMP_CAT1 TYPE SLIS_FIELDCAT_ALV,
HEADER_ALV1 TYPE SLIS_T_LISTHEADER,
HEADER_ALV_WA1 TYPE SLIS_LISTHEADER,
GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
DATA : SPRID TYPE ZSPR_PROJECT_ID.
DATA : CID TYPE ZCIRCLE_ID.
DATA : ITAB TYPE TABLE OF ZSCP_PROJECT.
DATA : WA TYPE ZSCP_PROJECT.
DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.
DATA : WA1 TYPE ZSCP_CIRCLE_M.
SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.
SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.
LOOP AT ITAB INTO WA.
READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.
WRITE : WA1-CIRCLE_DESC.
WRITE : WA-CIRCLE_ID,
WA-PROJECT_ID,
WA-DELEG_STAT,
WA-PRJ_STAT,
WA-FLCB,
WA-FLCL.
ENDLOOP.
*PERFORM FIELD_CATALOG1.
PERFORM alv_display1.
FORM FIELD_CATALOG1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'FLCB'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'FLCB1'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'FLCL'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'FLCL1'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
ENDFORM. "END CATALOG1.
FORM ALV_DISPLAY1.
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 = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE1 '
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 = GS_LAYOUT1
IT_FIELDCAT = CT_FIELDCAT1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A '
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.
Thanks and regards
Nagendra Kumarhi nagendra,
go through this code.
TYPE-POOLS : SLIS.
TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,
USR21,ADR6, BUT000.
SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.
SELECT-OPTIONS : S_SPR_ID FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.
PARAMETERS : P_STAT LIKE ZSCP_PROJECT-PRJ_STAT.
DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
G_REPID TYPE SY-REPID,
TEMP_CAT1 TYPE SLIS_FIELDCAT_ALV,
HEADER_ALV1 TYPE SLIS_T_LISTHEADER,
HEADER_ALV_WA1 TYPE SLIS_LISTHEADER,
GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
DATA : SPRID TYPE ZSPR_PROJECT_ID.
DATA : CID TYPE ZCIRCLE_ID.
DATA : ITAB TYPE TABLE OF ZSCP_PROJECT.
DATA : WA TYPE ZSCP_PROJECT.
DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.
DATA : WA1 TYPE ZSCP_CIRCLE_M.
SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.
SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.
LOOP AT ITAB INTO WA.
READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.
WRITE : WA1-CIRCLE_DESC.
WRITE : WA-CIRCLE_ID,
WA-PROJECT_ID,
WA-DELEG_STAT,
WA-PRJ_STAT,
WA-FLCB,
WA-FLCL.
ENDLOOP.
PERFORM FIELD_CATALOG1.
PERFORM alv_display1.
FORM FIELD_CATALOG1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'FLCB'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'FLCB1'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
CLEAR TEMP_CAT1.
TEMP_CAT1-TABNAME = 'ITAB'.
TEMP_CAT1-FIELDNAME = 'FLCL'.
TEMP_CAT1-KEY = 'X'.
TEMP_CAT1-SELTEXT_M = 'FLCL1'.
TEMP_CAT1-OUTPUTLEN = 10.
APPEND TEMP_CAT1 TO CT_FIELDCAT1.
ENDFORM. "END CATALOG1.
FORM ALV_DISPLAY1.
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 = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE1 '
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 = GS_LAYOUT1
IT_FIELDCAT = CT_FIELDCAT1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A '
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.
<b>please reward points if helpfull.</b>
with regards,
radhika kolluru. -
Excel view in ALV Grid---- Urgent
Hi,
On executing sample porgram BCALV_FULLSCREEN_DEMO, we get ALV grid display. After that, on Clicking "<b>Microsoft Excel View(controlshiftF7)</b>" we are getting blanck Excel screen view instead of the field values.
I have the same scenario requirement in real time. I want the excel screen with values from ALV Grid.
Thanks in Advance.
-Mohan.Hi Mohan,
Try this:
Download Data in EXCEL from ALV list display
1) Once you have alv report displayed in the screen.
2) Click button 'View' ( next to print button) on application toolbar
3) Select Excel in Place
4) This will download the same format as of Report
I hope your ALV have all the Standard functions in Toolbar. If not copy the status from and get the function as mentioned above.
<b>Program - SAPLSALV
Status - STANDARD</b>
Reward points if this Helps.
Manish
Maybe you are looking for
-
Adobe Acrobat 9 Standard Stopped working correctly
I have a legal licensed version of Adobe Acrobat 9 Standard that has worked fine for several years. Suddenly and possibly after one of the not so helpful updates, I can no longer delete, insert or extract pages. The delete option shows but is grayed
-
How to populate the webservice XML data in to Table ODI- Webserice invoke
Hi, I have multiple work orders in my oracle db table, That means multiple WorkOrder_Item_ID's are there in my source table. When I start transfer the data from source to Target using ODI , I need to get the information of multiple Work order Item_ID
-
XI - Can I Add Page Up and Down Buttons Back?
I just updated to XI and the page up and down buttons that used to be on the toolbar are gone. Is there a way to add them back? Thank you.
-
CRM 5.0 Business package
All, We have install CRM 5.0 Business Package on an EP7.0 box. A portal user has been assigned Partner Manager Channel Role ( com.sap.pct.crm.partnermngrcc). On logging into the portal with Partner Manager Role, the iviews associated to the Worksets
-
How to edit legend names in pie diagram graph
hi i have a spelling mistake in my lagend of pie graph now i need to edit it make correction of my legend name could any one please tell me the way to edit my legand plz...