on 09-29-2016 2:11 PM
Hello Experts,
I have a requirement that I want a sales order data on after 5th september to till date rest all moths and years data should be deleted, So how can we write the same in end routine ( I already have creation date for a sales order).
It will be helpful if anyone will provide me syntax for end routine as the requirement is easy but as I am new to abap
Thanks.
Regards,
Foram
Hi Kartik,
Thanks for your reply..:)
I am aware that we can do the same by dtp or info-package filters but my requirement is to complete the same by routine.
The code you mentioned will work for only one day ie 5th september?, But my requirement is to load all the data after 5th september to 30th september so how will i achieve these via routine.
Please reply.
Regards,
Foram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kartik,
There is slight changes in the date filter, Now I need all data after 15 december,2014 and desired output is mentioned below :
Code given by you is written as mentioned below :
Wrong output derived after code :
See first record which should not come instead a record posted on 18 december 2014 should come.
Please let me know if I am missing anything.
Rgerads,
Foram
Hi Kartik,
The above mentioned issue is solved and I got desired output, Thanks a lot again...:)
Can you please help me with below mentioned requirement :
I have a simple requirement that I want a fiscal period from a creation date (Creation date is available in DSO)
I am aware about I can get the same by just mapping fiscal year period to date in transformation but I want to do the same by using End routine.
So what will be the steps I should perform for the same please help me on it.
Step 1) creating a info-object which has NUMC type means character strings with only digit
Step 2) Call function module DATE_TO_PERIOD_CONVERT in my End routine.
But I am not sure how we can write it in end routine and syntax for the same , If anyone can provide me the syntax it will be a great help
Appreciate your help in advance.
Regards,
Foram
Hi Foram
Good that your issue is resolved.
For your second question, please click on pattern on your end routine screen (which will be above your code)
Once you click pattern, it will open another screen where you can call function module as per the below screen. You can enter your FM and proceed further. Fill the field names accordingly.
Regards
Karthik
Hi Foram
ABAP is not the only way to achieve this.
You could use DTP to filter out unwanted data. This is the simplest way. I am sure creation date will come from source.
Another easy trick is find out a transformation in your BI system which has got the similar logic and change the field names accordingly. This is the best way to learn as well.
Another way is to load the full data and do a selective deletion.
Anyways, the syntax can be as below.
LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
IF <RESULT_FIELDS>-FIELDNAME LT '20160905'.
DELETE RESULT_PACKAGE.
ENDIF.
ENDLOOP.
I am not sure about the complete situation, but a general point is not to use any hardcoded information in routine. If there is a proper justification, its fine. If not, please use some alternative approach.
If you are using the code, please test the code by loading data in test system. Make sure the data is as per your expectation and then proceed further
Hope this helps.
Regards
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.