cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BI End Routine 2

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

karthik_vasudevan
Active Contributor
0 Kudos

Hi Foram

The code will delete the data which is less than 5th September. LT means less than.

This is what you have asked for in your initial question

Try the code in test system and then let us know if it has some issues.

Regards

Karthik

Former Member
0 Kudos

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

Former Member
0 Kudos

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

karthik_vasudevan
Active Contributor
0 Kudos

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

karthik_vasudevan
Active Contributor
0 Kudos

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