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

Creating one document from an output

Former Member
0 Likes
908

Hi All,

We have a requirement to create a credit memo from a debit memo. Can anyone share the best approach to achieve this requirement? I was thnking of asynchronous RFC, but since there is a dependency on the 2 documents, I don't think this will work. Is synchronous RFC a good bet? What about workflow, or CALL IN UPDATE TASK?

Thanks,

Louisse

Hi All,

We have a requirement to create a credit memo from a debit memo. Can anyone share the best approach to achieve this requirement? I was thnking of asynchronous RFC, but since there is a dependency on the 2 documents, I don't think this will work. Is synchronous RFC a good bet? What about workflow, or CALL IN UPDATE TASK?

Thanks,

Louisse

5 REPLIES 5
Read only

madhu_vadlamani
Active Contributor
0 Likes
878

Hi Louisse,

Are you going to create from external system.Did the functional people explain the flow.

Regards,

Madhu.

Read only

0 Likes
878

Hi Madhu,

Only the high level requirement was given. If it is created from an external system, what would you suggest? What if not from external system?

Looking forward to your input.

Thanks,

Louisse

Read only

yuri_ziryukin
Product and Topic Expert
Product and Topic Expert
0 Likes
878

Hello Louisse,

I guess you need to create it at the time when the debit memo request is created.

Your approach depends on the way standard BAPI works. If the standard BAPI required that the previous document (debit memo) exists on the database, then you'll need to wait for it somehow.

I would propose trying qRFC approach for it.

In the user exit at the save of the debit memo you program a function call (write a new Z RFC-enabled function module) using qRFC technology (search in internet for an example) with destination NONE.

In the new function module you should check if the previous document is on database and implement a WAIT statement if not. When it's on database, you call the BAPI to create a credit memo with the data that you have in your Z-function.

Thus you can easily monitor if the queue is properly processed and react on errors (transaction SMQ2).

Regards,

Yuri

Read only

0 Likes
878

Hi Yuri,

If this is the approach, I guess the only concern is, what if the creation of credit memo fails? There is no way to re-trigger the mechanism but to create the document manually.

Thanks,

Louisse

Read only

yuri_ziryukin
Product and Topic Expert
Product and Topic Expert
0 Likes
878

Hello Louisse,

it depends how you react on the failure of the credit memo creation.

If the standard BAPI returns an error, you can generate a short dump with the message type X.

In this case your qRFC queue will become status SYSFAIL and you can reprocess it at any time once you fixed the error. If the reporocessing always fails and there is no way to correct the mistake, you can create the document manually and delete the failed entry from the queue via SMQ2 transaction.

qRFC is actually a very good solution

Regards,

Yuri