Skip to Content

(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 ./wp-content/uploads/2013/04/query_clip01_202823.png/wp-content/uploads/2013/04/table_clip02_bmp_202825.png
  2. Transformation:

We will filter the data, so that we get only selected data. /wp-content/uploads/2013/04/filter_clip03_202829.png

Join the data coming from two data-sources. /wp-content/uploads/2013/04/join_clip04_202830.png

Use Aggregation. /wp-content/uploads/2013/04/aggreg_clip05_202831.png

some data field will be populated through routine. /wp-content/uploads/2013/04/routine_clip06_202832.png

Map the field assignment to data-target. /wp-content/uploads/2013/04/map_clip07_202833.png

3. Data target: Store the result-set in DSO.  /wp-content/uploads/2013/04/dso_clip08_202834.png

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

/wp-content/uploads/2013/04/dso_clip09_202841.png

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:

/wp-content/uploads/2013/04/apd_clip10_202842.png

/wp-content/uploads/2013/04/apd_clip11_212229.png

/wp-content/uploads/2013/04/apd_clip12_202844.png

/wp-content/uploads/2013/04/apd_clip13_212230.png

a.       Join the data coming from two data-sources using Join button.

Connect them via the company code field.

/wp-content/uploads/2013/04/apd_clip14_212237.png

Now, your screen will look like:

/wp-content/uploads/2013/04/apd_clip15_202871.png

a.       Add Aggregation button to the path.

Select the char fields to the grouping fields section and key fields to the aggregation fields section.

/wp-content/uploads/2013/04/apd_clip16_202872.png

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.

/wp-content/uploads/2013/04/apd_clip17_212238.png

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.

/wp-content/uploads/2013/04/code_clip29_206542.png

Now your dataflow will look like:

/wp-content/uploads/2013/04/apd_clip19_202881.png

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:

/wp-content/uploads/2013/04/apd_clip22_202886.png

/wp-content/uploads/2013/04/apd_clip20_202882.png

/wp-content/uploads/2013/04/apd_clip21_202887.png

Step 3: Test the APD: Save it and execute the APD.

/wp-content/uploads/2013/04/apd_clip23_202897.png

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.

/wp-content/uploads/2013/04/apd_clip28_202912.png

Step 5: You can also schedule APD’s with process chains,

using program RSAN_PROCESS_EXECUTE.

Enter  your APD name and create variant.

/wp-content/uploads/2013/04/apd_clip25_202902.png

/wp-content/uploads/2013/04/apd_clip26_202903.png

/wp-content/uploads/2013/04/apd_clip27_202910.png

thanks& regards,

Vikas

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply