‎2008 Mar 27 4:08 PM
Hi Experts,
Pls. clarify me that,
My requitrement:
My Z prog.'s CONTROL wuld go to Standard SAP Prog. together with SELECTION CRITERIA by using the SUBMIT statement, so, from there I wanna to get/EXPORT/fetch the SAP processed ITAB to my Z prog. and so that, in Z prog. will customise/process it for my_ALV
So, I know there is EXPORT LIST TO MEMORY, but, I dont wanna LIST.
So, I got the folllwoing things from SAP HELP, so, pls. let me know that, Which wuld serve my requirement?
1. EXPORT obj1 ... objn TO DATA BUFFER f.
2. EXPORT obj1 ... objn TO INTERNAL TABLE itab.
2. EXPORT obj1 ... objn TO MEMORY.
3. EXPORT obj1 ... objn TO SHARED MEMORY itab(ar) ID key.
4. EXPORT obj1 ... objn TO SHARED BUFFER itab(ar) ID key.
5. EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
6. EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.
7. EXPORT (itab) TO ... .
thanq
‎2008 Mar 27 4:28 PM
either the SAP program is foreseen to export some data to memory, in this case you can get the exported data with IMPORT FROM MEMORY using the same memory ID
if the SAP program does not export data, you only can get the list generated by the program using the addition EXPORT LIST TO MEMORY
‎2008 Mar 27 4:28 PM
either the SAP program is foreseen to export some data to memory, in this case you can get the exported data with IMPORT FROM MEMORY using the same memory ID
if the SAP program does not export data, you only can get the list generated by the program using the addition EXPORT LIST TO MEMORY
‎2008 Mar 27 8:58 PM
u can use this EXPORT t_submit TO MEMORY ID 'MD1'
here ia an example for that
*"Table declarations...................................................
TABLES:
spfli, " Flight schedule
sflight. " Flight
*"Selection screen elements............................................
SELECTION-SCREEN BEGIN OF BLOCK blck WITH FRAME TITLE text-001.
SELECT-OPTIONS:
s_carrid FOR spfli-carrid.
SELECTION-SCREEN END OF BLOCK blck.
*" Type declarations...................................................
"----
Type declaration of the structure to hold flight schedule details *
"----
TYPES:
BEGIN OF type_s_spfli,
carrid LIKE spfli-carrid, " Airline Code
connid LIKE spfli-connid, " Flight Connection Number
cityfrom LIKE spfli-cityfrom, " Departure city
cityto LIKE spfli-cityto, " Arrival city
deptime LIKE spfli-deptime, " Departure time
arrtime LIKE spfli-arrtime, " Arrival time
END OF type_s_spfli.
"----
Type declaration of the structure to hold flight details *
"----
TYPES:
BEGIN OF type_s_sflight,
carrid LIKE sflight-carrid, " Airline Code
connid LIKE sflight-connid, " Flight Connection Number
fldate LIKE sflight-fldate, " Flight date
price LIKE sflight-price, " Airfare
currency LIKE sflight-currency, " Local currency of airline
END OF type_s_sflight.
"----
Type declaration of the structure to hold booking details *
"----
TYPES:
BEGIN OF type_s_sbook,
carrid LIKE sbook-carrid, " Airline Code
connid LIKE sbook-connid, " Flight Connection Number
fldate LIKE sbook-fldate, " Flight date
bookid LIKE sbook-bookid, " Booking number
customid LIKE sbook-customid, " Customer Number
END OF type_s_sbook.
*" Data declarations...................................................
"----
Header line to hold flight details *
"----
DATA
fs_spfli TYPE type_s_spfli.
"----
Header line to hold flight details *
"----
DATA
fs_sflight TYPE type_s_sflight.
"----
Header line to hold flight details *
"----
DATA
fs_submit TYPE type_s_sflight.
"----
Header line to hold booking details *
"----
DATA
fs_sbook TYPE type_s_sbook.
"----
Internal table to hold flight details *
"----
DATA
t_spfli TYPE
STANDARD TABLE
OF type_s_spfli.
"----
Internal table to hold flight details *
"----
DATA
t_sflight TYPE
STANDARD TABLE
OF type_s_sflight.
"----
Internal table to hold flight details *
"----
DATA
t_submit TYPE
STANDARD TABLE
OF type_s_sflight.
"----
Internal table to hold booking details *
"----
DATA
t_sbook1 TYPE
STANDARD TABLE
OF type_s_sbook.
*"Variable Declarations................................................
DATA:
w_check TYPE c,
w_flag TYPE c.
"----
START-OF-SELECTION *
"----
START-OF-SELECTION.
IMPORT w_flag FROM MEMORY ID 'SET'.
IF w_flag IS INITIAL.
SET PF-STATUS 'SPF1'.
PERFORM get_data_spfli.
ENDIF. " IF w_flag IS INITIAL.
"----
END-OF-SELECTION *
"----
END-OF-SELECTION.
IF w_flag IS INITIAL.
PERFORM display_output_spfli.
ELSE.
PERFORM display_output_sbook.
ENDIF. " IF w_flag IS INITIAL.
"----
AT LINE-SELECTION *
"----
AT LINE-SELECTION.
PERFORM get_data_sflight.
"----
AT USER-COMMAND *
"----
AT USER-COMMAND.
PERFORM get_data_sflight1.
"----
TOP-OF-PAGE *
"----
TOP-OF-PAGE .
PERFORM display_header.
"----
TOP-OF-PAGE DURING LINE-SELECTION *
"----
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM display_list_header.
&----
*& Form get_data_spfli *
&----
This subroutine retrives necessary data from floght schdule table. *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM get_data_spfli .
SELECT carrid " Airline Code
connid " Flight Connection Number
cityfrom " Departure city
cityto " Arrival city
deptime " Departure time
arrtime " Arrival time
INTO TABLE t_spfli
FROM spfli
WHERE carrid IN s_carrid.
CHECK sy-subrc NE 0.
MESSAGE e012(zmsg9) .
ENDFORM. " get_data_spfli
&----
*& Form display_output_spfli *
&----
This subroutine displays the output data. *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM display_output_spfli .
LOOP AT t_spfli INTO fs_spfli.
WRITE:/1(85) '' ,
3 w_check AS CHECKBOX ,
6 fs_spfli-carrid ,
14 fs_spfli-connid ,
23 fs_spfli-cityfrom ,
41 fs_spfli-cityto ,
62 fs_spfli-deptime ,
72 fs_spfli-arrtime .
HIDE fs_spfli-connid.
ENDLOOP. " LOOP AT t_spfli INTO
ULINE.
ENDFORM. " display_output_spfli
&----
*& Form display_output_sbook *
&----
This subroutine displays the output data. *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM display_output_sbook .
IMPORT t_sbook1 FROM MEMORY ID 'MD2'.
FREE MEMORY ID 'SET'.
LOOP AT t_sbook1 INTO fs_sbook.
WRITE:/1(85) '' ,
6 fs_sbook-carrid ,
14 fs_sbook-connid ,
23 fs_sbook-fldate ,
41 fs_sbook-bookid ,
62 fs_sbook-customid .
ENDLOOP.
ULINE.
ENDFORM. " display_output_sbook
&----
*& Form get_data_sflight1 *
&----
This subroutine retrives necessary data from sflight table. *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM get_data_sflight1 .
DATA:
lw_lines TYPE i,
lw_head TYPE i.
REFRESH t_submit.
DESCRIBE TABLE t_spfli LINES lw_lines.
lw_head = lw_lines + 4.
DO lw_head TIMES.
READ LINE sy-index FIELD VALUE w_check
fs_spfli-carrid
fs_spfli-connid.
IF w_check EQ 'X'.
SELECT carrid " Airline Code
connid " Flight Connection Number
fldate " Flight date
price " Airfare
currency " Local currency of airline
INTO TABLE t_sflight
FROM sflight
WHERE connid = fs_spfli-connid.
LOOP AT t_sflight INTO fs_sflight.
APPEND fs_sflight TO t_submit.
ENDLOOP.
ENDIF.
w_check = ' '.
ENDDO.
EXPORT t_submit TO MEMORY ID 'MD1' .
*SUBMIT yh1061_030501_submit
AND RETURN* .
ENDFORM. " get_data_sflight1
&----
*& Form display_header *
&----
This subroutine displays Header Information. *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM display_header .
WRITE: 'List of Available Flights With Booking.'.
ULINE.
WRITE:/1(85) '' COLOR 1,
3 'Carr.ID' COLOR 1,
12 'Conn.ID' COLOR 1,
20 'From' COLOR 1,
40 'To' COLOR 1,
60 'Depart' COLOR 1,
70 'Arrive' COLOR 1.
ULINE.
ENDFORM. " display_header
&----
*& Form display_list_header *
&----
This subroutine displays list Header Information. *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM display_list_header .
CASE sy-lsind.
WHEN 1.
ULINE.
WRITE:/1(75) '' ,
12 'Carr.ID' COLOR 1,
24 'Conn.ID' COLOR 1,
36 'Flight date' COLOR 1,
58 'Price' COLOR 1,
70 'Currency' COLOR 1.
ULINE.
ENDCASE.
ENDFORM. " display_list_header
reward if helpful
raam
‎2008 Mar 27 9:15 PM
How Can I write a EXPORT statement in calling SATNDARD SAP prog., Its not allowed!!!!! right?
thanq
‎2008 Mar 27 9:43 PM
the example what i gave is to call other program and export the table data to that program and display the data.
but if u want to export the data to the standard program u need to have the accesskey to change the program because u need to write IMPORT statement in the standard program.
if u have the accesskey we can change the standard program.
reward if helpful
raam
‎2008 Mar 27 10:33 PM
thanq.
ur correct.
but, my requirement is in reverse. I need to write EXPORT in SAP prog.
I hv access key, but, obviously, client do not accept for it. I copied it to a my_Z, but hectic.
thanq