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

Automation Program

Former Member
0 Likes
836

Hi All,

I want to create a custom program , which takes the test data from an excel sheet (one by one) and executes the program that many times

and finally the output gets stored in another file.

Please drop in your suggestions as to whether  we achieve this in ABAP ?? and if yes then how should I go about writing the code for the same??

Thanks & Regards,

Faiz

8 REPLIES 8
Read only

Former Member
0 Likes
800

Hi Faiz,

Here the code is :


SELECTION-SCREEN:BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

   PARAMETERS: G_FILE1 LIKE RLGRAP-FILENAME OBLIGATORY.

   PARAMETERS: P_FROM1 TYPE I DEFAULT 2 OBLIGATORY,

   P_TO1 TYPE I OBLIGATORY.

SELECTION-SCREEN:END OF BLOCK B2.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR G_FILE.

   PERFORM FILE_F4.

START-OF-SELECTION.

   CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

     EXPORTING

       FILENAME                = G_FILE

       I_BEGIN_COL             = '1'

       I_BEGIN_ROW             = P_FROM

       I_END_COL               = '8'

       I_END_ROW               = P_TO

     TABLES

       INTERN                  = IT_EXCEL

     EXCEPTIONS

       INCONSISTENT_PARAMETERS = 1

       UPLOAD_OLE              = 2

       OTHERS                  = 3.

it will go to internal table IT_EXCEL

Read only

former_member193464
Contributor
0 Likes
800

Yes possible in ABAP...
Does the excel contains the selection input values ?
create a program read from excel into an internal table..
Loop in the internal table.
and inside this loop for every record that you fetch
do your necessary  operations
store the result in another file
end the loop

you can also make use of submit command, but then you have to make two programs , one to read from excel and then pass this to the second program using SUBMIT...
hope it helps

Read only

GauthamV
Active Contributor
0 Likes
800

We have so many function modules as well as classes to upload and download data.

So you can upload data from excel based on your requirement and can download the final output as another file.

I feel there is no point still waiting and you can start with your custom program development.

Read only

Former Member
0 Likes
800

Hi,

You can use any of the standard FMs like Gui_upload to load data from excel to internal table.

Once you have data in internal table use it the way you want.

You can use GUI download to download data to application server.

There are several threads on SCN to explain how these standard FMs work.

Read only

Former Member
0 Likes
800

Hi All,

Thanks for your quick responses. I do know how to upload the data from excel to internal table. The problem that I'm facing is how to make this program as an entry point to several other program as well i.e. A) This program should be able to pass data to different program having different input fields, execute it multiple times in the background and then finally save the output result in a file.

Read only

0 Likes
800

use a dynamic submit statement inside your excel upload program

lets say lv_program_name is the variable where you store the program name  after uploading from excel ...
so then use  SUBMIT (lv_program_name)
also if it has to be run multiple times , (if there is a column say no. of times )
then use Do lv_n times. and then the above submit...
experiment a little its achievable ...
hope it helps...

Read only

Former Member
0 Likes
800

hi Faiz,

surely this can be acieved.

Please explaore the Foloowing Fm for further help.

For Uploading data from Excel:  Eg: ALSM_EXCEL_TO_INTERNAL_TABLE , etc....

For Writing the Output on Excel: Use OLE FM's for this.

Regards,

Amit

Read only

marcin_cholewczuk
Active Contributor
0 Likes
800

Hi Faiz,

Maybe it would be worth to try it with ECATT instead of writing new Report.

Best Regards

Marcin Cholewczuk