Skip to Content
0
Sep 15, 2016 at 08:40 AM

How Could i get the another program Output Details.

464 Views

Hi,

I have Two programs prg1 and prg2.

From first program i would like to run the Second program with Selection Screen values.

I checked in forum i found some posts. finally i was used like below.

From 1st program (zprac1)

SUBMIT zprac2 WITH SELECTION-TABLE it_rsparams AND RETURN.

BREAK-POINT.

If i use the above code i can able to run the program with output details also.

Here what my problem is .

1)I dont want to show the second program output. Just run it in background only.

2)After showing the output of the second program, After Press the back button only first program is triggering . After submit code in program 1.

Can run and again come immediately to the first program.

3)I am using below class for getting the Fields and data of the Second program but no output. Nor no error message.

4)I don't want to use any job.

Total 1st program coding.

DATA:

it_rsparams TYPE STANDARD TABLE OF rsparams,

wa_rsparams LIKE LINE OF it_rsparams.

DATA: ls_data TYPE REF TO data,

gv_flag TYPE c.

FIELD-SYMBOLS: <lt_data> TYPE table.


wa_rsparams-selname = 'P_MATNR'. "PARAMETER or SELECT-OPTION of the called program

wa_rsparams-kind = 'P'. "S=Select-options P=Parameters

wa_rsparams-sign = 'I'.

wa_rsparams-option = 'EQ'.

wa_rsparams-low = 'W61716'.

wa_rsparams-high = space.

APPEND wa_rsparams TO it_rsparams.

SUBMIT zprac2 WITH SELECTION-TABLE it_rsparams AND RETURN.

BREAK-POINT.

cl_salv_bs_runtime_info=>set(

display = abap_false

metadata = abap_false

data = abap_true ).

TRY.

CLEAR gv_flag.

cl_salv_bs_runtime_info=>get_data_ref(

IMPORTING r_data = ls_data ).

ASSIGN ls_data->* TO <lt_data>.

IF <lt_data> IS ASSIGNED.

gv_flag = 'X'.

ENDIF.

CATCH cx_salv_bs_sc_runtime_info.

MESSAGE `Unable to retrieve ALV data` TYPE 'E'.

ENDTRY.