‎2015 Mar 09 2:42 AM
Hello Experts,
I have program1 with selection screen and using class methods to fetch data. Now i have the data stored in both
1) Instance variable and
2) Static variable
Now i need to pass this data to program 2 and i am using Submit and return.
In Program 2 when i try to read the Static method to get the data, there is no data returned. its all empty. any thoughts?
*** Code snippet as below *** PRG 1 **********
o_sel->v_arbgb = p_arbgb.
o_sel->t_msgnr_range = s_msgno[].
CALL METHOD o_data->get_data "Uses the selection screen values and fetches the DB values.
EXPORTING
o_sel = o_sel.
**CALL METHOD yggtest1_data1=>get_stored_data
** IMPORTING
** it_data = lt_t100. "Returns data of 10 records
SUBMIT yggtest2 and RETURN.
*** Code snippet as below *** PRG 2 **********
CALL METHOD yggtest1_data1=>get_stored_data
IMPORTING it_data = lt_t100
lt_t100 returns no data -even though there is 10 records before the submit statement.
any thoughts do please share? All i would like is to use OOA to pass data between different reports, instead of Export/Import memory
‎2015 Mar 09 5:47 AM
Hi
uh... as i know, there is no concept is you could transport objects by OO in ABAP.
Anyway you need export to memory, export a OO instance to memory or a itab.
Need gurus to confirm this,
And this is class named as 'cl_salv_bs_runtime_info' could get last data from last program you submitted.
regards,
Archer
‎2015 Mar 09 6:00 AM
Hi,
The static methods/attributes call is invalid across different contexts( valid only in the same program where its used ).
For you scenario, you can have a look into http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/307d791b-3343-2e10-f78a-e1d50c7cf...
Kesav
‎2015 Mar 09 6:24 AM
Hi,
Please try to use IMPORT and EXPORT parameters. This makes your program easy and problem will be solved.
Regards,
Sneha.
‎2015 Mar 18 6:42 AM
Hi AB GK,
Try to use a singleton class which has an access to a public attributes. You can access the same instance during runtime and sharing the data between two program. It's the other way of using import and export.
‎2015 Mar 18 7:50 AM
A singleton class can achieve this?
Say,
A singleton class with global public attribute in program A.
And in program B, submit A, then B can access the attribute of singleton class???
regards,
Archer
‎2015 Mar 18 8:00 AM
SUBMIT replaces internal session, or with AND RETURN creates new one. So previous singleton instance will not be visible in SUBMITed program.