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

Submit and Return for T-Code COOIS

Former Member
0 Likes
6,453

Hi Experts,

My requirement is to get the data displayed after executing COOIS with fixed input parameters into an Internal table.

I am using variant for the selection screen of COOIS. ('PROD_ORD' - Self Created)

[ List - Component || Profile - 0 || Layout - /PROD_ORDER || 'X' Excl. ]

After executing the following program, the alv is getting displayed instead of coming back to this code(No. 2).

and second thing value is not geting exported in table 'list_tab'.

Below is my code ;-

  ---------------------------------------------------------------------------------------

DATA BEGIN OF list_tab OCCURS 0.

INCLUDE STRUCTURE abaplist.

DATA END OF list_tab.

1) CALL FUNCTION 'LIST_FREE_MEMORY'.

2) SUBMIT ppio_entry USING SELECTION-SET 'PROD_ORD'

EXPORTING LIST TO MEMORY AND RETURN. 

3) CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = list_tab

EXCEPTIONS

not_found = 1

OTHERS = 2.

---------------------------------------------------------------------------------------------

Please Suggest, how can we skip the alv display & sustain the our code and how can i get the value in internal table.

Thanks

Ram

26 REPLIES 26
Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,556

Do you know cl_salv_bs_runtime class.

  call method cl_salv_bs_runtime_info=>set
    exporting
      display  = abap_false
      metadata = abap_false
      data     = abap_true.

  submit (i_program)
   using selection-set i_variant
   with selection-table i_selection_table
*   WITH FREE SELECTIONS i_frees
   and return.

  try.
      call method cl_salv_bs_runtime_info=>get_data_ref
        importing
          r_data = lr_data.
      assign lr_data->* to <lt_data>.
    catch cx_salv_bs_sc_runtime_info.
  endtry.

Regards,
Raymond

Read only

0 Likes
4,556

Dear Raymond,

Thanks.

This class doesnot exist in 4.6c V.

Read only

0 Likes
4,556

Hi Ram

Raymond is correct - the CL_SALV_BS_RUNTIME class should help solve your problem. Setting the flag DISPLAY = ABAP_FALSE in the SET method will cause the output of all ALV reports to be suppressed.

Something to watch out for though is if you need to output your own ALV after submitting COOIS then you'll need to make sure you reset this DISPLAY flag before doing so. You can do this by calling the CLEAR_ALL method after the GET_DATA_REF method.

I wrote a blog on this functionality last year that might be useful to you:

Regards
Glen

Read only

0 Likes
4,556

There is a "p_alv" parameter (default is 'X', hidden in system variant associated with transaction) try to pass it as space to bypass ALV display.

Regards,
Raymond

Read only

Former Member
0 Likes
4,556

Hi Glen/Raymond,

Class 'CL_SALV_BS_RUNTIME' doesnot exist in 4.6c V.

Raymond,
For p_alv I used -
SUBMIT ppio_entry
USING SELECTION-SET 'PROD_ORD_DUMP'
WITH p_alv = ''
EXPORTING LIST TO MEMORY AND RETURN.

Still its displaying the Alv Report.

And program 'ppio_entry', has several INCLUDES, it doesn't have its own code.
I am not sure if this make any difference in Submit and Return Clause.

I even created ZBDC program and called then using Submit and Return,
then is getting executed and reamin at the same code but still after List_from_memory, its not fetching the data.

Thanks-
Ram

Read only

0 Likes
4,556

Hi Ram,

For content of COOIS you can submit report ppioc000 .

Sample code :

TYPES :

BEGIN OF ty_range_matnr,

        sign TYPE tvarv_sign,

        option TYPE tvarv_opti,

        low TYPE ioheader-matnr,

        high TYPE ioheader-matnr,

END OF ty_range_matnr,

BEGIN OF ty_range_aufnr,

      sign TYPE tvarv_sign,

      option TYPE tvarv_opti,

      low TYPE afko-aufnr,

      high TYPE afko-aufnr,

END OF ty_range_aufnr,

