‎2008 Dec 26 9:45 AM
I try to implement a senario . one is to output some data, another is used to execute the former one, import the result into memory, then read the data. but I can't get the correct code for submit? could you please give me a hand ?
**********************************
REPORT ZGUO.
tables: vbak.
types: begin of w_vbak,
VBELN like vbak-VBELN,
AUART like vbak-AUART,
end of w_vbak.
data: t_vbak type w_vbak occurs 0 with header line.
select-options : S_VBELN FOR vbak-VBELN obligatory.
select-options : S_AUART FOR vbak-VBELN .
select * from vbak into corresponding fields of table t_vbak
where VBELN in S_VBELN.
* where VBELN in S_VBELN and AUART in S_AUART.
write: sy-subrc , /.
loop at t_vbak.
write: t_vbak-VBELN, / t_vbak-AUART , /.
endloop.
*****************************************************
******************program 2*********************
*&---------------------------------------------------------------------*
*& Report ZGUO1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZGUO1.
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
seltab_wa-selname = 'S_VBELN'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'.
seltab_wa-low = '4969'.
append seltab_wa to seltab .
*
** SUBMIT ZGUO with selection-table seltab via SELECTION-SCREEN .
*
**SUBMIT ZGUO and return.
** SUBMIT ZGUO via SELECTION-SCREEN .
*submit ZGUO .
DATA BEGIN OF itab_list OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF itab_list.
DATA: BEGIN OF vlist OCCURS 0,
filler1(01) TYPE c,
field1(06) TYPE c,
filler(08) TYPE c,
field2(10) TYPE c,
filler3(01) TYPE c,
field3(10) TYPE c,
filler4(01) TYPE c,
field4(3) TYPE c,
filler5(02) TYPE c,
field5(15) TYPE c,
filler6(02) TYPE c,
field6(30) TYPE c,
filler7(43) TYPE c,
field7(10) TYPE c,
END OF vlist.
*SUBMIT ZGUO EXPORTING LIST TO MEMORY and return with selection-table seltab.
*SUBMIT ZGUO EXPORTING LIST TO MEMORY with selection-table seltab.
SUBMIT zreport EXPORTING LIST TO MEMORY.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = vlist
listobject = itab_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc NE '0'.
WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
ENDIF.
***************program 2*********************
some piece of program is copied directly from internet, but as I tried to exceute the second program, I got some error. could you please help to tell where I am wrong?
Thank you very much!!!
Code Formatted by: Alvaro Tejada Galindo on Dec 26, 2008 10:45 AM
‎2008 Dec 26 9:55 AM
Hi
Please be clear of which program you want to submit.
One program is known as Called Program and the other Calling Program.
This is a straight forward process.
Use Key word SUBMIT . For more info take F1 help on the key word
if you want to pass data from one program to other you can use key words
IMPORT and EXPORT
The Key word help very clear and Self Explanatory
IF you find any syntax error, the F1 help is always there to help you and moreover the syntax check helps you aswell
Regards
Ramchander Rao.K
Edited by: Ramchander Krishnamraju on Dec 26, 2008 10:56 AM
‎2008 Dec 26 9:55 AM
Hi
Please be clear of which program you want to submit.
One program is known as Called Program and the other Calling Program.
This is a straight forward process.
Use Key word SUBMIT . For more info take F1 help on the key word
if you want to pass data from one program to other you can use key words
IMPORT and EXPORT
The Key word help very clear and Self Explanatory
IF you find any syntax error, the F1 help is always there to help you and moreover the syntax check helps you aswell
Regards
Ramchander Rao.K
Edited by: Ramchander Krishnamraju on Dec 26, 2008 10:56 AM
‎2008 Dec 26 9:58 AM
HI..
Create variant and pass it to Submit.
SUBMIT 'program_name' USING SELECTION-SET 'Variant'.
Regards.
Jay
‎2008 Dec 26 5:22 PM
Hello Sony,
As I understand from your code you want to call ZGUO from ZGUO1 and make use of ZGUO output. In ZGUO you have S_VBELN as obligatory so you need to go with the via selection screen or have passed values to S_VBELN and use variant.
Please have a look at SAP help for using OPTIONS for submit
http://help.sap.com/saphelp_nw70/helpdata/EN/9f/db9dd035c111d1829f0000e829fbfe/content.htm
Thank you,
Nishikant.