Jan 27, 2016

How to Search BTE?

Posted by Vinod Vemuru in SAP ERP Financials on May 13, 2014
http://scn.sap.com/community/erp/financials/blog/2014/05/13/how-to-search-bte


Are you facing difficulties in finding out correct BTE to implement for your custom requirements? Doing extensive search over net/SCN? Not required now!!!

Yes, SAP has already given awesome “BTE search tool” which many people are unaware. I came across this interesting tool during my R&D and found it very helpful.
Hence, sharing this with the community.

Before we go on how to use this tool, let us go through little basics of BTE.

Business transaction event is delivered by SAP to code customer specific requirements during predefined standard processes. Call points are already defined by SAP. All we need to do is just plug in our code in the BTE based on our requirements and SAP would play it during standard process

Business transaction events are of two types.

Process BTE:

Process BTEs are called at a fixed, predefined points during the standard SAP program flow at which the system can process user defined/custom function modules instead of the standard function module. The pre-conditions/rules for calling up alternative processes are defined in the  customization of BTEs in t-code FIBF. There would be standard function module OPEN_FI function module assigned by default by SAP. If there are no custom function modules assigned in FIBF, standard function module is processed. Data and process flow of standard SAP can be changed in BTE.

OPEN_FI function module select the FM to be processed for P/S BTE.

Function module PC_FUNCTION_FIND determines the function module to process from the following tables (equal priority):

a) TPS34 Customer-Specific Function Modules
b) TPS32 Partner Function Modules
c) TPS31 SAP Function Modules
d) TPS01 Standard Function Module


Publish & Subscribe (P/S) BTE:

P/S BTEs are called at a fixed, predefined points during the standard SAP program flow. Data can only be published to another application through P/S BTE i.e. we can only export the data to P/S BTE. Changes to program flow or data can’t be performed here. The pre-conditions/rules for calling up alternative processes are defined in the  customization of BTEs in FIBF.

OPEN_FI function module select the FM to be processed for P/S BTE.

Function module BF_FUNCTIONS_FIND which is called inside OPEN_FI function module determines the function modules to process from the following tables:

a) TBE34 Customer-Specific Function Modules
b) TBE32 Partner Function Modules
c) TBE31 SAP Function Modules

(Source: Partly from F1 help)

How to search BTE:

Assume you have business requirement to implement a custom functionality to send an SMS alert to customers when dunning run is done. Since standard SAP does not have such functionality,
You can look for BTE for this.

Go to below t-codes
BERP: To search for process BTE
BERE: To search for P/S BTE

Both t-codes have same selection fields.

Select the attribute type A (Application component) and click F4 on selection attributes field.

z.png
In the next popup, drill down to the process area you are looking for. The paths displayed here are similar to SPRO path.
Select appropriate node. In this case it is DUNNING.

z.png
Path would come as shown below.
z.png

You can further restrict the search by entering other selection parameters which are self-explanatory. Now execute the program.
Output would show the list of available BTEs for the given node. Most of the times, description of the BTE says functionality.

z.png
Select appropriate BTE and use below tool bar options to explore further. We can see the sample FM delivered by SAP, interface of the BTE, Documentation etc.
z.png
Custom FMs can be created with the same interface as of sample FM. One common error seen while implementing the BTE is, custom FM interface may differ than standard FM interface.
In this case, the process would go for dump. This is because, SAP determines the FM name during run time (Dynamic call).

Similarly, search can be done based on other parameters like based on Business object name, IMG nodes etc.

You are welcome to post your comments and feedback on this blog

Regards,
V V

Jan 22, 2016

Change Delivery Quantity Using Function Module BAPI_OUTB_DELIVERY_CHANGE

Codes:
REPORT zchangeqty.
* DO update
DATA gw_do_header  TYPE bapiobdlvhdrchg.
DATA gw_do_ctrl    TYPE bapiobdlvhdrctrlchg.
DATA gv_delivery   TYPE vbeln_vl.
DATA gt_doitem     TYPE STANDARD TABLE OF bapiobdlvitemchg.
DATA gt_doitemctrl TYPE STANDARD TABLE OF bapiobdlvitemctrlchg.
DATA gt_doretn     TYPE STANDARD TABLE OF bapiret2.
DATA lw_doitem     TYPE bapiobdlvitemchg.
DATA lw_doitemctrl TYPE bapiobdlvitemctrlchg.
DATA lw_doretn     TYPE bapiret2.
DATA lw_lips       TYPE lips.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input  '80000349'
  IMPORTING
    output gv_delivery.