BEGIN OF ty_range_werks,

        sign TYPE tvarv_sign,

        option TYPE tvarv_opti,

        low TYPE t001w-werks,

        high TYPE t001w-werks,

END OF ty_range_werks,

BEGIN OF ty_range_dispo,

      sign TYPE tvarv_sign,

      option TYPE tvarv_opti,

      low TYPE ioheader-dispo,

      high TYPE ioheader-dispo,

END OF ty_range_dispo,

BEGIN OF ty_range_fevor,

      sign TYPE tvarv_sign,

      option TYPE tvarv_opti,

      low TYPE ioheader-fevor,

      high TYPE ioheader-fevor,

END OF ty_range_fevor,

BEGIN OF ty_range_arbpl,

        sign TYPE tvarv_sign,

        option TYPE tvarv_opti,

        low TYPE iooper-arbpl,

        high TYPE iooper-arbpl,

END OF ty_range_arbpl,

BEGIN OF ty_range_compo,

        sign TYPE tvarv_sign,

        option TYPE tvarv_opti,

        low TYPE ioopcomp-matnr,

        high TYPE ioopcomp-matnr,

END OF ty_range_compo,

BEGIN OF ty_range_datdeb,

      sign TYPE tvarv_sign,

      option TYPE tvarv_opti,

      low TYPE ioheader-gstrp,

      high TYPE ioheader-gstrp,

END OF ty_range_datdeb,

BEGIN OF ty_range_datfin,

      sign TYPE tvarv_sign,

      option TYPE tvarv_opti,

      low TYPE ioheader-gltrp,

      high TYPE ioheader-gltrp,

END OF ty_range_datfin,

TYPES : BEGIN OF ty_status_tmp,

        stat TYPE jest-stat,

        excl TYPE rc27x-flg_sel,

END OF ty_status_tmp.

TYPES :

         ty_range_matnr_tab TYPE STANDARD TABLE OF ty_range_matnr,

         ty_range_aufnr_tab TYPE STANDARD TABLE OF ty_range_aufnr,

         ty_range_werks_tab TYPE STANDARD TABLE OF ty_range_werks,

         ty_range_dispo_tab TYPE STANDARD TABLE OF ty_range_dispo,

         ty_range_fevor_tab TYPE STANDARD TABLE OF ty_range_fevor,

         ty_range_arbpl_tab TYPE STANDARD TABLE OF ty_range_arbpl,

         ty_range_compo_tab TYPE STANDARD TABLE OF ty_range_compo,

         ty_range_datdeb_tab TYPE STANDARD TABLE OF ty_range_datdeb,

         ty_range_datfin_tab TYPE STANDARD TABLE OF ty_range_datfin,

         ty_ioheader_tab   TYPE STANDARD TABLE OF ioheader,

         ty_ioitem_tab     TYPE STANDARD TABLE OF ioitem,

         ty_iosequen_tab   TYPE STANDARD TABLE OF iosequen,

         ty_iooper_tab     TYPE STANDARD TABLE OF iooper,

         ty_ioopcap_tab    TYPE STANDARD TABLE OF ioopcap,

         ty_ioopcomp_tab   TYPE STANDARD TABLE OF ioopcomp,

         ty_iooppreq_tab   TYPE STANDARD TABLE OF iooppreq.

data :        st_tcoa                 TYPE tcoa.

DATA : t_status_tmp            TYPE TABLE OF ty_status_tmp,

DATA:  w_flg_read_from_arch(1) TYPE c VALUE ' ',

             w_flg_update(1)    TYPE c VALUE  ' ',

CONSTANTS:

c_memid_tablesize(5) VALUE 'IOC00',

c_memid_ioc1(5)      VALUE 'IOC01',

c_memid_ioc2(5)      VALUE 'IOC02',

c_memid_stcoa(5)     VALUE 'IOC03',

c_memid_fcode(5)     VALUE 'IOC04',

c_memid_ioheader(5)  VALUE 'IOC05',

c_memid_ioitem(5)    VALUE 'IOC06',

