工作生活与爱好

工作中的记录; 生活中的记忆; 业余爱好的记载。

2007-01-25

 

Report to display 12 weeks forecast, Yesterday Stocks, Onhand Stocks, MTD Pull, MTD GR

*
* Report list last 12 Week Forecast, Yesterday, MTD PULL, Onhand Stock,
* MTD PO, MTD GR or NEXT MONTH PO
*
REPORT ZAI_WEEKLY LINE-SIZE 255 NO STANDARD PAGE HEADING
LINE-COUNT 065(001).

TABLES: MDKP, "Header Data for MRP Document
MDTB, "MRP table
MKPF, "Header: Material Document
MSEG, "Document Segment: Material
MARD, "Storage Location Data for Material
EKKO, "Purchasing Document Header
EKPO, "Purchasing Document Item
EKET, "Scheduling Agreement Schedule Lines
MARC, "Plant Data for Material
EINA, "Purchasing Info Record: General Data
MARA, "General Material Data
PBIM, "Independent requirements for material
PBED. "Independent requirements data

DATA: BEGIN OF INT_MRP OCCURS 100,
MATNR(18) TYPE C,
MENGE TYPE P DECIMALS 0,
MTDPULL TYPE P DECIMALS 0,
ONHAND TYPE P DECIMALS 0,
MTDGR TYPE P DECIMALS 0,
MTDPOORD TYPE P DECIMALS 0,
MTDPODEL TYPE P DECIMALS 0,
NEXPOORD TYPE P DECIMALS 0,
NEXPODEL TYPE P DECIMALS 0,
PLNMG01 TYPE P DECIMALS 0,
PLNMG02 TYPE P DECIMALS 0,
PLNMG03 TYPE P DECIMALS 0,
PLNMG04 TYPE P DECIMALS 0,
PLNMG05 TYPE P DECIMALS 0,
PLNMG06 TYPE P DECIMALS 0,
PLNMG07 TYPE P DECIMALS 0,
PLNMG08 TYPE P DECIMALS 0,
PLNMG09 TYPE P DECIMALS 0,
PLNMG10 TYPE P DECIMALS 0,
PLNMG11 TYPE P DECIMALS 0,
PLNMG12 TYPE P DECIMALS 0,
END OF INT_MRP.

DATA: BEGIN OF INT_DATE,
DATE01(12) TYPE C,
DATE02(12) TYPE C,
DATE03(12) TYPE C,
DATE04(12) TYPE C,
DATE05(12) TYPE C,
DATE06(12) TYPE C,
DATE07(12) TYPE C,
DATE08(12) TYPE C,
DATE09(12) TYPE C,
DATE10(12) TYPE C,
DATE11(12) TYPE C,
DATE12(12) TYPE C,
END OF INT_DATE.

DATA: BEGIN OF MDTBX OCCURS 0.
INCLUDE STRUCTURE MDTB.
DATA: END OF MDTBX.

DATA: NO01(2) TYPE N,
FN01(20),
FN02(20),
X_MONTH01(20),
X_MONTH02(20),
X_MONTH03(20),
X_MONTH04(20),
X_MONTH05(20),
X_MONTH06(20),
X_MONTH07(20),
X_MONTH08(20),
X_MONTH09(20),
X_MONTH10(20),
X_MONTH11(20),
X_MONTH12(20).
FIELD-SYMBOLS: , .

DATA: FDATE LIKE SY-DATUM,
LDATE LIKE SY-DATUM,
XDATE LIKE SY-DATUM.

DATA: BEGIN OF INT_PBED,
BDZEI TYPE PBED-BDZEI,
PLNMG TYPE PBED-PLNMG,
PDATU TYPE PBED-PDATU,
END OF INT_PBED,
ITAB_PBED LIKE TABLE OF INT_PBED.

DATA: BEGIN OF INT_MKPF,
VGART TYPE MKPF-VGART,
BUDAT TYPE MKPF-BUDAT,
MBLNR TYPE MKPF-MBLNR,
MJAHR TYPE MKPF-MJAHR,
END OF INT_MKPF,
ITAB_MKPF LIKE TABLE OF INT_MKPF.

