Application Development 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: 

SQ01/SQ02. Report records from horizontal to vertical in a query

andreagiugio
Explorer
0 Kudos

Hello all,

I am doing a query with SQ01/SQ02, I am reading a z_table that it is structured like this (4 fields for each records):

record n. 1 --> contract1, contract2, contract3, salesorder

record n. 2 --> contract4, contract5, contract6, salesorder

For the example above my final goal is to have in output 6 records, each records with 2 fields, structured like this:

record n. 1 --> contract1, sales order

record n. 2 --> contract2, sales order

record n. 3 --> contract3, sales order

record n. 4 --> contract4, sales order

record n. 5 --> contract5, sales order

record n. 6 --> contract6, sales order

Could you please suggest how can I get this result with SQ01/SQ02 transactions?


Thanks

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

IMHO for this kind of requirement forget query a build a report from scratch.

0 Kudos

thanks for suggestion. If I would achieve these results just with a query, do you have any suggestions? With infoset SQ02 we can write ABAP, anyway for the moment I am not able to achieve these results

0 Kudos

Did you try some join from your table to the contract table with a where clause

( contract~number EQ record~contract1 OR contract~number EQ record~contract2 OR contract~number EQ record~contract3 )

So you get 1-3 records in the query execution