09-17-2008 5:32 AM
append lines of itab to ntab.
sort ntab by belnr.
Hi all,
can u plz tell me that in foll. code why ntab is showing all values but not gtab ..?
gtab is showing blank i.e. no records in it..
plzzz
thankx in advance....
delete adjacent duplicates from ntab comparing belnr.
CALL FUNCTION 'HR_IT_SHOW_ANY_TABLE_ON_ALV'
TABLES
table = ntab.
select buzei bschl belnr gsber hkont zuonr kostl dmbtr sgtxt
into corresponding fields of gtab
CALL FUNCTION 'HR_IT_SHOW_ANY_TABLE_ON_ALV'
TABLES
table = gtab.
from bseg
where belnr = ntab-belnr.
append gtab.
endselect.
09-17-2008 5:39 AM
Use for all entries statement
Regards
Farzan
Edited by: Farzan Mohamed on Sep 17, 2008 6:47 AM
09-17-2008 5:39 AM
Use for all entries statement
Regards
Farzan
Edited by: Farzan Mohamed on Sep 17, 2008 6:47 AM
09-17-2008 5:48 AM
09-17-2008 5:52 AM
Is there any values in BSEG for the BELNR s in ntab... Please check going to se16
Regards
Farzan
09-17-2008 5:52 AM
09-17-2008 6:16 AM
Hi Nilesh,
Sorry i missed the TABLE keyword in my query, my query will work if you use INTO CORRESPONDING FIELDS OF TABLE gtab.
Regards
Karthik D
09-17-2008 6:19 AM
09-17-2008 5:43 AM
Hi Nilesh,
Rewrite the Select query as below;
SELECT buzei bschl belnr gsber hkont zuonr kostl dmbtr sgtxt
INTO CORRESPONDING FIELDS OF gtab FROM bseg
FOR ALL ENTRIES IN ntab
WHERE belnr = ntab-belnr.
Now this will fetch data from the database provided that ntab contains some records.
Regards
Karthik D
09-17-2008 5:53 AM
Hello Nilesh
I do not really understand your coding but perhaps you wanted to do the following:
IF ( ntab[] IS INITIAL ).
ELSE.
SELECT buzei bschl belnr gsber hkont zuonr kostl dmbtr sgtxt
INTO CORRESPONDING FIELDS OF TABLE gtab " << TABLE !!!
FROM bseg
FOR ALL ENTRIES IN ntab
WHERE belnr = ntab-belnr.
ENDIF.
I assume you have defined you itab's using header lines. Thus, this is another nice example how header lines spoil any ABAP coding.
If my coding solution is correct then the syntax check would have resulted in an error. GTAB would have been interpreted as work area (i.e. the header line) and therefore the syntax should be SELECT ... ENDSELECT.
Regards
Uwe
10-25-2008 6:43 AM