比较复杂的创建APD

APD Creation 

(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 .query_clip01.pngtable_clip02.bmp.png
  2. Transformation:

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

Join the data coming from two data-sources. join_clip04.png

Use Aggregation. aggreg_clip05.png

some data field will be populated through routine. routine_clip06.png

Map the field assignment to data-target. map_clip07.png

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

 

 

Step1T-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

 

dso_clip09.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:

apd_clip10.png

 

apd_clip11.png

 

apd_clip12.png

 

apd_clip13.png

 

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

 

Connect them via the company code field.

 

apd_clip14.png

 

Now, your screen will look like:

 

apd_clip15.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.

apd_clip16.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.

 

 

apd_clip17.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.

 

code_clip29.png

 

 

Now your dataflow will look like:

apd_clip19.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:

 

apd_clip22.png

apd_clip20.png

apd_clip21.png

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

apd_clip23.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.

 

apd_clip28.png

 

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

using program RSAN_PROCESS_EXECUTE.

Enter  your APD name and create variant.

 

apd_clip25.png

apd_clip26.png

apd_clip27.png

 

thanks& regards,

Vikas

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值