2008 Apr 30 1:10 PM
Hi there
I posted a question yesterday with regards to a select join and have managed to get that working.
This builds an ALV with data relating to several matnrs. On this report I have a field called zsuper which is the supersession part number for each matnr.
Ideally I want to get further details about this zsuper and display this as well in my ALV.
I need to find maktx for the zsuper, mmsta, labst and ebeln if bsart = 'ZD11'
Could I do this in my original SELECT or would I need to create new variables for each of these fields and read the tables that they are in into these variables?
Never had to create a deep report before!
Hi,
Since you are using "INTO CORRESPONDING FIELDS" clause of SELECT statement, I suggest you to use SELECT - ENDSELECT and
SELECT WERKS INTO <Workarea>-SUPER_WERKS......
Alternate Option, First read all the WERKS into an Internal table and use READ statement.
Regards,
Raj
Edited by: Rajasekhar Matukumalli on Apr 30, 2008 11:20 AM
2008 Apr 30 2:52 PM
try sample-prg. BCALV_TEST_HIERSEQ_LIST
/ fm REUSE_ALV_HIERSEQ_LIST_DISPLAY
A.
2008 Apr 30 3:20 PM
Managed to get the plants for each zsuper material but not sure how to move this data to a particular variable
SELECT werks
INTO CORRESPONDING FIELDS OF TABLE it_marc
from marc for all entries in part_data
where zsuper = part_data-zsuper.
if not sy-subrc is initial.
endif.
This gets all the plants for all the supersession parts, but needs to appear in a certain column called SUPER_WERKS which has been declared as plant in a structure.
2008 Apr 30 4:19 PM
Hi,
Since you are using "INTO CORRESPONDING FIELDS" clause of SELECT statement, I suggest you to use SELECT - ENDSELECT and
SELECT WERKS INTO <Workarea>-SUPER_WERKS......
Alternate Option, First read all the WERKS into an Internal table and use READ statement.
Regards,
Raj
Edited by: Rajasekhar Matukumalli on Apr 30, 2008 11:20 AM
2008 Apr 30 5:42 PM
It is always important to keep in mind the less number of data base hits, the more is the performance of the code.
So use one selected followed by a read.
Thanks.
2008 Apr 30 5:47 PM
select-endselect always lowers your performance as it hits database for every record. The best way is to get all the data in the internal table at one go and then manipulate the values on this internal table. This way your code performance will improve.
Thanks,
Sheel
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |