on 2024 Nov 08 11:25 AM
In this blog post we will discuss on how we can perform conversions, derivations, transformations etc in the SLT System.
Suppose the client has a requirement to view Purchase Requisitions data in near realtime in the BW Reports. Here they want to see the Amount fields in the local currency but the EBAN Table has the Amounts in the Document currency. Therefore, you will need to convert the source currency to the target currency but you do not want to enhance the standard table due to some constraints. Also, we cannot use the ODP datasource as a source for SLT.
In such scenarios, you can take advantage of the Advanced Replication Settings in SLT.
Step 1:
Add the required field exchange rate in the target table in LTRS.
You can do this by going to Table Settings->Table Structure->Add Field
Once you have added the required fields, save the table structure.
Step 2:
Begin by creating an Include Program in the SLT system:
In this Include program, you need to call a Remote Enabled Function Module from the source system. Here we are assuming the FM that you want to call is already Remote Enabled.
Next,in order to call the Remote Enabled FM, you need to know the technical name of the RFC destination.
You may hardcode this based on the environment of your SLT system.
Now we call the Remote Enabled FM by passing the FM name followed by the RFC destination.
Below is the sample code of the Include Program to derive the exchange rate:
Here 'BAPI_EXCHANGERATE_GETDETAIL' is a Remote Enabled Function Module
*******************************************************************************************
DATA: ls_exchrate TYPE bapi1093_0,
lv_rfcdest type sysid.
lv_rfcdest = sy-sysid.
CASE lv_rfcdest.
WHEN 'SLTD'.
lv_rfcdest = 'ECCD'.
WHEN 'SLTQ'.
lv_rfcdest = 'ECCQ’.
WHEN 'SLTP'.
lv_rfcdest = 'ECCP’
ENDCASE.
*Remote call from SLT to ECC getting exchange rate
*The field symbols follow a generic naming convention <wa_s_tablename> for source and <wa_r_tablename> for target work areas, where tablename denotes the source table name. For instance, the work areas for the table SPFLI would be <WA_S_SPFLI> and <WA_R_SPFLI>.
CALL FUNCTION 'BAPI_EXCHANGERATE_GETDETAIL' DESTINATION lv_rfcdest
EXPORTING
rate_type = 'M'
from_curr = <wa_s_eban>-waers
to_currncy = 'USD'
date = <wa_s_eban>-badat
IMPORTING
exch_rate = ls_exchrate.
* RETURN =
*assigned to EBAN LT structure
<wa_r_eban>-zzexch_rate = ls_exchrate-exch_rate.
Now that you have written the Include Program, you need to call it.
Step 3: Open LTRS t-code in the SLT system and navigate to Rule Assignment under Advanced Replication Settings.
Right click on the Rule Assignment and enter your table name.
Step 4: Click on the Create Icon and select Event Based rule since we want to execute the custom include program that we have written.
We will select the Begin of Record (BOR) event since we want to access the data of the source and target work areas.
Double click on the event and insert the Include Name in the Include Name field.
Step 5: Now change your event status from New to Released and save it.
Step 6: In your target system table e.g. in the BW system add the field for Exchange Rate in your staging adso and replicate your datasource so that it reflects the newly added exchange rate field that we added in the target table structure in SLT. Map the datasource field with the staging adso field and start the dataload.
You can see that the Exchange Rate column is populated. You can validate the values by running the FM in the ECC system for few records.
Now you may ask, what if my standard Function Module is not Remote Enabled in the source system.
E.g. you want to convert the WBS Element number from Internal to External Format and the FM
CONVERSION_EXIT_ABPSP_OUTPUT is not Remote Enabled.
In this case, you can proceed with creating a copy of the normal function module and make the copy as Remote Enabled.
If the Type of the Import and Export Parameters is not specified in the Standard Function Module, specify it in the copy Function Module else you might run into a syntax error.
Once you are done creating your Remote Enabled Function Module in the source system, proceed with creating the Include Program by following the steps mentioned earlier and you are good to go.
Feel free to reach out to me for any clarifications and I would be happy to help.
Happy learning!
Request clarification before answering.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.