2007 Feb 21 10:12 AM
Hi Experts,
SELECT keyseg
datseg
FROM /alogis/cdpos
INTO TABLE lt_/alogis/cdpos
WHERE keytyp EQ lc_keytyp.
if not is lt_/alogis/cdpos[] initial.
SELECT matnr
FROM mvke
INTO TABLE gt_mvke
FOR ALL ENTRIES IN lt_/alogis/cdpos
WHERE mtpos = 'YVWH'
or mtpos = lt_/alogis/cdpos-dataseg+0(4).
AND vkorg = pa_vkorg
AND vtweg = pa_vtweg.
endif.
where "lt_/alogis/cdpos" is an internal table of type "/alogis/cdpos" which is a DB table and which have the following fields"KEYSEG" and "DATASEG" and again "DATASEG" contain 4 fileds and first field is MTPOS(4),
now my question i want to extract data into gt_mvke which shld contain only those entries of MTPOS which r present in "/alogis/cdpos" and as well as MTPOS = 'YVWH'.
so i have extracted data from /alogis/cdpos into one internal table"lt_/alogis/cdpos" and now for all entries of this table shld be equal to MTPOS of MVKE.
but its giving some error message. wht could b the best method.
Please help me
Thanx in Advance
2007 Feb 21 10:16 AM
Change the code as follows
if not is lt_/alogis/cdpos[] initial.
loop at lt_/alogis/cdpos.
itab-mtpos = lt_/alogis/cdpos-dataseg+0(4).
append itab.
clear itab.
endloop.
SELECT matnr
FROM mvke
INTO TABLE gt_mvke
FOR ALL ENTRIES IN itab
WHERE ( mtpos = 'YVWH'
or mtpos = itab-mtpos )
AND vkorg = pa_vkorg
AND vtweg = pa_vtweg.
endif.
Regards,
Ravi
Hi Experts,
SELECT keyseg
datseg
FROM /alogis/cdpos
INTO TABLE lt_/alogis/cdpos
WHERE keytyp EQ lc_keytyp.
if not is lt_/alogis/cdpos[] initial.
SELECT matnr
FROM mvke
INTO TABLE gt_mvke
FOR ALL ENTRIES IN lt_/alogis/cdpos
WHERE mtpos = 'YVWH'
or mtpos = lt_/alogis/cdpos-dataseg+0(4).
AND vkorg = pa_vkorg
AND vtweg = pa_vtweg.
endif.
where "lt_/alogis/cdpos" is an internal table of type "/alogis/cdpos" which is a DB table and which have the following fields"KEYSEG" and "DATASEG" and again "DATASEG" contain 4 fileds and first field is MTPOS(4),
now my question i want to extract data into gt_mvke which shld contain only those entries of MTPOS which r present in "/alogis/cdpos" and as well as MTPOS = 'YVWH'.
so i have extracted data from /alogis/cdpos into one internal table"lt_/alogis/cdpos" and now for all entries of this table shld be equal to MTPOS of MVKE.
but its giving some error message. wht could b the best method.
Please help me
Thanx in Advance
2007 Feb 21 10:16 AM
Change the code as follows
if not is lt_/alogis/cdpos[] initial.
loop at lt_/alogis/cdpos.
itab-mtpos = lt_/alogis/cdpos-dataseg+0(4).
append itab.
clear itab.
endloop.
SELECT matnr
FROM mvke
INTO TABLE gt_mvke
FOR ALL ENTRIES IN itab
WHERE ( mtpos = 'YVWH'
or mtpos = itab-mtpos )
AND vkorg = pa_vkorg
AND vtweg = pa_vtweg.
endif.
Regards,
Ravi
2007 Feb 21 10:34 AM
so now i shld create a internal table itab and it shld contain one field that is MTPOS .
Thanks in advance. It it works inshallah i wil give u 10 pts.
2007 Feb 21 10:37 AM
HI Abdul,
Yes, you should create an internal table itab.
Do revert in case of any other issues.
Regards,
Ravi
2007 Feb 21 10:39 AM
yes u have to declare a field as mtpos is a large field and u want to use only first 4 char of this....
in a select statement u can't use field+0(4) or such things....
so declare a internal table with a field and move the data to this field and append the internal table.....now use this in ur select statement using for all entries and the field in where condition....
2007 Feb 21 10:48 AM
Thanks alot for helping me........May God fulfill all ur desires and dreams.
2007 Feb 21 10:49 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |