Question:
Hi BW Experts
I need to create a process chain with dynamic data loading.
My data is very big, so I manually load it by company and period.
This means if I have 50 companies and 12 period per company, this will make me 600 requests.
How can I set this to the process chain without creating multiple infopackage?
Thank you very much in advance!
Answer:
Create an infopackage where those two characteristics will be read from a table via abap,
Create an abap that will update the table, run the infopackage, wait for the end, update the table again, run the infopackage once more, and so on.
Integrate this abap in a process chain for the scheduling.
Regarding the table, you can either create a ztable on your own, or use TVARV. If you are not familiar with TVARV, ask an abaper to help you as is should be part of his core knowledge.
Ch
_________________
_
There are only 10 types of people in the world :
those who understand binary and those who don't.
Answer:
Thank you very much...
do you mean?
Start -->program(abap)-->infopackage--program(abap)-->program(abap)-->infopackage-->program(abap)-->infopackage-->program(abap)
program(abap) and so on?
My infopackage must load continuously until all the data is loaded, I have 500 request to run and it means my process chain will contain 500 sets of infopackage and abap?
can we have a looping process in the process chain where the loop will finish until the EOF of the table?
Thank you very much
Answer:
I meant
Start -->program(abap)-->infopackage--infopackage-->and so on
The logic on when to stop being part of the abap :
loop on Company code
..loop on month
....update table
....launch infopackage
....wait for end of infopackage
..endloop
endloop
*****
Here is some code on how to do it. Probably not the most efficient as it has been written by a non abaper, but still working smoohtly.
REPORT LOOP_TO_LAUNCH_INFOPACKAGES.
Tables: ZPARA,
rssdlrange ,
RSLDPSEL,
RSLDPIOT.
DATA : Dfrom like zpara-DATEFROM.
Data : Dto like zpara-DATEFROM.
Data : infopackage like BAPI6109-INFOPACKAGE.
Data : requestid like BAPI6107DR-REQUEST.
data : begin of t_return occurs 0.
include structure BAPIRET2.
data : end of t_return.
data : w_status like BAPI6107DR-REQUESTSTATUS.
clear RSLDPIOT.
select single * from RSLDPIOT
where text = 'IP - will be launched 12 times automatically'.
clear ZPARA.
select single * from ZPARA where objvers eq 'A'.
if sy-subrc = 0.
move ZPARA-datefrom to dfrom.
move ZPARA-dateto to dto.
else.
clear : dfrom ,
dto .
endif.
While dfrom <= dto.
clear RSLDPSEL.
select single * from RSLDPSEL
where LOGDPID eq RSLDPIOT-LOGDPID
and IOBJNM eq '0CALMONTH'.
if sy-subrc = 0.
move dfrom to RSLDPSEL-LOW.
modify RSLDPSEL.
clear t_return.
refresh t_return.
CALL FUNCTION 'BAPI_IPAK_START'
EXPORTING
INFOPACKAGE = RSLDPIOT-LOGDPID
IMPORTING
REQUESTID = requestid
TABLES
RETURN = t_return.
WAIT UP TO 30 SECONDS.
read table t_return index 1.
if sy-subrc <> 0 or t_return is initial.
w_status = 'Y'.
while w_status = 'Y' or w_status = space.
WAIT UP TO 10 SECONDS.
CALL FUNCTION 'BAPI_ISREQUEST_GETSTATUS'
EXPORTING
REQUESTID = requestid
IMPORTING
TECHSTATUS = w_status.
endwhile.
if w_status = 'G'.
write : / 'Infopackage successfully run for' color col_positive.
else.
write : / 'Problem running infopackage!!! Please check! Month = '
color col_negative.
endif.
write : dfrom.
else.
write : / 'PROBLEM STARTING INFOPACKAGE FOR MONTH ' color col_negative, dfrom,
' !'.
write : / 'Message: ', t_return-message.
endif.
else.
exit.
endif.
add 1 to dfrom.
endwhile.
Answer:
Thank you very much...
Answer:
Good Day again,
In this example, do i have to create several infopackage or only one?
Thank you very much