DATA: BEGIN OF INT_MSEG,
MBLNR TYPE MSEG-MBLNR,
MJAHR TYPE MSEG-MJAHR,
MATNR TYPE MSEG-MATNR,
MENGE TYPE MSEG-MENGE,
DMBTR TYPE MSEG-DMBTR,
SHKZG TYPE MSEG-SHKZG,
END OF INT_MSEG,
ITAB_MSEG LIKE TABLE OF INT_MSEG.

DATA: BEGIN OF INT_MARD,
MATNR TYPE MARD-MATNR,
DISKZ TYPE MARD-DISKZ,
LABST TYPE MARD-LABST,
END OF INT_MARD,
ITAB_MARD LIKE TABLE OF INT_MARD.

DATA: BEGIN OF INT_EKKO,
BUKRS TYPE EKKO-BUKRS,
EBELN TYPE EKKO-EBELN,
END OF INT_EKKO,
ITAB_EKKO LIKE TABLE OF INT_EKKO.

DATA: BEGIN OF INT_EKPO,
EBELN TYPE EKPO-EBELN,
EBELP TYPE EKPO-EBELP,
MATNR TYPE EKPO-MATNR,
END OF INT_EKPO,
ITAB_EKPO LIKE TABLE OF INT_EKPO.

SELECT-OPTIONS: X_MATNR FOR MDKP-MATNR, "Material number
X_WERKS FOR MDKP-PLWRK, "Plant
X_EKGRP FOR MARC-EKGRP, "Purchasing group
X_BESKZ FOR MARC-BESKZ, "Procurement Type
X_SPART FOR MARA-SPART, "Procurement Type
X_LIFNR FOR EINA-LIFNR, "Vendor's account number
X_BUDAT FOR MDTB-DAT00, "Posting Date
X_BUDAT2 FOR MDTB-DAT00.

START-OF-SELECTION.
PERFORM DATA_ONHAND.
PERFORM DATA_MRP.
PERFORM YESTERDAY_PULL.
PERFORM DATA_MTD_PULL.
PERFORM DATA_MTD_GR.
PERFORM DATA_MTD_PO.
* PERFORM DATA_NEX_PO.
PERFORM LOOP_INT_MRP.
END-OF-SELECTION.

FORM DATA_ONHAND.
CLEAR ITAB_MARD.
INT_MARD-DISKZ = ' '.
APPEND INT_MARD TO ITAB_MARD.

SELECT WERKS MATNR LGORT LABST
INTO CORRESPONDING FIELDS OF INT_MARD
FROM MARD FOR ALL ENTRIES IN ITAB_MARD
WHERE DISKZ = ITAB_MARD-DISKZ "Storage location MRP indicator
AND WERKS IN X_WERKS
AND MATNR IN X_MATNR.

* Check Purchase Group, Procurement Type
SELECT SINGLE * FROM MARC WHERE LVORM = ' '
AND WERKS IN X_WERKS
AND MATNR = INT_MARD-MATNR
AND EKGRP IN X_EKGRP
AND BESKZ IN X_BESKZ.
IF SY-SUBRC <> 0. CONTINUE. ENDIF.

* Check Purchasing Info
SELECT SINGLE * FROM EINA WHERE LOEKZ = ' '
AND MATNR = INT_MARD-MATNR
AND LIFNR IN X_LIFNR.
IF SY-SUBRC <> 0. CONTINUE. ENDIF.

* Check Division
SELECT SINGLE * FROM MARA WHERE LVORM = ''
AND MATNR = INT_MARD-MATNR
AND SPART IN X_SPART.
IF SY-SUBRC <> 0. CONTINUE. ENDIF.

* WRITE:/ INT_MARD-MATNR, INT_MARD-LABST.

INT_MRP-ONHAND = INT_MARD-LABST.
INT_MRP-MATNR = INT_MARD-MATNR.
COLLECT INT_MRP.
CLEAR INT_MRP.
ENDSELECT.
ENDFORM.

