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: 

Changedocument for sales invoice creation

Former Member
0 Kudos

When the sales invoice is changed in VF02, an entry is created in changedocument table CDHDR. But when the invoice is created in VF01 no entry is created in the table CDHDR.

Is there a way to enable creation of entry when invoice is created?

The change document object for sales invoice is FAKTBELEG

8 REPLIES 8

Former Member
0 Kudos

Dear All,

I am facing the same problem as I want to create the workflow when any sales invoice been created but there is no event do exists into business object VBRK, I have created the ZVBRK and added one custom event into it.

Now I am trying to generate the event and I have found that Change document FAKTBELEG is not working for creation of Billing Doc, while for change in Billing document it is working fine.

why so? any suggestion, guidance?

Cheers

Nitish

Former Member
0 Kudos

When document was create you know when it was created and why whom it was created, so there is no need to check in change document tables at all. Only when there is a change then thats needs to be recorded and those recording int he change document tables.

So, for sales order or billing creation details you will get it from vbak and vbrk tables. For changes you will get it from change document tables. it will not store some creation data.

Cheers,

Satya

0 Kudos

Dear Satya,

Many thanks for your suggestions.

Actuall I am interested in creating the workflow when any customer billing doc. has been created using VF01 txn. and I have created the zevent for that now I have also linked with this event with change document but as this change doc. is not getting triggered and so no event.

So basically CDHDR and CDPOS are not my concern, waiting for reply

Kind Regards

Nitish

0 Kudos

Hi!

You can try to setup output control for billing document:

- define your own access sequence or expand existing one with one more access based on KOMKBV3-TRTYP field (transaction type)

- assign access sequence to corresponding output type

- maintain condition records for corresponding output type with transaction type "V" - Change

- setup processing routines for corresponding output type. Here it is medium "T" - Tasks (SAP Business Workflow). I didn't try myself to invoke workflow in such a way but it seems this stays for such purposes. Even if not you can try medium "8" - Special function and link your custom program which triggers workflow execution.

This settings will lead to triggering output control whenever billing document is changed or created (this works for standard print medium for me) and invoke workflow execution (almost sure).

Regards,

Maxim.

Former Member
0 Kudos

CRHDR & CDPOS are the tables for storing data of changedocuments.

Former Member
0 Kudos

You can trigger a workflow when a billing document is created. There is something message control in which you can set to trigger a workflow automatically. But it requires configuration setting. Ask your functional folks to create output type and assign it to workflow event. You can see this vf03->goto->header ->outputs in the medium 8th option.

Cheers,

Satya

Former Member
0 Kudos

Hi everybody.

Thanks for your belated suggestions.

When I posted this question my purpose was same- start a workflow.

I found the best solution was to go for coding in old style user exit USEREXIT_SAVE_DOCUMENT in include MV45AFZZ, using FM SAP_WAPI_CREATE_EVENT to trigger desired event.

0 Kudos

Thanks Sudhir, Maxim and Satya,

I will check this into system and will revert back.

Regards

Nitish