04-17-2009 5:26 AM
Hi, all.
I created 2 addon programs.
1 program call another program by 'SUBMIT'.
but I don't get messages outputed by called program.
Is it impossinble?
please let me know.
thanks.
04-17-2009 5:59 AM
In my earlier reply i pointed that in the called program
if error
export sy-subrc to memory
endif
after submit in the calling program
import from memory
a®
04-17-2009 5:34 AM
Hello,
Please can u elaborate?
Is it that you want messages from the called program to be appended in the joblog of the calling program?
Coz when you run in foreground you will see messages of both, only in background both the called and calling programs will have seperate joblogs.
Regards,
Mansi.
04-17-2009 5:39 AM
Hello,
In Background, If you want to append messages from called program into calling program, then, in the calling program after the submit stmt, you will have to read the joblog for called program looping at the joblog table of called program using write stmt print all the msg .
Then if u see joblog of calling program , it will have messages of called program also.
Check the code below to get pointers:
"Call the functin module to read the job log of called program in the calling program after the SUBMIT stmt
CALL FUNCTION 'BP_JOBLOG_READ'
EXPORTING
client = sy-mandt
jobcount = g_jcount
jobname = g_jbname
TABLES
joblogtbl = g_t_joblogtbl
EXCEPTIONS
cant_read_joblog = 1
jobcount_missing = 2
joblog_does_not_exist = 3
joblog_is_empty = 4
joblog_name_missing = 5
jobname_missing = 6
job_does_not_exist = 7
OTHERS = 8.
IF sy-subrc EQ 0.
* Looping at the internal table for the joblog the messages are reported
* to build the joblog in CLOCO
LOOP AT g_t_joblogtbl INTO g_wa_joblogtbl.
MESSAGE g_wa_joblogtbl-text TYPE 'I'.
endloop.
endif.
Regards,
Mansi.
Edited by: SAP USER on Apr 17, 2009 6:42 AM
04-17-2009 5:48 AM
thank you Mansi and a®s.
A calling proglam is executed in foreground.
I don't want to display message on screen.
I want to get messages in a calling program...
or, I want to get a return code (status Error, Success, Warning).
is it impossible??
Regards.
Rie.
04-17-2009 5:59 AM
Hello,
After the Submit stmt, check for the sy-subrc value and accordingly you can report message that 'Sucess/ Error/ Falied ' etc.
Regards,
Mansi.
04-17-2009 5:37 AM
in the called program while in submit write error messages to spool or list to memory and then after submit read spool using sy-spono or list from memory
a®
04-17-2009 5:54 AM
hi,
use this statement .
SUBMIT zprogram
VIA JOB text-020 NUMBER l_jobcnt
AND RETURN.
hope it will work.
04-17-2009 5:59 AM
In my earlier reply i pointed that in the called program
if error
export sy-subrc to memory
endif
after submit in the calling program
import from memory
a®
04-17-2009 6:32 AM
Thank you katigiri, Mansi, and a®s.
I can get messages.
I use ABAP memory EXPORT/IMPORT.
Thank you very mach!
04-24-2009 3:35 AM
Hello all,
I read this thread and I have the same sort of problem, but with a small twist. I have a custom program that is doing a SUBMIT ...AND RETURN to an SAP standard program. So, although I want to get the messages, I cannot change the code of the submitted program to put the messages in MEMORY.
When I am in debug, after the return from the submitted program, the message is displayed on the bottom of the screen, but I can't figure out how to capture it so that I can add logic to react to the message.
Do any of you smart people have any ideas for me?
Katherine Reader
04-24-2009 3:50 AM
Hi, Katherine.
try this...
SUBMIT xxxxxx
VIA JOB (JOBNAME)
NUMBER (JOBCOUNT)
AND RETURN.
CALL FUNCTION "BP_JOBLOG_READ".
Mansi answered about this FM.
I hope it will work...
Rie