FORM DATA_MRP.
* MDTB-DELKZ :-
* PP - IndReq
* SB - DepReq
* AR - OrdRes
LOOP AT INT_MRP.
SELECT SINGLE * FROM PBIM WHERE WERKS IN X_WERKS
AND MATNR = INT_MRP-MATNR.
INT_PBED-BDZEI = PBIM-BDZEI.
APPEND INT_PBED TO ITAB_PBED.
CLEAR NO01.
SELECT BDZEI PLNMG PDATU
INTO CORRESPONDING FIELDS OF INT_PBED
FROM PBED FOR ALL ENTRIES IN ITAB_PBED
WHERE BDZEI = ITAB_PBED-BDZEI.
ADD 1 TO NO01.
CONCATENATE 'INT_MRP-PLNMG' NO01 INTO FN01.
CONCATENATE 'INT_DATE-DATE' NO01 INTO FN02.
ASSIGN (FN01) TO .
ASSIGN (FN02) TO .

ADD INT_PBED-PLNMG TO .
= INT_PBED-PDATU.

MODIFY INT_MRP.

IF NO01 => 12.
EXIT.
ENDIF.
ENDSELECT.
ENDLOOP.
ENDFORM.

FORM YESTERDAY_PULL.
INT_MKPF-BUDAT = SY-DATUM - 1.
APPEND INT_MKPF TO ITAB_MKPF.

SELECT BUDAT MBLNR MJAHR
INTO CORRESPONDING FIELDS OF INT_MKPF
FROM MKPF FOR ALL ENTRIES IN ITAB_MKPF
WHERE BUDAT = ITAB_MKPF-BUDAT.

* WRITE: / INT_MKPF-BUDAT, INT_MKPF-MBLNR, INT_MKPF-MJAHR.

CLEAR ITAB_MSEG.
INT_MSEG-MBLNR = INT_MKPF-MBLNR.
INT_MSEG-MJAHR = INT_MKPF-MJAHR.
APPEND INT_MSEG TO ITAB_MSEG.
SELECT MBLNR MJAHR MATNR MENGE DMBTR SHKZG
INTO CORRESPONDING FIELDS OF INT_MSEG
FROM MSEG FOR ALL ENTRIES IN ITAB_MSEG
WHERE MBLNR = ITAB_MSEG-MBLNR
AND MJAHR = ITAB_MSEG-MJAHR
AND MATNR IN X_MATNR
AND LGORT IN ('G1', 'G2', 'G3', 'G4')
AND BWART IN ('311', '312').

IF INT_MSEG-SHKZG = 'S'.
MULTIPLY INT_MSEG-MENGE BY -1.
MULTIPLY INT_MSEG-DMBTR BY -1.
ENDIF.

* WRITE: / INT_MSEG-MBLNR, INT_MSEG-MATNR, INT_MSEG-MENGE.
INT_MRP-MENGE = INT_MSEG-MENGE.
INT_MRP-MATNR = INT_MSEG-MATNR.
COLLECT INT_MRP.
CLEAR INT_MRP.
ENDSELECT.
ENDSELECT.

ENDFORM.

FORM DATA_MTD_PULL.
INT_MKPF-VGART = ' '.
APPEND INT_MKPF TO ITAB_MKPF.
SELECT BUDAT MBLNR MJAHR
INTO CORRESPONDING FIELDS OF INT_MKPF
FROM MKPF FOR ALL ENTRIES IN ITAB_MKPF
WHERE VGART <> ITAB_MKPF-VGART
AND BUDAT IN X_BUDAT.

* MTD Pull
SELECT * FROM MSEG WHERE WERKS IN X_WERKS
AND MBLNR = INT_MKPF-MBLNR
AND MJAHR = INT_MKPF-MJAHR
AND MATNR IN X_MATNR
AND LGORT IN ('G1', 'G2',
'G3', 'G4')
AND BWART IN ('311', '312').
IF MSEG-SHKZG = 'S'.
MULTIPLY MSEG-MENGE BY -1.
MULTIPLY MSEG-DMBTR BY -1.
ENDIF.

INT_MRP-MTDPULL = MSEG-MENGE.
INT_MRP-MATNR = MSEG-MATNR.

COLLECT INT_MRP.
CLEAR INT_MRP.

ENDSELECT.

