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

Problem in Export and import itab using memory id

manoj_kumar12
Explorer
0 Likes
643

Hi Guys,

I have a requirement to create a FM and in source code i need to perform the logic to

submit < Zprog > and return.

Inside the <Zprog> i need to export the needed itabs,variables,etc.. and after returning to the main FM

i need to import the same which i exported and the output of FM must be the value from <itab>.

Code performed :

1. In FM

     a. Submit <Zprog> and return.

     b. Import <itab> to memory id 'XYZ'.

When Submit gets executed

2. In Zprog

Export <itab> from memory id 'XYZ'. is added.

But after executing this the <itab> is empty.

<< Urgency Downgraded >>

Note: <itab> in both FM and Zprog is same structure as below.

  data: BEGIN OF it_error occurs 0,
         lifex_er type likp-lifex,
         ebeln_er type ekpo-ebeln,
         date_er  type sy-datum,
         message_er type BAPIRET2-message,
         type_er    type BAPIRET2-type,
      end of it_error.

Thanks!

Regards,

Manoj

Message was edited by: Kesavadas Thekkillath

3 REPLIES 3
Read only

Former Member
0 Likes
588

Hi,

Can you try using the same internal table name in both the FM and in the report,

In FM:

IMPORT it_error FROM MEMORY ID 'XYZ'.

In Report

EXPORT it_error TO MEMORY ID 'XYZ'.

Cheers

~Niranjan

Read only

NAeda
Contributor
0 Likes
588

Use Submit and return.

Ex:

REPORT  ytest_n.

TYPES : BEGIN OF ty_mara,
        matnr TYPE mara-matnr,
        ernam TYPE mara-ernam,
        flag  TYPE c,
        END OF ty_mara.

DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
       wa_mara TYPE ty_mara.

START-OF-SELECTION.

  SUBMIT ytest_n1 AND RETURN .

IMPORT it_mara TO it_mara
FROM MEMORY ID 'MAT_ID'.

LOOP AT it_mara into wa_mara.
  write wa_mara-matnr.
ENDLOOP.
************************************************

   REPORT  ytest_n1.

TYPES : BEGIN OF ty_mara,
        matnr TYPE mara-matnr,
        ernam TYPE mara-ernam,
        flag  TYPE c,
        END OF ty_mara.

DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
        it_mara1 TYPE STANDARD TABLE OF ty_mara,
       wa_mara TYPE ty_mara.


wa_mara-matnr = 'TEst_material'.
APPEND wa_mara TO it_mara.

EXPORT it_mara FROM it_mara
           TO MEMORY ID 'MAT_ID'.


Read only

manuelhildemaro_ramossanc
Active Participant
0 Likes
588

Hi Manoj.

Check this link

http://scn.sap.com/community/abap/blog/2011/07/07/gain-programmatic-access-to-data-of-sapgui-alv-rep...

I think that can help you.

Regards,

Manuel H.