on ‎2012 Feb 15 7:05 PM
Hi Expert,
I am loading Master Data for Inventory , but due to space after my Material record (eg . Correct record - L20233 Error record - "L20233 " ) space sfter 3 charector . it is throughing me error. after edting records in PSA i am able load it further to 0material . Can anyone please help me in writing routine at Transformation level to remove space while loading . Step by step approach is highly appreciated.
Request clarification before answering.
Joe ,
i have implemented start routine and it is working perfectly for loading data stage, But it is not able to delete records which is already exists. Probable reason it PERTICULAR MATERIAL USED AT SEVERAL PLACES is it correct ? --- 1
finally i have decided to add extension to material as original material suppose W02005 . Then while loading it will remove space from behind and add DONOTUSE to it so final it looks like W02005DONOTUSE .
suggest me how can i achieve this with routine point of view. ---2
Please guide me on both points .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have implemented start routine and it is working perfectly for loading data stage, But it is not able to delete records which is already exists. Probable reason it PERTICULAR MATERIAL USED AT SEVERAL PLACES is it correct ? --- 1
Regarding this try checking if the keys you're comparing to delete the records is correct
finally i have decided to add extension to material as original material suppose W02005 . Then while loading it will remove space from behind and add DONOTUSE to it so final it looks like W02005DONOTUSE .
Regarding this point, this can be achieved easily in the routine itself. Just check the length of the material field and append this based on your condition.
You can append like this
concatenate material 'DONOTUSE' into materlal.
Hope this is what you are looking for.
Regards,
Joe
Joe,
i am writting this code in Start Routine of Transfer Rule.
i have changed dataPak to Data_Package . but it shows me below error in code ...
The field "DATA_PACKAGE" is unknown, but there are the following fields
with similar names: "DATAPAK" and "L_S_DATA_PACKAGE_LINE".
Please check it and write step by step code which will help me in understand flow as first condense and then remove duplicate record.
Thanks Joe.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are writing it in the start routine of the transfer rules i guess it would be DATAPAK
But I suggest, leave the condense code as it is.
And just add the delete statement in the START ROUTINE OF THE UPDATE RULE.
Because the code otherwise if fine.
And I am normally used to writing my code in the UPDATE RULE
This should remove your duplicate records.
Regards,
Joe
Edited by: lazarus_joey on Feb 21, 2012 2:52 PM
Edited by: lazarus_joey on Feb 21, 2012 3:03 PM
thanks joe for yor promt replies..this is urgent..
my Datila as below,
Data Source name - Z_MAT_MASS
field name - /BIC/Z_MAT_MASS
we already used condense statement as below -
condense /BIC/Z_MAT_MASS.
Pleease provide me your step by step code to remove duplidate after condense statement.
This will help me and others i n future..
Thanks a lot ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Joe,
i have wriiten below code please check it and if you need change it and update ..
DATA: l_s_datapak_line type TRANSFER_STRUCTURE.
loop at datapak into l_s_datapak_line.
condense l_s_datapak_line-/BIC/Z_MAT_MAS.
modify datapak from l_s_datapak_line index sy-index transporting /BIC/Z_MAT_MAS .
clear l_s_datapak_line.
endloop.
if datapak[] is not initial.
sort datapak by /BIC/Z_MAT_MAS.
delete adjacent duplicates from datapak comparing /BIC/Z_MAT_MAS.
endif.
Note - when i am triggering Infopackage then it shows me Yello status and not upadeting to data target..check above code.. Thanks
Thanks for your prompt reply,
As i am BI Consultant , Can you please send me step by step code to achieve my requirement .that could be excelent for me.
i guess here we have to write loop statement also ,,, and i dont understtande data Package what parameter we have to provide here ...
Please send me code for same to remove one of duplicate data record in Transfer routine.
Thanks..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You just have to add the foll code in your start routine.
LOOP AT DATA_PACKAGE INTO TO WORK_AREA.
* write your routine for the field here.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE COMPARING KEY_FIELDS.
since i do not know your exact data source and field.
I can only give you the sample
Try writing with your field names
Regards,
Joe
I have written code at field level as ,
Result = Tran-strature-/bic/matnr.
condense no-gaps.
But , In PSA i have two records comming from source system . 1. Correct record 2. same record but haviing space behind it (that space i am removing with the help of above code) but in Infoobject it shows Duplicate Data Records .(because it is having corrct record and Condensed record.
Can any one please help me in code for ,
1. Condense Record -- so that it will remove space AS ABOVE I HAVE WRITTEN.
Note - after first step we will carry two records with same identity . - correct record and condensed.
2. I need Code for transfer rouitne to TO REMOVE DUPLICATE ADJESENT RECORD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you need transformation level solution for this,
you can write a field routine for 0material as follows.
use a "formula" Rule type
and use "R_TRIM Delete End Spaces"
i.e. your formula would be something like
R_TRIM(/BIC/XXXXXX) Here /BIC/XXXXXX would be your source field which has been mapped to the rule.
Hope this helps.
Regards,
Joe
Edited by: lazarus_joey on Feb 16, 2012 2:11 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ganesh ,
You can try these :
1. translate v_ods using ' '.
helpful to remove any character other than space too .
2. condense v_ods no-gaps .
helpful to remove space .
Regards,
Jaya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use condense syntax to remove the leading and trailing spaces...
in the field levell routine you can write the code....
RESULT = XXXX
condense RESULT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not required to write a routine for this cases! You can simply enable the ALPHA conversion for your info object settings in RSD1/RSD5. Using this a conversion from an external to an internal format takes place viz. 'SAPSCN ' becomes 'SAPSCN'. Conversion routines ALPHA, NUMCV, and GJAHR check whether data exists in the correct internal format before it is updated. For more details please refer http://goo.gl/Wgtlj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Ganesh
Try this
Result = <your-field>.
CONDENSE RESULT NO-GAPS.
NO-GAPS will remove any space even withing words. Like Anindya Bose will be AnindyaBose.
If you do not want that, use just CONDENSE RESULT.
you can also use Formula , L_TRIM and R_TRIM is there for this purpose
Regards
Anindya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.