‎2007 Oct 26 11:37 AM
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
‎2007 Oct 26 11:39 AM
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
‎2007 Oct 26 11:39 AM
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
‎2007 Oct 29 10:49 AM
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
‎2007 Oct 26 11:39 AM
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.
‎2007 Oct 29 10:50 AM
Hi Vasu,
I try the suggestion, it seem that it doesn't work. Any other alternative?
Regards,
Rayden
‎2007 Oct 26 11:43 AM
hi rayden,
do like this
SUBMIT PROGB WITH sel1 value1 AND RETURN.
<b>Reward for helpful answers</b>
Satish
‎2007 Oct 29 10:53 AM
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
‎2007 Oct 26 11:48 AM
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^
‎2007 Oct 26 11:54 AM
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.
‎2007 Oct 26 12:09 PM
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