EXPORTING LIST TO MEMORY / LIST_FROM_MEMORY / LIST_TO_ASCI ?
Hi Guys
I am trying to export a list to memory with the help of function module LIST_FROM_MEMORY downloading it from the memory. But its not in readable format. Then i am LIST_TO _ASCI functionmodule and i am pulling data into internal table..
when i am doing this there are some fields are blank. i am not getting the one field value ?
can anyone explain me ?
Thanks in advance ..
because it was blank or initial in database or in the list?
Similar Messages
-
Will SUBMIT report EXPORTING LIST TO MEMORY work, when Run in Background?
You can use SUBMIT <report> EXPORTING LIST TO MEMORY, and then Call the FM LIST_FROM_MEMORY to get the Data.
This works fine, when the Program is Run in Foreground. My question is, will it work when I Run the Program in Background? i.e. When I Run the Program in Background, will the SUBMIT Statement, Export the List to Memory? Because only then the FM LIST_FROM_MEMORY will get the Data.
Any alternate solution to meet the same requirement will be appreciated.It works for me... my spool output looked like:
11.01.2008 JC: Calling program - test list to memory 1
ZLOCAL_JC_SDN_CALLING_PROGRAM started at 12:54:29
ZLOCAL_JC_SDN_CALLING_PROGRAM call complete 12:54:30
ZLOCAL_JC_SDN_CALLING_PROGRAM started at 12:54:30
11.01.2008 JC: Called program - testing list to memory
ZLOCAL_JC_SDN_CALLED_PROGRAM was called at: 12:54:29
for the following code:
report zlocal_jc_sdn_calling_program.
parameters:
p_start(1) type c.
start-of-selection.
perform testcase.
*& Form testcase
form testcase.
data:
lt_list type table of abaplist.
write: / sy-repid, 'started at', sy-uzeit.
submit zlocal_jc_sdn_called_program
exporting list to memory
and return.
write: / sy-repid, 'call complete', sy-uzeit.
call function 'LIST_FROM_MEMORY'
tables
listobject = lt_list.
write: / sy-repid, 'started at', sy-uzeit.
call function 'WRITE_LIST'
tables
listobject = lt_list.
endform. "testcase
and
report zlocal_jc_sdn_called_program.
start-of-selection.
write: / sy-repid, 'was called at:', sy-uzeit. -
Submit ALV report in Background & exporting list to memory and return
Dear all,
I created one Z program (ZPROGRAM2).
Here i use SUBMIT ZPRORAM1_ALV exporting list to memory and return.
call function 'LIST_FROM_MEMORY'.
call function 'TABLE_COMPRESS' .
ZPRORAM1_ALV output i send mail.
This all are working in foreground.
If i schedule ZPROGRAM2 in background. that SUBMIT ZPRORAM1_ALV statement not working.
Please give me the Solution.
Thanks,
Durai.VIt is because of the ALV output that you are using. Check the condition sy-batch = 'X' (background processing) and then display a classical report. It will work then.
Thanks,
Jayant -
Need help in Exporting list to memory and return in background
Hello Experts,
I have a program which reads data from mc.9 by exporting list to memory.When I run it in foreground its working fine . However if I schedule it as a background program it is unable to get list from memory.
Any help will be appreciable.
Thank youHi jayaram,
I tried to do as you said. Its creating spool request and status to completed (sm37 instead of sm36 bcoz i don't hv authorization in production server). Now I didn't see any errors in job log. But data coming to ztable is as usual ( all are ZEROS).
Hey when i tried doing it as below
SUBMIT RMCB0300 WITH SL_WERKS-LOW = P_WERKS
WITH SL_LGORT = 'W001'
WITH SL_SPMON-LOW = P_FPERIOD
WITH SLV_NO = 'MC.9N'
WITH SL_SPMON-HIGH = P_FPERIOD EXPORTING LIST TO MEMORY AND RETURN .
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = LISTOBJECT
EXCEPTIONS
NOT_FOUND = 4
OTHERS = 8.
IF SY-SUBRC <> 0.
if SY-SUBRC = 4.
message 'not_found' type 'i'.
ELSEIF SY-SUBRC = 8.
message 'others' type 'a'.
endif.
ENDIF.
I found that my job with completed status but with in job log i found error of type I means that the error is with notfound type in exceptions.
Hey sorry for the postings may be due to some issues Im unable to see what i have replied in postings that's why im posting repeatedly..
Edited by: Praveen Pathuri on Apr 23, 2009 7:30 AM
Edited by: Praveen Pathuri on Apr 23, 2009 7:55 AM -
"EXPORTING LIST TO MEMORY" doesn't work
Hi experts!
In my program I need to update a vew deliveries using transaction VT04 and get from log numbers of updated deliveries. My code is:
SUBMIT RV56TRGN USING SELECTION-SET 'VAN SALE/VT04'
EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
I get error:
"Set screen is not allowed in subscreens"
But when I run code:
SUBMIT RV56TRGN USING SELECTION-SET 'VAN SALE/VT04' AND RETURN.
It runs OK.
Where may be the problem?test
-
Problems with SUBMIT and EXPORTING LIST TO MEMORY
Hi,
I have a program that executes another report using a submit call, then the output of this submit is retrieved to the program using the LIST_TO_MEMORY FM. Source code it's something like this:
SUBMIT rptime00
EXPORTING LIST TO MEMORY AND RETURN
WITH SELECTION-TABLE t_params
USER 'my_user'.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = t_table
EXCEPTIONS
not_found = 1
OTHERS = 2.
This code works fine if I execute the program in foreground. But when I try to execute the report in background (F9 instead of F8 for example), submit works fine but LIST_FROM_MEMORY returns a NOT FOUND exception instead of the output of submitted program.
So, is it possible to retrieve the output of a program called via submit when the report that executes the submit is executed in background?, how can I retrieve the output of submit when the report is executed in background?
thanks in advancetry
SUBMIT rptime00
EXPORTING LIST TO MEMORY AND RETURN
WITH SELECTION-TABLE t_params.
without user
hope that helps
Andreas -
Submit and return exporting list to memory is not working in background
Hi gurus,
i am using submit statement and exporting list to memory. it works fine in foreground and i am able to get the output. but in case of background , it is not exporting the list.PLease help me on this.
Thanks and regards,
RajeshwarHello Rajeshwar,
This is a duplicate thread. You have a thread with the same question.
[list_to_memory is not working in background;
Jayant Sahu -
Submit program exporting list to memory and return in background
Dear Experts,
I am using the following code in one of my program to get opening and closing stock of a material.
SUBMIT RM07MLBD
WITH MATNR IN LOC_R_MATNR
WITH WERKS IN LOC_R_WERKS
WITH DATUM IN LOC_R_DATE
WITH PA_SUMFL = WL_X
AND RETURN
EXPORTING LIST TO MEMORY.
The program is working fine when executed in foreground. however when executed in background the job is cancelled. I tried to debug in background through SM50 and found that the program is terminated(No short dump but debug screen is closed and i dont see this program running in SM50) when the above code is executed.
I found in the forum that when an ALV report is submitted in background it does not work. In my case the standard program is producing an ALV list (not ALV grid though).
How would i avoid this situation because the program i am submitting is a standard program.
What is the best solution to avoid from background jobs being cancelled when the above code is executed. Is there an alternate way that i can use to submit the program and get data.
Thanks in advance.
Rajesh.Hi Rajesh,
Just excute your standard program with the same input in back ground mode and check
out put is coming or not .
If output is not coming search by sy-batch and make the break points there and Ideantify
the problem.
When you execute the standard program in back ground mode If the output is come it should in your Zreport also.
I tried in my system in background mode also the output is coming for me.
Thnx,
Sam. -
How to call list from memory after submitting RCS13001
Can anyone help me with this problem? I am submitting RCS13001 and using option exporting list to memory and return. It was successfully displayed the ALV list (which I don't want to see) and return to the caller program. Then when calling function list_from_memory, it short dumped/returned nothing. It seems that nothing is saved in the memory when submitting the program.
So what I want to get now is call RCS13001 and process the data, don't display the ALV report but save it in memory, and then collect the memory for output.
Any help is appreciated and points awarded. Thanks in advance
Regards,
Eric
Code:
SUBMIT ZRCS13001
WITH PM_MTNRV INCL v_matnr
WITH PM_WERKS INCL p_werks
WITH PM_STLAL INCL p_stlal
WITH PM_CAPID INCL p_capid
WITH PM_DATUV INCL p_datuv
WITH PM_EMENG INCL v_emeng
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = alv_stb
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2Hi Eric,
Please check Rich's sample code.
report zrich_0003 .
data: begin of listout occurs 0,
line(1024) type c,
end of listout.
* Submit the report and export list to memory
submit z_your_report exporting list to memory
and return.
* Get list from memory and convert to ascii
perform retrieve_list_from_memory tables listout.
loop at listout.
write:/ listout.
endloop.
* RETRIEVE_LIST_FROM_MEMORY
form retrieve_list_from_memory tables reportlines.
data: list like abaplist occurs 0 with header line.
data: txtlines(1024) type c occurs 0 with header line.
clear list. refresh list.
clear reportlines. refresh reportlines.
call function 'LIST_FROM_MEMORY'
tables
listobject = list
exceptions
not_found = 1
others = 2.
check sy-subrc = 0.
call function 'LIST_TO_ASCI'
tables
listobject = list
listasci = txtlines
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
check sy-subrc = 0.
reportlines[] = txtlines[].
call function 'LIST_FREE_MEMORY'.
endform.
Also please check this link for more sample codes.
http://www.sapdevelopment.co.uk/reporting/rep_submit.htm
Regards,
Ferry Lianto
Please reward points if helpful. -
EXPORT l_werks to memory id 'MEM1'
HI gurus,
I am struck in from many days..
I have a program which posts data using IDOCS.
the code below
Export l_werks into memory id 'MEM1'.
Then the IDOC FM IDOC_INPUT_* ( which in turns calls the inbound IDOC FM ) is called and it posts the data into application (its an inbound process).
This code is written in program ZPAG_PROGRAM1, the data of werks is passed to business area and idocs are created and when we check the transaction the werks is copied to business area. All this works well good.
Now if I copy the program ZPAG_PROGRAM1 to ZPAG_PROGRAM 2, the idoc fails and the werks is not copied to business area field.
Its importan t for me please throw some idea. I check the USER_EXITS in the IDOC_INPUT* and Inbound IDOC FM there is no code related to the import filed.
Export is done in the program1, ther should be IMPORT some where.. where can I find this?
Plea se He lp .
regards,
NazeerHello Nazeer,
I guess there is no foolproof way of find the exact import statement for a corresponding export statement. As already suggested you could use RPR_ABAP_SOURCE_SCAN with the memord id as the search term. Also you can get the list of programs loaded in the ABAP stack by running the actual program and have a search in those programs for the memory id.
Vikranth -
Export t_temp to memory id 'Y2'.
i used these export and import parameters in my program !!
this is the export syntax..
export t_temp to memory id 'Y2'.
refresh t_temp.
import t_temp from memory id 'Y2'.
delete from memory id 'Y2'.
when I'm not passing any values in the export the import parameter is still picking the previous value..
the export parameter is empty but the import parameter is still having one record
How to delete the memory...to export, use the following
DATA: wa_indx TYPE indx.
EXPORT tab = itab TO DATABASE indx(xy) FROM wa_indx CLIENT
SY-MANDT
ID 'DETAILLIST'.
to import use this
imports from database the list sent by the calling program
IMPORT tab = itab FROM DATABASE indx(xy) TO wa_indx CLIENT sy-mandt
ID 'DETAILLIST'.
deletes the data to save wastage of memory
DELETE FROM DATABASE indx(xy)
CLIENT sy-mandt
ID 'DETAILLIST'. -
Export / Import to memory Id 2 . ( Unicode System)
hi all ,
we get unicode syntax error for the statement
EXPORT d1200 TO MEMORY ID 2.
Error discription is -
2 must be a character-type field (data type C, N, D, or T) . "INTERFACE".
We get similar error in import statement as well.
Please refer this code ..........
DATA: BEGIN OF d1200,
form LIKE mard-matnr,
formbez LIKE makt-maktx,
labst(10),
zeichnr LIKE drad-doknr,
zeichnr1 LIKE drad-doknr,
produktion_brutto(08) TYPE p, " (16) type c
reparatur(08) TYPE p,
zaehlerstand(16),
maxprod(08) TYPE p,
kapazitaet(06) TYPE p DECIMALS 2,
hoehe(07),
gewicht(07),
netto-gesamt(07) TYPE p,
ausschuss-gesamt(07) TYPE p,
brutto-gesamt(07) TYPE p,
restmenge(07) TYPE p,
*mico20000430
*notwendig für korrekte Anzeige in Druckliste
restmenge(08) TYPE p,
datenuebernahme(16),
menge(08) TYPE p decimals 0 ,
maxprod2(08) TYPE p decimals 0,
umwertung(08) TYPE p decimals 0,
ohnefa(08) TYPE p decimals 0,
charge like mchb-charg,
fhmnr LIKE mara-matnr,
END OF d1200.
EXPORT d1200 TO MEMORY ID 2.Unicode systems have a problem in that you can't define stuff as type X. Structures also have to be properly "bounded". You can also no longer rely on code such as field1+7(9) .
You could define your structure as a STRING and delimit the fields with say a tab symbol ( use the attribute in cl_abap_utilities to get the tab char in a unicode system).
export the string to memory.
on the import end use the SPLIT command on the string to re-create your data elements.
You will then have to manage the decimal arithmetic yourself.
It's a pain - but that's largely the point of Unicode --everything is treated as TYPE C.
Structures containing anything other than type C data are also a real problem if you want to upload / download data. Handling Binary files is a nightmare.
There are some SAP supplied utilities / notes / documentations on converting to a Unicode system.
Cheers
jimbo -
Export- Import to Memory Query
Hello Everyone,
I have 2 FMs where one exports variable to memory and other FM imports the same .
FM A:
DATA: id TYPE c LENGTH 10 VALUE 'SWITCH_WO',
id1 TYPE c LENGTH 10 VALUE 'SWITCH_OP'.
EXPORT g_workorder from g_workorder TO MEMORY ID id.
EXPORT g_operation from g_operation TO MEMORY ID id1.
FM B:
DATA: id TYPE c LENGTH 10 VALUE 'SWITCH_WO',
id1 TYPE c LENGTH 10 VALUE 'SWITCH_OP'.
IMPORT g_workorder FROM MEMORY ID id.
IMPORT g_operation FROM MEMORY ID id1.
When it export Sy-subrc is 0 but when i import it is 4 , where can i check memory variable in new debugger.
Please let me know ,
Regards,
RajHello,
You can use the Import and export to Memory Id only with the programs and FM which runs in the same session, because that memory is only available in the same session of the memory. Once you have imported say a internal table/work area to some memory id and the session ends the memory is cleared by the Garbage Collector.
In your case you are using 2 FM each running in different session, Import and Export to memory id will not work for you (as said it works in a single session). Try to use concepts of Shared Memory Object or populate a table (Custom table) and try to retrieve the same from 2nd FM.
Hope it helps.
Thanks,
Jayant -
Hi,
I want to know if a parameter ID of "export/import to memory" instruction is available in two differents session with different user's login?
tks
CarlosThe use of the shared buffer may be of some interest to you.
<b>From F1 help</b>
<i>EXPORT obj1 ... objn TO SHARED BUFFER dbtab(ar) ID key.
Additions:
1. ... = f (for each field you want to export)
2. ... FROM f (for each field you want to export)
3. ... CLIENT g (before ID key)
4. ... FROM wa (as last addition or after dbtab(ar))
In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Implicit field names not allowed in clusters and Table work areas not allowed.
Effect
Stores a data cluster in the cross-transaction application buffer.The specified objects obj1 ... objn (fields, structures, or tables) are stored as a single cluster in the buffer.
The specified table dbtab must have a standard structure.
The buffer area for the table dbtab is divided into various logically-related areas (ar, two-character ID).
You can export a collection of data objects (data cluster) to an area of the buffer under a key of your own choosing (key field).
You can import individual data objects from this collection using the IMPORT statement (as long as the data has not been deleted from the buffer).
Notes
In classes, you must always specify explicit names for the data objects. Addition 1 or addition 2 is therefore obligatory.
In classes, you must always specify the work area explicitly. Addition 4 is therefore obligatory.
The table dbtab that you specify after SHARED BUFFER must be declared under TABLES (except in addition 4).
You cannot export the header line of an internal table. If you specify the name of an internal table with a header line, the system always exports the actual table data.
You cannot export data, object, and interface references.
Please consult Data Area and Modularization Unit Organization documentation as well.
Example
Exporting two fields and an internal table to the buffer with structure INDX:
TABLES INDX.
TYPES: BEGIN OF ITAB3_TYPE,
CONT(4),
END OF ITAB3_TYPE.
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
F1(4), F2 TYPE P,
ITAB3 TYPE STANDARD TABLE OF ITAB3_TYPE WITH
NON-UNIQUE DEFAULT KEY INITIAL SIZE 2,
WA_INDX TYPE INDX.
Fill data fields before CLUSTR
before the actual export
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
Export data.
EXPORT F1 FROM F1
F2 FROM F2
ITAB3 FROM ITAB3
TO SHARED BUFFER INDX(ST) FROM WA_INDX ID INDXKEY.
Addition 1
... = f (for each object you want to export)
Effect
Exports the contents of the field f and stores them under the specified name.
Addition 2
... FROM f (for each field you want to export)
Effect
Exports the contents of field f and stores them under the specified name.
Addition 3
... CLIENT g (before ID key)
Effect
The data objects are stored in client g (as long as the import/export table dbtab is client-specific).
Addition 4
... FROM wa (as last addition or after dbtab(ar))
Effect
Use this addition if you want to store user data fields in the application buffer. Instead of the table work area, the system uses the specified work area wa. The specified work area must have the same structure as the table dbtab.
Example
DATA WA LIKE INDX.
DATA F1.
WA-AEDAT = SY-DATUM.
WA-USERA = SY-UNAME.
WA-PGMID = SY-REPID.
EXPORT F1 = F1 TO SHARED BUFFER INDX(AR)
CLIENT '001' ID 'TEST'
FROM WA.
Note
Catchable runtime error
EXPORT_BUFFER_NO_MEMORY: The EXPORT data cluster is too big for the application buffer. This error should not occur often, since the buffer uses a procedure similar to the LRU(Least Recently Used) procedure to monitor the buffer contents. However, if the error does occur, you can increase the profile parameter rsdb/obj/buffersize (see Profile Parameter Attributes), which may help.</i>
Regards,
Rich Heilman -
EXPORT/IMPORT TO MEMORY ID
Hi,
I'm using FM EXIT_SAPLV51S_001.(USER EXIT)
In the row :
EXPORT sy-uzeit TO MEMORY ID 'YTIME'.
I got sy-subrc = 4.
Why??? What is the problem?
Thanks
DIANAHi,
try this in user exit.
data: v_time type sy-uzeit.
<b>GET TIME.</b>
V_time = sy-uzeit.
EXPORT v_time TO MEMORY ID 'YTIME'.
GET TIME is must.
Regards
vijay
Maybe you are looking for
-
Error While activating business process in sxi_cache
Hello, I get following warning in TX: sxi_cache, when I try to deploy a integration process. Conversion From '[NN.]' to '[XC.ZXI_PROXY_VV2_STATUS_ABS_0001]' Can Cause Data-Dependent Errors Any ideas what's the cause for this warning? Regards Christia
-
How To Remap Contexts in Dynamically..
Dear Experts, in My scenario, I have one View, this view using for both Create and Chance Options, But I map only Same Context of ctxInputCreate. But When i Using this View on Chance mode CtxtinputCreate Context to Map to CtxinputChange. ctxtInputC
-
So i got an iPhone 6 around 6 months before. I have dropped it quite a few times and it's got 4 dents on the upper as well as lower sides..I wanted to know if anybody had got the same problem and got their iPhone replaced. I have my iPhone under warr
-
Over Time iMovie Files Corrupt -Which is an issue when I'm trying to backup
Hi, Please correct me if I'm posting this in the wrong section, but I've used iMovie for several years now and I'm finding that a lot of the movies I once finished and left alone for long periods of time won't copy to my backup hardrive (they will sh
-
I4 push mail doesn't work after update
My I4 push mail doesn't work after iOS 5 update. I have a mobileme acct and the settings show mail set up for push. Any thoughts?