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

Former Member
0 Likes
924

can any one pls give sample code for submit statement with example

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
830

Here is a sample code for SUBMIT statement which works.

You can use this to fix FBL3N issue.

submit ztest to sap-spool keep in spool 'X'

without spool dynpro

with s_batid in r_batch

with s_mpo in r_mp

and return.

Here S_BATID and S_MPO are select options in selection screen of program ZTEST. These are getting populated by ranges R_BATCH and R_MP.

Hope this will help you.

ashish

5 REPLIES 5
Read only

Former Member
0 Likes
831

Here is a sample code for SUBMIT statement which works.

You can use this to fix FBL3N issue.

submit ztest to sap-spool keep in spool 'X'

without spool dynpro

with s_batid in r_batch

with s_mpo in r_mp

and return.

Here S_BATID and S_MPO are select options in selection screen of program ZTEST. These are getting populated by ranges R_BATCH and R_MP.

Hope this will help you.

ashish

Read only

0 Likes
830

HOW TO POPULATE THE RANGES IN PROGRAM

Read only

Former Member
0 Likes
830

If ur report ZFFMR006A is displaying a ALV grid then it is not possible to avoid the display.

If it is using the ALV LIST or WRITE Sattement then u can avaoid it like this:

DATA: LISTOBJECT LIKE ABAPLIST OCCURS 0 WITH HEADER LINE.

SUBMIT Z48R_PROJEKTSTATUS WITH SO_WWSTO IN SO_WWSTO

WITH SO_ISTAT IN SO_ISTAT

EXPORTING LIST TO MEMORY

AND RETURN.

  • Import the list from memory and store it in table listobject

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LISTOBJECT

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

WRITE 'Error in list_from_memory.'.

ENDIF.

CALL FUNCTION 'LIST_TO_ASCI'

  • EXPORTING

  • LIST_INDEX = -1

TABLES

LISTASCI = LT_TXT

LISTOBJECT = LISTOBJECT

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3.

CHECK SY-SUBRC = 0.

DATA: LV_LINES LIKE SY-TABIX.

DESCRIBE TABLE LT_TXT LINES LV_LINES.

LOOP AT LT_TXT INTO W_TEXTLINE.

CHECK SY-TABIX > 3.

CHECK W_TEXTLINE(5) <> 'Keine'.

CHECK W_TEXTLINE(5) <> '-----'.

DO 120 TIMES. REPLACE ' |' WITH '|' INTO W_TEXTLINE. ENDDO.

"WRITE / w_textline(255).

PERFORM HANDLE_LINE USING W_TEXTLINE.

ENDLOOP.

  • Free memory

CALL FUNCTION 'LIST_FREE_MEMORY'

TABLES

LISTOBJECT = LISTOBJECT

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in list_free_memory.'.

ENDIF.

If useful reward points...

Read only

Former Member
0 Likes
830
REPORT report2. 

DATA: text       TYPE c LENGTH 10, 
      rspar_tab  TYPE TABLE OF rsparams, 
      rspar_line LIKE LINE OF rspar_tab.


rspar_line-selname = 'SELCRIT1'. 
rspar_line-kind    = 'S'. 
rspar_line-sign    = 'I'. 
rspar_line-option  = 'EQ'. 
rspar_line-low     = 'ABAP'. 
APPEND rspar_line TO rspar_tab. 

SUBMIT report1 USING SELECTION-SCREEN '1100' 
               WITH SELECTION-TABLE rspar_tab 
               WITH selcrit2 BETWEEN 'H' AND 'K' 
               AND RETURN.
Read only

Former Member
0 Likes
830

SUBMIT

Syntax

SUBMIT {rep|(name)} [selscreen_options]

[list_options]

[job_options]

[AND RETURN].

Addition:

... AND RETURN

Effect

The SUBMIT statement accesses an executable program rep. The executable program is executed as described under Calling Executable Reports.

The program name rep can either be specified directly or as the content of a character-like data object name. The data object name must contain the name of the program to be accessed in block capitals. If the program specified in name is not found, an irretrievable exception is generated.

The selscreen_options additions can be used to determine the selection screen for the program accessed and to supply it with values.

The list_options additions allow you to influence the output medium and the page size in the basic list for the program accessed.

SUBMIT - selscreen_options

Syntax

... [USING SELECTION-SCREEN dynnr]

[VIA SELECTION-SCREEN]

[selscreen_parameters] ... .

Extras:

1. ... USING SELECTION-SCREEN dynnr

2. ... VIA SELECTION-SCREEN

Effect

The addition USING SELECTION-SCREEN specifies the selection screen, VIA SELECTION-SCREEN specifies whether it is displayed. The additions selscreen_parameters provide values for the parameters, selection criteria, and the free selection of the called selection screen.

The values are transferred to the selection screen between the events INITIALIZATION and AT SELECTION-SCREEN OUTPUT The following hierarchy applies for transferring values:

First, the variant of the addition USING SELECTION-SET is transferred, which sets all parameters and selection criteria to the values of the variant. The values previously set in the called program are overwritten.

The values of the table of the addition WITH SELECTION-TABLE are then transferred. All parameters and selection criteria specified there are overwritten accordingly.

Finally, the values of the additions WITH sel value are transferred. All parameters and selection criteria are overwritten accordingly. If the addition WITH sel value is used more than once for the same parameter, this is overwritten with the last specified value. If the addition WITH sel value is used more than once for the same selection criterion, a selection table with the corresponding number of lines is transferred.

