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: 

call function '' in update task - code inside is BDC

Former Member
0 Kudos

hi to all,

in using call function '' in update task

the code inside is bdc. is this possible?

my scenario is from VA01 then post billing to VF01,

i am using user-exit MV45AFZZ in subroutine userexit_save_document.

i need to post billing after va01 save.

thanks to all.

1 ACCEPTED SOLUTION

matt
Active Contributor
0 Kudos

It probably isn't possible. A workaround, is to launch a function module "STARTING NEW TASK" in the update task, that does the BDC. This FM may to wait until the VA01 processing has finished. This could be done by, for example, by waiting for the new document to be visible in the VBAK table.

matt

4 REPLIES 4

matt
Active Contributor
0 Kudos

It probably isn't possible. A workaround, is to launch a function module "STARTING NEW TASK" in the update task, that does the BDC. This FM may to wait until the VA01 processing has finished. This could be done by, for example, by waiting for the new document to be visible in the VBAK table.

matt

Former Member
0 Kudos

Hi matt,

thanks for the reply and suggestion. I tried what you say i transfer the bdc to another function that start new task but still it doesnt work and i put break-point in that new task it still doesnt pass. Then checking the VBAK table the process already finished because the SO document already exist. I choose collective run under the function tab-attribute. Why other option isnt working like start immed, start delay etc.... If you have other suggestion on how to post billing vf01 automatically from va01 is highly appreciated.

booh

matt
Active Contributor
0 Kudos

To debug in the update task, you have to set that option on in the debugger.

If the user exit runs in the update task, then you must have something like: CALL FUNCTION MODULE my_fm_to_do_BDC STARTING NEW TASK. ( This function module should wait until the SD is created. You might want to check in a loop, with a WAIT command. Once it is created, then you start your BDC and CALL TRANSACTION. ) This is NOT an update function module. It may need to be RFC enabled - I'm not certain at the moment.

If the user exit doesn't run in the update task, you need to create, and call from the user exit, an update function module that calls your function module "my_fm_to_do_BDC" STARTING NEW TASK.

The attribute "collective run", which is V3, means that the update task won't run that function module until a regularly scheduled job on the application server runs. For processing to run during the rest of the SD save, you must use V1 (could be run in any order with other V1s) or V2 (Will run after V1, but in any order with other V2s). Typically, I use V2 for this kind of task.

matt

Former Member
0 Kudos

that scenario got to fail as VBAK is not alrady booked.

I would rather trigger a workflow event or create a change pointer - a subsequent job has to pick up that issue than...

Another way is to pass the not booked data to billing. BDC might be impossible then - validations will fail. So direct update of the DB is required without validation. As a develoment gatekeeper I would reject this.

kind regards,

HP