The document defines data types and structures for source and target fields used to transform data. It includes a FORM to compute the data transformation that copies fields from the source to target structures, with some fields undergoing simple transformations. For example, the country is always set to 'US' and the customer name is looked up from another table. The transformed data is appended to the target table.
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
36 views
Apdcode
The document defines data types and structures for source and target fields used to transform data. It includes a FORM to compute the data transformation that copies fields from the source to target structures, with some fields undergoing simple transformations. For example, the country is always set to 'US' and the customer name is looked up from another table. The transformed data is appended to the target table.
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2
REPORT RSAN_WB_ROUTINE_TEMP_REPORT .
TYPES: BEGIN OF y_source_fields ,
BILL_DATE TYPE /BI0/OIBILL_DATE , /BIC/ZZCBSARK TYPE /BIC/OIZZCBSARK , SOLD_TO TYPE /BI0/OISOLD_TO , ZZCBSARK__ZZCECFLAG TYPE /BIC/OIZZCECFLAG , KYF_0001 TYPE /BIC/OIZZKSB25_L , KYF_0002 TYPE /BIC/OIZZKWI07_L , END OF y_source_fields . TYPES: yt_source_fields TYPE STANDARD TABLE OF y_source_fields .
TYPES: BEGIN OF y_target_fields ,
COUNTRY TYPE /BIC/OIZZCOUNTRY , CALMONTH TYPE /BI0/OICALMONTH , ZZCBSARK TYPE /BIC/OIZZCBSARK , ZZCECFLAG TYPE /BIC/OIZZCECFLAG , CUSTOMER TYPE /BI0/OISOLD_TO , CUSTOMER_NAME TYPE RSTXTMD , REVENUE TYPE /BIC/OIZZKSB25_L , FEADJCOST TYPE /BIC/OIZZKWI07_L , END OF y_target_fields . TYPES: yt_target_fields TYPE STANDARD TABLE OF y_target_fields . *---------- Begin of type definitions -------------------------------
*TYPES: ...
*----------- End of type definitions --------------------------------
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 -----------------------------
SELECT SINGLE txtmd INTO ls_target-customer_name FROM /bi0/tcustomer WHERE customer = ls_source-sold_to. IF sy-subrc <> 0. CLEAR ls_target-customer_name. ENDIF.
*-6. REVENUE ls_target-revenue = ls_source-kyf_0001. *-7. Front End Adj COST $. ls_target-FEADJCOST = ls_source-kyf_0002.
APPEND ls_target TO et_target.
ENDLOOP.
*---------- End of transformation code ------------------------------