‎2013 Jan 12 7:46 AM
Hi All,
I need to write an abap program which takes a list of inputs from a flat file and executes another program that many number
of times.
Eg if my file contains AAA,BBB,CCC values then these values should be passed to another prog say Z_XYZ which will get
execute three times automatically using the corresponding values AAA,BBB,CCC as inputs .
Thanks,
Faiz
‎2013 Jan 12 5:06 PM
Hi Faiz,
have you tried the SUBMIT? See:
http://help.sap.com/abapdocu_70/en/ABAPSUBMIT.htm
http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm
Best regards
Thorsten
‎2013 Jan 12 5:19 PM
Hi Thorsten,
Using Submit we can pass the data to the selection screen,but I want to execute the program multiple times using different data as I had expalined above.
Can u pls give a detailed explanation on how to achieve this.
Thanks,
Faiz
‎2013 Jan 12 5:25 PM
Hi Faiz,
have you tried calling the program via SUBMIT inside a loop (with addition SUBMIT... AND RETURN)... and using the possibilities in the linked documentation to fill the selection screen? That should work as far as I know.
Or is your requirement to run the reports in parallel?
Best regards
Thorsten
‎2013 Jan 12 5:52 PM
Hi Thorsten,
I'll explain my requirement in detail.
My file contains these values - AAA,BBB,CCC .Now I want to create a prog(prog 1),which will take these 3 values from the file pass these values to the selection screen of prog2 one by one and using these values it will execute prog2 , three times and generate 3 outputs for the corresponding 3 input values.
Regards,
Faiz
‎2013 Jan 12 9:16 PM
Hi Faiz,
but that's exactly what you can achieve with Thorsten's solution using SUBMIT ... AND RETURN.
Regards,
Dirk
‎2013 Jan 12 9:40 PM
Hi Faiz,
I believe when you read the attached links, you will understand how to do it.
Anyway... I had created a simple test report sometime ago. I just added three variables to show the basic approach in your case. Maybe it helps.
(I know there is a better way to format code in SCN, but somehow it does not work properly...)
REPORT zts_report1.
PARAMETERS: p_arbgb TYPE t100-arbgb.
DATA: gs_t100 TYPE t100.
SELECT * FROM t100 INTO gs_t100
WHERE arbgb = p_arbgb
AND sprsl = sy-langu.
WRITE: / gs_t100-arbgb, space, gs_t100-msgnr, space, gs_t100-text.
ENDSELECT.
REPORT zts_report2.
PARAMETERS: p_arbgb1 TYPE t100-arbgb.
PARAMETERS: p_arbgb2 TYPE t100-arbgb.
PARAMETERS: p_arbgb3 TYPE t100-arbgb.
DATA: gv_index TYPE sy-index,
gt_rspar TYPE STANDARD TABLE OF rsparams,
gs_rspar TYPE rsparams,
gt_listobject TYPE STANDARD TABLE OF abaplist.
DO 3 TIMES.
gv_index = sy-index.
CLEAR: gt_rspar[],
gs_rspar.
gs_rspar-selname = 'P_ARBGB'.
gs_rspar-kind = 'P'.
CASE gv_index.
WHEN 1.
gs_rspar-low = p_arbgb1.
WHEN 2.
gs_rspar-low = p_arbgb2.
WHEN 3.
gs_rspar-low = p_arbgb3.
ENDCASE.
APPEND gs_rspar TO gt_rspar.
SUBMIT zts_report1 WITH SELECTION-TABLE gt_rspar
EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = gt_listobject[]
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = gt_listobject[]
EXCEPTIONS
empty_list = 1
OTHERS = 2.
ENDDO.
Best regards
Thorsten
‎2013 Jan 13 6:08 AM
Thanks Thorsten for ur help...I will surely try this and get back to u..