Call BAPI /Dataflow inside a Custom function

Hi,
I have a requirement in a real time job where i load data to SAP Tables via BAPI.
If i’m unable to load the BAPI , there should be a sleep for 1 minute and then i need to retry calling the BAPI.

Is there a way to call a BAPI inside a function, I am not sure if we could pass the TABLE elements as parameters inside the BAPI call.

Else i could also put the BAPI call inside a separate dataflow and put a while loop for it.If i could somehow call the dataflow inside a script, that would make my processing more smooth and faster.

If anybody has any approach on how to call the BAPIs or Dataflows inside a script or a function please reply


lifzgud (BOB member since 2010-10-25)

https://wiki.sdn.sap.com/wiki/display/BOBJ/Calling+RFCs-BAPIs


Werner Daehn :de: (BOB member since 2004-12-17)

I am aware of how to call the BAPI in a wizard.I have around 65 columns and now i need to call a custom function which takes one my earlier BAPI output columns as input.

If ($L_input= )
begin
Print(‘Retry required - and sleep’);
Sleep(10000);
Print(‘wake up’);

Now call the update function again

	$l_out = ?????
end

return $L_out

I need to know how to call the BAPI here.I can see something as RFC FUNCTION but not sure how to use this.


lifzgud (BOB member since 2010-10-25)

BAPIs cannot be called within custom functions, that seems to be the misunderstanding.

So I would have a dataflow with two queries, the first query calls the BAPI and returns what we need, the second query calls the custom function and as input we use any column required, some will be the columns returned by the BAPI.


Werner Daehn :de: (BOB member since 2004-12-17)