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: 

Sending Full Master data objects of DEBMAS from change pointer

Former Member
0 Kudos

Hello everyone;

I need to send complete DEBMAS and complete MATMAS idoc to my other system. I'm able to create and send MATMAS and DEBMAS idocs on change but it only sends the changed (delta) data. So I have made an enchancement on FM: CHANGE_POINTERS_READ which is like this:

ENHANCEMENT ZSEND_COMPLETE_IDOCS.    "active version


  field-symbols <fs_bdcp> type bdcp.

  if message_type = 'DEBMAS' or message_type = 'MATMAS'.

    loop at change_pointers assigning <fs_bdcp>.

      <fs_bdcp>-fldname = 'ALELISTING'.

    endloop.
  endif.

ENDENHANCEMENT.

However this only works for MATMAS. When I change a material in MM02, my idoc is created with complete segments, not only with changed segments. However this enhancement does not work for DEBMAS!?!? Anyone knows why?

I need to find out how to send my DEBMAS idoc completely to my other system.

Thanks in advance.

Talha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Talha,

Why you are not using standard transaction BD10( For Material ) and BD12 ( For Customers )? It should work for you.

Regards,

R

14 REPLIES 14

Former Member
0 Kudos

Hi Talha,

Why you are not using standard transaction BD10( For Material ) and BD12 ( For Customers )? It should work for you.

Regards,

R

0 Kudos

I think using BD10 and BD12 is for mass data transferring. But when my project goes live, I need to send my materials and customers whenever they are created or changed via BD21.

Submitting BD12 or BD10 on the changing user exit is an option but i think its not the proper way. SAP has a tcode BD21 which is very usefull and I desire to use it.

Thanks

Talha

0 Kudos

I know BD21 you can use it. But it is also designed to send the change. I am afraid it is not proper to way to twick it to make it work to send the full document always. What you can do is to switch of the change pointer via BD61 during data load and use BD10 and BD12 to send the Material and Customer for the first time and reactivate the Change pointer setting afterwards. Otherwise if you want to use change pointer for all then an entry with a "KEY" in BD52 should work for you. It takes care the newly created material and customer.

Regards,

R

0 Kudos

I have implemented BD52 already but no luck again.

I think i will use BD12 for DEBMAS but I have a little problem about it. I found an user-exit for XD02 (EXIT_SAPMF02D_001) and I have put a code and the end of it;

  submit RBDSEDEB  with SELKUNNR-LOW = i_kna1-kunnr
                                   with MESTYP = 'DEBMAS'
                                   with LOGSYS = 'MII_CONN' and return.

RBDSEDEB is BD12. My problem is, this exit works before the SAVE so whenever I run XD02 and let say i change the name from "XXX" to "XXX123", BD12 works with the old name ( "XXX") because it happens before the SAVE.

Do you know any other exit or any other way to submit BD12?

Thanks

Talha

0 Kudos

Hi,

Change pointer should work.

Please check the following.

1. BD61 - Make sure Change pointer is activated globally.

2. BD50 - Make sure change pointer for DEBMAS is active.

3. BD52 - Make sure you have an entry OBJECT - DEBI, TABLE Name - KNA1 Field Name - KEY. ( This should already be there ). If not there add it.

Now Create a customer via XD01/FD01.

Run BD21 with message type DEBMAS and you should see the idoc generated. ( Make sure you have other configs Like Distribution Model/ Partner Profile are there )

I checked it i my system and it is working like a charm.

Regards,

R

0 Kudos

Hello Rudra,

As you have mentioned, Change pointer works fine for me as well however just only for changed data. As I have told before i need to send the entire data no matter it is changed or not. Because my other system overwrites the data and if I send only the changed data, non-changed datas will be overwritten with empty fields.

I have tried everything that I have done for MATMAS and its working for MATMAS but not for DEBMAS and I have no clue why.

