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

Using For all entires...

Former Member
0 Likes
829

Hi,

I am getting data into final_itab but nothing is coming into IT_TRACT_DOCUMENT. May I know why?

This my code,

loop at final_itab.

select * from TRACT_DOCUMENT into corresponding fields of table IT_TRACT_DOCUMENT

FOR ALL ENTRIES IN FINAL_ITAB

  • where ACREVERSALDATE = FINAL_ITAB-POSTINGDATE

WHERE TR_ACC_CODE = FINAL_ITAB-COMP_CODE

and DEAL_NUMBER = FINAL_ITAB-TRANSACTION.

  • if not it_TRACT_DOCUMENT[] is initial.

select * from TRACT_ACCITEM into corresponding fields of table IT_TRACT_ACCITEM

FOR ALL ENTRIES IN it_TRACT_DOCUMENT

where DOCUMENT_GUID = IT_TRACT_DOCUMENT-OS_GUID.

endloop.

Moderator message - Moved to the correct forum

Edited by: Rob Burbank on Dec 3, 2009 4:09 PM

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
778

if FINAL_ITAB[] is not initial.

sort FINAL_ITAB by COMP_CODE TRANSACTION.

select * from TRACT_DOCUMENT into 
corresponding fields of table IT_TRACT_DOCUMENT
FOR ALL ENTRIES IN FINAL_ITAB
WHERE TR_ACC_CODE = FINAL_ITAB-COMP_CODE
and DEAL_NUMBER = FINAL_ITAB-TRANSACTION.

if it_TRACT_DOCUMENT[] is not initial.

select * from TRACT_ACCITEM into 
corresponding fields of table IT_TRACT_ACCITEM
FOR ALL ENTRIES IN it_TRACT_DOCUMENT
where DOCUMENT_GUID = IT_TRACT_DOCUMENT-OS_GUID.

endif.

endif.
6 REPLIES 6
Read only

Former Member
0 Likes
778

Well, I don't know what's in FINAL_ITAB, but my first guess would be that the values are initial. Are these fields actually populated in FINAL_ITAB, and if so, can you pick a row and look into your second table with SE11 and find that data?

Read only

0 Likes
778

Thank you so much for your reply.

In debug I can see values for FINAL_ITAB-COMP_CODE = 'AADO'

and FINAL_ITAB-TRANSACTION = 10000008 like that..but nothing is coming to IT_TRACT_Document....that's the issue.

Read only

0 Likes
778

One question, why are you using LOOP AT FINAL_ITAB when you are using for all entries.

second, when the the table FINAL_ITAB is not initial before using for all entries.

third, check the DB table actually has data that corresponds to the entries in FINAL_ITAB.

Regards

Prasenjit

Read only

Former Member
0 Likes
778

Hi Tanvi,

Loop - Endloop statement not required.Please check your logic again.

As per my understanding , if table is initial then your select statements will not be executed .

You should check this table for initial before use of for all entries.

Hope you understand it.

Read only

Clemenss
Active Contributor
0 Likes
778

Hi Thanvi,

make sure you have matching entries in database table TRACT_DOCUMENT. Also make sure that the data elements are the same for the fields and that the formatiing (i.e. leading zeros) is correct.

Regards,

Clemens

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
779

if FINAL_ITAB[] is not initial.

sort FINAL_ITAB by COMP_CODE TRANSACTION.

select * from TRACT_DOCUMENT into 
corresponding fields of table IT_TRACT_DOCUMENT
FOR ALL ENTRIES IN FINAL_ITAB
WHERE TR_ACC_CODE = FINAL_ITAB-COMP_CODE
and DEAL_NUMBER = FINAL_ITAB-TRANSACTION.

if it_TRACT_DOCUMENT[] is not initial.

select * from TRACT_ACCITEM into 
corresponding fields of table IT_TRACT_ACCITEM
FOR ALL ENTRIES IN it_TRACT_DOCUMENT
where DOCUMENT_GUID = IT_TRACT_DOCUMENT-OS_GUID.

endif.

endif.