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: 

ALV Report(urgent)

0 Kudos

Hi ,

i want the below functionality in ALV report.

Here's the program that's needed:

-


BEGIN PROG (Z_YRTCM_RTCM_SO_CHECK) -


Get List1

From table YRTCM_POS_EXT, SELECT Distinct (YRTCM_POS_EXT.VBELN)

Get List2

From table CMSD_RTCM, SELECT Distinct (CMSD_RTCM.YY_VBELN)

Calculate List 3 as:

List3 = "List1-List2" (i.e. such entries in List1 that are NOT in List2)

Output List3

Then also…..Just for the heck of it:

Calculate List 4 as:

List4 = "List2-List1" (i.e. such entries in List2 that are NOT in List1)

(It'll be a shock if List4 did not return a NULL set)

Output List4

-


END PROG (Z_YRTCM_RTCM_SO_CHECK) -


Regards,

Cherith

1 ACCEPTED SOLUTION

Former Member
0 Kudos

If the common field is VBELN, try out the following code:

sort list1 by vbeln.

sort list2 by vbeln.

loop at list1.

read table list2 with key vbeln = list1-vbeln.

if sy-subrc <> 0.

move list1 to list3.

append list3.

endif.

endloop.

This code will give you the records which are present in list1 but not in list2.

Try out the similar logic for the other case also.

Reward all useful answers.

Thank you.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Can you please elaborate on this. Which is the common field in all of the four lists based on which you want to process the records. Is it VBELN?

0 Kudos

Hi Nilesh,

It is vbeln.

Regards,

Cherith

Former Member
0 Kudos

If the common field is VBELN, try out the following code:

sort list1 by vbeln.

sort list2 by vbeln.

loop at list1.

read table list2 with key vbeln = list1-vbeln.

if sy-subrc <> 0.

move list1 to list3.

append list3.

endif.

endloop.

This code will give you the records which are present in list1 but not in list2.

Try out the similar logic for the other case also.

Reward all useful answers.

Thank you.