Category: BC – ABAP
Edit Tables Directly in SE16 by Using SE16N
If you need to edit one table directly without using one SM30 view do these steps: Go to SE16N; Insert table name, press enter; In transaction box on top write “&SAP_EDIT” and press enter; Press F8 and insert line and delete line button will be available. Please be very carefull when doing this, it may [...]
Default Values for Sales Order by User
Sometimes you need to assign default values to one user when entering the sales order. Todo so go to SU01, enter user, click modify and click parameters. Here you have: PID Parameter Short Description AAT ZOR Order Type SPA 0001 Division VKO 03 Sales Organization VTW 01 Distribution Channel
Get user email from RH data in SAP
When sending one email, sometimes you use SY-UNAME as reference so this is the desired select: select single usrid usrid_long from pa0105 where pernr eq SY-UNAME and subty eq 9003 (ASK HR Manager) and begda le sy-datum and endda ge sy-datum. if usrid is empty use usrid_long endselect. And it’s this, any doubts just post
Send Email SAP Function to External address or distribution list
When you need to trigger email from user exit or from your own program you can use this function. You can send it to single email destination or to a distribution list ( SBWP Transaction ). This will only work if SCOT transaction is correctly configured, and this must be made by a System Administrator. Here goes the [...]
Addin a check box to a SAP Table
When you want to make a View of a table and get a check box in one of the fields, tou can use the data element CHKBOX. By doing so, when you use the Table Maintenance Generator, a check box will be added to the maintenance view. Any doubts? Please Comment
Avoid Deletion of Sales Order and Delivery (VA02 and VL02N )
If you want to block these document deletion option by user exit the is a solution. You can simply get to MV45AFZZ (sales order) and MV50AFZ1 (delivery) and place the following code in the FORM userexit_delete_document: MESSAGE ‘Document delete not allowed’ TYPE ‘I’. CALL TRANSACTION ‘Va01′ AND SKIP FIRST SCREEN. Change the transaction to what [...]
Message Output access sequence by Shipping Point (INVOICE RD00)
When you need to create access sequences. Using fields that are not available in field catalog you can append them to the VBRK Table. For Instance use ZZVSTEL to append to VBRK and then you need to make them available in other tables so you can create an access sequence. These tables are KOMK, KOMG [...]
Select for all entries
When you need to access many records from one internal table is better to use select for all entries. instead of doing this loop at internal-table select * from table where……. endloop. it’s better to SELECT * FROM bkpf INTO CORRESPONDING FIELDS OF TABLE it_bkpf FOR ALL ENTRIES IN it_vbrk WHERE bukrs = it_vbrk-bukrs AND [...]
Add SAP External Database Connection (DBCO)
When you want to set up external database connection, you need to use DBCO Transaction. When using DBCO you are setting up the properties for an external database. REPORT ztest. DATA: BEGIN OF wa, ncust(40) TYPE c, name(35) TYPE c, END OF wa. DATA: dbs TYPE dbcon-con_name. DATA: con(20) TYPE c. DATA : ls_wa LIKE [...]
Difference between select single and up to 1 row
The ‘SELECT SINGLE’ statement selects the first row in the database that it finds that fulfils the ‘WHERE’ clause If this results in multiple records then only the first one will be returned and therefore may not be unique. The ‘SELECT ….*….. UP TO 1 ROWS’ statement is subtly different. The database selects all of the [...]