2014 Jul 17 3:28 AM
Hi,
I have a ALV report program there five loops are using based on vbak and vbap table.So my requirement is after second loop if when third loop is not reading the records then earlier two loops data should come in main internal table.in third loop lips and likp data is reading so whose sales order line items delivery having blank it should show blank of delivery column.So how to pass first two loops data to main internal table if third internal table is not reading data.
Thanks.
<subject edited by moderator>Message was edited by: Manish Kumar
2014 Jul 17 4:38 AM
hi
go through control level processing (search it in Google)
in that use AT NEW for the third field and write your logic
2014 Jul 17 5:07 AM
HI Pradeep,
Are you talking about loop inside a loop?
Don't do that... Instead you loop one internal table(which will determine number of records to output internal table) and read(with any key) other internal tables from this loop to get related details.
Once one record(work area) is ready, append it to the output internal table at the end of loop.
Regards
Sreekanth
2014 Jul 17 5:32 AM
Hi Kumar,
Instead of nested loops, you can use parallel loop processing, it will give best performance.
Fro better understanding please check below sample example.
EX:
***** By using Read statement first you are checking the records available or not
***** If records available then find the INDEX of that records
***** Then LOOP your internal table from that INDEX
***** By doing like this you can SKIP the other records to LOOP.
LOOP AT VBAP INTO LS_VBAP.
READ TABLE LIPS INTO LS_LIPS WITH KEY VBELN = LS_VBAP-VBELN.
IF SY-SUBRC EQ 0.
LOOP AT LIPS INTO LS_LIPS FROM SY-TABIX.
IF LS_LIPS-VBELN NE LS_VBAP-VBELN.
EXIT.
ENDIF.
HERE YOU CAN WRITE YOUR LOGIC.
ENDLOOP.
ENDIF.
ENDLOOP.
Regards,
Rajesh.B
2014 Jul 17 5:32 AM
2014 Jul 17 6:38 AM
At least these two discussions are now related via incoming links.