cancel
Showing results for 
Search instead for 
Did you mean: 

Select Distinct Fields from non related table

former_member575017
Participant
0 Kudos

Hi Experts,

I have to fetch Distinct Fields from table zdcxy along with the fields from the table zvend but there is no primary key forigen key relationship also if I wanted use join condition. I need to move fields from both the table into output file and 1 part I implemented but I am unable to do second part plz any body can help me its argent. below I pasted part of code along with two requirements.

1.Select all data (Location - LIFNR, Descr u2013 ZPLTNAMEC, CJI_CUSTOMER u2013 CJI customer flag) from ZVEND table.

2.Select all distinct DCs and BUs from zdcxy table.

SELECT * FROM ZVENDPLT INTO CORRESPONDING FIELDS OF TABLE IT_VENDPLT.

*select distinct zdc from zdcxy into corresponding fields of table it_map.

*select distinct zbu from zdcxy into corresponding fields of table it_map.

IF SY-SUBRC = 0.

LOOP AT IT_VEND.

MOVE : IT_VENDPLT-LIFNR TO IT_TAB-FIELD1,

IT_VENDPLT-ZPLTNAMEC TO IT_TAB-FIELD2,

IT_VENDPLT-CJI_CUSTOMER TO IT_TAB-FIELD3,

CONCATENATE :IiT_TAB-FIELD1 IT_TAB-FIELD2 IT_TAB-FIELD3 IT_TAB-FIELD4

INTO IT_LOAD-RECORD SEPARATED BY SEPARATOR.

TRANSFER IT_LOAD TO OUT_FILE.

ENDLOOP.

Can any body explain me hw to fetch DC and Bu from the table zdcxy and keep in the same loop of it_vend.

Second thing is that I need to give information about records into second output file hw to do that means I opened one more file and I am unable to move the record history there plz help me.

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member575017
Participant
0 Kudos

Plz any body can help me it's argent.

Thanks

Basu