c_memid_ioconf(5)    VALUE 'IOC07',

c_memid_iogmer(5)    VALUE 'IOC08',

c_memid_iogomo(5)    VALUE 'IOC09',

c_memid_iosequen(5)  VALUE 'IOC10',

c_memid_iooper(5)    VALUE 'IOC11',

c_memid_ioopcap(5)   VALUE 'IOC12',

c_memid_ioopscap(5)  VALUE 'IOC13',

c_memid_ioopsccf(5)  VALUE 'IOC14',

c_memid_iosoper(5)   VALUE 'IOC15',

c_memid_iosocap(5)   VALUE 'IOC16',

c_memid_iososcap(5)  VALUE 'IOC17',

c_memid_iososccf(5)  VALUE 'IOC18',

c_memid_iosoconf(5)  VALUE 'IOC19',

c_memid_iosogmer(5)  VALUE 'IOC20',

c_memid_iosogomo(5)  VALUE 'IOC21',

c_memid_ioopcomp(5)  VALUE 'IOC22',

c_memid_ioopmst(5)   VALUE 'IOC23',

c_memid_ioopprt(5)   VALUE 'IOC24',

c_memid_ioopconf(5)  VALUE 'IOC25',

c_memid_ioopgmer(5)  VALUE 'IOC26',

c_memid_ioopgomo(5)  VALUE 'IOC27',

c_memid_iomamo(5)    VALUE 'IOC28',

c_memid_iooppreq(5)  VALUE 'IOC29',

c_memid_iooppord(5)  VALUE 'IOC30',

c_memid_iosopreq(5)  VALUE 'IOC31',

c_memid_iosopord(5)  VALUE 'IOC32',

c_memid_iodocl(5)    VALUE 'IOC33',

c_memid_ioopdocl(5)  VALUE 'IOC34',

c_memid_excl_cua(5)  VALUE 'IOC50',

c_memid_refresh(5)   VALUE 'IOC51',

c_memid_komm(5)      VALUE 'IOC52',

c_memid_selkrit(5)   VALUE 'IOC53',

c_memid_tcotx(5)     VALUE 'IOC54',

c_memid_d202(5)      VALUE 'IOC55'.

*--------------------------------------------------------------*

        PERFORM f0001_recherche_info_ordre

                            USING

                               r_matnr

                               r_aufnr

                               r_werks

                               r_dispo

                               r_fevor

                               r_arbpl

                               r_compo

                               r_datdeb

                               r_datfin

                               r_datdeb_ordo

                               w_selid

                               w_selopr

                               ' '  " header_sel

                               ' '  " item_sel

                               c_x  " sequ_sel

                               c_x  " ope_sel

                               ' '

                               c_x  " opcomp_sel

                               ' '

                           CHANGING

                               t_ioheader

                               t_ioitem

                               t_iosequen

                               t_iooper

                               t_ioopcap

                               t_ioopcomp

                               t_iooppreq.

