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

empty value in export and import value in object oriented

Former Member
0 Likes
2,476

hi expert

i have big problem on exportand import one char .

in mymethod u have one char with name

   DATA : ANSWER1(1) TYPE C.

  ANSWER1 'J' .

   EXPORT ZANSWER FROM ANSWER1 TO MEMORY ID 'ABC'.

in my program i need this value  for use .so in mycodei write:

   DATA : ZANSWER(1) TYPE C VALUE 'D' .

   IMPORT ANSWER1 TO ZANSWER FROM memory id 'ABC'.

but in my program any value doesnt come after import

pleasehelp mewhat'stheproblem

13 REPLIES 13
Read only

former_member209120
Active Contributor
0 Likes
2,054

Hi maryam,

Remove value 'D'. and try

try like this

DATA : answer1(1) TYPE c.
DATA : ZANSWER(1) TYPE C VALUE 'D' .

answer1 =  'J' .

EXPORT answer1 TO MEMORY ID 'ABC'.

IMPORT ANSWER1 TO ZANSWER FROM memory id 'ABC'.


WRITE : / zanswer.


are  you trying to get default value 'D' in case of not value in answer1?

Read only

0 Likes
2,054

hi mr ramesh.

i try but nothing happened.i use export in one method for event save.

and because of it i should use this format for export.because i need object oriented format.

thanks

Read only

Former Member
0 Likes
2,054

s/m Maryam,

can you post the full program.

Is the method of global class ???

Regards

Read only

0 Likes
2,054

sorry mr

Mohammed Yakub Shah

my code is too long .i use this export in method and so i need use this format because of object oriented format.

Read only

Amarpreet
Active Participant
0 Likes
2,054

you don't need to write

IMPORT ANSWER1 TO ZANSWER FROM memory id 'ABC'.

I think all you need to write is :

IMPORT ZANSWER FROM MEMORY ID 'ABC' .

Read only

Former Member
0 Likes
2,054

hi mr

Amarpreet Singh

i need to use export in method so i need to use this format for object oriented

Read only

arindam_m
Active Contributor
0 Likes
2,054

This message was moderated.

Read only

SwadhinGhatuary
Active Contributor
0 Likes
2,054

REPORT  ZPROG1.

data: it_lfa1prog1 type STANDARD TABLE OF lfa1,

      wa_lfa1      type lfa1.

************************************************************************

START-OF-SELECTION.

*Clear memory id

FREE MEMORY ID sy-uname.

*Execute Program 2

submit ZPROG2 and return.

************************************************************************

END-of-SELECTION.

*Display data

LOOP AT it_lfa1prog1 INTO WA_LFA1.

  write:/ WA_LFA1-LIFNR.

ENDLOOP.

Program 2 - Exports data to memory

&---------------------------------------------------------------------*

*& Report  ZPROG2

*&---------------------------------------------------------------------*

*&

*&---------------------------------------------------------------------*

REPORT  ZPROG2.

data: it_lfa1prog2 type STANDARD TABLE OF lfa1.

************************************************************************

START-OF-SELECTION.

* Select data

  select *

    UP TO 10 rows

    from lfa1

    into table it_lfa1prog2.

  EXPORT it_lfa1prog2 to MEMORY ID sy-uname.

Read only

Former Member
0 Likes
2,054

Hi,

  

Instead of using  ' IMPORT ANSWER1 TO ZANSWER FROM memory id 'ABC'. '

Try      ' IMPORT ZANSWER TO ZANSWER FROM memory id 'ABC'. '

Regards

Amit

Read only

0 Likes
2,054

hi mr

Amit Gupta

i need use this format because i use export in method and i need use object oriented

Read only

Aiolos
Active Participant
0 Likes
2,054

use sap memory instead of abap memory.

Read only

Former Member
0 Likes
2,054

hi expert i use module in screen 1400 of ca02 and pass it to my program.

my problem solved.

best regards.

Read only

0 Likes
2,054

Good...