Quantcast
Channel: SCN : Unanswered Discussions - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 3719

Calling a SAP RFC within a Custom Function

$
0
0

Hi,

 

I have created a ABAP function which reads view PROGDIR using a single input parameter PROGRAM_NAME and returns Y or N is the program exists.

 

I then created a custom function in BODS to call the function and get the resulting export parameter.  Code for BODS custom function below:

 

$LV_Result = __RFC_FUNCTION SAP_RE..Z_KDS_PROGRAM_EXISTS[RESULT]($PV_Program_Name )[PROGRAM_NAME] ;

print('Result of Check Abap = '||$lv_result);

print( __RFC_FUNCTION SAP_RE..Z_KDS_PROGRAM_EXISTS[RESULT]($PV_Program_Name )[PROGRAM_NAME] );

if ($LV_Result = 'Y') return 'Y';

else begin

Print('##########################################################');

Print('##');

Print('## Please Generate and Transport ABAP DataFlow '||$PV_Program_Name);

Print('##');

Print('##########################################################');

return 'N';

end

 

The issue is I am getting a NULL result from the RFC function call.  When I test the function in SAP it performs as expected giving me a Y or N if the program name supplied exists.

 

The Custom function is to be used with a condition transform in a workflow to check that the ABAP Dataflow and the resulting program has been generated and transported into the target environment.

 

Please note due to restrictions we are unable to use the "Generate and Execute" option.  We are restricted to manual generation in development, then transport through to production.

 

Thanks in Advance for the Assist.


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>