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

simple code question

Former Member
0 Likes
682

Hi, just a simple question. How to move several fields to a structure?

ex, for structure ls_pa0001, how to currect the following code?

move lv_pernr, lv_begda, lv_endda to ls_pa0001-pernr, ls_pa0001-begda, ls_pa0001-endda.

Thanks!

<LOCKED BY MODERATOR - USE APPROPRIATE TITLES>

Edited by: Alvaro Tejada Galindo on Aug 25, 2008 5:23 PM

5 REPLIES 5
Read only

JozsefSzikszai
Active Contributor
0 Likes
662

hi,

you have to do one-by-one:

ls_pa0001-pernr = lv_pernr.

ls_pa0001-begda = lv_begda.

...

hoep this helps

ec

Read only

0 Likes
662

if you have the field values in a structure you can also move it with

move-corresponding fields of LV to zpa0001

Read only

Former Member
0 Likes
662

hi,

You can move the value in the structure one by one. There is no other way for moving the values.

If you want to use move statement then write as many move statements as many variable you want to transfer.

MOVE lv_pernr to ls_pa0001-pernr.

MOVE ....etc.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
662

Thanks for you. I've move the values one by one and the fields of the structure has currect value when debug but the structure has nothing. That is, I got ls_pa0002-pernr, ls_pa0002-begda..., but for ls_pa0002, it shows 'Non-charlike structure'. That's why?

Thanks!

Read only

0 Likes
662

Hi...

How can you move variables into structure?

See this sample code....

Get back if your requirement is deffrent...

types: begin of ls_pa0001,
       pernr like pa0001-pernr,
       begda like pa0001-begda,
       endda like pa0001-endda,
       end of ls_pa0001.

data: wa type ls_pa0001.

data: lv_pernr like pa0001-pernr value '88888',
      lv_begda like pa0001-begda value '20070101' ,
      lv_endda like pa0001-endda value '20081201'.

move: lv_pernr to wa-pernr,
      lv_begda to wa-begda,
      lv_endda to wa-endda.

write:/ wa-pernr,
        wa-begda,
        wa-endda.

Thanks,

Naveen.I