Site icon SAP Human Resources Experts And Solutions

How to run any functional module with input data from text file

<p>We all know SAP Legacy System Migration Workbench &lpar;<a href&equals;"https&colon;&sol;&sol;saphcmsolutions&period;com&sol;advanced-lsmw&sol;">LSMW<&sol;a>&rpar; pretty well&period; We use it in 99&percnt; data migration projects&comma; or when we need to do some mass changes in the live system and standard PA70 doesn&&num;8217&semi;t work well because of its limits&period; Some geek guys like myself dig deeper and use function modules instead of writing ABAP code to make any mass changes&period; There is a great advantage &&num;8211&semi; you don&&num;8217&semi;t need a Developer license to run the functional module&period; Open SE37 transaction&comma; select module and run it with some parameters&period; Today I want to share with you my research how to run any functional module with a dataset from a text file&period; Just couple clicks and you have a VERY powerful tool to do almost everything in SAP&period; And&comma; one more advantage&comma; running functional modules directly is much faster&comma; than using batch inputs&period;<&sol;p>&NewLine;<p>Yes&comma; here comes eCATT to the scene&period; It&&num;8217&semi;s that flexible that we can use not only for <a href&equals;"https&colon;&sol;&sol;saphcmsolutions&period;com&sol;howto-organize-sap-testing&sol;">testing purpose<&sol;a> but to run mass operations&period; It has its own script language which could help us to analyze FM output and build a chain of FM calls to accomplish something complex&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;00&period;png"><img class&equals;"alignnone size-full wp-image-3123" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;00&period;png" alt&equals;"" width&equals;"509" height&equals;"236" &sol;><&sol;a><&sol;p>&NewLine;<p><&excl;--more--><&sol;p>&NewLine;<p>In my case we&&num;8217&semi;ll create infotype 0015 from the dataset in a plan file&period;<&sol;p>&NewLine;<div id&equals;"attachment&lowbar;3121" style&equals;"width&colon; 1418px" class&equals;"wp-caption alignnone"><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;01&period;png"><img aria-describedby&equals;"caption-attachment-3121" class&equals;"wp-image-3121 size-full" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;01&period;png" alt&equals;"Running SAP eCATT test with functional module" width&equals;"1408" height&equals;"656" &sol;><&sol;a><p id&equals;"caption-attachment-3121" class&equals;"wp-caption-text">Running SAP eCATT test with a functional module<&sol;p><&sol;div>&NewLine;<p>Setup test script in SECATT transaction to run functional module &lpar;or class method if you want&rpar;&period; The system automatically creates module params&period; Leave them as is for a while&period; Further we&&num;8221&semi; match them with test container dataset&period; This is how data container looks like&period; If you don&&num;8217&semi;t want to type manually these params use Edit -&gt&semi; Import Parameters to copy interface definition&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;02&period;png"><img class&equals;"alignnone size-full wp-image-3124" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;02&period;png" alt&equals;"" width&equals;"1171" height&equals;"374" &sol;><&sol;a><&sol;p>&NewLine;<p>&nbsp&semi;<&sol;p>&NewLine;<p>Download variant to a text file&period; Pay attention that it&&num;8217&semi;s a tab-delimited file where headers start with &num; sign&period; Add some data and upload the file back or choose &&num;8216&semi;External Variants &sol; Path&&num;8217&semi; radio button&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;03&period;png"><img class&equals;"alignnone size-full wp-image-3125" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;03&period;png" alt&equals;"" width&equals;"1124" height&equals;"479" &sol;><&sol;a><&sol;p>&NewLine;<p>By now we have test script and test data container&period; All we need is test configuration&comma; which includes both test script and the data container&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;04&period;png"><img class&equals;"alignnone size-full wp-image-3126" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ecatt&lowbar;fm&lowbar;04&period;png" alt&equals;"" width&equals;"872" height&equals;"542" &sol;><&sol;a><&sol;p>&NewLine;<p>Run it and boom&comma; we&&num;8217&semi;re all set&period;<&sol;p>&NewLine;<p>Then you can analyze FM return code and log it to convenience&period; Why is eCATT better than LSMW&quest; We can create an additional column in Excel with operation code&period; If it&&num;8217&semi;s INS we create a new record&comma; if DEL we delete it&period; In LSMW we&&num;8217&semi;d need to record two different scripts to perform the same&period;<&sol;p>&NewLine;

Exit mobile version