ENDSELECT.
ENDFORM.

FORM DATA_MTD_GR.
INT_MKPF-VGART = ' '.
APPEND INT_MKPF TO ITAB_MKPF.
SELECT BUDAT MBLNR MJAHR
INTO CORRESPONDING FIELDS OF INT_MKPF
FROM MKPF FOR ALL ENTRIES IN ITAB_MKPF
WHERE VGART <> ITAB_MKPF-VGART
AND BUDAT IN X_BUDAT.

* MTD Goods Receipts
SELECT * FROM MSEG WHERE WERKS IN X_WERKS
AND MBLNR = INT_MKPF-MBLNR
AND MJAHR = INT_MKPF-MJAHR
AND MATNR IN X_MATNR
AND LGORT IN ('G1')
AND BWART IN ('101', '102').
IF MSEG-SHKZG = 'H'.
MULTIPLY MSEG-MENGE BY -1.
MULTIPLY MSEG-DMBTR BY -1.
ENDIF.

INT_MRP-MTDGR = MSEG-MENGE.
INT_MRP-MATNR = MSEG-MATNR.

COLLECT INT_MRP.
CLEAR INT_MRP.

ENDSELECT.

ENDSELECT.
ENDFORM.

FORM DATA_MTD_PO.
CLEAR ITAB_EKKO.
INT_EKKO-BUKRS = '0010'. "Company Code
APPEND INT_EKKO TO ITAB_EKKO.
SELECT BUKRS EBELN
INTO CORRESPONDING FIELDS OF INT_EKKO
FROM EKKO FOR ALL ENTRIES IN ITAB_EKKO
WHERE BUKRS = ITAB_EKKO-BUKRS
AND LOEKZ = ' '.

CLEAR ITAB_EKPO.
INT_EKPO-EBELN = INT_EKKO-EBELN.
APPEND INT_EKPO TO ITAB_EKPO.
SELECT EBELN EBELP MATNR
INTO CORRESPONDING FIELDS OF INT_EKPO
FROM EKPO FOR ALL ENTRIES IN ITAB_EKPO
WHERE EBELN = ITAB_EKPO-EBELN
AND MATNR IN X_MATNR
AND LOEKZ = ' '
* "Delivery completed" indicator
AND ELIKZ = ' '.

CLEAR EKET.
SELECT SINGLE * FROM EKET WHERE EBELN = INT_EKPO-EBELN
AND EBELP = INT_EKPO-EBELP
AND EINDT IN X_BUDAT.
IF SY-SUBRC = 0.
INT_MRP-MATNR = INT_EKPO-MATNR.
INT_MRP-MTDPOORD = EKET-MENGE.
INT_MRP-MTDPODEL = EKET-WEMNG.
COLLECT INT_MRP.
CLEAR INT_MRP.
ENDIF.
ENDSELECT.
ENDSELECT.
ENDFORM.

FORM DATA_NEX_PO.
CLEAR ITAB_EKKO.
INT_EKKO-BUKRS = '0010'. "Company Code
APPEND INT_EKKO TO ITAB_EKKO.
SELECT BUKRS EBELN
INTO CORRESPONDING FIELDS OF INT_EKKO
FROM EKKO FOR ALL ENTRIES IN ITAB_EKKO
WHERE BUKRS = ITAB_EKKO-BUKRS
AND LOEKZ = ' '.

CLEAR ITAB_EKPO.
INT_EKPO-EBELN = INT_EKKO-EBELN.
APPEND INT_EKPO TO ITAB_EKPO.
SELECT EBELN EBELP MATNR
INTO CORRESPONDING FIELDS OF INT_EKPO
FROM EKPO FOR ALL ENTRIES IN ITAB_EKPO
WHERE EBELN = ITAB_EKPO-EBELN
AND MATNR IN X_MATNR
AND LOEKZ = ' '
* "Delivery completed" indicator
AND ELIKZ = ' '.

