A: write sy-datum using edit mask ‘==PDATE’ to lv_datestring.
types: begin of c16,
aaa(16) type c, "CHAR(16)
end of c16.
types: begin of r16,
aaa type guid_16, "RAW(16)
end of r16.
data: it_chars type table of c16,
it_raws type table of r16,
c1(16) type c.
c1 = '1234567890123456'.
append c1 to it_chars.
call method CL_RSZ_WWW_DB_INTERFACE=>CONVERT_CHAR_TO_RAW
I_T_IN = IT_chars
E_T_OUT = it_raws
A: EKPO and *EKPO are usually defined in TABLES statement, and both use the DDIC structure of EKPO. Classical usage is to distinguish between old and new value of the record.
SELECT SINGLE * FROM *bkpf is equal to SELECT SINGLE * FROM bkpf into *bkpf
the same as SELECT SINGLE * FROM bkpf is equal to SELECT SINGLE * FROM bkpf into bkpf
While declaring variables, always follow the naming conventions through out your code. Your variable names talks a lot about its usage.
Make sure your variables are of the form:
L – Local
I – Import
E – Export
G – Global
T – Table Type
V – Single Value
S – Structure
T – Table
R – Type ref to Data
O – Type ref to Object
E – Type ref to Exception objects
Name – name of the variable.
lt_sel – local table
lo_rvs – local object
and so on.
Before changing the parameters (type or name), make sure that you run “Where used”, make a note and change them as well.
While working on ABAP Classes and Interfaces, Never change a super class of a framework. It could potentially bring all applications down. Double check to make sure that the code you change is in your class only.
Ctrl + D Duplicate any line.
Ctrl + . & Ctrl + , Comment and Un-Comment selected lines.
Ctrl+Shift+X Deletes the whole line.
Ctrl+Shift+V Gives All Paste options.
To assist in locating codes, can be a bookmark, using a combination: CTRL + ALT + (0 to 9).
To go to bookmark created, use combination CTRL + (0 to 9).
- Q: How to debug IDOCs inbound processing (most first FMs on receiver system (under ALEREMOTE non dialog user)?
A: Simple and stupid solution is to put eternal loop in form FA5_DOCUMENT_SYNTAX_CHECK (program LEDI1FA5):
12345data: x type flag.*if sy-uname eq 'SAPSD'.while x is initial.endwhile."endif.
Then the process will be available for debugging in the transaction SM50.
- Please create lock objects on the header tables and make sure that you obtain a lock before changes and release the lock after changes.
- Make sure that you transactions are atomic. Either commit your work after all changes are successful or Rollback in case of error. If you rollback, make sure that you have released the locks.
- Q: How to pass dynamic varable into SELECT … WHERE IN clause?
A:1234567data: lv_pabprfs type string,qry type string.select single param from zparam into lv_pabprfs where paramid = 'PAPROFIL'."lv_pabprfs = 'M033', 'M833', 'M843'qry = 'b~pabprf in (' && lv_pabprfs && ')'.select single baset into myvar from jitoco where outpo = '3' and (qry).
- During save, please make sure that entries in all the text (_T_*) tables that relate to your modules are also saved. If no data exists, treat it as an error. (As across check, you can verify the same by executing the view and making sure that the data is returned correctly)
- The Function should be RFC Enabled. Never raise an exception. Always return errors in the ET_RETURN (Type BAPIRET2) structure.
- Never hardcode text strings. Make sure that you use a text element. But use it with text reference.
E.g. If you have an error during validating the email, use it as “Email ID is required”(001) instead of using text-001. This will ensure that error messages are displayed regardless of user logon language.
- At the end of the function, Always call “get details” and return the values as export/table values. This will serve the purpose of reflecting the data as-is in the DB back to the user and will save another round trip to retrieve it again.
- Q: How to get variable value from another running program?
A:1234567"in case of needed programm isn't in the memory area, we can to call it viaPERFORM change_control_record IN PROGRAM SAPMV50A.ld_mem = '(SAPMV50A)XLIPS'.ASSIGN (ld_mem) TO <mem>.IF sy-subrc = 0. "if ld_mem is assignedlt_xlips = <mem>.ENDIF.
- Update audit fields created by, created date, created time only during create.
- Please ensure that IV_UNAME (SY-UNAME) and IV_LANGUAGE (SY_LANGU) are mandatory for all modules. Extract the data for the language specified.
- Q: Where are the packing handling units data stored during execution of transaction VL01/VL02/VL32N”? CVEKP table is always empty.
A: The variable is (SAPLV51G)IVEKP