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

Query on COSS table

Former Member
0 Likes
841

Hi Friends

Am querying COSS table for posting details based on all primary keys available.

i want to select only particular field WTGXXX (XXX- is the period ranging from 001 till 016) in the select clause.

Is it possible, if yes how is the approach.

Thanks

Lavanya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
720

Hello

Try like this:


PARAMETERS: P_PERIO(3).
DATA: IFIELDS LIKE RSFS_STRUC OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF ITAB OCCURS 0,
      DMBTR TYPE WTGXXX,
      END OF ITAB.
CONCATENATE 'WTG' P_PERIO INTO IFIELDS-LINE. APPEND IFIELDS.

SELECT (IFIELDS) INTO TABLE ITAB FROM COSS
       WHERE LEDNR EQ ... " set conditions
         AND OBJNR EQ ...
         AND GJAHR EQ ...

You set P_PERIO value (f.e. 001) and run. In table itab you will have all values of field WTG001 for particular conditions.

2 REPLIES 2
Read only

Former Member
0 Likes
721

Hello

Try like this:


PARAMETERS: P_PERIO(3).
DATA: IFIELDS LIKE RSFS_STRUC OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF ITAB OCCURS 0,
      DMBTR TYPE WTGXXX,
      END OF ITAB.
CONCATENATE 'WTG' P_PERIO INTO IFIELDS-LINE. APPEND IFIELDS.

SELECT (IFIELDS) INTO TABLE ITAB FROM COSS
       WHERE LEDNR EQ ... " set conditions
         AND OBJNR EQ ...
         AND GJAHR EQ ...

You set P_PERIO value (f.e. 001) and run. In table itab you will have all values of field WTG001 for particular conditions.

Read only

Former Member
0 Likes
720

thanks, it works