CLEAR EKET.
SELECT SINGLE * FROM EKET WHERE EBELN = INT_EKPO-EBELN
AND EBELP = INT_EKPO-EBELP
AND EINDT IN X_BUDAT2.
IF SY-SUBRC = 0.
INT_MRP-MATNR = INT_EKPO-MATNR.
INT_MRP-NEXPOORD = EKET-MENGE.
INT_MRP-NEXPODEL = EKET-WEMNG.
COLLECT INT_MRP.
CLEAR INT_MRP.
ENDIF.
ENDSELECT.
ENDSELECT.
ENDFORM.

FORM LOOP_INT_MRP.
SORT INT_MRP.
LOOP AT INT_MRP.
* Check Purchase Group, Procurement Type
SELECT SINGLE * FROM MARC WHERE LVORM = ' '
AND WERKS IN X_WERKS
AND MATNR = INT_MRP-MATNR
AND EKGRP IN X_EKGRP
AND BESKZ IN X_BESKZ.
IF SY-SUBRC <> 0. CONTINUE. ENDIF.

* Check Purchasing Info
SELECT SINGLE * FROM EINA WHERE LOEKZ = ' '
AND MATNR = INT_MRP-MATNR
AND LIFNR IN X_LIFNR.
IF SY-SUBRC <> 0. CONTINUE. ENDIF.

* Check Division
SELECT SINGLE * FROM MARA WHERE LVORM = ''
AND MATNR = INT_MRP-MATNR
AND SPART IN X_SPART.
IF SY-SUBRC <> 0. CONTINUE. ENDIF.

WRITE: / INT_MRP-MATNR UNDER ' Material',
INT_MRP-PLNMG01 UNDER X_MONTH01,
INT_MRP-PLNMG02 UNDER X_MONTH02,
INT_MRP-PLNMG03 UNDER X_MONTH03,
INT_MRP-PLNMG04 UNDER X_MONTH04,
INT_MRP-PLNMG05 UNDER X_MONTH05,
INT_MRP-PLNMG06 UNDER X_MONTH06,
INT_MRP-PLNMG07 UNDER X_MONTH07,
INT_MRP-PLNMG08 UNDER X_MONTH08,
INT_MRP-PLNMG09 UNDER X_MONTH09,
INT_MRP-PLNMG10 UNDER X_MONTH10,
INT_MRP-PLNMG11 UNDER X_MONTH11,
INT_MRP-PLNMG12 UNDER X_MONTH12,
INT_MRP-MENGE UNDER 'Yesterday Pull',
INT_MRP-MTDPULL UNDER ' MTD Pull',
INT_MRP-ONHAND UNDER ' On Hand'.
INT_MRP-MTDPOORD = INT_MRP-MTDPOORD - INT_MRP-MTDPODEL.
* INT_MRP-NEXPOORD = INT_MRP-NEXPOORD - INT_MRP-NEXPODEL.
WRITE: / INT_MRP-MTDPOORD UNDER ' MTD PO',
INT_MRP-MTDGR UNDER ' MTD GR'.
ENDLOOP.
ENDFORM.

TOP-OF-PAGE.
FORMAT COLOR COL_TOTAL.
WRITE: / SY-DATUM, SY-UZEIT, SY-REPID,
110 'Material Consumption',
200 SY-UNAME, SY-PAGNO.

SKIP.
CLEAR NO01.
DO 12 TIMES.
ADD 1 TO NO01.
CONCATENATE 'INT_DATE-DATE' NO01 INTO FN01.
CONCATENATE 'X_MONTH' NO01 INTO FN02.
ASSIGN (FN01) TO .
ASSIGN (FN02) TO .
* Date conversion to 31 January 2003
* CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'
* EXPORTING
* INPUT =
* IMPORTING
* OUTPUT = .
* = .
CONCATENATE +6(2) +4(2) (4) INTO .
ENDDO.

WRITE: /1 ' Material',
20 X_MONTH01(8),
35 X_MONTH02(8),
50 X_MONTH03(8),
65 X_MONTH04(8),
80 X_MONTH05(8),
95 X_MONTH06(8),
110 X_MONTH07(8),
125 X_MONTH08(8),
140 X_MONTH09(8),
155 X_MONTH10(8),
170 X_MONTH11(8),
185 X_MONTH12(8),
200 'Yesterday Pull',
215 ' MTD Pull',
230 ' On Hand'.
WRITE: /215 ' MTD PO',
230 ' MTD GR'.

