Problem in transformation routine.
Hi,
I add new logic but it is not working. my understanding is if the condition ( IF <FS>-CALDAY > W_ZODPMSOB-CALDAY.) is ture then out from the loop, but when i debuge the code it is come on the loop and jump out from the loop it is not going to check the condition eventhough <FS>-CALDAY is less than the W_ZODPMSOB-CALDAY.
please help me to fix this problem.
Thanks
FORM apply_resettlement TABLES w_zodpmsob LIKE it_result.
DATA : lv_tabix TYPE sy-tabix, rec_found(1).
READ TABLE w_zodpmsob
WITH KEY ba_objnrt = <fs>-ba_objnrt
BINARY SEARCH.
lv_tabix = SY-TABIX + 1.
lOOP.
IF <FS>-CALDAY > W_ZODPMSOB-CALDAY.
EXIT.
CLEAR: lv_tabix.
READ TABLE w_zodpmsob
WITH KEY ba_objnrt = <fs>-ba_objnrt
BINARY SEARCH.
lv_tabix = SY-TABIX + 1.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
<fs>-/bic/zamount_c = <fs>-amount * w_zodpmsob-/bic/zper_cap.
<fs>-/bic/zamount_o = <fs>-amount * w_zodpmsob-/bic/zper_oper.
<fs>-/bic/zamount_r = <fs>-amount * w_zodpmsob-/bic/zper_rec.
<fs>-/bic/zamount_u = <fs>-amount * w_zodpmsob-/bic/zper_und.
<fs>-/bic/zper_cap = w_zodpmsob-/bic/zper_cap.
w_recno = w_recno + 1.
<fs>-recno = w_recno.
ENDFORM. "APPLY_RESETTLEMENT
Hi Pria,
First of all, do not worry. This is a easy fix.
Can you please let me know what is the purpose you want the code? It is quite not clear with this piece of code as in this code we are just increasing the sy-tabix by 1 if the condition meet and do not meet.
In your code, I can see that some statements are not required.
***lOOP.
IF <FS>-CALDAY > W_ZODPMSOB-CALDAY.
*** EXIT.
CLEAR: lv_tabix.
READ TABLE w_zodpmsob
WITH KEY ba_objnrt = <fs>-ba_objnrt
BINARY SEARCH.
lv_tabix = SY-TABIX + 1.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
ENDIF.
*** ENDLOOP.
I have added *** on the statements that are not required this applies for WHILE statement too. You ideally only need IF statement. But still it is not clear the purpose of your code. I do not see any modifications to the data etc.
Can you please paste your complete code of endroutine and tell the purpose of your code?
Regards
Amit
Similar Messages
-
Problem with Transformation Routine
Hi all
I am using a DSO 0FIGL_O02 taking data from the DataSource 0FI_GL_4 . I have a field 0Customer to the DSO & for that i´m taking data from the another DSO ZPCA_EC3 .
The folllowing is the Tranformation Routine i have tried
Routine 1,
Data : zcustomer type /BIC/AZPCA_EC300-CUSTOMER.
select single customer
from /BIC/AZPCA_EC300
into ZCUSTOMER
where AC_DOC_NO = SOURCE_FIELDS-BELNR.
RESULT = zcustomer.
Routine 2.
Data : zcustomer type /BIC/AZPCA_EC300-CUSTOMER.
select single customer
from /BIC/AZPCA_EC300
into ZCUSTOMER
where AC_DOC_NO = SOURCE_FIELDS-BELNR
and COMP_CODE = SOURCE_FIELDS-bukrs
and FISCYEAR = SOURCE_FIELDS-gjahr.
RESULT = zcustomer.
I dont get any errors for this Routine , But when i run the DTP it is going on Running & Running for hours, with no results , But again no errors also.
What could be the problem ?
Could anyone help me write a better routine .here is my requirement
I want to pick up 0Customer field data from ZPCA_EC3 based on 0AC_DOC_NO in both ZPCA_EC3 & 0FI_GL_4 DataSource.
Regards
RameshHi,
well I don't know the key of your ods. But the first check would be to use fields in the where clause which are in the key or a additional index. Another option might be to select the data for the complete data package at once into a internal table and access the internal table in the routine. May be you can also do the whole thing in the start routine.
regards
Siggi -
Problem to call a easy function in a transformation routine
Hi,
I wanted to convert a string ("12") to an integer (12) in my transformation routine.
Here the code:
DATA: vaca_number TYPE i.
CALL FUNCTION u2019conversion_exit_alpha_outputu2019
EXPORTING
input = source_fields-vaca
IMPORTING
output = vaca_number.
IF source_fields-smocker CS 'Y'.
result = vaca_number * 120.
ELSEIF source_fields-smocker CS 'N'.
result = vaca_number * 240.
ELSE.
monitor_rec-msgid = 'ZMESSAGE'.
monitor_rec-msgty = 'E'.
monitor_rec-msgno = '001'.
monitor_rec-msgv1 = 'ERROR SMOCKER UNKNOWN FOR PPS'.
monitor_rec-msgv2 = source_fields-smocker.
APPEND monitor_rec TO monitor.
RAISE EXCEPTION TYPE cx_rsrout_abort.
ENDIF.
When i check, i have the following error:
E:"RS_C_ICON_VERSION-" expected, not "#CONVERSION_"
Have you an idea ?
Thanks for your help.
Rodolphe.That's one problem. But if you look at the interface for the FM, it requires a character value. The following, using an integer, will dump. Try it and see. The only way to make it work is to define i_2 as a character, not integer.
PROGRAM zz_temp.
DATA:
c_1 TYPE c VALUE '1',
i_2 TYPE i.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = c_1
IMPORTING
output = i_2. -
Infoobject routine problem in transformation using BI 7.0 datasource
Hi expert,
We have the business senario:need to look up data from Active data of DSO: /BIC/AZIN_O0100 into infoobject ZN1 in DSO:AAA through the link ZNR. We have the code, but after DTP, there are blank value in infoobject ZN1 in the content of DSO:AAA. Anyone can guide us why we get the blank in the value.
DSO:AAA
ZNR;ZN1
Source field
ZNR;
Active data /BIC/AZIN_O0100
/BIC/ZNR;/BIC/ZN1
Code in routine of infoobject ZN1 in transformation (BI 7.0 datasource)
DATA: IT_ZN1 TYPE /BIC/AZIN_O0100-/BIC/ZN1.
SELECT /BIC/ZN1 INTO IT_ZN1 FROM /BIC/AZIN_O0100
WHERE /BIC/ZNR = SOURCE_FIELDS-ZNR.
ENDSELECT.
RESULT = IT_ZN1.Hi ,
Please split this code in start routine and transformation routine.
DSO:AAA
ZNR;ZN1
Source field
ZNR;
Start Routine
Active data /BIC/AZIN_O0100
/BIC/ZNR;/BIC/ZN1
DATA: IT_ZN1 TYPE /BIC/AZIN_O0100-/BIC/ZN1.
SELECT /BIC/ZN1 FROM /BIC/AZIN_O0100 INTO IT_ZN1
FOR ALL ENTRIES IN SOURCE_PACKAGE
WHERE /BIC/ZNR = <SOURCE_FIELDS>-ZNR.
Transformation Routine
READ TABLE IT_ZN1 with key
/BIC/ZNR = <SOURCE_FIELDS>-ZNR BINARY SEARCH.
IF sy-subrc = 0.
RESULT = IT_ZN1 - FIELDNAME.
Hope this answres you.
-Vikram
RESULT = IT_ZN1. -
Routine problem in transformation
Hi sdners
following is the secenrio, i had a doubt in that. i have to create a transformation routine for the field cost performance index= budegt cost of work performed * percentage of work complete/ direct effort + direct expences. these for infoobject loaded by flat file. so how to do write the code, weather i have to map all calcultion field in traget field. please guide me how to write the code.
hariHi Hari,
I am assuming you have the fields budegt cost of work performed, percentage of work complete/ direct effort and direct expences in the data source.
Now when you enter into routine, scroll up. There you will find CLASS lcl_transform DEFINITION.
PUBLIC SECTION. Under that you will see TYPES: BEGIN OF tys_SC_1,
Under that you will find the the technical names of all fields that you have mapped i.e budegt cost of work performed, percentage of work complete/ direct effort and direct expences. You will have to use it in result.
Now what you have to do is scroll down again and then go to :
Start of code *************
CLASS lcl_transform IMPLEMENTATION.
METHOD compute_ZPYENTDT.
DATA:
MONITOR_REC TYPE rsmonitor.
Skip all these, keep them as it is:
$$ begin of routine - insert your code only below this line -
... "insert your code here
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
raise exception type CX_RSROUT_ABORT.
... "to skip a record
raise exception type CX_RSROUT_SKIP_RECORD.
... "to clear target fields
raise exception type CX_RSROUT_SKIP_VAL.
RESULT = Technical name of budegt cost of work performed * technical name of percentage of work complete/ direct effort + technical name of direct expences.
End of Code **************
Hope this helps.
Thanks,
Rahul -
Transformation routine problem - changing 2 infoobjects in 1 routine
Dear all,
i have coded a transformation routine which gets data from 4 infoobjects and writes into 1 infoobject.
routine is like that:
startdate-starttime-enddate-endtime
routine converts data into : time difference / 0calmonth
however i need to update also 0calmonth with that routine? how can i do that?
when i define a rule, i guess it always update only one infoobject?
thanks in advance.Hi John,
sure you can. It is the same procedure as in update rules, but a start routine will only work if all your required fields are contained in the communication structure and so in the infosource. Otherwise you need to stay with the second routine.
regards
Siggi -
Calling a function module from within a transformation routine
I created a routine within a transformation and experience the following weird behavior now:
When I call a function module within that routine, the load fails with the following error message:
Exceptions in Substep: Rules
When I click on the button next to this text, it point me to my function module call.
What I do not understand is, that the following two scenarios work fine:
- Having the same function call (with fake values) in a plain ABAP program works beautilfully
- If I copy the content of my function module directly into my transformation routine, everything works fine as well
I am now wondering whether the routine does not "see" the function module I am calling. The module resides in a different package. Is that a problem? Do I have to include something first?
Here is the code that calls my FM (
CALL FUNCTION 'Z_CA_CONVERT_US_COST'
EXPORTING
PSOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC
PSOURCEUOM = SOURCE_FIELDS-BASE_UOM
PUSITM = SOURCE_FIELDS-/BIC/USITM
PTARGETUOM = PRODUCTION_UOM
IMPORTING
PTARGETVAL = RESULT
EXCEPTIONS
CONVERSION_NOT_MAINTAINED = 1
PARTNO_NOT_FOUND = 2
OTHERS = 3.
Thanks a lot for your help. Points will be assigned.
DennisGood catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
DATA:
SOURCEVAL TYPE /BIC/OIINVQTY,
SOURCEUOM TYPE /BIC/OIUSUOM,
USITM TYPE /BIC/OIUSITM,
TARGETUOM TYPE /BIC/OIUSUOM,
CONVERTED_COST TYPE /BIC/OIINVQTY.
DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
" get the Production UOM
SELECT SINGLE I~/BIC/USPRDUOM
FROM /BIC/PUSITM AS I
INTO PRODUCTION_UOM
WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
IF ( SY-SUBRC = 4 ). " no records found
"RAISE PARTNO_NOT_FOUND.
RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
ENDIF.
" load the parameters
SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
USITM = SOURCE_FIELDS-/BIC/USITM.
" then you can call the FM
CALL FUNCTION 'Z_CA_CONVERT_US_COST'
EXPORTING
PSOURCEVAL = SOURCEVAL
PSOURCEUOM = SOURCEUOM
PUSITM = USITM
PTARGETUOM = PRODUCTION_UOM
IMPORTING
PTARGETVAL = CONVERTED_COST
EXCEPTIONS
CONVERSION_NOT_MAINTAINED = 1
PARTNO_NOT_FOUND = 2
OTHERS = 3.
" ... [do the rest]
Thanks for your help,
Dennis -
Error in Transformation Routine
Hi all,
I have written a code in transformation routine. I have debugged the code. The code which I have written is working fine. The value in 'Result' is correct and till here the code executes without any error. After that , system throws an error which I cannot understand as this is the system generated code.
I wanted to paste the error analysis here but i dont have any option to copy from there. Message class is "RSBK". Number is 299
Any ideas?
Regards,
Aisha Ishrat
ICI Pakistan Ltd.Hi AI,
As I told you earlier ... jsut copy and paste the code I sent you in the end routine ... if the end routine contains your data then we are sure that the transformations have worked fine ... if it does not contain any data then we are sure something has gone wrong during the transformation.... you cannot find the problem until you are sure where it is happening.... lets work on this and get it out of our way... I am waiting for your response.
Another point if anything has gone wrong while doing the transformations for location then the end routine will not have location info ... this is why I suggest you to put the code above in the end routine and debug ... this will give you a fair idea as to what has happened and where the problem arises.... Hope this helps.
best regards,
Kazmi -
Help in transformation routine
I have to put an indicator for delivery block in transformation routine.
Logic: if headed delivery block 'LIFSK' is not blank, result is 'X'.
Here is my code which is not working:
IF SOURCE_FIELDS-LIFSK NE ''.
RESULT = 'X'.
ENDIF.
But this code is not doing anything. I tired using 'test' function in transformation, it gives abap dump.
What is the problem. Code is in right place in transformation routine.
A similar code for item level block is working:
More details:
$$ begin of routine - insert your code only below this line -
... "insert your code here
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
raise exception type CX_RSROUT_ABORT.
... "to skip a record
raise exception type CX_RSROUT_SKIP_RECORD.
... "to clear target fields
raise exception type CX_RSROUT_SKIP_VAL.
IF SOURCE_FIELDS-ZZ_LIFSP ne ''.
RESULT = 'X'.
endif.
$$ end of routine - insert your code only before this line -
ENDMETHOD. "compute_ZDELIBLK
Thanks
Jeff
Edited by: Jeff Edwards on Aug 17, 2008 10:34 PMNo luck.
Error analysis
The following checkpoint group was used: "No checkpoint group specified"
If in the ASSERT statement the addition FIELDS was used, you can find
the content of the first 8 specified fields in the following overview:
" (not used) "
" (not used) "
" (not used) "
" (not used) "
" (not used) "
" (not used) "
" (not used) "
" (not used) "
ST22 / ABAP Editor :
*-- Get field name from source field with extern posit.
READ TABLE i_t_seg_source ASSIGNING <ls_s_seg_source>
WITH KEY segid = i_segid.
ASSERT sy-subrc = 0.
IF sy-subrc = 0.
READ TABLE <ls_s_seg_source>-t_field ASSIGNING <ls_s_field>
WITH KEY position = l_posit_source_ex.
> ASSERT sy-subrc = 0.
ENDIF.
*-- r_s_parameter-param_id has to be set out side due to type inheritance of RuleStepMapping
CONCATENATE '<' <ls_s_seg>-y__nm '>' INTO
c_s_connector-s__nm.
c_s_connector-f__nm = <ls_s_field>-fieldname.
ENDMETHOD. -
Create Multiple records in transformation routine
Hi,
Could anyone let me know how to do creation of multiple records (from one source record) in BI 7.0 transformation routine, E.g.
Source record
Cost Center Period 01 Period 02
1234 $30 $50
--> (After transformation)
Period Cost center Total cost
01 1234 $30
02 1234 $50
Many thanks,
AlvinThe problem was with the following code segment:
tmp_curr_rec_id := get_block_property( :system.current_block, current_record );
set_record_property( tmp_curr_rec_id, :system.current_block, status, new_status );
After omitting these two lines, the code worked properly.
Thansk for all whoe replied.
Regards,
Tamas -
Transformation routine used for GR as at posting date (0GR_VAL_PD KF)
HI all,
I have problem in 2lis_02_scl transformation Routine where i am not getting corect data for GR as at posting date (0GR_Val_pd) KF.
Can anyone tell me what routine shall i try to use.
Thanks n Regards,
Gaurav SekhriHI Gaurav,
The code which you have given does not specify the desired result which you want. Also one more thing you have written a code as follows:
IF ( SOURCE_FIELDS-PROCESSKEY = '002' or "WE-Wert
SOURCE_FIELDS-PROCESSKEY = '012' or
SOURCE_FIELDS-PROCESSKEY = '022' )
AND SOURCE_FIELDS-BWAPPLNM EQ 'MM'.
RESULT = SOURCE_FIELDS-CPPVLC.
endif.
What is the above condition does not satisfy. you need to specify a RESULT if the above condition is not met like.
IF ( SOURCE_FIELDS-PROCESSKEY = '002' or "WE-Wert
SOURCE_FIELDS-PROCESSKEY = '012' or
SOURCE_FIELDS-PROCESSKEY = '022' )
AND SOURCE_FIELDS-BWAPPLNM EQ 'MM'.
RESULT = SOURCE_FIELDS-CPPVLC.
ELSE.
REULT = " Your desired result if condition is not met".
endif.
Hope it helps.
Regards,
Satyam -
Problems with transformation; infoobject not updated in DSO.
Hi all,
We are having some problems with one of our transformations between PSA and DSO.
Suddenly some of the fields are not filled in the DSO. The mapping for field Sales order number worked fine, and then I added an infoObject in the DSO to hold the info for Sales order item. I also replaced the infoobject that was supposed to hold the sales order number. After this, none of the two fields has any data in DSO. I checked the PSA, and the data is available here. I tested the rule in Rule details and for sales order number it gives the correct result, but for sales order item it gives a runtime error; assertion failed. I checked on SAP Notes, and found 929934. But the corrections are already added in our system.
Has anyone got any ideas on what to do?
BR,
LindaHi,
There are a number of problems in Transformation when either a source field or target field is changed.
This can lead to inconsistent transformation.
You can raise a message to SAP or best thing is if possible delete the Transformation and create a new one.
Regards,
Nitin -
Target value in transformation routine
Hi
How can I get the value of target field, which is already present, in the transformation routine?
For Example, I have a transformation between ODS DS1 and ODS DS2. DS1 has fields DS1_F1, DS1_F2 and DS2 has fields DS2_F1, DS2_F2. Now I have written a transformation routine for target field DS2_F1 with input DS1_F1. In this routine, I want to get the value of DS2_F1, which is already present, before the result is being updated. How can I get it?
Thanks & Regards
TejoHi,
Use end routine concept here .
Regards,
Anil Kumar Sharma .P -
Table Declaration in Transformation Routine
Hi all,
I have declared a table in transformation routine as follows :
DATA : BEGIN OF VACATIONS OCCURS 0,
DATE TYPE D,
END OF VACATIONS.
System is giving following error on this :
' E:Tables with headers are no longer supported in the OO context.'
What should I do now?
Regards,
Aisha Ishrat
ICI Pakistan Ltd.Hi Al,
Let me explain here ... because you are doing what is being told to do without actually understanding your purpose. Let me take a scenario. You want to read a database table for sales orders populate it into the internal table. Then you wnat to loop at the internal table you populated and print the output. For this what you need is an internal table where your data will be stored - simply put its a 2 dimentional array. so your data once put into the internal table would look like:
Sales_Order Sold_To_Party
1 1
2 3
3 5
4 1
Now what you do is read it - which means you are going to read one line at a time, which means a structure not an internal table, which was the purpose of the header line. but since header lines are not supported you need a different work area (structure). So that when you read the first line your structure contains as follows:
1 1
When you read the second line your structure or work area contains the second line:
2 3
so on.....
From the explaination above you must be clear that you need an internal table to store data temporarily and a structure to manipulate a single record. Now the cod would look like:
DATA: it_vbak type table of VBAK.
DATA: wa_vbak type vbak.
Notice above that one is using a "table" while declaring and the other is not.
Select * from VBAK into table it_vbak.
loop at it_vbak into wa_vbak.
note above that you are looping at the internal table and populating one record
into the work area.
write:/ wa_vbak-vbeln.
endloop.
Hope this helps. Ask if you have any more concerns.
Best regards,
Kazmi -
CX_SY_NO_HANDLER triggered when call FM in Transformation Routine in BI
Hi,
Currently we are encountering an error whereby the Exception 'CX_SY_NO_HANDLER' will be triggered whenever we call a Function Module inside a Transformation Routine in BI.
Previously, this FM was a Custom FM, but even after changing to a standard FM this error still happens.
The process does not even enter into the FM, but immediately jumps to a 'Try - Catch' block of standard SAP, with the message "an exception (CX_SY_NO_HANDLER) occured".
Hence, we need to confirm:
does SAP/BI allow calling an FM inside a Transformation Routine?
if yes to above, how do we avoid encountering this error when calling a FM inside a Transformation Routine.
Your help is very much appreciated.
Thanks you.Yes, you can call a FM from function module.
Make sure your import and export parameters are of same type as defined in FM when passing values to FM from transformation.
For example:
in function module
xyz type i.
transformation
abc type char.
CALL FUNCTION 'dsjfh'
EXPORT
xyz = abc.
Regards,
San!
Maybe you are looking for
-
Email notification to specific user when processing multiple files at a time
Hi I am new to SSIS and error mail notification ,can some please provide details for my urgent and prioritized task in my project. below is the requirement I have a package for multiple file processing using for each file enumerator .each file havin
-
How can I capture the complete http-message sent from client to WAS?
Hello, When debugging a BSP application several utility classes/objects are available. Only I can't find the original authentication information forwarded by the client (userid). Therefor I would like to have available the whole http-message (full he
-
Error message: "There was a problem reading this document (14)." I had an pdf file open (File 1) while I was converting a WordPerfect file to pdf and the converted file froze up after it opened. I closed it and converted another WP file to pdf and
-
'max case when...then' does it work in Desktop reports as a calculation?
Hi! I've used 'max case when...then' in my SQL in Admin edition. It works fine. However when I try to use it as a part of my calculation: MAX(CASE WHEN (:Payroll Month 1 - Gross Sal) THEN TO_NUMBER(NVL("Gross Salary ".Basic Salary, 0)) Else 0 END) in
-
MacBook restarts when select shutdown
Hi, I have a macbook that everytime I choose shutdown it restarts its self. I tried reinstalling the OS. That made not different, repaired the disk permissions still no join. I think its the dvd drive that keeping the macbook from shutting down is th