FORM f0001_recherche_info_ordre USING

                     it_matnr  TYPE ty_range_matnr_tab

                     it_aufnr  TYPE ty_range_aufnr_tab

                     it_werks  TYPE ty_range_werks_tab

                     it_dispo   TYPE ty_range_dispo_tab

                     it_fevor   TYPE ty_range_fevor_tab

                     it_arbpl   TYPE ty_range_arbpl_tab

                     it_compo   TYPE ty_range_compo_tab

                     it_datdeb  TYPE ty_range_datdeb_tab

                     it_datfin  TYPE ty_range_datfin_tab

                     it_datdeb_ordo TYPE ty_range_datdeb_tab

                     i_selid      TYPE tj48t-selid

                     i_selopr     TYPE tj48t-selid

                     i_header_sel TYPE char1 " Order header selection

                     i_item_sel   TYPE char1 " Order item selection

                     i_sequen_sel TYPE char1 " Order sequence selection

                     i_oper_sel   TYPE char1 " Order operation selection

                     i_opcap_sel  TYPE char1

                     i_opcomp_sel TYPE char1 " Order component selection

                     i_oppreq_sel TYPE char1   "#EC NEEDED sel DA ordre

         CHANGING    ot_ioheader  TYPE ty_ioheader_tab

                     ot_ioitem    TYPE ty_ioitem_tab

                     ot_iosequen  TYPE ty_iosequen_tab

                     ot_iooper    TYPE ty_iooper_tab

                     ot_ioopcap   TYPE ty_ioopcap_tab

                     ot_ioopcomp  TYPE ty_ioopcomp_tab

                     ot_iooppreq  TYPE ty_iooppreq_tab.

  st_tcoa-header_sel = i_header_sel.

  st_tcoa-item_sel   = i_item_sel.

  st_tcoa-sequen_sel = i_sequen_sel.

  st_tcoa-oper_sel   = i_oper_sel.

  st_tcoa-opcap_sel  = i_opcap_sel.

  st_tcoa-opcomp_sel = i_opcomp_sel.

  EXPORT

      tcoa FROM st_tcoa

      status_tmp FROM  t_status_tmp

      flg_read_from_arch FROM w_flg_read_from_arch

      flg_update FROM w_flg_update

TO MEMORY

      ID c_memid_stcoa.

  SUBMIT ppioc000

* Selektionen

                 WITH  s_aufnr  IN  it_aufnr

                 WITH s_matnr  IN it_matnr

                 WITH s_werks  IN it_werks

                 WITH s_dispo  IN it_dispo

                 WITH s_fevor  IN it_fevor

                 WITH s_compo  IN it_compo

                 WITH s_arbpl  IN it_arbpl

                 WITH p_selid  = i_selid

                 WITH p_selopr = i_selopr

                 WITH s_eckst  IN it_datdeb

                 WITH s_ecken  IN it_datfin

                 WITH s_terst IN it_datdeb_ordo

AND RETURN.

  IMPORT ioheader_tab TO ot_ioheader FROM MEMORY ID c_memid_ioheader.

  IMPORT ioitem_tab   TO ot_ioitem   FROM MEMORY ID c_memid_ioitem.

  IMPORT iosequen_tab TO ot_iosequen FROM MEMORY ID c_memid_iosequen.

  IMPORT iooper_tab   TO ot_iooper   FROM MEMORY ID c_memid_iooper.

  IMPORT ioopcap_tab  TO ot_ioopcap  FROM MEMORY ID c_memid_ioopcap.

  IMPORT ioopcomp_tab TO ot_ioopcomp FROM MEMORY ID c_memid_ioopcomp.

  IMPORT iooppreq_tab TO ot_iooppreq FROM MEMORY ID c_memid_iooppreq.

ENDFORM.               " form f0001_recherche_info_ordre

Read only

Former Member
0 Likes
4,556

Thanks  Jerome,

I modified the above code as per our requirement.
But while Submit PPIOC000 With - - -  and Return.
Its going to Dump with Memory Low run time Fatal error.
-
Ram

Read only

0 Likes
4,556

Hello Ram and if you try to start COOIS with your variant ? do you have this dump ?

I think the amount of data is too higth.

best regards Jerome.

Read only

0 Likes
4,556

Hi Jermoe,
While executing COOIS or ppioc000 , it doesnt take hardly 20 secs.
The output of COOIS when exported to excel, it hardly of 6 MB.

Read only

Former Member
0 Likes
4,556

Hi Jerome,

When I am using
SUBMIT ppioc000
WITH s_werks IN it_werks
WITH p_syst1 = 'DLV'
WITH p_excl1 = 'X'
RETURN.
its going to dump.

And While using....
SUBMIT ppioc000
USING SELECTION-SET 'PROD_ORD'
EXPORTING LIST TO MEMORY AND RETURN.
It remains at the code after execution without any error.
But givs no data after CALL FUNCTION 'LIST_FROM_MEMORY'.
Here the sy-subrc is 1.
-
Ram

Read only

0 Likes
4,556

Hi,

