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

How to do submit with parameter?

Former Member
0 Likes
2,695

Hi,

I would like to pass some data from Program A to Program B.

How do i do a submit statement with parameter from Program A to pass data to Program B.

How do i grab the data from Program B that was pass by Program A?

Regards,

Rayden

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,490

HEllo,

DO like this.


  SUBMIT  B WITH SO_PROJ IN SO_PROJ
                             WITH SO_PSP IN SO_PSP
                             WITH SO_WWSTO IN SO_WWSTO
                             WITH SO_WWGFG IN SO_WWGFG
                             WITH SO_ISTAT IN SO_ISTAT
                             WITH SO_ESTAT IN SO_ESTAT
                             EXPORTING LIST TO MEMORY
                             AND RETURN.
" Ouptut from Report B.

 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'
       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_ZSTATUS USING W_TEXTLINE.
  ENDLOOP.

* Free memory
  CALL FUNCTION 'LIST_FREE_MEMORY'.

Cheers,

Vasanth

9 REPLIES 9
Read only

Former Member
0 Likes
2,491

HEllo,

DO like this.


  SUBMIT  B WITH SO_PROJ IN SO_PROJ
                             WITH SO_PSP IN SO_PSP
                             WITH SO_WWSTO IN SO_WWSTO
                             WITH SO_WWGFG IN SO_WWGFG
                             WITH SO_ISTAT IN SO_ISTAT
                             WITH SO_ESTAT IN SO_ESTAT
                             EXPORTING LIST TO MEMORY
                             AND RETURN.
" Ouptut from Report B.

 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'
       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_ZSTATUS USING W_TEXTLINE.
  ENDLOOP.

* Free memory
  CALL FUNCTION 'LIST_FREE_MEMORY'.

Cheers,

Vasanth

Read only

0 Likes
2,490

Hi Vasanth,

I'm trying to avoid memory. Is there any other way instead of using memory. By using memory, will it cause some inconsistency when there is multiple concurrency running on the program?

Regards,

Rayden

Read only

Former Member
0 Likes
2,490

You can pass data by using EXPORT/IMPORT Memory or by using SET/GET Parameter ID.

also,

SUBMIT zreport with p_param1 = 'value'

with p_param2 = 'value'.

p_param1 and p_param2 are parameters in zreport program.

Read only

0 Likes
2,490

Hi Vasu,

I try the suggestion, it seem that it doesn't work. Any other alternative?

Regards,

Rayden

Read only

Former Member
0 Likes
2,490

hi rayden,

do like this

SUBMIT PROGB WITH sel1 value1 AND RETURN.

<b>Reward for helpful answers</b>

Satish

Read only

0 Likes
2,490

Hi Satish,

I doing both Screen A and B as dialog screen. Screen A have a textbox name TBA, Screen B have a textbox name TBB. I need to enter some value in TBA and after which by pressing execute. The value will be pass over to TBB. How to do that without using memory?

Any sample code?

Regards,

Rayden

Read only

Former Member
0 Likes
2,490

hi

good

U can use the SUBMIT report WITH SELECTION-TABLE itab.

Here itab needs to be of type rspar.

Itab has the structure:

SELNAME (length 8),

KIND (length 1),

SIGN (length 1),

OPTION (length 2),

LOW (length 45),

HIGH (length 45).

U fill the itab with the parameters or select-options of the report to be called and the corresponding values and then submit it.

reward point if helpful.

thanks

mrutyun^

Read only

Former Member
0 Likes
2,490

Hi ,

follow this sample code ...

data: seltab type table of rsparams,

dispo_tab like line of seltab.

dispo_tab-selname = 'S_DISPO'.

dispo_tab-sign = s_dispo-sign.

dispo_tab-option = s_dispo-option.

loop at s_dispo.

dispo_tab-low = s_dispo-low.

dispo_tab-high = s_dispo-high.

append dispo_tab to seltab.

endloop.

  • S_DISPO is select options

*P_DAYS is parameters

submit zreport with p_days eq p_days

with selection-table seltab.

Read only

Former Member
0 Likes
2,490

Hi,

First, you can check the syntax of submit. Then you can understand, which parameters can pass.

<b>SUBMIT</b>

Calls an executable program of type 1.

Syntax

SUBMIT <rep> [AND RETURN] [VIA SELECTION-SCREEN]

[USING SELECTION-SET <var>]

[WITH <sel> <criterion>]

[WITH FREE SELECTIONS <freesel>]

[WITH SELECTION-TABLE <rspar>]

[LINE-SIZE <width>]

[LINE-COUNT <length>].

Calls the program <rep>. If you omit the AND RETURN addition, the current program is terminated. Otherwise, the data from the current program is retained, and processing returns to the calling program when <rep> has finished running. The other additions control the selection screen and set attributes of the default list in the called program.

Regards,

Bhaskar