ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV? http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV? http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV? http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Check this for basic concepts of OOPS
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/ABAP%20Objects/ABAP%20Code%20Sample%20to%20Learn%20Basic%20Concept%20of%20Object-Oriented%20Programming.doc
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/ALV%20grid/ABAP%20Code%20Sample%20to%20Display%20Data%20in%20ALV%20Grid%20Using%20Object%20Oriented%20Programming.doc
Tabstrip
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/ALV%20grid/ABAP%20Code%20Sample%20for%20Tab%20Strip%20in%20ALV.pdf
Editable ALV
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/ALV%20grid/ABAP%20Code%20Sample%20to%20Edit%20ALV%20Grid.doc
Tree
http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
General Tutorial for OOPS
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/An%20Easy%20Reference%20for%20ALV%20Grid%20Control.pdf
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
http://www.sap-img.com/abap/what-is-alv-programming.htm
http://www.sap-img.com/abap-function.htm
http://www.geocities.com/mpioud/Abap_programs.html
http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf
http://www.sap-img.com/abap-function.htm
鍏蜂綋浠g爜鐨勫啓娉曞涓?
A. 鏄劇ず瀛樺偍鐨勯噾欏?br />DATA: SHIFT TYPE I.
CLEAR SHIFT.
SELECT SINGLE * FROM TCURX WHERE CURRKEY = (璐у竵綾誨瀷).
IF SY-SUBRC = 0.
聽 SHIFT = 2 - TCURX-CURRDEC.
ENDIF.
(鏄劇ず閲戦) = (瀛樺偍閲戦) * 10 ** SHIFT.
B. 瀛樺偍杈撳叆鐨勯噾欏?鑷矯URR type鐨勬暟鎹〃鐨勫瓧孌?
DATA: SHIFT TYPE I.
CLEAR SHIFT.
SELECT SINGLE * FROM TCURX WHERE CURRKEY = (璐у竵綾誨瀷).
IF SY-SUBRC = 0.
聽 SHIFT = TCURX-CURRDEC 鈥?2.
ENDIF.
(瀛樺偍閲戦) = (鏄劇ず閲戦) * 10 ** SHIFT.
鐢變笂闈㈠叕寮忔?zhèn)ㄥ彲浠ヤ簡瑙d皋Z綍TWD鏄劇ず100鐐轟綍瀛樺偍鍊間負(fù)1
鍦═CURX涓瑿URRKEY = 鈥楾WD鈥?鍏禖URRDEC = 0, 鍥犳鏄劇ず閲戦浼?xì)涔樺崄鐨勮礋浜寢啤鏂规墠鏄瓨鍌ㄧ殑绲愭?/p>
C:鍒╃敤鐜版垚鐨凢unction modules:
CURRENCY_AMOUNT_ SAP _TO_ DISPLAY : 鏄劇ず瀛樺偍鐨勯噾欏?br />CURRENCY_AMOUNT_DISPLAY_TO_SAP : 瀛樺偍杈撳叆鐨勯噾欏?鑷矯URR type鐨勬暟鎹〃鐨勫瓧孌?
浣跨敤 FBL1N , FBL3N, FBL5N 鍒嗗埆鍙互鏌ョ湅渚涘簲鍟嗭紝鎬昏處錛屽鎴風(fēng)被鍨嬬鐩殑鏈竻宸叉竻欏廣?br />渚涘簲鍟?K)鐨勬湭娓呭凡娓呴」瀛樻斁鐨勮〃鍒嗗埆鏄?BSIK, BSAK BKPF 鏄儲鍔″嚟璇佹姮澶達(dá)紝BSEG 鏄儲鍔″嚟璇佽欏圭洰銆傚湪璐㈠姟鍑瘉璁拌處鐨勬椂鍊欙紝鏁版嵁琚彃鍏?BKPF 鍜?BSEG錛屽鏋滄湁蹇呰錛屾暟鎹悓鏃舵彃鍏ヤ互涓婂叚寮犺〃涓殑涓涓湭娓呰〃銆傚仛娓呭笎鐨勬椂鍊欙紝鏁版嵁浠庡叚寮犺〃涓殑涓涓湭娓呰〃鍒犻櫎錛屽悓鏃舵彃鍏ュ搴旂殑宸叉竻琛ㄣ?br /> 聽
|
閫氬父浣犲湪浣跨敤浠諱綍T-code鍓嶄竴瀹氫細(xì)鏈夋潈闄愭嫻嬬殑.
AUTHORITY_CHECK:榪欎釜鍑芥暟鍙槸灝忔鏌ヤ竴涓嬩綘鐨剈ser鏈夋病鏈?浠涔堟椂鍊欒繃鏈? AUTHORITY_CHECK_TCODE:媯鏌-code
聽
聽
鏉冮檺瀵硅薄錛?/font>
AUTHORITY-CHECK OBJECT 'A_S_WERK'
聽聽聽聽聽聽聽聽 ID 'BUKRS' FIELD '__________' 聽聽聽聽聽聽聽聽 ID 'WERKS' FIELD '__________'. Check SY-SUBRC... 聽
AUTHORITY-CHECK OBJECT 'V_VBRK_VKO'
TCODE:聽SU21. AUTHORITY-CHECK OBJECT 'S_TCODE' ID 'TCD' FIELD <tcode>. |
some useful function process date: CALL FUNCTION 'DATE_GET_MONTH_LASTDAY'聽 "鑾峰彇鏈湀鏈鍚庝竴澶?br />聽 EXPORTING 聽 CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'聽聽 "鑾峰彇鏈湀鏈鍚庝竴澶?br />聽聽EXPORTING 聽 CALL FUNCTION 'MONTH_PLUS_DETERMINE'聽 "鑾峰彇N鏈堝墠鐨勬棩鏈?br />聽 EXPORTING 聽 CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'聽聽聽聽聽聽聽聽聽 "璁$畻涓や釜鏃ユ湡闂寸殑鏈堜喚宸?br />聽 EXPORTING |
鍦╯ap寮鍙戠殑榪囩▼涓紝緇忓父闇瑕佽嚜瀹氫箟鏁版嵁琛紝瀵逛簬綆鍗曠殑鏁版嵁琛紝鎴戜滑鍙互閫氳繃sap鐨勮〃緇存姢宸ュ叿鐢熸垚緇存姢浠g爜錛屽茍寤虹珛鑷畾涔夌殑TCODE鏉ョ淮鎶ゅ叾鏁版嵁銆傚叿浣撴楠ゅ涓嬶細(xì)
涓銆佸緩绔嬭嚜瀹氫箟琛紙TCODE 錛歋E11錛?/strong>
浜屻佺敓鎴愮淮鎶や唬鐮?/strong>
涓夈佸緩绔嬭嚜瀹氫箟CODE錛圱CODE錛歋E93錛?/strong>
聽 call function 'RS_TABLE_LIST_CREATE' call function 'VIEW_MAINTENANCE_CALL'
1 鍦ㄢ淒elivery and Maintenance鈥漈ab灞忓箷璁劇疆鈥淒ata Browser/Table view Maint.鈥濆睘鎬т負(fù)鈥滃厑璁?dāng)R氳繃鏍囧噯琛ㄦ牸緇存姢宸ュ叿緇存姢鈥?br />2 璁捐琛ㄦ牸瀛楁
3 璁劇疆琛ㄦ牸鎶鏈緗紝鑿滃崟錛氳漿鍒幫紞銆嬫妧鏈緗?br />4 淇濆瓨?gòu)葊媧匯?/p>
鐢熸垚緇存姢浠g爜浠g爜鏈変袱涓斿緞錛?br />1銆乻e11鐣岄潰鐨勮彍鍗曪細(xì)瀹炵敤紼嬪簭錛嶃婽able Maintenance Generator鍏跺疄榪欓噷灝辨槸璋冪敤SE54
2銆侀氳繃TCODE錛?SE54
鏈変笁縐嶆柟娉曟潵寤虹珛鑷繁鐨凾CODE鏉ョ淮鎶よ嚜瀹氫箟琛紱
1 閫氳繃SM30緇存姢
榪涘叆TCODE錛歋E93寤虹珛鏂癟CODE錛宼code綾誨瀷閫夋嫨涓猴細(xì)鈥淭ransaction with parameters錛坧arameter transaction錛夆濓紱浜嬪姟鏍忚緭鍏モ淪M30鈥濓紱閫変腑鈥滆煩榪囪搗濮嬪睆騫曗濓紱閫変腑鈥淚nherit GUI attribute鈥濓紱杈撳叆榛樿瀛楁錛歏IEWNAME聽= '鑷畾涔夌殑琛ㄥ悕'聽鍜孶PDATE 錛?'X'錛涗繚瀛樻縺媧誨嵆鍙紱
2 閫氳繃RS_TABLE_LIST_CREATE鍑芥暟寤虹珛鏂扮▼搴忔潵寤虹珛TCODE
鏂扮▼搴忎唬鐮佸涓?br />
report聽 zjwec026聽 .
聽聽聽聽聽聽聽聽 exporting
聽聽聽聽聽聽聽聽聽聽聽聽聽 action聽聽聽聽 = 'ANLE'
聽聽聽聽聽聽聽聽聽聽聽聽聽 table_name = 'ZJW_CC_GZJSQ'
聽聽聽聽聽聽聽聽聽聽聽聽聽 generation_forced = ' '.
3閫氳繃View_Maintenance_Call 鍑芥暟寤虹珛鏂扮▼搴忔潵寤虹珛TCODE錛屼唬鐮佸彲浠ュ弬瑙丼AP鐨勬爣鍑嗙▼搴廟FT042D_CALL
浠g爜濡備笅
report聽 rft042d_call.
聽聽聽聽 exporting
聽聽聽聽聽聽聽聽聽 action聽聽聽聽聽聽聽聽 = 'S'
聽聽聽聽聽聽聽聽聽 view_name聽聽聽聽聽 = 'V_T042D'.
涓聽Profiles璺緞
SAP profiles are stored in a special file directory. This directory can be made accessible from all hosts depending on current needs:
UNIX systems : /usr/sap/<SID>/SYS/profile
Windows NT systems: \usr\<SID>\sys\profile\
( <SID> = SAP system name and <SAPGLOBALHOST> = name of the NT machine on which the global profile directory is physically located)
浜?Profiles鍛藉悕瑙勫垯
In R/3 Releases 2.1x / 2.2x, the profiles were generated with the names:
START_<instancename>and <SID>_<instancename>.
From Release 3.0A, the profiles are generated with the names: START_<instancename>_<hostname>and <SID>_<instancename>_<hostname>.
The聽'startsap'script first looks for profiles that end with_<hostname>. If these profiles do not exist, the names from the Releases 2.1x / 2.2x are used.
涓?Profiles綾誨瀷
3.1
Default Profiles聽Definition
If you want to assign the same parameter value for all application servers (such as the name of the database host, or the host on which the message server is running), enter it in the default profile. In general, you can list any parameter you like here.
SAP recommends that you use the following values:
Parameter Definition |
Parameter Name in Profile |
Name of the database host |
SAPDBHOST |
Name of the update server |
rdisp/vbname |
Name of the enqueue server |
rdisp/enqname |
Name of the server for handling background processing events |
rdisp/btcname |
Name of the computer on which the message server is running |
rdisp/msname |
Name of the TCP service under which the message server can be reached |
rdisp/msserv |
Name of the computer on which the SNA Gateway is running |
rdisp/sna_gateway |
Name of the TCP Service under which the SNA Gateway can be reached |
rdisp/sna_gw_service |
You cannot choose a name for the default profile. It is always called DEFAULT.PFL. The default profile, like all other profiles, is located in the global profile directory of the SAP System. For example, under UNIX it is located in the directory/usr/sap/<SID>/SYS/profile(<SID>= SAP System name). There is always one active default profile.
SAPDBHOST = hs0011
DIR_ORAHOME = /oracle/BIN
rdisp/mshost = hs0311
rdisp/vbname = hs0311_BIN_53
rdisp/enqname = hs0311_BIN_53
rdisp/btcname = hs0002_BIN_53
rdisp/sna_gateway = is0001
rdisp/sna_gw_service = sapgw00
3.2 Start Profiles 聽
When you start an SAP instance on a host, the start profile defines which SAP services are started (message server, dialog, gateway or enqueue process. for example). The startsap
program is responsible for starting these service processes,
The processes that can be started include:
Apart from the general profile parameters, such as the name of the SAP System (SAPSYSTEMNAME), instance number (SAPSYSTEM) and name of the SAP instance (INSTANCE_NAME), the only parameter names that are permitted in a start profile are:聽
Execute_xx (xx = 00-99) : To start operating system commands, which prepare the SAP System start. For example, you can use this parameter to start the SAP-related database or to set up links to executables on UNIX platforms.
Start_Program_xx (xx = 00-99)
: To start an SAP instance, for example, on an application server.
Stop_Program_xx (xx = 00-99)
: To start an operating system command or SAP program after the SAP instance was stopped. For example, the halting or removal of shared memory areas that were used by the SAP System.
The number
xx
defines the execution sequence. The programs specified in
Execute_ parameters
are executed before the programs listed in the
Start_Program
parameters. After the SAP instance has been stopped, the programs specified in the
Stop_Program
parameters are started. Here is an example of a start profile used to start a message server, an application server and an SNA gateway:
#.***************************************************************
#.* Start profile START_DVEBMG47
#.*
#.* Version = 000003
#.* last changed by = WATT
#.* last changed on = 21.03.1995, 15:05:19
#.***************************************************************
SAPSYSTEMNAME = K11
INSTANCE_NAME = DVEBMG47
#----------------------------------------------------------------
# start message server
#----------------------------------------------------------------
_MS = ms.sapK11_DVEBMG47
Execute_01 = local ln -s -f $(DIR_EXECUTABLE)/msg_server $(_MS)
Start_Program_01 = local $(_MS) pf=$(DIR_PROFILE)/K11_DVEBMG47
#----------------------------------------------------------------
# start application server
#----------------------------------------------------------------
_DW = dw.sapK11_DVEBMG47
Execute_02 = local ln -s -f $(DIR_EXECUTABLE)/disp+work $(_DW)
Start_Program_02 = local $(_DW) pf=$(DIR_PROFILE)/K11_DVEBMG47
#----------------------------------------------------------------
# start SNA-Gateway
#----------------------------------------------------------------
聽3.3 Instance Profiles聽
Instance profiles provide an application server with additional configuration parameters to complement the settings values from the default profile. Typically, these parameter settings adapt the instance according to the desired resources. They also define the available instance resources (main memory, shared memory, roll memory and so on), and how to allocate memory to the SAP application buffers.
To start application servers on several computers using identical parameter settings, you can use a single instance profile. It is generally not necessary for each application server to have its own instance profile. Instance profiles are also called system profiles.
聽
Below is a typical instance profile:
#.*************************************************
#.* Instance profile BIN_DVEBMG53 *
#.* Version = 000005 *
#.* Generated by user = BLOCHING *
#.* Date generated = 04.08.1995, 11:10:35 *
#.*************************************************
INSTANCE_NAME = DVEBMG53
SAPSYSTEM = 53
SAPSYSTEMNAME = BIN
abap/buffersize = 40000
abap/programs = 600
ipc/shm_psize_10 = 15000000
ipc/shm_psize_14 = 0
ipc/shm_psize_17 = 0
ipc/shm_psize_18 = 0
ipc/shm_psize_19 = 0
ipc/shm_psize_40 = 17000000
rdisp/PG_MAXFS = 4096
rdisp/PG_SHM = 1000
rdisp/ROLL_MAXFS = 16384
rdisp/ROLL_SHM = 200
rdisp/btctime = 60
rdisp/wp_no_dia = 5
rdisp/wp_no_enq = 1
rdisp/wp_no_vb = 1
rdisp/wp_no_vb2 = 1