Skip to Content
avatar image
Former Member

Select Distinct Fields from non related table

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 01, 2008 at 07:09 AM

    Plz any body can help me it's argent.

    Thanks

    Basu

    Add comment
    10|10000 characters needed characters exceeded