Posted: Fri Dec 19, 2008 10:06 am Post subject: Отступ ALV при печати
Подскажите пожалуйста каким образом можно сделать так, чтобы при печати ALV, таблица печаталась с отступом от левого края? Это очень удобно для сшивания документов, но что-то никак не могу найти как это делается
Age: 165 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Fri Dec 19, 2008 10:39 am Post subject:
Смотрите место с
SET MARGIN 7 5.
Code:
REPORT Z_ALVGRIDTESTCLICK.
TYPE-POOLS: SLIS.
DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF FIELDCAT,
SORTCAT TYPE SLIS_T_SORTINFO_ALV,
SORTCAT_LN LIKE LINE OF SORTCAT,
EVENTCAT TYPE SLIS_T_EVENT,
EVENTCAT_LN LIKE LINE OF EVENTCAT.
TABLES : MARA.
* Internal table for storing line item data per document number
data: begin of itab occurs 10,
MATNR like MARA-MATNR,
MTART LIKE MARA-MTART,
BISMT LIKE MARA-BISMT,
end of itab.
START-OF-SELECTION.
SELECTION-SCREEN BEGIN OF BLOCK BA WITH FRAME TITLE TTL1.
SELECT-OPTIONS: P_MATNR FOR MARA-MATNR.
SELECTION-SCREEN END OF BLOCK BA.
*&--------------------------------------------------------------------*
* AT SELECTION-SCREEN.
*&--------------------------------------------------------------------*
AT SELECTION-SCREEN.
* DEFINE PAGE LEFT MARGIN AND TOP MARGIN
SET MARGIN 7 5.
* DEFINE PIRNT FORMATE
PRINT-CONTROL FUNCTION: 'SABLD' LINE 1,
'SAOFF' LINE 2,
'SAULN' LINE 3.
* The above sentence print-control function used to define print format
* Find document header data and line item data from given parameters.
PERform find_document .
PERform ALVDISPLAY.
*------------------------------------------------*
* GET DATA FROM SOME SYSTEM TABLE
* THEN ,PUT THESE DATA INTO INTERNAL TABLE.
*------------------------------------------------*
form find_document .
SELECT MATNR
MTART
BISMT
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM MARA
WHERE MATNR IN P_MATNR.
endform .
*---------------ALV Disply Function ---------------------*
form alvdisplay .
DATA: COL_POS TYPE I.
DATA: PGM LIKE SY-REPID.
PGM = SY-REPID.
*Add The 1th column :company code .
ADD 1 TO COL_POS.
FIELDCAT_LN-REF_TABNAME = 'MARA'.
FIELDCAT_LN-FIELDNAME = 'MTART'.
FIELDCAT_LN-KEY = SPACE.
FIELDCAT_LN-DO_SUM = SPACE.
FIELDCAT_LN-COL_POS = COL_POS.
FIELDCAT_LN-NO_OUT = SPACE.
FIELDCAT_LN-QFIELDNAME = SPACE.
FIELDCAT_LN-HOTSPOT = SPACE.
APPEND FIELDCAT_LN TO FIELDCAT.
form USER_COMMAND USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
READ TABLE ITAB INDEX SELFIELD-TABINDEX.
CHECK SY-SUBRC = 0.
CASE UCOMM.
WHEN '&IC1'.
CASE SELFIELD-SEL_TAB_FIELD.
WHEN 'ITAB-MATNR'.
SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.
CALL TRANSACTION 'MM43' AND SKIP FIRST SCREEN.
ENDCASE.
ENDCASE.
ENDform.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.