Regarding ALV report to output in excel
How to do ALV report to output in excel format?
*& 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
Similar Messages
-
Can we adjust ROW height in ALV report as like of Excel ?
Dear all,
Can we adjust ROW height in ALV report as like of Excel sheet ?
Can we increase/decrease the row height in the output display ?
How ?kps204020 wrote:
Thanks a lot for your response.
I've tried your proposal, but it has no affect. The report cells show all their content using as much lines as necessary for this.This is the default behaviour for HTML table data (tables and cells expand to fit their content).
So I still have rows with lots of lines and rows with only a few lines mixed in my IR dependant on the cell content. Because some rows filling nearly the whole screen, it is difficult to get an overview with regard to adjacent rows.
I'm using Application Express 4.1.1.00.23. with Theme 21. Scarlet and Firefox 17.0.1.Are all users using Firefox?
Actually I'm working on my first APEX Solution for usage in my company and the customers demanding a solution for this topic . So I'm very keen to find a solution.
I'm very much looking forward to your response.I've been involved with similar issues in the past. My first response is simple: Does this data have to be shown in the report? Can the offending column(s) be removed from the primary report? They will still be visible in the single row view, and the detail view if there is one.
The second option is to create a detail view for the report with a structure that is better suited to the data involved, and make this the default view. (For an example of this, see the treatment of the PRODUCT_DESCRIPTION column in the detail view of the Products report in the Sample Database Application: click on the View Detail button on the Products page.)
The third possibility is some kind of customization of the presentation of the data. This will involve using some combination of HTML/CSS/Dynamic Actions/Plug-ins/JavaScript that you may not be familiar with: do you have experience of these? To go down that route you need to describe in detail how you want to present the data, or what behaviour is required when the data is too long, and share an example of the report on apex.oracle.com that we can work with. -
Help needed regarding ALV report
Hi,
I have a query regarding ALV report.
The requirement is as follows:-
When the user executes the ALV report and if he sums one numeric field column values and filters out some of the field columns ( for example there r 5 columns in the report and the user has filtered out 2 of them and viewing only 3 columns)
and now the requirements is that when the user runs the report later he should see the modified report ( i mean only 3 cloumns and the total value of the column which he has made) but not the original output which was there when the report was developed.
First of all i wanna know is it possible to do r not. If yes then how
Hope u have got what i want.
eagerly waiting for ur reply.
regards,
maqsoodHi
Yes you can! You have to manage the layout variant.
So when you call your ALV you have to set the parameter I_SAVE = 'A'.
In this way you'll allow the user to save the variants for layout.
After you has to have a chance to choose the variant in selection-screen.
See the demo program BCALV_GRID_11 to manage the variant in selection-screen.
Max -
Reports 6i output in excel?
Reports 6i output in excel?
Hello, iv done alot of googling on this and this seems to be a common problem, but i havent came across and simple consise solution.
Can anybody help me with this problem??
Excel output for Reports
thanks KHi,
there's a good overview document with a lot of detail links
Doc ID: 209770.1
Getting Reports Ouput to MS Excel - Techniques and References
regards
Rainer -
Regarding downloading from alv report o/p to excel sheet
Hi gurus,
When i am trying to download the alv output to excel sheet it is downloading only titles, No data is getting displayed in it.No data is getting downloaded.
Thnaks in advance.Hi,
What are the steps you do to download ALV to excel? We need to replicate the case in order to find answer.
Regards,
Teddy Kurniawan -
No column heading in second page in alv report when save in excel file
Hi Expert,
How can i remove the column header from Alv report when program execute in background and save in excel file right now
its comming column header in each page. Client dont want header column in excel from second page. is this possible?
with regards
chandan_vijiHi Ravi,
thanks for reply i have solved this problm throug line count and NEW-PAGE LINE COUNT 10000 bcoz client want output in excel file only one page header.
with regards
chandan_viji -
Hi experts 1 query regarding alv report running in background
when i run my alv report with 40 columns in background in spool when i get output disturbed 20 lines of first row is moving to second row so when i download to excel the o/p is completely disturbed and no use for me is there any way to solve this problem.please reply
hi ,
this will solve your problem
http://www.****************/Tutorials/ALV/Spool/width.htm
Increasing the width of the spool when using ALV List
By Aafaque Husain, YASH Technologies
Whenever an ALV report (with more number of columns) is scheduled in background, the output will be displayed in a zigzag fashion as shown below:
If we try to download the output from the spool or try to view the output, then we observe that the output is not in an appropriate fashion.
To get the right format of output in the spool we generally increase the u201Cno. of columns fieldu201D in the Format typesu201D. Have a look at the following screenshot:
Sometimes even when we change this field, we get the output truncated at the end, like last few columns are not displayed. There is certain limitation for this field, so that even if increase this value again, we find no change in the output display in spool.
This value is effective only when we check the check box u201CNumber of columns from list display formatu201D in the SPAD transaction.
Ø GO to SPAD Transaction code
Ø In the menu Settings -> Spool System as shown belowu2026
Ø In the others tab check the first check box in the Output Controller block, SAVE and exit.
Now Schedule the ALV report again by providing the output device and format, and then we get the full output in the spool as shown below:
Regards,
Madhavi -
Send ALV report as attachment in EXCEL format
Hi SAP Guru,
I had a report output as ALV format.
Currently, when the background job ended, it would be send out to the recipent thru SAPconnect as PDF format using internet mailing address.
I tried to search for a configuraiton for EXCEL output but there don;t seems to be any option availble.
I can only choose from PDF/TEXT/HTM/PS in the output document type selection in SOST.
How can I configure to allow the system to send out the ALV report to my recipent in EXCEL format instead of PDF or HTML?
ThanksHi,
By Using OOPS Concept you can send ALV Output as Excel Format by using Class Interface: CL_BCS.
Do some search on CL_BCS.
There are some demo Program, sreach for BCS* on SE38.
Thanks & Regards
M Nair -
XML Publisher report default output in Excel format.
Hi,
We have defined one concurrent program whose output format is text, this concurrent program executable is PL/SQL and in this PL/SQL program we are generating XML data and displaying XML using below fnd_request.
l_conc_id := FND_REQUEST.SUBMIT_REQUEST('GMP','GMPPDROP','', '',FALSE,
p_sequence_num,chr(0),'','','','','','','','','','','',
We have also defined template for this.
Using below fnd_request we are choosing template and data is getting generated in PDF format. Now our requirement is to display the output by default in Excel format.
FND_REQUEST.SUBMIT_REQUEST('XDO','XDOREPPB','', '',FALSE,'',
l_conc_id,554,G_comb_pdr_temp,
G_comb_pdr_locale,'Y','RTF','',scale_report,'','','','','',
When i saw XML Report Publisher concurrent program, there is one parameter for Output Format and i tried passing 'Excel'/EXCEL/excel to this parameter but output is still coming in PDF format.
FND_REQUEST.SUBMIT_REQUEST('XDO','XDOREPPB','', '',FALSE,'',
l_conc_id,554,G_comb_pdr_temp,
G_comb_pdr_locale,'Y','RTF','Excel',scale_report,'','','','','',
I have also tried giving Default Output to EXCEL in template definition but this is also not working.
Your valuable suggestions highly appreciated.
Thanks
VijayHi;
What is EBS version? Please see below which could be helpful for your issue:
Changing Output Format to RTF or Excel in XML Publisher Request Does Not Display Output Correctly [ID 404512.1]
Cannot View BI Publisher (formerly XML Publisher) Report Output In Excel Format or XHTML [ID 359875.1
How is Default Output Type Determined for Reports Submitted Using XML [ID 888972.1]
Also see:
XML PUBLISHER report in Excel out put problem
XML PUBLISHER report in Excel out put problem
Regard
Helios -
Problem in ALV report o/p to Excel
Hi to all
I have developed an ALV report, which is showing correct display and out put.
But when I am downloading it to excel, o/p is not coming in proper way. Fields are misplaced from there actual place and not in readable condition.
Please guide me..
Regards
AnubhavHello Lakshmiraj
I am sending you the coding of my ALV report program.
Please check.
REgards
Anubhav
*& Report YRMR033_AMENDMENT_ORDER_LIST
*& DEVELOPER : ANUBHAV GUPTA
*& DATE : 21.03.2008
*& REPORT DESCRIPTION : REPORT TO DISPLAY AMENDMENTS IN PURCDHASE ORDERS
WITH OLD VALUES AND NEW VALUES.
REPORT YRMR033_AMENDMENT_ORDER_LIST LINE-SIZE 132 NO STANDARD PAGE HEADING
LINE-COUNT 065(001)
MESSAGE-ID VR.
TABLES: DD04T,
CDHDR,
CDPOS,
DD03L,
DD41V,
T685T,
VBPA,
TPART,
KONVC,
EKKO.
TABLES : NAST, LFA1,ekpo.
SELECT-OPTIONS: "XUDATE FOR nast-erdat OBLIGATORY, "Created on date
XUDATE FOR CDHDR-UDATE OBLIGATORY, "Amendment date
S_EKGRP FOR EKKO-EKGRP,
s_lifnr for ekko-lifnr.
SELECTION-SCREEN SKIP.
DATA: WFLAG,
WCHANGENR LIKE CDHDR-CHANGENR.
DATA: INDTEXT(60) TYPE C.
DATA: BEGIN OF ICDHDR OCCURS 50.
INCLUDE STRUCTURE CDHDR.
DATA: END OF ICDHDR.
DATA: BEGIN OF ICDSHW OCCURS 50.
INCLUDE STRUCTURE CDSHW.
DATA: END OF ICDSHW.
DATA: BEGIN OF EKKEY,
EBELN LIKE EKET-EBELN,
EBELP LIKE EKET-EBELP,
ETENR LIKE EKET-ETENR,
END OF EKKEY.
DATA: BEGIN OF ITAB OCCURS 50,
BEGIN OF EKKEY,
EBELN LIKE EKET-EBELN,
EBELP LIKE EKET-EBELP,
ETENR LIKE EKET-ETENR,
END OF EKKEY,
ebeln like ekko-ebeln,
ebelp like ekpo-ebelp,
CHANGENR LIKE CDHDR-CHANGENR,
UDATE LIKE CDHDR-UDATE,
UTIME LIKE CDHDR-UTIME,
USERNAME LIKE CDHDR-USERNAME,
CHNGIND LIKE CDSHW-CHNGIND,
FNAME LIKE CDSHW-FNAME, "ADDED BY ANUBHAV
FTEXT LIKE CDSHW-FTEXT,
OUTLEN LIKE CDSHW-OUTLEN,
F_OLD LIKE CDSHW-F_OLD,
F_NEW LIKE CDSHW-F_NEW,
END OF ITAB.
DATA : BEGIN OF ITAB1 OCCURS 0,
EBELN LIKE EKET-EBELN,
bedat like ekko-bedat,
EBELP LIKE EKET-EBELP,
txz01 like ekpo-txz01,
lifnr like ekko-lifnr,
name1 like lfa1-name1,
UDATE LIKE CDHDR-UDATE,
FTEXT LIKE CDSHW-FTEXT,
F_OLD LIKE CDSHW-F_OLD,
ekgrp like ekko-ekgrp,
F_NEW LIKE CDSHW-F_NEW,
CHANGENR LIKE CDHDR-CHANGENR,
UTIME LIKE CDHDR-UTIME,
USERNAME LIKE CDHDR-USERNAME,
CHNGIND LIKE CDSHW-CHNGIND,
FNAME LIKE CDSHW-FNAME, "ADDED BY ANUBHAV
OUTLEN LIKE CDSHW-OUTLEN,
AMDNO TYPE CHAR4,
END OF ITAB1.
DATA: OLD_OBJECTID LIKE CDHDR-OBJECTID.
INTERNAL TABLES
----"modification
DATA: BEGIN OF I_NAST OCCURS 0,
OBJKY TYPE NAST-OBJKY,
ERDAT TYPE NAST-ERDAT,
KAPPL TYPE NAST-KAPPL,
KSCHL TYPE NAST-KSCHL,
PARVW TYPE NAST-PARVW,
PARNR TYPE NAST-PARNR,
ERUHR TYPE NAST-ERUHR,
AMDNO TYPE CHAR4,
EBELN TYPE EKKO-EBELN,
END OF I_NAST.
DATA : I_NAST1 LIKE TABLE OF I_NAST WITH HEADER LINE.
DATA: BEGIN OF I_TAB OCCURS 0,
OBJKY TYPE NAST-OBJKY,
ERDAT TYPE NAST-ERDAT,
KAPPL TYPE NAST-KAPPL,
KSCHL TYPE NAST-KSCHL,
PARVW TYPE NAST-PARVW,
PARNR TYPE NAST-PARNR,
ERUHR TYPE NAST-ERUHR,
END OF I_TAB.
DATA: INDEX TYPE I.
TYPE-POOLS : SLIS.
ALV Declarations *
DATA: W_REPID LIKE SY-REPID,
P_I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
P_I_HEADING TYPE SLIS_T_LISTHEADER,
I_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT,
I_HEADING TYPE SLIS_T_LISTHEADER.
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
SR TYPE I.
INITIALIZATION----
INITIALIZATION.
CLEAR I_NAST.
CLEAR I_TAB.
REFRESH I_NAST.
REFRESH I_TAB.
AT SELECTIN SCREEN----
AT SELECTION-SCREEN.
PERFORM DATA_VALIDATION.
TOP OF PAGE----
TOP-OF-PAGE.
PERFORM TOP_OF_PAGE.
END OF PAGE----
END-OF-PAGE.
START OF SELECTION----
START-OF-SELECTION.
PERFORM BUILD_COMMENT USING I_HEADING.
PERFORM EVENT_BUILD CHANGING I_EVENTS.
SELECT * FROM EKKO . " WHERE EBELN IN XEBELN AND
*LIFNR IN XLIFNR.
CLEAR CDHDR.
CLEAR CDPOS.
CDHDR-OBJECTCLAS = 'EINKBELEG'.
CDHDR-OBJECTID = EKKO-EBELN.
PERFORM GETCHGDOCS.
ENDSELECT.
DELETE ITAB WHERE ( FNAME NE 'NETPR'
AND FNAME NE 'NETWR'
AND FNAME NE 'MENGE' ).
loop at itab.
read table itab.
itab-ebeln = itab-ekkey+0(10).
itab-ebelp = itab-ekkey+11(4).
modify itab.
endloop.
LOOP AT ITAB.
MOVE-CORRESPONDING ITAB TO ITAB1.
APPEND ITAB1.
ENDLOOP.
LOOP AT ITAB1.
SELECT OBJKY ERDAT KAPPL KSCHL PARVW PARNR ERUHR
FROM NAST
INTO CORRESPONDING FIELDS OF TABLE I_NAST
WHERE OBJKY = ITAB1-EBELN
AND KAPPL = 'EF'
AND KSCHL = 'ZNEU'
AND PARVW = 'LF'
AND SPRAS = SY-LANGU.
IF SY-SUBRC NE 0.
DELETE ITAB1.
ENDIF.
LOOP AT I_NAST.
MOVE-CORRESPONDING I_NAST TO I_NAST1.
APPEND I_NAST1.
ENDLOOP.
ENDLOOP.
SORT I_NAST1 BY OBJKY ASCENDING ERDAT DESCENDING ERUHR DESCENDING.
DELETE ADJACENT DUPLICATES FROM I_NAST1 COMPARING OBJKY.
* Select data from TABLE NAST to get ebeln before selected date
IF I_NAST1[] IS NOT INITIAL.
SELECT OBJKY ERDAT KAPPL KSCHL PARVW PARNR ERUHR
FROM NAST
INTO CORRESPONDING FIELDS OF TABLE I_TAB
FOR ALL ENTRIES IN I_NAST1
WHERE OBJKY = I_NAST1-OBJKY
AND ERDAT <= I_NAST1-ERDAT
AND PARNR = I_NAST1-PARNR
AND KAPPL = 'EF'
AND KSCHL = 'ZNEU'
AND PARVW = 'LF'
AND SPRAS = SY-LANGU.
ENDIF.
Logic to get no of amendments for one po
LOOP AT I_NAST1.
CLEAR INDEX.
LOOP AT I_TAB WHERE OBJKY = I_NAST1-OBJKY.
INDEX = INDEX + 1.
ENDLOOP.
I_NAST1-AMDNO = INDEX - 1.
I_NAST1-EBELN = I_NAST1-OBJKY.
MODIFY I_NAST1 TRANSPORTING AMDNO EBELN.
ENDLOOP.
*LOOP AT I_NAST1.
*READ TABLE ITAB1 WITH KEY EBELN = I_NAST1-EBELN.
*IF SY-SUBRC = 0.
*ITAB1-AMDNO = I_NAST1-AMDNO.
*MODIFY ITAB1 TRANSPORTING AMDNO .
*ENDIF.
*ENDLOOP.
DELETE I_NAST1 WHERE AMDNO = 0. "ADDED BY ANUBHAV
LOOP AT ITAB1.
READ TABLE I_NAST1 WITH KEY EBELN = ITAB1-EBELN.
IF SY-SUBRC NE 0.
DELETE ITAB1.
ENDIF.
ENDLOOP.
loop at itab1.
select single *
from ekko
into ekko
where ebeln = itab1-ebeln.
if sy-subrc = 0.
itab1-bedat = ekko-bedat.
itab1-lifnr = ekko-lifnr.
itab1-ekgrp = ekko-ekgrp.
modify itab1.
endif.
endloop.
DELETE ITAB1 WHERE EKGRP NOT IN S_EKGRP.
DELETE ITAB1 WHERE LIFNR NOT IN S_LIFNR.
loop at itab1.
select single *
from lfa1
into lfa1
where lifnr = itab1-lifnr.
if sy-subrc = 0.
itab1-name1 = lfa1-name1.
modify itab1.
endif.
endloop.
loop at itab1.
select single *
from ekpo
into ekpo
where ebeln = itab1-ebeln
and ebelp = itab1-ebelp.
if sy-subrc = 0.
itab1-txz01 = ekpo-txz01.
modify itab1.
endif.
endloop.
sort itab1 by udate descending ebeln ebelp.
building field catelogue
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'Itab1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_L = 'PO NO '.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'Itab1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'BEDAT'.
WA_FIELDCAT-SELTEXT_L = 'PO DATE '.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'Itab1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'EBELP'.
WA_FIELDCAT-SELTEXT_L = 'Item No '.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'Itab1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'TXZ01'.
WA_FIELDCAT-SELTEXT_L = 'Item Description'.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'Itab1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'LIFNR'.
WA_FIELDCAT-SELTEXT_L = 'Vendor NO '.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'Itab1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'NAME1'.
WA_FIELDCAT-SELTEXT_L = 'Vendor Name'.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'ITAB1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'UDATE'.
WA_FIELDCAT-SELTEXT_L = 'Amendment Date'.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'ITAB1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'FTEXT'.
WA_FIELDCAT-SELTEXT_l = 'Change Field Description'.
WA_FIELDCAT-just = 'L'.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'ITAB1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'F_OLD'.
WA_FIELDCAT-SELTEXT_L = 'Old Value '.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
ADD 1 TO SR.
WA_FIELDCAT-COL_POS = SR.
WA_FIELDCAT-ROW_POS = 1.
WA_FIELDCAT-TABNAME = 'ITAB1'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-FIELDNAME = 'F_NEW'.
WA_FIELDCAT-JUST = 'L' .
WA_FIELDCAT-SELTEXT_L = 'New Value '.
APPEND WA_FIELDCAT TO P_I_FIELDCAT.
CLEAR WA_FIELDCAT.
DATA : L_REPID TYPE SYREPID,
L_REPID1 LIKE DISVARIANT.
L_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = 'X'
I_CALLBACK_PROGRAM = L_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = P_I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'X'
IS_VARIANT = L_REPID1
IT_EVENTS = I_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 = ITAB1[]
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.
*& Form GETCHGDOCS
text
FORM GETCHGDOCS.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
DATE_OF_CHANGE = CDHDR-UDATE
OBJECTCLASS = CDHDR-OBJECTCLAS
OBJECTID = CDHDR-OBJECTID
TIME_OF_CHANGE = CDHDR-UTIME
USERNAME = CDHDR-USERNAME
TABLES
I_CDHDR = ICDHDR
EXCEPTIONS
NO_POSITION_FOUND = 1
OTHERS = 2.
CHECK SY-SUBRC EQ 0.
DELETE ICDHDR WHERE CHANGE_IND EQ 'I'.
CHECK NOT ICDHDR[] IS INITIAL.
LOOP AT ICDHDR.
CHECK ICDHDR-UDATE IN XUDATE.
CHECK ICDHDR-USERNAME IN XNAME.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
CHANGENUMBER = ICDHDR-CHANGENR
IMPORTING
HEADER = CDHDR
TABLES
EDITPOS = ICDSHW
EXCEPTIONS
NO_POSITION_FOUND = 1
OTHERS = 2.
CHECK SY-SUBRC EQ 0.
DELETE ICDSHW WHERE ( CHNGIND NE 'U' OR TABNAME NE 'EKPO' ).
LOOP AT ICDSHW.
CHECK ICDSHW-TEXT_CASE EQ SPACE.
MOVE-CORRESPONDING ICDSHW TO ITAB.
MOVE-CORRESPONDING ICDHDR TO ITAB.
MOVE ICDSHW-TABKEY+3 TO ITAB-EKKEY.
APPEND ITAB.
ENDLOOP.
ENDLOOP.
ENDFORM. "GETCHGDOCS
*& Form BUILD_COMMENT
text
-->P_I_HEADING text
FORM BUILD_COMMENT USING P_I_HEADING TYPE SLIS_T_LISTHEADER.
DATA: WA_LINE TYPE SLIS_LISTHEADER,
TEXT1(50) TYPE C,
TEXT2(40) TYPE C,
W_DATE1(10) TYPE C,
W_DATE2(10) TYPE C.
CONCATENATE ' CHAMBAL FERTILISERS AND CHEMICALS LIMITED' ' ' INTO TEXT1.
WA_LINE-TYP = 'H'.
WA_LINE-INFO = TEXT1.
APPEND WA_LINE TO P_I_HEADING.
CLEAR TEXT1.
CONCATENATE ' AMENDED ORDERS' ' ' INTO TEXT1.
WA_LINE-TYP = 'S'.
WA_LINE-INFO = TEXT1.
APPEND WA_LINE TO P_I_HEADING.
write xudate-low to w_date1 DD/MM/YYYY .
write xudate-high to w_date2 DD/MM/YYYY .
concatenate 'PERIOD FROM : ' W_DATE1 ' TO ' W_DATE2 INTO TEXT2 SEPARATED BY SPACE.
WA_LINE-TYP = 'S'.
WA_LINE-INFO = TEXT2.
APPEND WA_LINE TO P_I_HEADING.
ENDFORM. " build_comment
*& Form EVENT_BUILD
text
-->P_I_EVENTS text
FORM EVENT_BUILD CHANGING P_I_EVENTS TYPE SLIS_T_EVENT.
DATA: W_EVENT TYPE SLIS_ALV_EVENT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = P_I_EVENTS.
READ TABLE P_I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO W_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_TOP_OF_PAGE TO W_EVENT-FORM.
APPEND W_EVENT TO P_I_EVENTS.
ENDIF.
ENDFORM. " event_build
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_HEADING
I_LOGO = 'CFCLLOGO'.
ENDFORM. " top_of_page -
Urgent: regarding ALV report display problem
hi,
There are 3 problems:-
1.) I had made a ALV report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as PERIOD :- _______ to _______ on alv report ..
2.)the 2nd problem is dat when i use the ' wa_fieldcat-no_zero = 'X'. It eliminates all the leading zeros which are present which is okay when i it displays material no.. but the problem is dat it also deletes the other fields where the values are to be zeros.
i had used this FM:-
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ITS1-MATNR
IMPORTING
OUTPUT = ITS1-MATNR.
so that only matnr field are to be 0's.
3.) I want to delete the rows which use to contain the values 0's as there are no calculations are performing as these are displayed .
ANYbody having solution of this problem ,plzzzz provide the soluion of it as it is most urgent to me and dat person will definately rewarded.
regards,
ric.shi kiran,
thanks for ur response. here is d code which i am using it and plzz help me to figure out where i have to make changes:-
REPORT ZTEST03.
TABLES: ISEG,MARA.
TYPE-POOLS : SLIS.
INTERNAL TABLE FOR INVENTORY STOCK *****************
DATA: BEGIN OF ITS1 OCCURS 0,
MATNR LIKE ISEG-MATNR,
MEINS LIKE ISEG-MEINS,
MENGE LIKE ISEG-MENGE,
WRTZL LIKE ISEG-WRTZL,
BUCHM LIKE ISEG-BUCHM,
WRTBM LIKE ISEG-WRTBM,
WERKS LIKE ISEG-WERKS,
BUDAT LIKE ISEG-BUDAT,
MTART LIKE MARA-MTART,
ITEMDESC LIKE MAKT-MAKTX,
DIFFQTY LIKE ISEG-BUCHM,
DIFFVALUE LIKE ISEG-WRTBM,
END OF ITS1.
data: t_heading type slis_t_listheader.
SELECTION-SCREEN BEGIN OF BLOCK PAR1 WITH FRAME TITLE TEXT-001.
*********PARAMETERS*********
PARAMETERS : PLANT LIKE ISEG-WERKS OBLIGATORY.
*********SELECTION SCREEN OPTIONS*********
SELECT-OPTIONS : R_DATE FOR ISEG-BUDAT,
M_TYPE FOR MARA-MTART,
IT_M FOR MARA-MATNR.
*********DEFINING VARIABLES*********
SELECTION-SCREEN END OF BLOCK par1.
TOP-OF-PAGE.
PERFORM PG_HEADER.
START-OF-SELECTION.
SELECT DISTINCT A~MATNR A~MEINS A~MENGE A~WRTZL A~BUCHM A~WRTBM A~WERKS A~BUDAT B~MTART
FROM ISEG AS A INNER JOIN MARA AS B ON B~MATNR = A~MATNR
INTO CORRESPONDING FIELDS OF TABLE ITS1 WHERE B~MATNR = A~MATNR AND B~MEINS = A~MEINS AND A~WERKS = PLANT AND A~BUDAT IN R_DATE AND B~MTART IN M_TYPE AND B~MATNR IN IT_M.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ITS1-MATNR
IMPORTING
OUTPUT = ITS1-MATNR.
SORT ITS1 BY MATNR.
DELETE ADJACENT DUPLICATES FROM ITS1 WHERE MENGE = 0 AND BUCHM = 0.
LOOP AT ITS1.
ITS1-DIFFQTY = ITS1-MENGE - ITS1-BUCHM.
ITS1-DIFFVALUE = ITS1-WRTZL - ITS1-WRTBM.
SELECT SINGLE MAKTX FROM MAKT INTO ITS1-ITEMDESC WHERE MATNR = ITS1-MATNR.
MODIFY ITS1.
ENDLOOP.
PERFORM PRN_SMSTOCK_ALV.
WRITING DATA FROM D TABLES**********
FORM PG_HEADER.
WRITE : 'PHYSICAL INVENTORY AUDIT REPORT PLANT : ', PLANT.
ENDFORM.
*& Form PRN_SMSTOCK_ALV
text
--> p1 text
<-- p2 text
form PRN_SMSTOCK_ALV .
data: w_title type lvc_title,
w_repid type syrepid,
w_comm type slis_formname,
w_status type slis_formname,
x_layout type slis_layout_alv,
t_event type slis_t_event,
t_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv.
refresh t_fieldcat.
refresh t_event.
refresh t_sort.
clear x_layout.
clear w_title.
perform set_fieldcat2 using:
1 'MTART' 'MTART' 'MARA' '15' space 'MATERIAL TYPE' space space space space space space space space SPACE t_fieldcat 'L' 'C',
2 'MATNR' 'MATNR' 'MARA' '13' space 'MATERIAL NO. ' space space space space space space space space SPACE t_fieldcat 'R' 'C',
3 'ITEMDESC' 'MAKTX' 'MAKT' '25' space 'MATERIAL DESCRIPTION' space space space space space space space space SPACE t_fieldcat 'L' 'C',
4 'MEINS' 'MEINS' 'MARA' '5' space 'UOM' space space space space space space space space SPACE t_fieldcat 'C' 'C',
5 'MENGE' 'MENGE' 'ISEG' '13' space 'ORG.INV.QTY' space space space space space space space space SPACE t_fieldcat 'R' 'C',
6 'WRTZL' 'WRTZL' 'ISEG' '13' space 'ORG.INV.VALUE' space space space space space space space space SPACE t_fieldcat 'R' 'C',
7 'BUCHM' 'BUCHM' 'ISEG' '13' space 'PHY.INV.QTY' space space space space space space space space SPACE t_fieldcat 'R' 'C',
8 'WRTBM' 'WRTBM' 'ISEG' '13' space 'PHY.INV.VALUE' space space space space space space space space SPACE t_fieldcat 'R' 'C',
9 'DIFFQTY' 'MENGE' 'ISEG' '13' space 'DIFF.INV.QTY' space space space space space space space space SPACE t_fieldcat 'R' 'C',
10 'DIFFVALUE' 'WRTZL' 'ISEG' '13' space 'DIFF.INV.VALUE' space space space space space space space space SPACE t_fieldcat SPACE 'P'.
x_layout-zebra = 'X'.
perform set_top_page_heading using t_heading t_event.
perform set_events using t_event.
w_status = ''.
w_repid = sy-repid.
w_comm = 'USER_COMMAND'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = w_repid
it_fieldcat = t_fieldcat
i_Callback_top_of_page = 'Top-of-page'
is_layout = x_layout
it_sort = t_sort
i_callback_pf_status_set = w_status
i_callback_user_command = w_comm
i_save = 'X'
it_events = t_event
i_grid_title = w_title
tables
t_outtab = ITS1
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.
FORM set_fieldcat2 USING
p_colpos p_fieldname p_ref_fieldname p_ref_tabname
p_outputlen p_noout
p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
p_hotspot p_showasicon p_checkbox p_edit
p_dosum
t_fieldcat TYPE slis_t_fieldcat_alv
P_JUST
P_FTYPE.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
General settings
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-col_pos = p_colpos.
wa_fieldcat-no_out = p_noout.
wa_fieldcat-hotspot = p_hotspot.
wa_fieldcat-checkbox = p_checkbox.
wa_fieldcat-icon = p_showasicon.
wa_fieldcat-do_sum = p_dosum.
Set output length.
IF NOT p_outputlen IS INITIAL.
wa_fieldcat-outputlen = p_outputlen.
ENDIF.
Set text headers.
IF NOT p_seltext_m IS INITIAL.
wa_fieldcat-seltext_m = p_seltext_m.
ENDIF.
IF NOT p_seltext_l IS INITIAL.
wa_fieldcat-seltext_l = p_seltext_l.
ENDIF.
IF NOT p_seltext_s IS INITIAL.
wa_fieldcat-seltext_s = p_seltext_s.
ENDIF.
IF NOT p_reptext_ddic IS INITIAL.
wa_fieldcat-reptext_ddic = p_reptext_ddic.
ENDIF.
IF NOT p_ddictxt IS INITIAL.
wa_fieldcat-ddictxt = p_ddictxt.
ENDIF.
IF NOT P_JUST IS INITIAL.
WA_FIELDCAT-JUST = P_JUST.
ENDIF.
Set as editable or not.
IF NOT p_edit IS INITIAL.
wa_fieldcat-input = 'X'.
wa_fieldcat-edit = 'X'.
ENDIF.
APPEND wa_fieldcat TO t_fieldcat.
ENDFORM. "set_fieldcat2
======================== Subroutines called by ALV ================
*& Form top_of_page
Called on top_of_page ALV event.
Prints the heading.
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_heading.
ENDFORM.
form set_top_page_heading using t_heading type slis_t_listheader
t_events type slis_t_event.
data: x_heading type slis_listheader,
x_event type line of slis_t_event.
Report title
clear t_heading[].
clear x_heading.
x_heading-typ = 'H'.
x_heading-info = 'PHYSICAL INVENTORY AUDIT REPORT'.
append x_heading to t_heading.
Plant Name
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'PLANT: '.
x_heading-info = its1-werks.
append x_heading to t_heading.
Posting Date
*clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'POSTING DATE: '.
x_heading-info = ITS1-BUDAT.
append x_heading to t_heading.
Control Date
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'CONTROL No: '.
x_heading-info = its1-werks.
append x_heading to t_heading.
Control date
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'CONTROL DATE: '.
x_heading-info = its1-werks.
append x_heading to t_heading.
User who is running the report
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'User: '.
x_heading-info = sy-uname.
append x_heading to t_heading.
Date of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Date: '.
write sy-datum to x_heading-info.
append x_heading to t_heading.
Time of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Time: '.
write sy-uzeit to x_heading-info.
append x_heading to t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-form = 'TOP_OF_PAGE'.
append x_event to t_events.
endform.
form set_events using t_events type slis_t_event.
data: x_event type line of slis_t_event.
endform.
plzzz help me out as it is most urgent to me.
regards,
ric.s -
When I am trying to down load the ALV report to EXCEL. The report fields are not coming in the same order as they are in the report.
Please advice.
<b><REMOVED BY MODERATOR></b>
Thank you.
Gouri.
Message was edited by:
Alvaro Tejada GalindoHi,
You can use the FM - ALV_XXL_CALL.
It is the same function module invoked when you click on the export to excel button of the ALV.
You can pass teh field catalog of the ALV here along with the name of ur internal table and the internal table itself. It will download everything to Excel alongwith the Column headers ( depending on ur field catalog definition). Just make sure ur field catalog has the COL_Heading correctly populated.
<b>
Sample Code -</b> CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
i_tabname = 'T_GRID' " Name of the Internal table
it_fieldcat = t_fcatk[] " Field catalog
TABLES
it_outtab = t_grid " Interbnal table with data
EXCEPTIONS
fatal_error = 1
no_display_possible = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e806(bk).
ENDIF.
Regards
Sudheer -
Hi to all
I am preparing a ALV report.
In which I want to display the values which are entered on selection screen.
On the selection screen these are the fields :
s_werks for pa0001-werks
s_orgeh for pa0001-orgeh
I am successful to capture one value (s_orgeh-low) but if multiple values are selected then how to display.
Plz guide me...Hi,
try like this..in the belwo code first FM captures the selection screen fields and the second function mdoule dispalys them in the output.
DATA :
Internal table for Selection screen parameters
i_seltable TYPE STANDARD TABLE OF rsparams.
*& Form get_selection_screen
Subroutine to get the user selection on selection screen
FORM get_selection_screen .
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = sy-repid
TABLES
selection_table = i_seltable
EXCEPTIONS
not_found = 01
no_report = 02.
IF sy-subrc NE 0.
REFRESH i_seltable.
ENDIF.
ENDFORM. " get_selection_screen
*& Form display_selection_criteria
Subroutine to display the selction criteria in the output
FORM display_selection_criteria .
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = sy-repid
seltext = c_x
newpage = space
TABLES
sel_tab = i_seltable
EXCEPTIONS
sel_tab_empty = 1
OTHERS = 2.
IF sy-subrc <> 0.
REFRESH i_seltable.
ENDIF.
ENDFORM. " display_selection_criteria
Regards,
Nagaraj -
Hi all,
I've created an ALV report which is having a editable checkbox box field and some more fields that are not editable.
My requirement is that when i check any checkbox, some of the fields in that particular row should become editable.
In table control it can be done easily but can it be done in ALV.
Note: I have created the ALV through container as it was required.
Thanks in Advance.
Regards
DheerajHi,
Basically you will have to first register the data change event after you display the grid as follows:-
CALL METHOD y_lobj_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>MC_EVT_MODIFIED
EXCEPTIONS
error = 1
OTHERS = 2.
Here Y_LOBJ_GRID is my grid object of type CL_GUI_ALV_GRID.
Then you will have to set a handler method for this.
SET HANDLER y_obj_evt_handler->y_m_handle_cell_modified
FOR Y_LOBJ_GRID.
Here y_obj_evt_handler is a local class in your program and y_m_handle_cell_modified is the method of that class.
In this method you can change the fields to make then editable or non editable.
Regards,
Ankur Parab -
SAP ALV report scheduling background in excel format
Hi Gurus,
We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.Now I want to change this pdf format to excel format.In SCOT T.Code I am able to find any excel format.Please help me out.
I am waiting for your reply.
Advance Thanks
Nirmal> We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.
"Something" has to do the conversion to excel, it will not work without programming.
If you display a grid the data is sent via OLE to the frontend where excel is started and displaying the data. If you run a program in the background there is no terminal connection and hence no excel and hence no conversion.
What you can do is that you display the data as raw data and send it as attachment - but then people need to import and convert themselves.
Markus
Maybe you are looking for
-
Forms 9.0 (Imagem)
I am making a system in Forms 9 and I need to do a screen that will record some images (BLOB). THE problem is in as to capture this image in Forms 9 since he works in the Web. Respectfully Alessandro
-
Robohelp 8.0.2 update applicable for TCS2 version?
Hi all, just a quick question, I'm having TCS2 installed on my machine shortly, uninstalling my existing RH 8.0.2 install, just want to know if I should be applying the 8.0.2 update to TCS2, or if this issue was evening happening with RH in the TCS.
-
Regular Expressions - Email Validation
According to RFC-2822 and RFC-2821 specifications the local part of email addresses are allowed to contain a whitespace character as long as it is within quotations. The rest of my regular expression works fine I am battling to find out how to match
-
Hi all, Here is the steps I followed in Oracle 10g R2 on Win XP: 1. As an OS admininstrator I issued the following commands c:\LSNRCTL LSNRCTL> change_password Old password: New password: Reenter new password: Connecting to (DESCRIPTION=(ADDRESS=(PRO
-
Hi guys, I have this page which calls the same query (across a database link!) four times! First when an initial LOV is generated (and the page is loaded), again for another LOV based off the initial one and finally for the report generated based off