2007 Aug 22 10:56 AM
Hello everyone:
I want to retrieve data from database to the structure. but the structure defined like this below:
TOLERANZOB LIKE QAMV-TOLERANZOB
TOLERANZOB1 LIKE QAMV-TOLERANZOB
so how can I retrieve the data from the database ? make sure that the two fields contain data both.
Thanks in advance .
Regards
Nick
2007 Aug 22 11:00 AM
Hi,
Use select single
Select single TOLERANZOB into TOLERANZOB from QAMV where ......
If sys-subrc = 0.
TOLERANZOB1 = TOLERANZOB.
endif.
<b>Reward if helpful.</b>
Hello everyone:
I want to retrieve data from database to the structure. but the structure defined like this below:
TOLERANZOB LIKE QAMV-TOLERANZOB
TOLERANZOB1 LIKE QAMV-TOLERANZOB
so how can I retrieve the data from the database ? make sure that the two fields contain data both.
Thanks in advance .
Regards
Nick
2007 Aug 22 11:00 AM
Hi,
Use select single
Select single TOLERANZOB into TOLERANZOB from QAMV where ......
If sys-subrc = 0.
TOLERANZOB1 = TOLERANZOB.
endif.
<b>Reward if helpful.</b>
2007 Aug 22 11:06 AM
Hi Nick,
To retreive data for TOLERANZOB from QAMV,
If you know the key fields then use
SELECT SINGLE TOLERANZOB FROM QAMV INTO TOLERANZOB WHERE keyfields.
else, you can use
SELECT TOLERANZOB FROM QAMV UPTO ONE ROWS INTO TOLERANZOB WHERE....
Once you retreive the data using the select query, you can check if it is initial and if not move the data from TOLERANZOB to TOLERANZOB1.
<b>Reward points for helpful answers.</b>
Best Regards,
Ram.
2007 Aug 22 11:06 AM
Hi
no , the two fields don't contain the same data .
such as , TOLERANZOB contains the first data , and TOLERANZOB1 contains the second data .
thanks
nick.
2007 Aug 22 11:06 AM
Hi Nick,
Let's consider WA is the name of the strcuture, then you will write the query as below:
Select single TOLERANZOB from QAMV into WA-TOLERANZOB where .......
if sy-subrc = 0.
WA-TOLERANZOB1 = WA-TOLERANZOB.
endif.
2007 Aug 22 11:42 AM
you define an internal table from structure and then fill this itab with data.
For example:
data: itab type standard table of QAMV (or whatever the structure name is).
Then you can fill this itab via:
Select * from QAMV into table itab [where if required, write any field of need].
Thanks.