Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Export/Import to Memory ID issue

Former Member
0 Likes
5,445

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.

  • I have checked that in both programs that the S_QMDAT_R has the same structure as the other working ones.
  • My internal table had data in it at the point of EXPORT
  • SY-SUBRC 0 for both statements


7 REPLIES 7
Read only

Former Member
0 Likes
2,116

Hi Brad,

You cant pass an internal table using Export/Import memory id.

Regards,

Rajesh

Read only

0 Likes
2,116

Hi Rajesh

Yes you can. It works for SPART, VKORG, VTWEG.

Cheers

Brad

Read only

0 Likes
2,116

Hi Brad,

Try with

IMPORT s_qmdat_r TO s_qmdat_r[] FROM MEMORY ID 'Z3DAT1'.

Regards,

Rajesh

Read only

0 Likes
2,116

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'

Read only

Former Member
0 Likes
2,116

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

Read only

Former Member
0 Likes
2,116

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

Read only

Former Member
0 Likes
2,116

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.