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: 

Submit program can't return for submit program with submit another program

pataselano
Active Contributor
0 Kudos
1,997

Hi All,

In program_1, I am using the following code for submit program_2:

  cl_salv_bs_runtime_info=>set(
  exporting display = abap_false
  metadata = abap_true
  data = abap_true ).


  submit (v_program_2)
  with free selections texpr
  with selection-table i_select
  and return.

In program_2, I am using submit to program_3 with similar code.

When running program_1, the program will stop on the alv display of program_2 and can not receive data from memory.

How to solve this problem?

1 ACCEPTED SOLUTION

pataselano
Active Contributor
0 Kudos
1,811

Thank you all for comment and answer.

Finally, I can solve this problem by myself.

After get data from program_3, cl_salv_bs_runtime_info=>clear_all() for clear alv data of program_3 and before display data to alv for program_2, I set cl_salv_bs_runtime_info again.

cl_salv_bs_runtime_info=>set(
  exporting display = abap_false
  metadata = abap_true
  data = abap_true ).

So, program_1 can get data from submit of program_2 without displayed alv of program_2.

14 REPLIES 14

thkolz
Contributor
1,811

Did you try to use SUBMIT with EXPORTING LIST TO MEMORY?

Sandra_Rossi
Active Contributor
0 Kudos
1,811

It's a good workaround, but I think that it's best to use cl_salv_bs_runtime_info as far as possible. So, understand first why the called program ignores cl_salv_bs_runtime_info, then I guess the best workaround can be found.

Sandra_Rossi
Active Contributor
0 Kudos
1,811

It's something specific to (V_PROGRAM_2) which seems to deactivate the feature.

If you run on a test program, it should work. Try to see by debug of CL_SALV_BS_RUNTIME_INFO why there's a difference between the test program and (V_PROGRAM_2).

raymond_giuseppi
Active Contributor
1,811

Check if the program_3 use a call of cl_salv_bs_runtime_info=>clear_all() or similar method that would deactivate the handling of ALV events?

NB: The class use memory id cl_salv_bs_runtime_info=>c_memid_info to pass information, so a recursive call may not be allowed/handled.

0 Kudos
1,811

Yes, in program_2, I used cl_salv_bs_runtime_info=>clear_all() after submit program_3.

Any solution for solve that problem?

0 Kudos
1,811

In fact, by using cl_salv_bs_runtime_info=>clear_all(), you prevent cl_salv_bs_runtime_info from continuing to run.

The called program should check in memory whether it has already been called with cl_salv_bs_runtime_info (check the contents of the memory identifier cl_salv_bs_runtime_info=>c_memid_info with cl_salv_bs_runtime_info=>get) and save the contents before calling the class a second time, and restore it to its previous value after receiving the data).

amirbarzegar
Explorer
0 Kudos
1,811

SUBMIT zzh99cwtr0 "ZZRPMENUSTART00

WITH pnppernr IN r_pernr
WITH begd_cal = s_begda " '20190321'" " PERIOD START
WITH endd_cal = s_endda " '20190420'" " PERIOD END
WITH grid = 'X'
WITH lv = ''
USING SELECTION-SET 'FOR_DEVELOPERS'
EXPORTING LIST TO MEMORY
AND RETURN.

for example above code return data into memory and make sure to memory id must be unique .

0 Kudos
1,811

It's a good workaround, but I think that it's best to use cl_salv_bs_runtime_info as far as possible. So, understand first why the called program ignores cl_salv_bs_runtime_info, then I guess the best workaround can be found.

pataselano
Active Contributor
0 Kudos
1,811

sandra.rossi,
In program_2. I used cl_salv_bs_runtime_info=>clear_all() after submit program_3.

Any solution for solve that problem?

Sandra_Rossi
Active Contributor
0 Kudos
1,811

I can't reproduce your case, you are not precise enough, so as I said you should make sure that it works well in simple case, then tri to debug CL_SALV_BS_RUNTIME_INFO why it stops working in the special case of program_2 and program_3, I'm pretty sure you don't do it correctly.

Sandra_Rossi
Active Contributor
0 Kudos
1,811

If you say you do "clear_all" right before doing a "get*", I hope you can understand that it's normal you get nothing.

pataselano
Active Contributor
0 Kudos
1,812

Thank you all for comment and answer.

Finally, I can solve this problem by myself.

After get data from program_3, cl_salv_bs_runtime_info=>clear_all() for clear alv data of program_3 and before display data to alv for program_2, I set cl_salv_bs_runtime_info again.

cl_salv_bs_runtime_info=>set(
  exporting display = abap_false
  metadata = abap_true
  data = abap_true ).

So, program_1 can get data from submit of program_2 without displayed alv of program_2.

0 Kudos
1,811

-1 just because I think that Raymond answer is much more useful answer for future visitors. The problem is not about the number of programs called, it's just because you used "clear_all" which of course has reset the preceding calls.

0 Kudos
1,811

sandra.rossi

If I don't use "clear_all" then I can't use alv for program_2 because alv still use by program_3.

So, I set the alv again with two conditions:

  1. "display = abap_true" for the tcode that directly runs program_2
  2. "display = abap_false" for the tcode that runs program_2 through program_1.