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: 

Problem in SUBMIT RKAEP000 command in cl_salv_bs_runtime_info class

former_member565051
Participant
0 Kudos
1,601

Dear Experts,

I am facing an issue with SUBMIT functionality while retrieving the data when using cl_salv_bs_runtime_info class.

I have written the code in following way:

FIELD-SYMBOLS: <lt_data> TYPE ANY TABLE,

<ls_data> TYPE any,

<lt_dat2> TYPE ANY TABLE.

cl_salv_bs_runtime_info=>set( EXPORTING

display = abap_false metadata = abap_false data = abap_true ).

repname = 'RKAEP000'.

SUBMIT (repname) WITH p_tcode EQ 'KOB1'

WITH p_kokrs = 'XXX'

WITH aufnr IN rt_aufnr

WITH p_disvar = '/SAP_ABAP'

EXPORTING LIST TO MEMORY AND RETURN.

cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data_descr = lr_data_descr ).

CREATE DATA lr_data TYPE HANDLE lr_data_descr.

ASSIGN lr_data->* TO <lt_data>.

cl_salv_bs_runtime_info=>get_data( IMPORTING t_data = <lt_data> ).

Now, issue is when i execute this code, no data will be populated in <lt_data>.

But when i execute the Tcode KOB1 alone first, and then if I execute this above code from my report I am getting the correct result and <lt_data> is correctly populated.

Is the issue with memory?

How can i get my internal table filled with data without executing the Tcode alone, as I am using SUBMIT.

Any help will be appreciated.

Thank & Regards,

AV

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
669

To test the assumption, I recommend that you run KOB1 in background, make sure the ALV is output in a spool, then change temporarily the SUBMIT of your program:

SUBMIT RKAEP000 USING SELECTION-SET '000' AND RETURN. 

(where 000 is to be replaced with the name of the program variant used by the background job)

If it works, then display the program variant and all its parameters, and change the SUBMIT to pass all the parameters of the program variant via WITH.

12 REPLIES 12

raymond_giuseppi
Active Contributor
0 Kudos
669

Could you remove the EXPORTING LIST TO MEMORY? (AFAIK it could trigger a good old list ALV and not a GRID so no data returned to the class)

0 Kudos
669

You also forget some parameters (is this the reason you put the program name in a variable, to trick code inspector?) When you execute the transaction, some parameters id are set in memory, and the next execution is successful

You could save a default variant for the report and use it in the SUBMIT statement USING SELECTION-SET in addition to the parameters.

NB: I too used to set metadata to true, but it was intended to regenerate the grid later (or convert it to format XML or XLSX later WYSIWYG)

Sandra_Rossi
Active Contributor
0 Kudos
669

Please use the CODE button to format your code so that it's shown in a more user-friendly format (colorized).

Sandra_Rossi
Active Contributor
669

Is it possible that the submit parameters are incorrect? To make sure, what happens if you create a little program as follows, is something displayed?

REPORT ztest.
SUBMIT RKAEP000
WITH p_tcode EQ 'KOB1'
WITH p_kokrs = 'XXX'
WITH aufnr IN rt_aufnr
WITH p_disvar = '/SAP_ABAP'.

stanislaslemaire
Participant
669

Hello, I'm using the same technique without issue, but I set parameters metadata to true, not false.
Perhaps can you try with metadata set to true ?
And as asked by Raymond, don't use EXPORTING LIST TO MEMORY ! Else no data transferred to ALV...
With EXPORTING LIST TO MEMORY, use CALL FUNCTION 'LIST_FROM_MEMORY'

Sandra_Rossi
Active Contributor
669

I just tried with a little demo program. There's no issue with using EXPORTING LIST TO MEMORY (although it's redundant with DISPLAY = ' '), and no issue with METADATA (can be left ' '). I think the only reason left is that the program RKAEP000 is called differently from KOB1 (parameters, sy-tcode, etc.)

former_member565051
Participant
0 Kudos
669

Hello Stanislas,

Yes, I did that too.

But still no luck on this.

I have also used CALL FUNCTION 'LIST_FROM_MEMORY', but still didnt get any data.

I wonder why the data gets populated in my code when I run the Tcode KOB1 separately

 cl_salv_bs_runtime_info=>set(
        EXPORTING display = abap_false
                  metadata = abap_true
                  data = abap_true ).
      SUBMIT rkaep000 AND RETURN
                  WITH p_tcode EQ 'KOB1'
                  WITH p_kokrs = 'VWDS'
                  WITH aufnr IN rt_aufnr
                  WITH p_disvar = '/SAP_ABAP'. --> Already created in KOB1 transaction.


      cl_salv_bs_runtime_info=>get_data_ref(
      IMPORTING r_data_descr = lr_data_descr ).
      CREATE DATA lr_data TYPE HANDLE lr_data_descr.
      ASSIGN lr_data->* TO <lt_data>.
      cl_salv_bs_runtime_info=>get_data(
      IMPORTING
      t_data = <lt_data>
      ).
      LOOP AT <lt_data> ASSIGNING <ls_data>.

former_member565051
Participant
0 Kudos
669

@Sandra,

Thanks for help.

Yes this could be the issue,

I will try to pass selection set in submit command

former_member565051
Participant
0 Kudos
669

Also during the debugging, i found out that the values are not getting refreshed from the memory while calling the SUBMIT command. The previous values are not getting cleared in the standard report rkaep000 (Like AUFNR, BUDAT ) Is there any way to clear out.

Sandra_Rossi
Active Contributor
0 Kudos
670

To test the assumption, I recommend that you run KOB1 in background, make sure the ALV is output in a spool, then change temporarily the SUBMIT of your program:

SUBMIT RKAEP000 USING SELECTION-SET '000' AND RETURN. 

(where 000 is to be replaced with the name of the program variant used by the background job)

If it works, then display the program variant and all its parameters, and change the SUBMIT to pass all the parameters of the program variant via WITH.

0 Kudos
669

Sandra Rossi

Thanks Sandra, I will try this approach.

Regards

0 Kudos
669

Thank you so much experts.

Issue is resolved now.

I gone through sandra.rossi approach.

Scheduled the background job and checked which parameters are required.

Found that it is mandatory to pass RT_BUDAT range in the SUBMIT report.

Thread can be closed.