Try this.

    SUBMIT PPIO_ENTRY USING SELECTION-SET 'PROD_ORD'
                                      EXPORTING LIST TO MEMORY
                                      AND RETURN.

Regards,

Danish

Read only

0 Likes
4,556

Hi Ram,

If you call ppioc000 with

SUBMIT ppioc000

USING SELECTION-SET 'PROD_ORD' AND RETURN.

Do you have the dump .

Could you please give me the dump message ?

BR Jerome.

Read only

0 Likes
4,556

Hi Danish,

Its giving the below error -
The addition "EXPORTING LIST TO MEMORY" cannot be used with the
addition "TO SAP-SPOOL".
-
Ram

Read only

0 Likes
4,556

Hi,

Apologies for that. It was by mistake. I have seen the code which you have written. There are are no issues with it.

DATA LIST_TAB TYPE TABLE OF ABAPLIST.

START-OF-SELECTION.

    SUBMIT PROG USING SELECTION-SET 'VARIANT'
              EXPORTING LIST TO MEMORY
              AND RETURN.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      LISTOBJECT = LIST_TAB
    EXCEPTIONS
      NOT_FOUND  = 1
      OTHERS     = 2.

If you are getting SY_SUBRC = 1, then I am definetely sure that the Variant name that you have specified in SUBMIT program either does not exist or is with some different name.

Regards,

Danish.

Read only

0 Likes
4,556

Dear Danish,
How can you be so sure about it...
I myself created the variant.
and it exist with the same name I used in the code.
-
Ram

Read only

0 Likes
4,556

Hello Ram,

It is indeed working perfectly fine on my system.

Further, if the ALV grid contains no rows to display, the function module LIST_FROM_MEMORY contains data which says - List contains no data.

So, the number of records of ALV has nothing to do with this.

The only issue that I thought was of the variant name. This is the reason why I asked you to cross check.

Just try using WITH SELECTION-TABLE instead of SELECTION-SET.

Regards,

Danish.

Read only

0 Likes
4,556

Hi Danish,

I tried other options as well.
I am using 4.6c version and if the ALV output is in classical form, then the same code works fine for any program.

But in case of normal ALV output is not fetching data in LIST_FROM_MEMORY.
What differnt we could code so that it starts exporting data from normal ALV output as well?
-
Ram

Read only

Former Member
0 Likes
4,556

Hi Jerome,
By using the above code, its executing properly without any error and cursor goes to the next line of RETURN.

When we CALL FUNCTION 'LIST_FROM_MEMORY'
                     TABLES
                              listobject = list_tab
                    EXCEPTIONS
                              not_found  = 1
                              OTHERS     = 2.

here no value comes in table list_tab which i have to use in further programing.
-
Ram

Read only

Former Member
0 Likes
4,556

Dear All,

I found a point.
When we use such SUBMIT and RETURN statement with LIST_FROM_MEMORY with T-Codes like FBL5N.
There is option of 'switchlist' in such t-codes and List_from_memory gives sy-subrc eq 0 only when the ALV output is in CLASSICAL format.
If its in noraml ALV, same thing happens as in PPIOC000 case.
Here the sy-subrc is 1 and no data is geting extracted.
I think this is the problem.
How can we resolve this ?
-
Ram

Read only

Former Member
0 Likes
4,556

ALV report with ALV_REUSE_GRID_DISPLAY can not be exported using SUBMIT and RETURN.

ALV with ALV_REUSE_LIST_DISPLAY can only be exported.

Let me know if I am woring.

-
Ram

Read only

Former Member
0 Likes
4,556

Thanks Raymond, Glen, Danish and Jerome for your help.

Read only

0 Likes
4,556

Ram, The code I write is an extract of a productive program and i would know why it don't work for you .

You don't have lines in table after call ?

BR Jerome.

Read only

0 Likes
4,556

Hi Jerome,

With the report 'PPIOC000' I am using below code,

SUBMIT ppioc000
EXPORTING LIST TO MEMORY AND RETURN
USING SELECTION-SET 'PROD_ORD'.

