(Analysis Process Designer) APD Creation: T-code: RSANWB
1. To get the query data and store it in DSO.
2. Populate the text for field: Company code.
3. Some field to be populated using routine.
Create DSO (ZTest02): direct update
Create a variant for your query using t-code RSRT.
APD screen: Create Data-source by drag-n-drop of the buttons available.
a. a. Give the values in the properties of Query1.
a. b. We will be populating Company code text from the text table(/BI0/TComp_code).Enter details
a. c. Add a filter to query path. Select your fields and give values.
Give values in filter conditions:
Company code: F007,E014
After completing the steps, your screen looks like:
a. Join the data coming from two data-sources using Join button.
Connect them via the company code field.
Now, your screen will look like:
a. Add Aggregation button to the path.
Select the char fields to the grouping fields section and key fields to the aggregation fields section.
a. Add the Routine button to the path , select the source fields and target fields.
We will populate two fields using routine. Add them in the target fields.
We added KYF_001 and KYF_001_CURR. We are populating them as amt. 100 and currency as JPY.
Put the code:
USING it_source TYPE yt_source_fields
ir_context TYPE REF TO if_rsan_rt_routine_context
EXPORTING et_target TYPE yt_target_fields .
*——— Begin of transformation code —————————–
DATA: ls_source TYPE y_source_fields,
ls_target TYPE y_target_fields,
w_curr type /BI0/OICFM_TR_CUR,
w_amt type /BI0/OICFM_0021.
LOOP AT it_source INTO ls_source.
w_curr = ‘JPY’.
w_amt = 100.
MOVE-CORRESPONDING ls_source TO ls_target.
ls_target-KYF_001_curr = w_curr.
ls_target-KYF_001 = w_amt.
APPEND ls_target TO et_target.
*———- End of transformation code ——————————
Now your dataflow will look like:
a. Finally, Add the data target DSO. Give DSO name,
map the field in field assignment icon.
Now your APD data- flow will look like:
Step 3: Test the APD: Save it and execute the APD.
3 records are transferred to DSO.
Step 4: Check the data in DSO: The text(TXTMD) is populated and two fields(CFM_0021,CFM_TR_CURR) are populated as per routine. And the other data is as per query.
Step 5: You can also schedule APD’s with process chains,
using program RSAN_PROCESS_EXECUTE.
Enter your APD name and create variant.