cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc before saving billing document.

0 Kudos

Hi Gurus!

In my business scenario we have to send data which will be finally populated on billing document, send it to external system, wait for response and after recieving it finally save the invoice. I would like to use idocs for easier analysis of send data. Unfortunatly usually idocs are triggered by output which can be set upped after saving invoice. Im looking for a way to send idoc before saving billing document. Anyone knows how I could achieve that? Some BADI's or enhancement points which I could use ?


Regards

Jakub

Accepted Solutions (1)

Accepted Solutions (1)

RahulHanda
Active Contributor
0 Kudos

Hi Jakub,

This is what you can do. When billing document is created automatically (against delivery) put this for block to getting posted in FI. In output type, in the routine mention if document is blocked trigger the output which would be for IDOC. Send this IDOC to customer and receive the information coluld be through B2B again and update the same in document. Then release the same.

Let me know if it helped.

Regards

Rahul

0 Kudos


Hi Rahul,

Thasnk for quick response, but this is not the solution which Im looking for. Unfortunatly I have we need to recieve response before saving docuemnt. That is mandatory condition in my case .

Regards

Jakub

RahulHanda
Active Contributor
0 Kudos

Hi Jakub,

You can use delivery for this purpose. If you are waiting for this information, which is required for billing document, then there are two handle this with delivery:

Create delivery document and create a output from this (details could be from delivery and sales orders) and send the same to customer. Assuming customer is using B2B for sending back information, then you can work with POD and define specific field to capture this in your POD document. When you create billing document which would be on the basis of delivery (after POD), copy that information (required one) from POD (define your custom field).

The above could also be captured in custom field which will directly update LIPS table and then could be referenced in billing document.

On the other hand if customer is not sending this information, then obviously you need to trigger billing document manually to update the same (not sure how are you creating billing docs today, manually or in background).

Let me know if it helped.

Regards

Rahul

0 Kudos

Hi Rahul,

I cannot use output on delivery level. I would like to system behave like: User press "save" -> SAP starts processing program for creation of invoice. On one point program generates idoc and send it. After sent we have programmed loop like "every 5 sec check table Z* and look for value ZZZ".  In the mean time we recieve idoc with proper value and it is populated in table Z*. When main program fing this vlaue it is passing it to invoice and allows to save docuemnt. If for some reason we do not recieve response or it will be value which wont allows us to create infoic, then program givess error message and terminates process of saving invoice.

Regards

Jakub

RahulHanda
Active Contributor
0 Kudos

Hi Jakub,

With this situation, this is what I can think of (at high level):

  • Create custom field in VF01, lets say indicator as check box (Send IDOC, with name).
  • When you go in VF01 this should not be ticked (basically blank).
  • User after filling/checking data, clicks this (basically to send IDOC). Once clicked it has to turn grey so that user can't send again. (check exit accordingly to trigger this)
  • In the background it would trigger program SD70AV3A with one default variant having output type. The key here would be to have some external number range to trigger output in SD70AV3A, but should not be used to create actual number for billing. This means it should generate a number on enter before selecting this check box and pass this number in this output program. If later saved system would generate internal number for billing document, else user can leave transaction and nothing is saved. (check USEREXIT_NUMBER_RANGE for this).

Let me know if it helped.

Regards

Rahul

0 Kudos

Hi Rahul,

We have been processing this topic for some time, and after couple tests we decided that this kind of solution is the only resonable way.


Rahul Handa wrote:

Hi Jakub,

This is what you can do. When billing document is created automatically (against delivery) put this for block to getting posted in FI. In output type, in the routine mention if document is blocked trigger the output which would be for IDOC. Send this IDOC to customer and receive the information coluld be through B2B again and update the same in document. Then release the same.

Let me know if it helped.

Regards

Rahul

I have thought abou it  a little but in that kind of solution when I will try to set posting block on in VOFA, then I will block this billing document type for posting for all sale organization. In my scenario this kind of billing docuemnt is used in couple of slae organizations but it have to be blocked only for the one. Do you know any way to bypas that?

Regards

Jakub

Shiva_Ram
Active Contributor
0 Kudos

Instead of creating billing document, can the requirement be fulfilled by creating a proforma invoice-IDOC created against the delivery? If all data are received in Z-table, then allow the system to create the regular billing document.

Regards,

former_member182378
Active Contributor
0 Kudos

Jakub,

To clarify, could the information that is passed from SAP be overwritten with new information that the external system sends and which is populated in the z table? What are these fields (information)?

Something which is populating in the billing document comes from previous documents and or the master data, in some cases business wants to overwrite this data.

TW

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jakub,

Can you please explain the steps you follow to process sales order?

As you said, you wanted to send data which will be populated on billing document. But at the same you are waiting for some confirmation as well in between. So at what stage you are waiting for confirmation and whether the delivery and invoice is been created automatically, batch job.

If there is waiting time at delivery level, then you can do enhancement at delivery output, delivery IDoc where, you already have delivery details with delivered quantity and other details if required as well, through enhancement you can add net price/ total price sales order details which you use to send on invoice. so once delivery IDoc is triggered before saving invoice the required details can be send.

Thanks,

Trupti

0 Kudos

Hi Trupti,

Sale order and delivery is standard process. I need to send data on moment when user press "save" during invoice creation in VF01 (we do not use VF04 in that case). I would like to system behave like: User press "save" -> SAP starts processing program for creation of invoice. On one point program generates idoc and send it. After sent we ahve programmed loop like "every 5 sec check table Z* and look for value ZZZ".  In the mean time we recieve idoc with proper value and it is populated in table Z*. When main program fing this vlaue it is passing it to invoice and allows to save docuemnt. If for some reason we do not recieve response or it will be value which wont allows us to create infoic, then program givess error message and terminates process of saving invoice.


I hope this will make situation a little bit more clear.

Regards

Jakub