"header
gw_do_header-deliv_numb gv_delivery.

"header control
gw_do_ctrl-deliv_numb gv_delivery.

"items
CLEAR lw_doitem.
lw_doitem-deliv_numb gv_delivery.
lw_doitem-dlv_qty    '9'.      "<----new qty from 10 to 9
SELECT SINGLE FROM lips INTO lw_lips
  WHERE vbeln lw_doitem-deliv_numb.
IF sy-subrc 0.
  lw_doitem-fact_unit_nom   lw_lips-umvkz.
  lw_doitem-fact_unit_denom lw_lips-umvkn.
  lw_doitem-conv_fact       lw_lips-umrev.
  lw_doitem-deliv_item      lw_lips-posnr.
  lw_doitem-sales_unit      lw_lips-vrkme.
ENDIF.
APPEND lw_doitem TO gt_doitem.

"item control
lw_doitemctrl-deliv_numb gv_delivery.
lw_doitemctrl-deliv_item lw_doitem-deliv_item.
lw_doitemctrl-chg_delqty 'X'.
APPEND lw_doitemctrl TO gt_doitemctrl.

CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
  EXPORTING
    header_data    gw_do_header
    header_control gw_do_ctrl
    delivery       gv_delivery
  TABLES
    item_data      gt_doitem
    item_control   gt_doitemctrl
    return         gt_doretn.

READ TABLE gt_doretn INTO lw_doretn WITH KEY type 'E'.
IF sy-subrc 0.
  "Error handling
ELSE.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait 'X'.
ENDIF.


Before:















After:












Jan 21, 2016

NiHsLGetNodeAddr unknown - SAP GUI 740 for Windows - hostname empty - 'NiHsLGetNodeAddr' unknown

by Raghavendra Rao Noothangi

We are getting an error while connecting to SAP system "NiHsLGetNodeAddr" unknown.
That is after updating SAP GUI for windows from version 730 to 740.
The version of SAP GUI is as below:-
GUI version.jpg
The Error message will be as below:-
Error 1.jpg
More details of error:-
Error 2.jpg
As per SAP Note 2077230
we need do workaround to avoid this error after upgrade of SAP GUI.
In your windows workstation; go to location of "SAPUILandscape.xml".
use RUN (open RUN using combination of WindowsKey+R) and type "%appdata%"
Run.jpg
you can find the SAPUILandscape.xml inside SAP folder.
File location.jpg
Edit this file (SAPUILandscape.xml) using Notepad or Notepad++ (optional, widows application).
you need to Scroll it to down and find the entries related to "<Routers>" & change the entries as per SAP Note.
you should replace or change  /H/" to " followed by re-start of SAP GUI (close all sessions and re-open SAP GUI).

i.e....when opened in notepad, you need to change the following:
Note: Here 10.20.30.40 as an example for router String.
router="/H/10.20.30.40/H/"/>
to
router="/H/10.20.30.40"/>

router="/H/server.company.com/H/"/>
to
router="/H/server.company.com"/>
Change the Router.jpg
To make it simple:-
1 - windowsKey+R.
2 - Type " %appdata%\SAP " (type without " ).
3 - Backup the Original files to another location.
4 - Open SAPUILandscape.xml file with notepad.
5 - Use Key board short cut, ctrl+H for find and replace.
5.1 - Key in the string in Find " router="/H/<IPaddress of SAP router / FQDN of SAP router>/H/"/> ".
5.2 - Key in the string in replace  " router="/H/<IPaddress of SAP router / FQDN of SAP router>"/> ".
6 - Save changes.
7 - Close all SAP GUI sessions (save and logoff, just in case).
8 - close SAP GUI
9 - Re-open SAP GUI & you can try connecting to SAP server.

Normal SAP GUI entry will be as below:-
After Editing the .xml file and restart of SAP GUI, the entry looks like as below:-




Actual file before edit will look like as below:-
Original.jpg

After change in the .xml file will be with changes as below (look for RED circle):-
Original After Change.jpg
Please close all active sessions (if existing) followed by CLOSE and re-start of SAP GUI.
using SAP GUI short icon.SAP gui icon.jpg

For your information only:-
The .Xml file contains the following parts, easy to understand when opened with IE. But, edit using notepad or notepad++.
Note: the number of entries is dependent on number of entries maintained by you in SAP GUI.
Contents of XML file.jpg
As per SAP Note this error will be fixed with patch 1 (for SAP GUI windows 740) and expected release will be after Dec 8th 2014.


Ref: http://scn.sap.com/docs/DOC-59397