Providing values for free selections is independent of this hierarchy.

Notes

The options for parameter transfer enable a selection screen to be viewed as a parameter interface of an executable program. This applies particularly for background selection screen processing and for parameters and selection criteria that are defined without screen elements using the addition NO-DISPLAY

When transferring data, note that any adjustments made to the screen format, such as abbreviations or the execution of conversion routines, are not executed for fields for which there are no screen elements on the selection screen. This applies for all parameters and selection criteria defined with NO DISPLAY. It also applies for all lines of a selection table with the exception of the first line.

The additions selscreen_parameters only work the first time the called program is executed. If a selection screen is displayed in the called program, the runtime environment calls the program again after it is finished, thereby replacing the values specified in selscreen_parameters with the previous input values.

Addition 1

... USING SELECTION-SCREEN dynnr

Effect

This addition specifies which selection screen is called. dynnr is a data object that must contain the screen number of a selection screen defined in the called program when the SUBMIT statement is called.

If the addition USING SELECTION-SCREEN is omitted or the screen number 1000 is entered, the standard selection screen is called. If no standard selection screen is defined in the called program, no selection screen is called.

If a screen number that is not 1000 is entered in the addition USING SELECTION-SCREEN, the corresponding independent selection screen is called. If no selection screen with this screen number is defined in the called program, this leads to an untreatable exception.

Addition 2

... VIA SELECTION-SCREEN

Effect

If this addition is specified, the selection screen is displayed on the screen. Otherwise, background selection screen processing takes place. In background selection screen processing, the selection screen events are triggered without the selection screen being displayed.

SUBMIT - list_options

Syntax

... [LINE-SIZE width]

[LINE-COUNT page_lines]

{ [EXPORTING LIST TO MEMORY]

| [TO SAP-SPOOL spool_options] } ... .

Extras:

1. ... LINE-SIZE width

2. ... LINE-COUNT page_lines

3. ... EXPORTING LIST TO MEMORY

4. ... TO SAP-SPOOL spool_options

Effect:

These additions affect the basic list in the program accessed. While LINE-SIZE and LINE-COUNT influence the formatting, the other two additions determine the output type of the list.

EXPORTING LIST TO MEMORY saves the list to the ABAP Memory and TO SAP-SPOOL sends it as a print list to the SAP spool system. If you do not specify these additions, the basic list is displayed as a screen list.

Note:

The additions only take effect the first time the program accessed is executed. If a selection screen is displayed in the program accessed, the runtime environment accesses the program again after completion, without taking account of the list_options additions. This is particularly important to the addition TO SAP-SPOOL, because the basic list is displayed as a screen list and not as a print list when the program is accessed again. For this reason, it is advisable not to use the addition VIA SELECTION-SCREEN when using list_options.

Addition 1

... LINE-SIZE width

Addition 2

... LINE-COUNT page_lines

Effect

These additions define the line width and page length of the basic list. They have the same effect as the additions of the same name in the program initiating statement for the program accessed. If the program accessed has the same additions in the program initiating statement, these overwrite the values specified for SUBMIT.

Addition 3

... EXPORTING LIST TO MEMORY

Effect

This addition stores the basic list for the program accessed in the ABAP Memory. It can only be used together with the addition AND RETURN.

The list is stored in the ABAP Memory as an internal table of the row type ABAPLIST, ABAPLIST being a structured data type in the ABAP Dictionary.

The calling program can access the list stored once program access is completed, using function modules belonging to the function group SLST.

The function module LIST_FROM_MEMORY loads the list from the ABAP Memory to an internal table of the row type ABAPLIST.

The function module WRITE_LIST inserts the content of an internal table of the row type ABAPLIST in the current list.

The function module DISPLAY_LIST displays the content of an internal table of the row type ABAPLIST in a separate list screen.

Note

The addition can only work provided the function key Enter is not linked to a function code in the GUI status last defined for the program accessed.

Example

Once the program report has been accessed, the list stored there in the ABAP Memory is read by means of function modules and inserted in the current list.

DATA list_tab TYPE TABLE OF abaplist.

SUBMIT report EXPORTING LIST TO MEMORY

AND RETURN.

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.

Addition 4

... TO SAP-SPOOL spool_options

Effect

This addition causes a new print list level to be opened in the internal session of the program called and assures that the first output statement for the basic list creates a new spool request. All list outputs of the program called are transferred as print lists, page by page, to the SAP spool system. Using the spool_options additions, the print parameters and archiving parameters of the spool request are specified.

Note

It is not possible to switch from the print list to a screen list in the program called. The statement NEW-PAGE PRINT OFF does not work on print list levels created using SUBMIT TO SAP-SPOOL.

Example

Accessing an executable program and creating a spool request.

DATA: print_parameters TYPE pri_params,

archi_parameters TYPE arc_params,

valid_flag(1) TYPE c.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

archive_mode = '3'

IMPORTING

out_parameters = print_parameters

out_archive_parameters = archi_parameters

valid = valid_flag

EXCEPTIONS

invalid_print_params = 2

OTHERS = 4.

IF valid_flag = 'X' AND sy-subrc = 0.

SUBMIT submitable TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

ARCHIVE PARAMETERS archi_parameters

WITHOUT SPOOL DYNPRO.

ENDIF.