Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only
Former Member
4,318 Views
1 Comment

(Analysis Process Designer) APD Creation: T-code: RSANWB

Requirement:

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.

  1. DataSource: data will come from query , text will be taken from text table .
  2. Transformation:

We will filter the data, so that we get only selected data.

Join the data coming from two data-sources.

Use Aggregation.

some data field will be populated through routine.

Map the field assignment to data-target.

3. Data target: Store the result-set in DSO. 

Step1: T-code:RSA1

Create DSO (ZTest02): direct update

With key-fields:

Country(0Country),

Company Code(0Comp_code),

Medium description(0TxtMD),

Date

And data-fields:

Amount1

Amouunt2(USD),

Currency1,Currency2

Step2:

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:

Country: CL,GB

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:

FORM compute_data_transformation

     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.

     clear: ls_source,ls_target,w_curr,w_amt.

  ENDLOOP.

*---------- End of transformation code ------------------------------

  1. ENDFORM.

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.

thanks& regards,

Vikas

---

1 Comment
Labels in this area