So I have decided to use BD12 to send entire data for DEBMAS. However, I need to find a proper user-exit or something to do this automatically. For example, when user hit SAVE on XD02, after saving I want to call(submit) BD12 to create and send DEBMAS idoc.

Can you help on this issue?

Thank you

Talha

0 Kudos

Hi Talha,

I am not sure of any EXIT/BADI which triggers after the creation of the customer. Just submitting BD12 inside exit EXIT_SAPMF02D_001 will not work as it is called before COMMIT. What you can do is to raise a workflow event ( SWE_EVENT_CREATE ) inside the exit EXIT_SAPMF02D_001 and trap that event to raise a task method and submit BD12 there. Since the workflow event will be triggered in UPDATE TASK, that will ensure the data consistency.

It seems a bit complicated but if you are familiar with Simple workflow concept, it is not going to cause too much of trouble. Let me know what do you think about this.

Regards,

Rudra

0 Kudos

Hi,

Even you can think of using BTEs or write some UPDATE MODULE to capture thye customer number and submit BD12. If you use UPDATE MODULE make sure you do not SUBMIT( Otherwise you get an update termination) any program . what you can do is to call a FM in background task there and SUBMIT inside there. Please check the below link..

http://scn.sap.com/thread/86722

Regards,

R

0 Kudos

Hi Rudra,

I have tried what you have offered but no luck with BTE's. I have copied the FM for 1320, and put a break point in it. However, when i get to the break point, my datas havent changed yet in KNA1 table. As you know im changing the master data of customer (XD02).

I think I'm going to write a custom program which checks the table BDCPV and submits BD12 when finds data for background job. It seems not a good way but the only way

Thank you

Talha

0 Kudos

Could you wrap this submit in a FM, define it as RFC enabled

FUNCTION z_xxxxxx.

*"----------------------------------------------------------------------

*"  IMPORTING

*"     VALUE(I_KUNNR) TYPE  KNA1-KUNNR

*"----------------------------------------------------------------------

* RFC enabled, parameters by values

*"----------------------------------------------------------------------

    SUBMIT RBDSEDEB

      WITH SELKUNNR-LOW = i_kunnr

      WITH MESTYP = 'DEBMAS'

      WITH LOGSYS = 'MII_CONN'.

ENDFUNCTION.

Call it in background task in your exit (only once, if necessary keep a static flag for this or wrap it in a perform on commit.), so it will execute after commit-work, even after actual update task update of database.

* in exit, only once per customer update

CALL FUNCTION 'Z_XXXXXX' IN BACKGROUND TASK

   EXPORTING

      i_kunnr       = i_kna1-kunnr

Regards,

Raymond

0 Kudos

Raymond;

Thanks for your helpful answer. However I'm struggling with another problem.

I have created the FM and added the "call function on background task" to my user-exit as you have mentioned. It was working fine.

When I use XD02 to change customer, my idoc is triggered right after it with the updated data but today background task assign this job to 1 hour later.

This means creating idocs when DEBMAS is changed is unknown. It can also happen before the SAVE action of XD02 and that will prevent the updated data to be sent via IDOC.

How can i defined a time period or timeline for a background task? Or Is there a way to call FM right after the SAVE (That will guarantee my issue).

Thank you

Talha

0 Kudos

The background task will always execute after the SAVE (actually after the end of the update task submitted by the COMMIT-WORK)

Were there performance problems today, were many tasks awaiting in SM58. If destination not available (no processes were free) then look via SM59 at parameters of the destination (here NONE) usually the system try every 15 minutes up to a total of 30 times, you can reduce wait duration.

Regards,

Raymond

0 Kudos

I have solved it by saving those values to a Z table on the BTE. And Z program to send those datas via BD12 with a job.

Thank you all for your efforts.

Former Member
0 Kudos

Talha

Can you tell me how did you solve the issue. When you said you saved the values to Z table did you save complete Customer master data to Z table ?

What logic did you implement in Z program ? Did you submit bd12 in Z program?