‎2009 Mar 25 6:26 AM
Hello everyone,,
I am facing a problem...could any one please help me out in solving this
The issue is : I have a program which will submit some jobs at the background.
Now,Before calling the FM Job_Submit , I am exporting some values.
Now the program that is submitted in the Job_Submit, I am trying to import the values that i have exported in the main program. I couldnt able to import the values in the program that is submitted using Job_Submit. I also tried using set and get parameters still couldnt able to make it work.
lv_jobid = p_v_jobid.
lv_repid = wa_submitjoblist-rep_id.
lv_unit = wa_submitjoblist-bj_unit.
" exporting the values for the report being submitted .
export lv_jobid to memory id 'JOBID2REP'.
export lv_repid to memory id 'REPID2REP'.
export lv_unit to memory id 'UNIT2REP'.
call function 'JOB_SUBMIT'
exporting
* ARCPARAMS =
authcknam = sy-uname
* COMMANDNAME = ' '
* OPERATINGSYSTEM = ' '
* EXTPGM_NAME = ' '
* EXTPGM_PARAM = ' '
* EXTPGM_SET_TRACE_ON = ' '
* EXTPGM_STDERR_IN_JOBLOG = 'X'
* EXTPGM_STDOUT_IN_JOBLOG = 'X'
* EXTPGM_SYSTEM = ' '
* EXTPGM_RFCDEST = ' '
* EXTPGM_WAIT_FOR_TERMINATION = 'X'
jobcount = p_v_jobid
jobname = 'TFDBBATCHJOBRUN'
* LANGUAGE = SY-LANGU
* PRIPARAMS = ' '
report = wa_submitjoblist-bj_repname
variant = wa_submitjoblist-bj_variant
importing
step_number = p_v_stepid
* EXCEPTIONS
* BAD_PRIPARAMS = 1
* BAD_XPGFLAGS = 2
* INVALID_JOBDATA = 3
* JOBNAME_MISSING = 4
* JOB_NOTEX = 5
* JOB_SUBMIT_FAILED = 6
* LOCK_FAILED = 7
* PROGRAM_MISSING = 8
* PROG_ABAP_AND_EXTPG_SET = 9
* OTHERS = 10
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
now in the program thats getting submitted in the Job_Submit.
import lv_jobid from memory id 'JOBID2REP'.
import lv_repid from memory id 'REPID2REP'.
import lv_unit from memory id 'UNIT2REP'.
Could any one please help me out in solving the problem....
thanks and regards
Chandu Reddy Sunkari
‎2009 Mar 25 6:46 AM
Hi,
i could be wrong here, but I suspect this may be happening because when using export to...memory ID, the data is stored in the ABAP memory of the main session. When the background job is run, it may be in a different main session, which has its own separate ABAP memory, hence the data that is exported may not be accessible by the import statement.
Regards,
Arun
‎2009 Mar 25 6:46 AM
Hi,
i could be wrong here, but I suspect this may be happening because when using export to...memory ID, the data is stored in the ABAP memory of the main session. When the background job is run, it may be in a different main session, which has its own separate ABAP memory, hence the data that is exported may not be accessible by the import statement.
Regards,
Arun
‎2009 Mar 25 6:49 AM
‎2009 Mar 25 6:59 AM
Hi ...
I have even tried working with SET and GET parameters..
the problem i am facing here is ...when the job is submitted then the get parameters are not getting any values from the main program ...
however when i run the program (the program which i submitted using job_submit) individually and make sy-batch = X .. then the get parameters are fetching the values ...
the problem is when i submit the program from the main program .. the get parameters are not getting any values...
thanks and regards
Chandu Reddy Sunkari
‎2009 Mar 25 7:26 AM
Hi ,
In OO context Export Memory id is obsolete. Can you please try with the below option and check wither it works .
data: field1(2) type c.
data: field4(2) type c.
constants: co_fld(4) type c value 'FLDV'. " Memory Field name
field1 = 'TEST'.
export co_fld from field1 to MEMORY.
IMPORT co_fld to field4 from memory.
write field4.
Regards,
Ravi Sankar.Z
‎2009 Mar 25 6:50 AM
Hi..
You cannot export parameters in your program and import them in the JOB submitted with JOB_SUBMIT, the reason being as given below:
There are two type of memories in SAP, a. SAP Memory b. ABAP Memory
a. SAP Memory is for the entire session.
b. ABAP Memory is for the particular session, and the statement which you are using tries to store in the ABAP Memory which cannot be used globally.
Try passing them in the job as a variant..
Best Regards,
Pradeep.
‎2009 Mar 25 6:51 AM
hello
Dialog work process and Non-dialog work processes are executed in different memory area so you will not be able get export memory values using import statement.
Instead move the parameter to some temporary table or TVARC and then read the values.
Hope this will solve your problem.
‎2009 Mar 26 12:36 PM
thanks for all your suggestions .. tried solving this problem with a ztable and storing it in them...:-)
thanks and regards
chandu reddy sunkari