on 2024 Jul 30 10:48 AM
Hell All,
I have a scnario like below. Could you please check and help me to write the end routine.
From source i am getting GL Account number and Company code based on that need to look Fiscal year period and operational company from another ADSO (like DFGL001).
Thanks and Regards,
Venkat.
you need to write an end routine in your SAP BW transformation to perform the following tasks:
Extract the GL Account Number and Company Code from the source.
Look up the Fiscal Year Period and Operational Company Code from the target ADSO (DFGL001) based on the GL Account Number and Company Code.
Map these values to your target InfoProvider (such as an InfoCube or DSO).
The end routine Purpose: To look up the Fiscal Year Period and Operational Company Code from DFGL001 based on the GL Account Number and Company Code
Input: SOURCE_PACKAGE - Internal table with source data TARGET_PACKAGE - Internal table with target data
Example End Routine
DATA: lt_source TYPE TABLE OF <source_structure>,
lt_target TYPE TABLE OF <target_structure>,
lt_dfgl001 TYPE TABLE OF <dfgl001_structure>,
lv_fiscal_year_period TYPE <fiscal_year_period_type>,
lv_operational_company TYPE <operational_company_type>.
Extract data from the source package
lt_source = SOURCE_PACKAGE.
Loop through the source records
LOOP AT lt_source INTO DATA(ls_source).
Fetch corresponding records from DFGL001 ADSO based on GL Account and Company Code
SELECT SINGLE fiscal_year_period
operational_company
INTO (lv_fiscal_year_period, lv_operational_company)
FROM dfgl001
WHERE gl_account = ls_source-gl_account
AND company_code = ls_source-company_code.
Handle cases where no matching records are found
IF sy-subrc = 0. Map the values to the target structure
ls_source-fiscal_year_period = lv_fiscal_year_period.
ls_source-operational_company = lv_operational_company.
ELSE. Handle cases where no data is found
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.