Application Development 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: 

SET/GET not working when I submit one program into Main program.

Former Member
0 Kudos

Hi All,

I am using set/get parameter as follows but somewht it is not working.. Please help.

IF ( uf_instn = 'ACEFR' and uf_messg <> 'BSP' ).

set parameter id 'AJN' field lf_jobname.

set parameter id 'AJC' field gf_jobcount.

ENDIF.

SUBMIT zace_interface

USER sy-uname

VIA JOB lf_jobname

NUMBER gf_jobcount

WITH SELECTION-TABLE lt_seltab

  • TO SAP-SPOOL

AND RETURN.

in the zace_interface program I have another submit program

submit zrsbdcsub and return

user 'ZACE_INTERFACE'

with mappe eq lf_group

with von eq sy-datum

with bis eq sy-datum

with fehler eq space

with logall eq co_true.

ad inside this submit im using

get parameter id 'AJN' field v_jobname.

get parameter id 'AJC' field v_jobcount.

but i am not able to get the values into v_jobname & v_jobcount.

Can you please help me in this regard. how i will get the values in v_jobname & v_jobcount.

Thanking you in advance

Regards,

Prashant

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi Prashant,

Which is approach that does not work in the background?

SET/GET or EXPORT/IMPORT parameter?

Perhaps you can check table TBTCO to get the job name and job count.

Regards,

Ferry Lianto

9 REPLIES 9

Simha_
Employee
Employee
0 Kudos

Hi,

In both the programs, try using giving the same variable names in both the reports and check....

Cheers,

Simha.

former_member181962
Active Contributor
0 Kudos

Hi Prashant,

Did you check if the IF condition is succeeding?

Regards,

Ravi

0 Kudos

Yes Ravi,

If condition is scceeding.

Regards,

Prashant

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try to use export and import to memory ID statement instead.


IF ( uf_instn = 'ACEFR' and uf_messg <> 'BSP' ).
  export lf_jobname  to memory id 'ZJOBNAME'.
  export gf_jobcount to memory id 'ZJOBCOUNT'.
ENDIF.

SUBMIT zace_interface
USER sy-uname
VIA JOB lf_jobname
NUMBER gf_jobcount
WITH SELECTION-TABLE lt_seltab
* TO SAP-SPOOL
AND RETURN.

in the zace_interface program I have another submit program

submit zrsbdcsub and return
user 'ZACE_INTERFACE'
with mappe eq lf_group
with von eq sy-datum
with bis eq sy-datum
with fehler eq space
with logall eq co_true.

ad inside this submit im using
import v_jobname from memory id 'ZJOBNAME'.
import v_jobcount from memory id 'ZJOBCOUNT'.

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

But I am executing all this in Background.

When i execute the same in forground its working perfectly.

Problem comes when st the program for background execution.

Do we have any other alternative.?

Regards,

Prashant

ferry_lianto
Active Contributor
0 Kudos

Hi Prashant,

Which is approach that does not work in the background?

SET/GET or EXPORT/IMPORT parameter?

Perhaps you can check table TBTCO to get the job name and job count.

Regards,

Ferry Lianto

0 Kudos

Hello Ferry,

Neither SET/GET nor EXPORT/IMPORT working in the background.

When I check the parameter Id's before submitting another program it shows that it has been Set sucessfully but when i check in debug mode all the SAP & ABAP memory ids which I have set before submitting the Z-program are vanished.

I tried to get the status from TBTCO but to keep checking till it get over. Because unless n until predecessor job does not get over I dont want to start the execution of next job.

Is it a good option to use wait till --- seconds & in while endwhile i will keep checking the status of the job?

If you have anyother alternative for this please let me know

Thanks for your help till date

Regards,

Prashant

0 Kudos

any solutions man I got same problem

0 Kudos

Hi..,

any way u r executing the programs in the same session but between diff. internal sessions u can use the IMPORT and EXPORT options ( ABAP MEMORY )

or do one thing...

<b>In the first program Copy these fields into a file in the <b>application server</b>,, and in the Second submit program u retrieve these variable values from the Application server file into these two variables!!</b>

just now i have solved one of the issues of this Kind by using an Application server file.

In the first program..

IF ( uf_instn = 'ACEFR' and uf_messg <> 'BSP' ).

OPEN dataset 'FILE' for output in text mode encoding default.

transfer lf_jobname to 'FILE'.

transfer gf_jobcount to 'FILE'.

CLOSE dataset 'FILE'.

ENDIF.

and instead of using the GET parameters in the second program ..

OPEN dataset 'FILE' for input in text mode encoding default.

read dataset 'FILE' into v_jobname.

read dataset 'FILE' into v_jobcount.

CLOSE dataset 'FILE'.

This has solved my problem !!!!! hope this helps u also!!

regards,

sai ramesh