INITIALIZATION.
CASE SY-DATUM+4(2).
WHEN '01'.
ADD 31 TO SY-DATUM.
WHEN '02'.
ADD 28 TO SY-DATUM.
WHEN '03'.
ADD 31 TO SY-DATUM.
WHEN '04'.
ADD 30 TO SY-DATUM.
WHEN '05'.
ADD 31 TO SY-DATUM.
WHEN '06'.
ADD 30 TO SY-DATUM.
WHEN '07'.
ADD 31 TO SY-DATUM.
WHEN '08'.
ADD 31 TO SY-DATUM.
WHEN '09'.
ADD 30 TO SY-DATUM.
WHEN '10'.
ADD 31 TO SY-DATUM.
WHEN '11'.
ADD 30 TO SY-DATUM.
WHEN '12'.
ADD 31 TO SY-DATUM.
WHEN OTHERS.
ADD 28 TO SY-DATUM.
ENDCASE.
LDATE = FDATE = SY-DATUM.
LDATE+6(2) = '01'.
SUBTRACT 1 FROM LDATE.
FDATE = LDATE.
FDATE+6(2) = '01'.
MOVE: FDATE TO X_BUDAT-LOW,
LDATE TO X_BUDAT-HIGH.
APPEND X_BUDAT.

LDATE+6(2) = '28'.
ADD 60 TO LDATE.
LDATE+6(2) = '01'.
SUBTRACT 1 FROM LDATE.
FDATE = LDATE.
FDATE+6(2) = '01'.
MOVE: FDATE TO X_BUDAT2-LOW,
LDATE TO X_BUDAT2-HIGH.
APPEND X_BUDAT2.

 

How to use ALV for Hierarchical Lists

Can anyone tell me how to use ALV for hierarchical lists using the function code REUSE_ALV_HIERSEQ_LIST_DISPLAY?

Swarna

Hello, there are some nice examples in SAP which use this function module, so you might want to check them out ( where used etc. )

In essence, this is a call in one of my ABAPs

  CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_interface_check = 'I'
i_callback_program = gv_repid
* i_callback_pf_status_set = 'STATUS_DATA'
i_callback_user_command = 'COMMAND_DATA'
* is_layout = gs_layout
it_fieldcat = gt_fieldcat
i_default = ' '
i_save = 'A'
i_tabname_header = v_headers_itable
i_tabname_item = v_items_itable
i_structure_name_header = v_headers_table
i_structure_name_item = v_items_table
is_keyinfo = gs_keyinfo
i_bypassing_buffer = 'X'
TABLES
t_outtab_header = i_headers
* t_outtab_item = i_result
t_outtab_item = i_report
EXCEPTIONS
program_error = 1
OTHERS = 2.

The field cat creation worked like this :
FORM fieldcat.

DATA: ls_fieldcat TYPE slis_fieldcat_alv.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_internal_tabname = v_items_itable
i_structure_name = v_items_table
CHANGING
ct_fieldcat = gt_fieldcat.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_internal_tabname = v_headers_itable
i_structure_name = v_headers_table
CHANGING
ct_fieldcat = gt_fieldcat.

ENDFORM.


and of course you need to tell the thing what is key and item

gs_keyinfo-header01 = 'PA'.
gs_keyinfo-item01 = 'PA'.
gs_keyinfo-item02 = 'SAPDOC'.
PERFORM fieldcat.
I hope this helps you and not confuse you,
Cheers.

 

Upload Logo for REUSE_ALV_COMMENTARY_WRITE

For those who wish to upload and use a picture in your ALV abap reports.

Steps for uploading Logo :-:
1. Goto the transaction OAER
2. Enter the class name as 'PICTURES'
3. Enter the class type as 'OT'
4. Enter the object key as the name of the logo you wish to give
5. Execute
6. Then in the new screen select Standard doc. types in bottom window
Click on the Screen icon
Now, it will ask for the file path where you have to upload the logo
7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE

or

Import Logo and Background Picture for Reporting

