Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

create validity period for business partners

ChristofLange
Explorer
0 Kudos

Dear Experts,

We are using ABAP to create and update business partners.

The creation of a BUPA - using Function BAPI_BUPA_CREATE_FROM_DATA u2013 works well, a BUPA (which is valid 01.01.0001 to 31.12.9999) is created.

To modify an existing BUPA we use the Function BAPI_BUPA_CENTRAL_CHANGE which works good as well.

However, we want to keep the history!

Consequently the update should not just change u2013 say the name2 u2013 but create a new validity period from today to 31.12.9999 using the new name2 and keep the old data in the initial validity period (of cause that one must be limited to last only form 01.01.0001 until yesterday)

If the name2 is changed on 20.10.2009 that means the resulting BUPA should look like this:

validity period 01.01.0001 to 19.10.2009: old name2

validity period 20.10.2009 to 31.12.9999: new name2

Does anybody know a Function to work with time dependency like that?

We are looking forward to reading your ideas.

Regards,

Christof Lange

Edited by: Christof Lange on Nov 26, 2009 9:06 AM

9 REPLIES 9

Former Member
0 Kudos

Christof,

You can do one thing, crete one Ztable to store the validity time details with the BP and validity time range. You update this table before calling the Function BAPI_BUPA_CENTRAL_CHANGE.

I handled the same situation with the above procedure and succeed.

Regards,

Naresh Durki.

0 Kudos

Dear Naresh,

thanks a lot for your reply!

I understand that you have created a Z-Table to store the validity range for a BP. However, we would like to handle multiple validly periods for each BP.

In the customizing we used switch u201CTime Dependency BP Central Datau201D (to be found in Transaction spro under Cross-Application Components->SAP Business Partner->Activate Switch functions) to activate the time dependency for BP. That lead to the button u201Ccreate validity periodu201D in the upper middle of the BP Screen you reach with transaction BP or BUP2.

What we are looking for is to create a new validity period just like that button does u2013 just with our own APBP program.

I am looking forward to reading your replies.

Regards,

Christof Lange

0 Kudos

Christof,

You have to create new program which will take the inputs of new validity period for a BP. Before updating the values to the BP read the old contents and store in Ztable you can store multiple validity ranges for a BP.

We can even store multiple values for a business partner with different validity periods.

My key field will be BP and two date ranges.

--Naresh.

0 Kudos

Dear Naresh,

thanks for that elaboration!

However the validity time is supposed to be visible in Transaction BP. And the user is supposed to be able to use the u201Cvalidity timeu201D-DropDown in the upper middle of the screen to see how the BP looked like in the past.

I feel that a Z-Table is not the solution I am looking for since the functionality is already available in the standard SAP transaction (BP and BUP2). Itu2019s right behind that button which I mentioned earlier: u201Ccreate validity periodu201D . Itu2019s just that do not know how I can access it through abap.

I am looking forward to further ideas.

Regards,

Christof Lange

Edited by: Christof Lange on Dec 4, 2009 8:12 AM

0 Kudos

Dear all,

as we have not found any bapi that suits our purpose we finally decided to work directly on the database. The idea is to limit the validity period in table BUT000 and create a new entry in table BUT000TD for the new validity period. It seems to work

Finally, I would like to thank you once again for your help!

Best regards,

Christof

0 Kudos

Dear all, is it possible to activate the time dependency for BUT000 if you have CRM?

Best regards.

0 Kudos

Hi,

we are not using CRM. Consequently I canu2018t answer your question.

Best Regards,

Christof Lange

0 Kudos

Hi,

Can you please share how you created new entries in table BUT000_TD to create new time slice?

Thanks

0 Kudos

Dear Naresh, thanks a lot!!

Your reply help me in one problem here with BP to RE-FX.

Thanks!!

Brunoro