Professional Documents
Culture Documents
htm
System Fields
275 Edit a table : run SE16N and type in the command box : &sap_edit
How to enforce an index on a table when doing a select ?
274
%_hints ORACLE 'INDEX("VBAP" "VBAP~Z06")' : this will read table VBAP with index Z06
273 How to transport variants ? -> run program RSTRANSP
If you need to read a text (READ_TEXT) but you don't know exactly the language, normally
you'll have to loop. But with the following
272
function you can read the text in several languages at one time :
SSFRT_READ_INCLUDE_TEXT
Translate a transaction code :
SE63 -> transport object
271
R3TR TRAN <transaction code>
Conversion Unit of Measure :
suppose unit of measure in NL = ST
when you logon in FR -> ST=> PC
-> OUTPUT = PC
Search for a data element ?
for example : 4 length & 2 decimals
269
se16 table DD04L -> field LEN = 4, field DECIMALS = 2 -> complete list of all data elements
(you need the field ROLLNAME)
Convert language to ISO-language:
268
CALL FUNCTION 'CONVERSION_EXIT_ISOLA_OUTPUT'
Run a program after a transport :
267
R3TR XPRA program name
266 character ß in a smartform : copy/paste from Word
265 Dynamic columns for Business Workplace (Workflow/Inbox) : SWL1
264 ABAP and Excel Transformations (XML) : transaction XSLT_TOOL
Function ALV BLOCK LIST (several layouts)
263 report BALVBT01
Transaction FBL3N for example of LIST_DISPLAY with groups
1 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
262 report :
RHALECPS : display ALE change pointers for HR Master Data
RHALESMD : Evaluate ALE change pointers for HR Master Data
261 Set the status of an IDOC
260 Do a Mass Update : transaction MASS
Translate WorkItem description :
Via transaction SE63 : R3TR PDTS 90100124 (= number of task)
259
Translate WorkItem text :
Logon in the language you want to tranlate, and change the WorkItem text
When changing requirements, pricing procedures... with transaction VOFM, always add to your
258 transport request the following entry :
R3TR XPRA RV80HGEN : this regenerates the procedures
257 update IDOC status : RC1_IDOC_SET_STATUS (as from release 6.0)
256 Mass maintenance material master - MM17
255 Reset/Refresh ALV buffer : Run program BALVBUFDEL
254 MS Word as editor for smartforms : I18N
253 view all conditions for output control => transaction NACE
translate all messages from a message class
SE63
252 choose : Transport object
fill in :
R3TR MSAG ZBM0_SD_A640
251 Program to process inbound IDOC's : RBDAPP01
Enhancements & user-exits
table MODSAP
250
Vb. user exit : EXIT_SAPLV50E_004
SELECT kposn kschl stunr zaehk INTO CORRESPONDING FIELDS OF TABLE lit_konv
2 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
FROM konv
WHERE knumv = l_knumv.
245 generate ALE interface for BAPI : transaction BDBG
244 inbound processing of IDOCs ready for transfer (status 64) : program RBDAPP01
Show icons :
3 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
223 If you have a program, how can you find the jobs for it ?
TBTCP veld PROGNAME -> JOBNAME
222 Table for version management : VRSD
221 Start a WorkItem from within ABAP (Workflow)
220 Generate an instance of an object : (Workflow)
Set a status to a Switchdocument (Workflow) :
object :
219 ISUIDESWD
methode :
SETSTATUS
Set an activity in a Switchdocument (Workflow) :
object
218 ISUSWITCHD
method
SETSTATUSACTIVITY
217 Send and Receive an IDOC in the same system
216 User decision in a Workflow
215 Application Logging (via SLG0 and SLG1)
214 Show fields on a screen or not
213 Add an IDOC status (WE47)
4 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
include rswwincl.
include lswwaf01.
data: return_code like syst-subrc.
208 Delete some Workitems out of the Business Place : transaction-code SWWL
207 How to stop a Workflow for a Switchdocument (SAP-ISU) ?
Stop a Workflow : Transaction-code : SWW_WI_ADMIN_CANCEL
Read all objects of a container : Function SWW_WI_CONTAINER_READ_OBJECTS
206
Read all attributes : Function SWW_WI_CONTAINER_READ
Example program...
205 Update an IDOC-status
204 Download ABAP-program code, TABLE-definition
Show an IDOC :
CLEAR range_credat.
203
REFRESH range_credat.
AND RETURN.
Get the value of an attribute of a copied object :
* Get the property of the Requisitioneruser.
SWC_CREATE_OBJECT REF_BUS2121 'BUS2121' object-key-REQUIREMENTREQUEST.
SWC_GET_PROPERTY REF_BUS2121
202 'REQUISITIONERUSER'
w_requisitioneruser.
* it_users is filled with all the users for the org units
* check if requisitioner is in user table
read table it_users into wa_users
5 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
6 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
7 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
8 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
9 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
1)
Matchcode table for Business Partners :
174 M_BUPAA
SAP-ISU
173 Play a WAV-file
SAP ISU : Business Partner change :
10 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
document_number = w_docnum
segment_name = c_segnam_e1knvvm ( LIKE edidd-segnam value 'E1KNVVM')
IMPORTING
idoc_container = w_edidd (INCLUDE STRUCTURE edidd)
if OK
w_e1knvvm = w_edidd-sdata (w_e1knvvm LIKE e1knvvm)
3) EDI_DOCUMENT_CLOSE_READ
4) EDI_DOCUMENT_TREE_DISPLAY
BOM explosion
CS_BOM_EXPL_MAT_V2
capid = PP01
datuv = 07.09.2004
ehndl = 1
mtnrv = 121641
mehrs = X
werks = 0t00
returns 2 tables :
1) MATCAT
160 contains the main material and the 'sub' BOMS
2) STB
contains all the materials from the BOM
-> you can delete all the records where STB-IDNRK = MATCAT-MATNR
-> take field MNGKO for the quantity, and MMEIN for the Unit of Measure
report = RCS13001
159 Report RATSTDEL = Delete Data From a Company Code in Asset Accounting
STORAGE_PARAMETERS_WRONG_SET
158 -> SELECT is too big for the internal table
-> already too much data in the system with 'maloc'...
Print to your Local Printer :
157 in SAP set the printer to 'LOCL'.
this sends the output to your default printer...
CO tables like GLT0 :
156 COSP CO Object: Cost Totals - External Postings
COSS CO Object: Cost Totals - Internal Postings
155 RSQL error 23 = output area too small -> check your internal table
11 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
12 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
139 fields FRYE2/FRPE2 = beginning of allowed fiscal year and fiscal period
fields TOYE2/TOPE2 = end of allowed fiscal year and fiscal period
1) read table T001 with the company code, and get the field PERIV (fiscal
year variant)
134 2) CALL FUNCTION 'G_POSTING_DATE_OF_YEAR_GET'
with VARIANT = t001-periv
YEAR = the fiscal year
CONVERSION_EXIT_INVDT_OUTPUT
133 vb. 79968869 = 30.11.2003
CONVERSION_EXIT_INVDT_INPUT
13 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
DEFINE fill_string.
w_countm = 0.
do &2 times.
131 &1+w_countm(1) = &3.
w_countm = w_countm + 1.
enddo.
END-OF-DEFINITION.
14 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
15 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
How to convert ?
You need :
- SY-DAYST
- SY-TZONE
105 Example of a tree program
104 How to scan an ABAP/4 program for statements,...
103 Lock a table
Get fieldname of a variable when you select a line.
DATA : w_field(30) TYPE c.
102
AT LINE-SELECTION.
GET CURSOR FIELD w_field.
Examples of SET/GET PARAMETER ID + CALL TRANSACTION xxx AND SKIP FIRST
101
SCREEN
Standard SAP program for creating a BDC for characteristics
RCCTBI01
100
Display and change the data created by that program
RCCTBISC
Show the variants of a program in a popup-screen (like the default SAP)
99 Call function RS_VARIANT_CATALOG
Uses tables VARIS and VARID
98 Fill in an Excel spreadsheet (several sheets !)
97 Insert a button on the selection-screen
Read balance of an GL-account
Table GLT0 read with
RLDNR = 00
RRCTY = 0
RVERS = 001
96 BUKRS = the company code
RYEAR = the year
RACCT = the account (with leading zeros)
16 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
03 = display
93 Example program for downloading characteristics in general
92 Run a transaction and skip first screen
91 Get a user parameter
Show a grid in a screen
90
flow logic
89 Function to invert a string of characters (max. 256 length)
88 Get characteristics of a class for batches
87 Show an internal table in a window to make a choise
86 Example of INNER JOIN
Put in upper case
85
Translate <variable> to upper case.
Texts types for SD (via IMG - Text determination - text types) of VOTX
84 Then you get for example billing text = 9902
This is the ID needed for 'READ_TEXT'.
83 Check change pointers after a data upload
82 FI Document ranges -> FBN1 and function RF_GET_DOCUMENT_NUMBER
81 Write system log messages -> SE92 and function RSLG_WRITE_SYSLOG_ENTRY
80 Loop at screen -> Make a parameter output only
79 Check wether a unit of measure can be used for a material ?
Change documents for FI
BKPF-TCODE
78
= FBD1 -> objectclass = BELEGD
= FB01 -> objectclass = BELEG
Read change documents
CDHDR and CDPOS
77
CHANGEDOCUMENT_READ_HEADERS
CHANGEDOCUMENT_READ_POSITIONS
76 How to run in LSMW a Direct Input ?
75 Convert date in user format
74 List of all LSMW Tables
17 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
AT LINE-SELECTION.
CHECK t_data-belnr NE space.
72 SET PARAMETER ID 'BLN' FIELD t_data-belnr.
SET PARAMETER ID 'BUK' FIELD t_data-bukrs.
SET PARAMETER ID 'GJR' FIELD t_data-gjahr.
SELECT bukrs
from t001
INTO TABLE t_t001
WHERE bukrs IN s_bukrs.
68
CLEAR r_bukrs. REFRESH r_bukrs.
LOOP AT t_t001.
MOVE 'IEQ' TO r_bukrs.
MOVE t_t001-bukrs TO r_bukrs-low.
MOVE space TO r_bukrs-high.
APPEND r_bukrs.
CLEAR r_bukrs.
ENDLOOP.
Get a list of all the company codes in a select-option
SELECT bukrs FROM t001
INTO TABLE t_t001
WHERE bukrs IN s_send.
67 IF sy-subrc NE 0.
MESSAGE e306.
ENDIF.
-> t_t001
18 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
FORM 0000_init.
t_reqtype_werks-zzreqtype+0(1) = 'O'.
19 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
20 of 21 21/12/2012 5:26 PM
Usefull ABAP/4 code http://users.skynet.be/am261047/SAP/abap.htm
21 of 21 21/12/2012 5:26 PM