Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Background Job - Access memory variables

nagarajan_ramudu
Active Participant
0 Likes
1,264

Dear Gurus,

I have created a custom program to call another program in a background job. Due to some due reason, I don't call the transaction using submit, instead I submit the program using a job.

My requirement is to pass the memory variable from first program to another program using a memory variable. I used EXPORT / IMPORT memory and it didn't work.

Is there a way to do this without file access, custom table? Please let me know.

Thanks

Nagarajan

1 ACCEPTED SOLUTION
Read only

alex_cook
Active Participant
0 Likes
1,055

How about using a SET/GET Parameter ID?

8 REPLIES 8
Read only

Former Member
0 Likes
1,055

Nagarajan,

Memory Export / Import works only when used within the same session, so it won't work in your scenario, instead you can pass the value directly to the program you are submitting through background job, just create a parameter eg. P_VAL in the target program and the pass the value when you submit the job...


    SUBMIT  [Program Name ]
            WITH P_VAL = [ your value ]...VIA JOB...

Regards,

Trikanth

Read only

0 Likes
1,055

Thanks much for your reply.

I use below statement

SUBMIT "Stand Report"

USING SELECTION-SCREEN 1000

WITH SELECTION-TABLE t_rspar_tab

VIA JOB name NUMBER number

AND RETURN.

I tried to add addtional parameter, giving an error. Called program is standard program.

I would like to pass the "value" from first program to called program BADI that is executed in Background Job.

Edited by: Nagarajan Ramudu on Jan 20, 2011 12:34 AM

Read only

0 Likes
1,055

Have you declared that parameter in the second program ?

eg.

PARAMETERS: P_VAL TYPE STRING.

Once you have declared your parameter, you can pass the value to the program and use P_VAL in you program logic.


SUBMIT "Stand Report"
USING SELECTION-SCREEN 1000
WITH SELECTION-TABLE t_rspar_tab
WITH P_VAL = "your value"
VIA JOB name NUMBER number
AND RETURN.

Regards,

Trikanth

Read only

0 Likes
1,055

Sorry I forgot to update you.

Second program is a standard SAP program and I access BADI for change the content. So I need to pass the value from first program to second program's BADI.

Read only

0 Likes
1,055

Can you tell me which standard program you are using ? Unless someone suggests a better solution, you can simply create an entry in TVARVC table (Table of Variant Variables) and read in your Badi to use instead of creating a Ztable.

Regards,

Trikanth

Read only

alex_cook
Active Participant
0 Likes
1,056

How about using a SET/GET Parameter ID?

Read only

0 Likes
1,055

Parameter ID is not working.

TVARC is an option but looking for alternative.

I thinking to use DATASET. What is the default file location and where do I find? Is it a suggested way to use dataset for this? Please let me know.

Read only

Former Member
0 Likes
1,055

Parameter ID's are user specific, you should use the same user id for both SET / GET. DATASET option is to write a file to the app. server and read it again from the same location which involves a file location, read/write access, a bit complex way of doing for just storing a value, anyway the default location would be DIR_HOME (check TCode Al11 to see where it is mapped)

Regards,

Trikanth