Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

Re: Internal table Query

$
0
0

Hi Venkat,

 

For example your Z table has these fields

MATNR

LGORT

MENGE

 

with the following records collected internal table ITAB.

 

MATNR  LGORT  MENGE

Mat1     StLoc1        12

Mat1     StLoc2          4

Mat1     StLoc3        25

Mat2     StLoc1        22

Mat2     StLoc2        24

Mat2     StLoc3        14

(Assumed that there are only 3 LGORT values)

 

Now your Final IntTable structure has to be in transposed way

 

MATNR

STLOC1

STLOC2

STLOC3

 

First fill the Final IntTable (say IT_OUT) with the MATNR values from ITAB ( or May be from the Selection screen), Loop at this  and fill the values of STLOC1, STLOC2 and STLOC3 fields with MENGE values. (See the code attached)

 

MATNR     STLOC1      STLOC2     STLOC3

MAT1          12               4               25

MAT2          22               24             14

 

This is just an idea to transpose values. With this clue and you can have better syntax.

 

 

Jogeswara Rao K


Viewing all articles
Browse latest Browse all 10425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>