Application Development and Automation 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: 
Read only

Change Pointers

Former Member
0 Likes
1,352

Dear experts,

I'm working on a scenario, where in I created a function module, which does all the functionality that is required to do.

Now the requirement is I need to trigger this fn module when a sales document is created, can some one please specify

The step by step procedure to trigger the fn module using change pointers

Thanks in Advance

-Amit

10 REPLIES 10
Read only

former_member194669
Active Contributor
0 Likes
1,273

Why you need a change pointer for this. Find any "After Save" userexit and call this fm

a®

Read only

0 Likes
1,273

> Why you need a change pointer for this. Find any "After Save" userexit and call this fm

>

> a®s

a®s,

Our scenario is little peculiar, where in we need to change the sales order once the data base commit has been done, so I need to change only thru change pointer.

Read only

0 Likes
1,273

I think you have already have change pointer activated for sales documents

then

Write a custom program and scheduled in background with


" Use to read change points

    call function 'CHANGE_POINTERS_READ'
      exporting
        message_type                = v_mestyp  " ORDERS05 
        read_not_processed_pointers = c_mark
      tables
        change_pointers             = i_chgptrs
      exceptions
        error_in_date_interval      = 1
        error_in_time_interval      = 2
        others                      = 3.
    describe table i_chgptrs lines v_bdcp_count.
    if v_bdcp_count eq 0.
      raise no_change_pointer_records.
    endif.

then delete the deleted entries


* Deleted the deleted entries
  delete i_chgptrs where cdchgid eq 'E''.

then take the i_chgptrs-tabkey (This contains the sales document number) and pass to your function module

a®

Read only

0 Likes
1,273

If I'm running a program in the back ground, how often should I schedule it.

Sales orders may be created every minute.

I know there is a way using workflows, classes and methods, where in a task get instantiated and kicks the method which inturn kicks my fn module when a change pointer is created. But I'm unable to recollect the correct solution on how to crack the same.

If you have nay Idea on this kind of solution, then it would be highly appreciated.

Thanks

-Amit

Read only

0 Likes
1,273

Change pointers are for idoc creation. Ift may happen that you disturb sending of idocs or that creating of idocs delets the changepointers you need. Using this is a bad idea. Maybe its running in the moment cause nobody invoked changepointers for your mestype, but this is an hard to find error in the futier.

Write your own changepointers in an exit. Do not use the changepointers for idocs for this.

Read only

0 Likes
1,273

Yes you can use WF for this.

Please check Naren Muthu's reply in the following thread

a®

Read only

0 Likes
1,273

> Yes you can use WF for this.

>

> Please check Naren Muthu's reply in the following thread

>

>

>

> a®s

Thanks,

But what is the singnificance of "AIA1_WF_APPROVAL_CHECK" in the forum.

My function module is not of this type, it has only sales order as i/p parameter.

Can you please guide me if I can use directly my fn module, without changing into this type.

Read only

Former Member
0 Likes
1,273

Hello Amit,

It is not possible to trigger function module using change pointers. basically change pointers are used to generate the change document for the fields changed in master data. In your case you need to look for exit after SO save where you can call your function module.

Hope this helps!

Thanks,

-Augustin.

Read only

Former Member
0 Likes
1,273

Hi amit,

in the save exit of the sales order "MV45AFZZ", you call your function module and do the validation.

change pointers will create an idoc, which will be distrubuted to the different systems, if the other system needs to know the changes happened.

In the user exit MV45AFZZ report of the sales order, you can call your function module depending on the save document or prepare save document or on many other conditions which are available .

Open the exit given, you will find many options where in depending on your requirement, Function module can be invoked and the values after execution of the FM can be passed to the relevant variables as well.

Read only

0 Likes
1,273

Thanks everyone for your inputs,

I guess I need to use change documents to trigger the workflow, can some one please point me to the sequence of steps to setup workflow such that once a sales order is created it triggers a workflow, which internally triggers my fn module.

Also can any one tell me what is the T-code "SWED", does it have any significance with respect to workflow.

Thanks

-Amit