2012 May 31 2:54 AM
Hi All
I am trying to pass some select options between programs. I am doing this using internal tables and EXPORT to memory ID/ IMPORT from memory ID. Is this the correct way to do this?
This is my code... The code works for VKORG VTWEG and SPART. For some reason however I tried to add a new field today and I don't see any data from my Import statement even though SY-SUBRC = 0?
* Allow multiple lines to be passed to ZRR01
EXPORT s_spart_r FROM s_spart_r[] TO MEMORY ID 'SPART1'.
EXPORT s_vkorg_r FROM s_vkorg_r[] TO MEMORY ID 'VKORG1'.
EXPORT s_vtweg_r FROM s_vtweg_r[] TO MEMORY ID 'VTWEG1'.
EXPORT s_kunnr_r FROM s_kunnr_r[] TO MEMORY ID 'KUNNR1'.
* ISR059895 - Also add Z3 Date
EXPORT s_qmdat_r FROM s_qmdat_r[] TO MEMORY ID 'Z3DAT1'.
*------End of Addition
* Retrieve Date range from ZRR02
IMPORT s_qmdat_r FROM MEMORY ID 'Z3DAT1'.
IF s_qmdat_r[] IS NOT INITIAL.
ENDIF.
Hi All
I am trying to pass some select options between programs. I am doing this using internal tables and EXPORT to memory ID/ IMPORT from memory ID. Is this the correct way to do this?
This is my code... The code works for VKORG VTWEG and SPART. For some reason however I tried to add a new field today and I don't see any data from my Import statement even though SY-SUBRC = 0?
* Allow multiple lines to be passed to ZRR01
EXPORT s_spart_r FROM s_spart_r[] TO MEMORY ID 'SPART1'.
EXPORT s_vkorg_r FROM s_vkorg_r[] TO MEMORY ID 'VKORG1'.
EXPORT s_vtweg_r FROM s_vtweg_r[] TO MEMORY ID 'VTWEG1'.
EXPORT s_kunnr_r FROM s_kunnr_r[] TO MEMORY ID 'KUNNR1'.
* ISR059895 - Also add Z3 Date
EXPORT s_qmdat_r FROM s_qmdat_r[] TO MEMORY ID 'Z3DAT1'.
*------End of Addition
* Retrieve Date range from ZRR02
IMPORT s_qmdat_r FROM MEMORY ID 'Z3DAT1'.
IF s_qmdat_r[] IS NOT INITIAL.
ENDIF.
2012 May 31 3:14 AM
Hi Brad,
You cant pass an internal table using Export/Import memory id.
Regards,
Rajesh
2012 May 31 3:17 AM
Hi Rajesh
Yes you can. It works for SPART, VKORG, VTWEG.
Cheers
Brad
2012 May 31 3:22 AM
Hi Brad,
Try with
IMPORT s_qmdat_r TO s_qmdat_r[] FROM MEMORY ID 'Z3DAT1'.
Regards,
Rajesh
2012 May 31 3:41 AM
Good idea but it didn't work unfortunately. I don't know what happened but I've just re run it again for the 50th time and it has started working without any code change??!?!
I'm confused and a little bit worried when it just 'starts working randomly'
2012 May 31 3:27 AM
Hi Brad,
Are you trying to the same in the Background. If so may be you should try using the Shared buffer. Check Rich's answer in the following thread : http://scn.sap.com/thread/75471
Hope it helps.
Regards,
Karthik D
2012 May 31 3:45 AM
Hi,
You can try this. Maybe it will help.
First PROGRAM.
REPORT z_jtest03.
DATA: zdate TYPE sy-datum.
SELECT-OPTIONS: s_date FOR zdate.
EXPORT s_date TO MEMORY ID sy-datum.
SUBMIT z_jtest04 VIA SELECTION-SCREEN AND RETURN.
Second PROGRAM
DATA: zdate2 TYPE sy-datum.
SELECT-OPTIONS: s_date2 FOR zdate2 NO-DISPLAY.
INITIALIZATION.
IMPORT s_date TO s_date2 FROM MEMORY ID sy-datum.
IF s_date2[] IS NOT INITIAL.
WRITE:/ 'OK'.
ENDIF.
Regards,
Jake
2014 May 20 7:00 AM
hii,
you can try like this
(SELECT PARAMETER NAMES HERE) IS SELECT OPTIONS OR PARAMETER LIKE IN SE38
SUBMIT ( YOUR PROGRAM NAME ) WITH VKORG = (SELECT PARAMETER NAMES HERE)
VTWEG =
SPART =
AND RETURN .
THESE VKORG, VTWEG AND SPART SHOULD DEFINE SAME MANNER IN CURRENT PROGRAM AND SUBMIT PROGRAM ALSO.