In this step, you can import a customer-specific logo and a background picture into the R/3 System. These will be displayed in the header area of reports in HR Funds and Position Management.

From the SPRO:
HR Funds and Position Management --> Dialog Control --> Customize Reporting Interface --> Import Logo and Background Picture for Reporting.

Activities
1. Enter the Name of your logo/background picture as an object key in the initial screen.
2. Make sure that the class name is PICTURES, and the class type is OT.
3. Choose Execute.
4. Double-click the document type Picture on the Create tab page. A dialog box will appear in which you can enter the path in which the logo/background picture can be found.
5. Enter the path and choose Open. The logo will be uploaded into the current R/3 System. If the logo/background picture is to be transported into other systems as well, choose Transport.
6. Return to the initial screen and repeat the procedure after having entered the Name of your background picture as an object key.

Please note that the logo/background picture can only be displayed in ALV-based reports with an HTML header. Manually programmed reports such as business distribution plans are not based on the ALV.

If you have selected several initial objects, ALV-based reports in HR Funds and Position Management will automatically use a hiearchical-sequential display. A logo is not displayed here either. Note also that the logo cannot be printed (see print preview in program).

Make sure that the logo does not exceed a height of 100 pixels because it would mean that the header of the report will be scrollable.


 

How can I insert my company logo in the standard report?

It is not possible to print logo in the ordinary report, but it can done through ALV.

Write the code in Top-of-page event in ALV.

The following is the code for inserting the logo in ALV.

FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM.


 

How to Refresh ALV List/Grid once it is displayed?

This mean to say that if you have a 'refresh' push button in your gui status, every time you press the button, the list should get refreshed.

In ALV, to refresh the table you have to call the method "refresh_table_display".

It has the syntax very similar to creating the table.

It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)

or

if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications).

the synatx is :-

call method grid (name of grid )->refresh_table_display

exporting

IS_STABLE = (THIS IS FOR DATA REFRESHING)

I_SOFT_REFRESH = (THIS IS FOR ICON REFRESHING).


 

function REUSE_ALV_FIELDCATALOG_MERGE

An example :-

Please note that structure ZSTOCK is a custom table and iline looks as follow :-

data: iline type table of zstock with header line.
data: gt_fieldcat type slis_t_fieldcat_alv.

perform setup-fieldcatalog using gt_fieldcat[].

form setup-fieldcatalog using _fieldcat type slis_t_fieldcat_alv.
data: ls_fieldcat type slis_fieldcat_alv.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_internal_tabname = 'ILINE'
i_structure_name = 'ZSTOCK'
changing
ct_fieldcat = _fieldcat.

loop at _fieldcat into ls_fieldcat.
case ls_fieldcat-fieldname.
when 'DEPT'.
ls_fieldcat-no_out = 'X'.
when 'DESCR'.
ls_fieldcat-no_out = 'X'.
when 'GOOD_PRD'.
ls_fieldcat-do_sum = 'X'.
endcase.

modify _fieldcat from ls_fieldcat.
endloop.

endform. " FIELDCATALOG

 

Display a Secondary List using ALV Grid

Try this program...it may help you to change the font ..etc.

Code:
REPORT ZSIRI NO STANDARD PAGE HEADING.
* this report demonstrates how to send some ABAP data to an
* EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
* handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_MAPL TYPE OLE2_OBJECT, " list of workbooks
H_MAP TYPE OLE2_OBJECT, " workbook
H_ZL TYPE OLE2_OBJECT, " cell
H_F TYPE OLE2_OBJECT. " font
TABLES: SPFLI.
DATA H TYPE I.
* table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.

Archives

1990年1月15日   2007年1月14日   2007年1月15日   2007年1月16日   2007年1月17日   2007年1月18日   2007年1月19日   2007年1月20日   2007年1月22日   2007年1月23日   2007年1月24日   2007年1月25日   2007年1月26日   2007年1月27日   2007年1月29日   2007年1月30日   2007年1月31日   2007年2月1日   2007年2月2日   2007年2月3日   2007年3月13日   2007年5月15日   2007年5月16日   2007年6月2日  

This page is powered by Blogger. Isn't yours?