‎2007 Feb 08 1:36 PM
HI,
I've developed a report which calls another standard report, which exports values to memory.
i will import those values to my program. I am calling that standard program in b/g mode.
If i run the report in debugging mode i am getting output. But if i run directly (F8) the values are not exporting to memory and not getting the output.
what would be the problem??
points assured for quick response.
regards,
Pra
‎2007 Feb 08 1:38 PM
‎2007 Feb 08 1:43 PM
START-OF-SELECTION.
***PERFORM TO SUBMIT STANDARD REPORT TO CAPTURE DATA INTO itab.
PERFORM SUBMIT_zstandard_PROGRAM.
***PERFORM TO IMPORT DATA FROM DP96 PROGRAM.
PERFORM IMPORT_DATA_FROM_standard.
FORM SUBMIT_standard_PROGRAM .
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = C_JOBNAME
JOBCLASS = 'A'
IMPORTING
JOBCOUNT = X_JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC = 0.
SUBMIT zzzstandard
USER SY-UNAME
VIA JOB C_JOBNAME NUMBER X_JOBCOUNT
AND RETURN
WITH DD_VBELN IN S_VBELN
WITH DD_VKORG IN S_VKORG
WITH DD_ERNAM IN S_ERNAM
WITH DD_ERDAT IN S_ERDAT
WITH P_PDFROM = P_MONTH
WITH P_YRFROM = P_YEAR
WITH P_DATETO = SY-DATUM
WITH P_SAVEX = 'X'
WITH P_TEST = 'X'.
ENDIF.
IF SY-SUBRC EQ 0.
MESSAGE I000 WITH'submit started'.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = X_JOBCOUNT
JOBNAME = C_JOBNAME
PRDDAYS = 0
PRDHOURS = 0
PRDMINS = 0
STRTIMMED = 'X'
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
INVALID_TARGET = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
MESSAGE I000 WITH'submit done - success'.
PERFORM WRITE.
ENDIF.
ENDIF.
In ZZZstandard program i've written
export statement which is not exporting values...
Message was edited by:
Praneet
‎2007 Feb 08 1:49 PM
Hi
The EXPORT / IMPORT to ABAP Memory parameters might be not used correctly.
Please paste the code here so that any comments can given.
Regards
- Atul
‎2007 Feb 08 2:35 PM
***PERFORM TO SUBMIT STANDARD REPORT TO CAPTURE DATA INTO itab.
PERFORM SUBMIT_zstandard_PROGRAM.
<b>wait up to 5 seconds.</b>
***PERFORM TO IMPORT DATA FROM DP96 PROGRAM.
PERFORM IMPORT_DATA_FROM_standard.
change ur coding like this & execute using F8.
this wait syntax may help u.
Message was edited by:
Kalpanashri Rajendran
‎2007 Feb 13 6:09 AM
Hi
what is the necessity to wait for 5 seconds?
if it is must then how can i do that?
My export and import coding is like this:
exporting in called program:
EXPORT TAB = T_RESULTS_LIST
TO DATABASE INDX(XY)
FROM G_INDEX
ID 'T_TAB'.
Importing in my calling program:
IMPORT TAB = T_RESULTS_LIST
FROM DATABASE INDX(XY)
TO G_INDEX
ID 'T_TAB'.
Any suggestion to change coding??
Praneet
‎2007 Feb 13 6:34 AM
HI,
The export statement will write to INDX database table with ID XY and Import statement will read the cluster data from the database table INDX with id XY.
If you want to export to memory and import from memory, use the normal
EXPORT obj1 ... objn TO MEMORY.
and IMPORT obj1 ... objn FROM MEMORY.
This will work.
Regards
Subramanian
‎2007 Feb 13 6:39 AM
Praneet,
When you submit the report via a JOB the called program is executed in background. You have mentioned this in your query.
In such cases the <b>calling program</b> does not wait till the <b>called program</b> has finished execution and program execution for the calling program continues after the SUBMIT statement.
The next executable statement in the calling program is the IMPORT statement but since the called program is probably still under processing and has not exported anything to the database id. Hence the IMPORT statement does not fetch anything.
~Kiran
‎2007 Feb 13 8:41 AM
Kiran,
shall i use <b>commit work and wait</b> statment to make my called program to wait and till calling program to finish it's execution.
If your answer is Yes, where can i insert the code exactly?
any other solution to avoid this problem...
Regards,
Rajasekhar
‎2007 Feb 13 9:11 AM
Commit Work and Wait is not the solution.
If you had to write a WAIT statement then you would have to know the processing time(XX) of the called program and then write a WAIT UP TO XX seconds statement in your program.
If you have to process the called program in the background you can check the status of the job in a DO...ENDO loop after the JOB_CLOSE function and before the IMPORT statement. If the job has finished/cancelled exit the DO loop and continue with the program i.e. the IMPORT statement.
Hope this helps...
~Kiran
‎2007 Feb 13 9:26 AM
Kiran,
Even the called program not importing any data..still it is showing the job status as Finished / cancelled. How can we confirm that export statment has uploaded data to cluster??
How can we find out processing time of a program ..any system variable returns that?
Praneet
‎2007 Feb 13 9:40 AM
Hi
For knowing the processing time of a program
-
Use SE36 Transaction to get the run time Analaysis
Hope this will help.
Please reward suitable points.
Regards
- Atul
‎2007 Feb 13 9:42 AM
You cannot know the processing time of a background job beforehand.
Check the SY-SUBRC variable after the EXPORT statement. If it is set to ZERO then the data is exported correctly. For any other value of SY-SUBRC you should raise an exception in the program since the calling program is dependant on the exported data.
What I meant in my earlier post was to modify your code as below
JOB_OPEN
JOB_SUBMIT
JOB_CLOSE
DO.
Check status of the job.
IF JOB_STATUS = FINISHED. "Data should have been exported
EXIT THE LOOP.
ENDIF.
IF JOB_STATUS = CANCELLED.
EXIT THE LOOP.
ENDIF.
ENDO.
IF JOB_STATUS = FINISHED.
IMPORT DATA.
ELSEIF JOB_STATUS = CANCELLED.
*Message stating dependant job was cancelled
ENDIF.
~Kiran
Please reward useful answers
‎2007 Feb 13 9:59 AM
before importing the data ur first perform must be completed but here its not completed so ur not getting the output. Here we have to use wait statment.
here i have inserted tht syntax in ur program now execute ur program & check.
START-OF-SELECTION.
***PERFORM TO SUBMIT STANDARD REPORT TO CAPTURE DATA INTO itab.
PERFORM SUBMIT_zstandard_PROGRAM.
wait up to 5 seconds
***PERFORM TO IMPORT DATA FROM DP96 PROGRAM.
PERFORM IMPORT_DATA_FROM_standard.
FORM SUBMIT_standard_PROGRAM .
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = C_JOBNAME
JOBCLASS = 'A'
IMPORTING
JOBCOUNT = X_JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC = 0.
SUBMIT zzzstandard
USER SY-UNAME
VIA JOB C_JOBNAME NUMBER X_JOBCOUNT
AND RETURN
WITH DD_VBELN IN S_VBELN
WITH DD_VKORG IN S_VKORG
WITH DD_ERNAM IN S_ERNAM
WITH DD_ERDAT IN S_ERDAT
WITH P_PDFROM = P_MONTH
WITH P_YRFROM = P_YEAR
WITH P_DATETO = SY-DATUM
WITH P_SAVEX = 'X'
WITH P_TEST = 'X'.
ENDIF.
IF SY-SUBRC EQ 0.
MESSAGE I000 WITH'submit started'.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = X_JOBCOUNT
JOBNAME = C_JOBNAME
PRDDAYS = 0
PRDHOURS = 0
PRDMINS = 0
STRTIMMED = 'X'
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
INVALID_TARGET = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
MESSAGE I000 WITH'submit done - success'.
PERFORM WRITE.
ENDIF.
ENDIF.
‎2007 Feb 13 10:06 AM
HI Kalpana,
If i put wait statement it is working..i've checked for several instances.
Even i put commit work and wait after export, is not working. Only wait statement before importing is working...
I need only one clarification ..how can we enusre that Wait is for 5 seconds?
can you explain....
Regards,
Praneeth
‎2007 Feb 13 10:10 AM
thats based on the amount of data transfered u can check with 2 seconds also .
If u r importing more data then u can increase the seconds.
Since i dont know the amount of transfer i specified 5 seconds. If its minimum u reduce it to some 3 seconds & check whether its working.
‎2007 Mar 08 9:08 AM
Hi,
Wait statement is working fine for small amount of data.
but not able to retreive data when the amount of data is large..
What can we do?
Praneeth