Still same thing is happening.
Its not getting Exported into memory and hence after LIST_FROM_MEMORY no line is coming in the table.
If it picks up the data, it will be of great use....

-
Ram

Read only

0 Likes
4,556

hi, Why you want export the list in memory ?

could you please give me the message of dump you have when you try :

SUBMIT ppioc000

USING SELECTION-SET 'PROD_ORD' AND RETURN.

Sorry for lot of message but i try to understand.

BR Jerome.

Read only

0 Likes
4,556

Hi Jerome,

There is nothing to say sry bro...
Ultimatly it is gonna help me or some else..

Below i have explained in detail,
It will be benificial to us if we get some solution from it...

I am exporting to memory because my code is
...............................................................
CALL FUNCTION 'LIST_FREE_MEMORY'.

SUBMIT ppioc000
EXPORTING LIST TO MEMORY AND RETURN
USING SELECTION-SET 'PROD_ORD'.

  CALL FUNCTION 'LIST_FROM_MEMORY'
       TABLES
            listobject = list_tab
       EXCEPTIONS
            not_found  = 1
            OTHERS     = 2.

  IF sy-subrc = 0.
    CALL FUNCTION 'WRITE_LIST'
         TABLES
              listobject = list_tab.
  ENDIF.

  CALL FUNCTION 'LIST_TO_ASCI'
       EXPORTING
            list_index         = -1
       TABLES
            listasci           = l_ascitab
            listobject         = list_tab
       EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.

  CALL FUNCTION 'LIST_FREE_MEMORY'.
...............................................................

If i use the above code, then no dump is comming its executing but no output.

But if am using the below code :
...............................................................
EXPORT tcoa FROM st_tcoa
         status_tmp FROM  t_status_tmp
         flg_read_from_arch FROM w_flg_read_from_arch
         flg_update FROM w_flg_update
  TO MEMORY ID c_memid_stcoa.

  SUBMIT ppioc000
  WITH s_werks  IN it_werks
  WITH p_syst1 = 'DLV'
  WITH p_excl1 = 'X'
  AND RETURN.
-> DUMP.
  IMPORT ioheader_tab TO p_ty_ioheader_tab
  FROM MEMORY ID c_memid_ioheader.
   ETC.
...............................................................
Message :
Memory low. Leave the transaction before taking a break!
Message no. 00 072

Diagnosis
The memory on your application server is running low.

System Response
You are exclusively using one of the few work processes running on the application server. So that this does not hinder the other users too much, the work process is released if you do not work with it for a few minutes. The system terminates the transaction, causing you to lose data that you previously entered.

Procedure
Continue to work as normal and exit the transaction before you take a long break.

Dump:
The ABAP/4 runtime system and the ABAP/4 compiler use a common
interface to store different types of data in different parts of
the SAP paging area. This data includes the
ABAP/4 memory (EXPORT TO MEMORY), the SUBMIT REPORT parameters,
CALL DIALOG and CALL TRANSACTION USING, as well as internally define
macros (specified with DEFINE).

To store further data in the SAP paging area, you attempted to
allocate a new SAP paging block, but no more blocks were
available.
..........................................................................
Component............ "EM"
Place................ "SAP-Server alstdev_ALD_00 on host alstdev (wp 0)"
Version.............. 37
Error code........... 7
Error text........... "Warning: EM-Memory exhausted: Workprocess gets PRIV "
Description.......... " "
System call.......... " "
Module............... "emxx.c"
Line................. 1650
.........................................................................
002590     IF    tcoa-opcomp_sel = con_x
002600        OR tcoa-opcomp_sel = con_z.
002610       EXPORT IOOPCOMP_TAB     TO MEMORY  ID CON_MEMID_IOOPCOMP.
     >       DESCRIBE TABLE IOOPCOMP_TAB LINES LINES.
002630     ELSE.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,556

As report use Logical database IOC, you could also try to use FM LDB_PROCESS to receive an internal table similar to the one used by the report.

Regards,
Raymond