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 Statement

Former Member
0 Likes
603

Hi,

I am passing selection table in the submit statement using a struct of type rsparams.

now in the program that im calling using Submit statment,i want to know how to use that selection table.

Also can anyone tell me how to use Export Import statement for passing internal tables.

Answers will be rewarded,

Regards,

Rohan

6 REPLIES 6
Read only

Former Member
0 Likes
575

Hi Rohan,

You can use a FM to capture values of the selection-screen,

example,,

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

EXPORTING

CURR_REPORT = L_REPID

TABLES

SELECTION_TABLE = T_SELECT

EXCEPTIONS

NOT_FOUND = 1

NO_REPORT = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

<b>

Where T_SELECT is table of type RSPARAMS.

using SUBMIT....</b>

SUBMIT <program name> USING SELECTION-SCREEN 1000

WITH SELECTION-TABLE <b>T_SELECT</b>.

<b>Reward points if this helps,</b>

Kiran

Read only

Former Member
0 Likes
575

Refer the following programs to pass internal tabes between programs:

report  z_82235_test1                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

wa1-a = '1'.
wa1-b = '2'.
append wa1 to itab1.
clear wa1.

wa1-a = '3'.
wa1-b = '4'.
append wa1 to itab1.
clear wa1.


export itab1 to memory id '001'.
export itab2 to memory id '002'.

submit z_82235_test2 and return exporting list to memory .


import itab1 from memory id '003'.
import itab2 from memory id '004'.

write:/ 'ITAB1'.
loop at itab1 into wa1.
write : / wa1-a, wa1-b.
clear: wa1.
endloop.

write:/ 'ITAB2'.
loop at itab2 into wa2.
write : / wa2-c, wa2-d.
clear: wa2.
endloop.



report  z_82235_test2                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

import itab1 from memory id '001'.
import itab2 from memory id '002'.

itab2[] = itab1[].

wa1-a = 'a'.
wa1-b = 'b'.
append wa1 to itab1.
clear wa1.




export itab1 to memory id '003'.
export itab2 to memory id '004'.

Read only

Former Member
0 Likes
575

HI,

Chk this sample.

*Code used to populate 'select-options' & execute report  
DATA: seltab type table of rsparams,
      seltab_wa like line of seltab.

  seltab_wa-selname = 'PNPPERNR'.
  seltab_wa-sign    = 'I'.
  seltab_wa-option  = 'EQ'.

* load each personnel number accessed from the structure into
* parameters to be used in the report
  loop at pnppernr.
    seltab_wa-low = pnppernr-low.
    append seltab_wa to seltab.
  endloop.
  SUBMIT zreport with selection-table seltab
                                via selection-screen.

Regards

Reshma

Read only

former_member189059
Active Contributor
0 Likes
575

Hello Rohan...

to export a table use the following

DATA: wa_indx TYPE indx.

  EXPORT tab = itab TO DATABASE indx(xy) FROM wa_indx CLIENT
  SY-MANDT
  ID 'DETAILLIST'.

  • to import use this


* imports from database the list sent by the calling program
  IMPORT tab = itab FROM DATABASE indx(xy) TO wa_indx CLIENT sy-mandt
  ID 'DETAILLIST'.

* deletes the data to save wastage of memory
  DELETE FROM DATABASE indx(xy)
    CLIENT sy-mandt
    ID 'DETAILLIST'.

Read only

Former Member
0 Likes
575

Hi Rohan,

In the main program use the following to export to memory,

DATA: wa_indx TYPE indx.

EXPORT tab = ITAB2 TO DATABASE indx(xy) FROM wa_indx

CLIENT sy-mandt ID '<enter a 4 letter ID>'.

where ITAB2 is the internal table you want to pass, don't forget to mention the ID.

Now in the submitted program use the following code to import,

DATA: wa_indx TYPE indx.

import tab = ITAB from database indx(xy) to wa_indx CLIENT sy-mandt

id '<enter a 4 letter ID>'.

ITAB is the table into which the data will get imported, it should have the same structure

as the exported table.

Here use the same ID as used to EXPORT.

Once you're done with the import, delete the table from memory.

delete from database indx(xy) client sy-mandt id '<enter a 4 letter ID>'.

Regards,

Samson Rodrigues.

Read only

Former Member
0 Likes
575

You need to fill field name on the selection-screen and the values which u want on selection-screen for these fields..

You have to make sure that all required fields are appended to the table of type RSPARAMS...

regards

Prax