2007 Jul 27 9:41 AM
Hi,
I wrote the program, (Progarm everything is syntactically correct. Just i want to get the output with write statement). How can i define the data type for the output for multiple tables. Which table name shall i take into the output type. Plz tell me how to pass this join staement into the output type.
I had marked in bold words. Plz select how to get the output.
TYPES:
BEGIN OF TY_LFB1,
MINDK TYPE LFB1-MINDK,
END OF TY_LFB1,
BEGIN OF TY_EKKO,
EKGRP TYPE EKKO-EKGRP,
AEDAT TYPE EKKO-AEDAT,
EBELN TYPE EKKO-EBELN,
SUBMI TYPE EKKO-SUBMI,
BSART TYPE EKKO-BSART,
KTWRT TYPE EKKO-KTWRT,
LIFNR TYPE EKKO-LIFNR,
END OF TY_EKKO,
BEGIN OF TY_LFA1,
KTOKK TYPE LFA1-KTOKK,
NAME1 TYPE LFA1-NAME1,
ORT01 TYPE LFA1-ORT01,
REGIO TYPE LFA1-REGIO,
PSTLZ TYPE LFA1-PSTLZ,
TELF1 TYPE LFA1-TELF1,
TELFX TYPE LFA1-TELFX,
END OF TY_LFA1,
BEGIN OF TY_ADRC,
HOUSE_NUM1 TYPE ADRC-HOUSE_NUM1,
STREET TYPE ADRC-STREET,
PO_BOX TYPE ADRC-PO_BOX,
END OF TY_ADRC,
BEGIN OF TY_ADR6,
SMTP_ADDR TYPE ADR6-SMTP_ADDR,
END OF TY_ADR6,
BEGIN OF TY_WYT3,
LIFN2 TYPE WYT3-LIFN2,
END OF TY_WYT3.
D A T A
DATA:
ST_LFB1 TYPE TY_LFB1,
IT_LFB1 TYPE TABLE OF TY_LFB1,
ST_EKKO TYPE TY_EKKO,
IT_EKKO TYPE TABLE OF TY_EKKO,
ST_LFA1 TYPE TY_LFA1,
IT_LFA1 TYPE TABLE OF TY_LFA1,
ST_ADRC TYPE TY_ADRC,
IT_ADRC TYPE TABLE OF TY_ADRC,
ST_ADR6 TYPE TY_ADR6,
IT_ADR6 TYPE TABLE OF TY_ADR6,
ST_WYT3 TYPE TY_WYT3,
IT_WYT3 TYPE TABLE OF TY_WYT3,
<b>ST_TAB1 TYPE TY_EKKO,
IT_TAB1 TYPE TABLE OF TY_EKKO.</b>
S E L E C T O P T I O N S.
SELECT-OPTIONS:
SMINDK FOR ST_LFB1-MINDK,
SAEDAT FOR ST_EKKO-AEDAT,
SEKGRP FOR ST_EKKO-EKGRP,
SLIFNR FOR ST_EKKO-LIFNR.
A T S E L E C T I O N S C R E E N
AT SELECTION-SCREEN.
PERFORM VALIDATE_MINDK.
PERFORM VALIDATE_EKGRP.
PERFORM VALIDATE_LIFNR.
S T A R T O F S E L E C T I O N.
START-OF-SELECTION.
PERFORM GETDATA_EKKO.
PERFORM GETMIND_LFB1.
PERFORM GET_VENDORMASTERDATA.
PERFORM GET_VENDORADDRESS.
PERFORM GET_VENDOREMAIL.
PERFORM GET_INVOICEPARTY.
SELECT EKKOEKGRP EKKOAEDAT EKKOEBELN EKKOSUBMI EKKOBSART EKKOKTWRT EKKO~LIFNR
LFA1KTOKK LFA1NAME1 LFB1MINDK ADRCHOUSE_NUM1 ADRCSTREET ADRCPO_BOX ADR6SMTP_ADDR WYT3LIFN2 INTO TABLE IT_TAB1
FROM EKKO INNER JOIN LFA1 ON EKKOLIFNR EQ LFA1LIFNR
JOIN LFB1 ON LFA1LIFNR EQ LFB1LIFNR
JOIN WYT3 ON LFA1LIFNR EQ WYT3LIFNR
JOIN ADRC ON LFA1ADRNR EQ ADRCADDRNUMBER
JOIN ADR6 ON ADRCADDRNUMBER EQ ADR6ADDRNUMBER
WHERE LFB1~MINDK IN SMINDK AND
EKKO~AEDAT IN SAEDAT AND
EKKO~EKGRP IN SEKGRP AND
EKKO~LIFNR IN SLIFNR.
IF SY-SUBRC EQ 0.
LOOP AT IT_TAB1 INTO ST_TAB1.
<b>WRITE:/ ST_TAB1-EKGRP,ST_TAB1-AEDAT,ST_TAB1-EBELN,ST_TAB1-SUBMI,ST_TAB1-BSART,ST_TAB1-KTWRT,ST_TAB1-LIFNR,ST_TAB1-KTOKK,
ST_TAB1-NAME1,ST_TAB1-MINDK,ST_TAB1-HOUSE_NUM1,ST_TAB1-STREET,ST_TAB1-PO_BOX,ST_TAB1-SMTP_ADDR,ST_TAB1-LIFN2.</b>
ENDLOOP.
ELSE.
WRITE:/ 'NO RECORDS FOUND'.
ENDIF.
Ram
2007 Jul 27 9:57 AM
<b>data:
begin of fs_itab1,
ekgrp type EKKO-EKGRP ,
aedat type EKKO-AEDAT ,
ebeln type EKKO-EBELN ,
submi type EKKO-SUBMI ,
bsart type EKKO-BSART ,
ktwrt type EKKO-KTWRT ,
lifnr type EKKO-LIFNR,
ktokk type LFA1-KTOKK ,
name1 type LFA1-NAME1 ,
mindk type LFB1-MINDK ,
house_num1 type ADRC-HOUSE_NUM1 ,
street type ADRC-STREET ,
po_box type ADRC-PO_BOX ,
smtp_addr type ADR6-SMTP_ADDR ,
lifn2 type WYT3-LIFN2,
end of fs_itab1.
data: it_itab1 like standard table of fs_itab1.
SELECT EKKOEKGRP EKKOAEDAT EKKOEBELN EKKOSUBMI EKKOBSART EKKOKTWRT EKKO~LIFNR
LFA1KTOKK LFA1NAME1 LFB1MINDK ADRCHOUSE_NUM1 ADRCSTREET ADRCPO_BOX ADR6SMTP_ADDR WYT3LIFN2 INTO TABLE IT_ITAB1
FROM EKKO INNER JOIN LFA1 ON EKKOLIFNR EQ LFA1LIFNR
JOIN LFB1 ON LFA1LIFNR EQ LFB1LIFNR
JOIN WYT3 ON LFA1LIFNR EQ WYT3LIFNR
JOIN ADRC ON LFA1ADRNR EQ ADRCADDRNUMBER
JOIN ADR6 ON ADRCADDRNUMBER EQ ADR6ADDRNUMBER
WHERE LFB1~MINDK IN SMINDK AND
EKKO~AEDAT IN SAEDAT AND
EKKO~EKGRP IN SEKGRP AND
EKKO~LIFNR IN SLIFNR.
IF SY-SUBRC EQ 0.
LOOP AT IT_ITAB1 INTO fs_itab1.
WRITE:/ fs_itab1-EKGRP,fs_itab1-AEDAT,fs_itab1-EBELN,fs_itab1-SUBMI,fs_itab1-BSART,fs_itab1-KTWRT,fs_itab1-LIFNR,fs_itab1-KTOKK,
fs_itab1-NAME1,fs_itab1-MINDK,fs_itab1-HOUSE_NUM1,fs_itab1-STREET,fs_itab1-PO_BOX,fs_itab1-SMTP_ADDR,fs_itab1-LIFN2.
ENDLOOP.
ELSE.
WRITE:/ 'NO RECORDS FOUND'.
ENDIF.
</b>
Change the above part of the code, the errors are rectified.
Regards,
Pavan
2007 Jul 27 9:45 AM
hi rams
u asked how to pass this join statement into the output type? wat u meant by that
can u plz explain
regards
ravish
2007 Jul 27 9:50 AM
Hi,
I want to Use WRITE statement . But in that Write statement i have to use the datatype. This is the write staement but iam getting the error that The data object "ST_TAB1" does not have a component called "KTOKK". Plz tell me how to WRITE the statement.
This is the data.
DATA:
ST_LFB1 TYPE TY_LFB1,
IT_LFB1 TYPE TABLE OF TY_LFB1,
ST_EKKO TYPE TY_EKKO,
IT_EKKO TYPE TABLE OF TY_EKKO,
ST_LFA1 TYPE TY_LFA1,
IT_LFA1 TYPE TABLE OF TY_LFA1,
ST_ADRC TYPE TY_ADRC,
IT_ADRC TYPE TABLE OF TY_ADRC,
ST_ADR6 TYPE TY_ADR6,
IT_ADR6 TYPE TABLE OF TY_ADR6,
ST_WYT3 TYPE TY_WYT3,
IT_WYT3 TYPE TABLE OF TY_WYT3,
ST_TAB1 TYPE TY_EKKO,
IT_TAB1 TYPE TABLE OF TY_EKKO.
WRITE:/ ST_TAB1-EKGRP,ST_TAB1-AEDAT,ST_TAB1-EBELN,ST_TAB1-SUBMI,ST_TAB1-BSART,ST_TAB1-KTWRT,ST_TAB1-LIFNR,ST_TAB1-KTOKK,
ST_TAB1-NAME1,ST_TAB1-MINDK,ST_TAB1-HOUSE_NUM1,ST_TAB1-STREET,ST_TAB1-PO_BOX,ST_TAB1-SMTP_ADDR,ST_TAB1-LIFN2.
2007 Jul 27 9:52 AM
Hi,
I want to Use WRITE statement . But in that Write statement i have to use the datatype. This is the write staement but iam getting the error that The data object "ST_TAB1" does not have a component called "KTOKK". Plz tell me how to WRITE the statement.
This is the data.
DATA:
ST_LFB1 TYPE TY_LFB1,
IT_LFB1 TYPE TABLE OF TY_LFB1,
ST_EKKO TYPE TY_EKKO,
IT_EKKO TYPE TABLE OF TY_EKKO,
ST_LFA1 TYPE TY_LFA1,
IT_LFA1 TYPE TABLE OF TY_LFA1,
ST_ADRC TYPE TY_ADRC,
IT_ADRC TYPE TABLE OF TY_ADRC,
ST_ADR6 TYPE TY_ADR6,
IT_ADR6 TYPE TABLE OF TY_ADR6,
ST_WYT3 TYPE TY_WYT3,
IT_WYT3 TYPE TABLE OF TY_WYT3,
ST_TAB1 TYPE TY_EKKO,
IT_TAB1 TYPE TABLE OF TY_EKKO.
WRITE:/ ST_TAB1-EKGRP,ST_TAB1-AEDAT,ST_TAB1-EBELN,ST_TAB1-SUBMI,ST_TAB1-BSART,ST_TAB1-KTWRT,ST_TAB1-LIFNR,ST_TAB1-KTOKK,
ST_TAB1-NAME1,ST_TAB1-MINDK,ST_TAB1-HOUSE_NUM1,ST_TAB1-STREET,ST_TAB1-PO_BOX,ST_TAB1-SMTP_ADDR,ST_TAB1-LIFN2.
2007 Jul 27 9:53 AM
please check your internal table and your workarea for the field KTOKK
i feel that this field is not declared properly or may be not declared at all
2007 Jul 27 9:53 AM
hi do like this.
loop at IT_TAB1 into ST_TAB1.
WRITE:/ ST_TAB1-EKGRP,ST_TAB1-AEDAT,ST_TAB1-EBELN,ST_TAB1-SUBMI,ST_TAB1-BSART,ST_TAB1-KTWRT,ST_TAB1-LIFNR,ST_TAB1-KTOKK,
ST_TAB1-NAME1,ST_TAB1-MINDK,ST_TAB1-HOUSE_NUM1,ST_TAB1-STREET,ST_TAB1-PO_BOX,ST_TAB1-SMTP_ADDR,ST_TAB1-LIFN2.
Endloop.
Reward if helpful
check it out wether this field KTOKK is in structure TY_EKKO defined or not.
regards
Azad.
2007 Jul 27 9:55 AM
Hi Ram,
Your system is giving an error saying ST_TAB1 does not have a component called KTOKK, this is bcoz, the internal table ST_TAB1 is defined based on TY_EKKO and in the definition of TY_EKKO you've not included the field KTOKK.
Inorder to get the result you have to use such internal table which has KTOKK in its definition or you need to include KTOKK into the definition of TY_EKKO and populate the value into ST_TAB1 later.
<b>
Reward points if this helps,</b>
Kiran
2007 Jul 27 10:00 AM
replce the definition of ty_ekko with following code
types : begin of ty_ekko ,
ekgrp type ekko-ekgrp ,
aedat type ekko-aedat ,
ebeln type ekko-ebeln ,
submi type ekko-submi ,
bsart type ekko-bsart ,
ktwrt type ekko-ktwrt ,
lifnr type ekko-lifnr ,
ktokk type lfa1-ktokk ,
name1 type lfa1-name1 ,
mindk type lfb1-mindk
house_num1 type adrc-house_num1 ,
street type adrc-street ,
po_box type adrc-po_box ,
smtp_addr type adr6-smtp_addr ,
lifn2 type wyt3-lifn2
end of ty_ekko .
2007 Jul 27 9:56 AM
TYPES : BEGIN OF TY_EKKO,
EKGRP TYPE EKKO-EKGRP,
AEDAT TYPE EKKO-AEDAT,
EBELN TYPE EKKO-EBELN,
SUBMI TYPE EKKO-SUBMI,
BSART TYPE EKKO-BSART,
KTWRT TYPE EKKO-KTWRT,
LIFNR TYPE EKKO-LIFNR,
END OF TY_EKKO,
This is your declaration for TY_EKKO which does not have KTOKK.
Regards
Gopi
2007 Jul 27 9:56 AM
Hi Ram,
You have to create a type containing all the fields of your defined types TY_EKKO, TY_LFA1, TY_LFB1,TY_LFB1and TY_ADRC. and use that type for getting the result from your select statement and use the same for out putting. i think you are searching for this answer.
revert back if this is not the solution you are looking for
Regards
Sarath
Reward points
2007 Jul 27 9:57 AM
<b>data:
begin of fs_itab1,
ekgrp type EKKO-EKGRP ,
aedat type EKKO-AEDAT ,
ebeln type EKKO-EBELN ,
submi type EKKO-SUBMI ,
bsart type EKKO-BSART ,
ktwrt type EKKO-KTWRT ,
lifnr type EKKO-LIFNR,
ktokk type LFA1-KTOKK ,
name1 type LFA1-NAME1 ,
mindk type LFB1-MINDK ,
house_num1 type ADRC-HOUSE_NUM1 ,
street type ADRC-STREET ,
po_box type ADRC-PO_BOX ,
smtp_addr type ADR6-SMTP_ADDR ,
lifn2 type WYT3-LIFN2,
end of fs_itab1.
data: it_itab1 like standard table of fs_itab1.
SELECT EKKOEKGRP EKKOAEDAT EKKOEBELN EKKOSUBMI EKKOBSART EKKOKTWRT EKKO~LIFNR
LFA1KTOKK LFA1NAME1 LFB1MINDK ADRCHOUSE_NUM1 ADRCSTREET ADRCPO_BOX ADR6SMTP_ADDR WYT3LIFN2 INTO TABLE IT_ITAB1
FROM EKKO INNER JOIN LFA1 ON EKKOLIFNR EQ LFA1LIFNR
JOIN LFB1 ON LFA1LIFNR EQ LFB1LIFNR
JOIN WYT3 ON LFA1LIFNR EQ WYT3LIFNR
JOIN ADRC ON LFA1ADRNR EQ ADRCADDRNUMBER
JOIN ADR6 ON ADRCADDRNUMBER EQ ADR6ADDRNUMBER
WHERE LFB1~MINDK IN SMINDK AND
EKKO~AEDAT IN SAEDAT AND
EKKO~EKGRP IN SEKGRP AND
EKKO~LIFNR IN SLIFNR.
IF SY-SUBRC EQ 0.
LOOP AT IT_ITAB1 INTO fs_itab1.
WRITE:/ fs_itab1-EKGRP,fs_itab1-AEDAT,fs_itab1-EBELN,fs_itab1-SUBMI,fs_itab1-BSART,fs_itab1-KTWRT,fs_itab1-LIFNR,fs_itab1-KTOKK,
fs_itab1-NAME1,fs_itab1-MINDK,fs_itab1-HOUSE_NUM1,fs_itab1-STREET,fs_itab1-PO_BOX,fs_itab1-SMTP_ADDR,fs_itab1-LIFN2.
ENDLOOP.
ELSE.
WRITE:/ 'NO RECORDS FOUND'.
ENDIF.
</b>
Change the above part of the code, the errors are rectified.
Regards,
Pavan
2007 Jul 27 9:59 AM
This is the complete code with no errors.......
Copy paste the code
TYPES:
BEGIN OF TY_LFB1,
MINDK TYPE LFB1-MINDK,
END OF TY_LFB1,
BEGIN OF TY_EKKO,
EKGRP TYPE EKKO-EKGRP,
AEDAT TYPE EKKO-AEDAT,
EBELN TYPE EKKO-EBELN,
SUBMI TYPE EKKO-SUBMI,
BSART TYPE EKKO-BSART,
KTWRT TYPE EKKO-KTWRT,
LIFNR TYPE EKKO-LIFNR,
END OF TY_EKKO,
BEGIN OF TY_LFA1,
KTOKK TYPE LFA1-KTOKK,
NAME1 TYPE LFA1-NAME1,
ORT01 TYPE LFA1-ORT01,
REGIO TYPE LFA1-REGIO,
PSTLZ TYPE LFA1-PSTLZ,
TELF1 TYPE LFA1-TELF1,
TELFX TYPE LFA1-TELFX,
END OF TY_LFA1,
BEGIN OF TY_ADRC,
HOUSE_NUM1 TYPE ADRC-HOUSE_NUM1,
STREET TYPE ADRC-STREET,
PO_BOX TYPE ADRC-PO_BOX,
END OF TY_ADRC,
BEGIN OF TY_ADR6,
SMTP_ADDR TYPE ADR6-SMTP_ADDR,
END OF TY_ADR6,
BEGIN OF TY_WYT3,
LIFN2 TYPE WYT3-LIFN2,
END OF TY_WYT3.
D A T A
DATA:
ST_LFB1 TYPE TY_LFB1,
IT_LFB1 TYPE TABLE OF TY_LFB1,
ST_EKKO TYPE TY_EKKO,
IT_EKKO TYPE TABLE OF TY_EKKO,
ST_LFA1 TYPE TY_LFA1,
IT_LFA1 TYPE TABLE OF TY_LFA1,
ST_ADRC TYPE TY_ADRC,
IT_ADRC TYPE TABLE OF TY_ADRC,
ST_ADR6 TYPE TY_ADR6,
IT_ADR6 TYPE TABLE OF TY_ADR6,
ST_WYT3 TYPE TY_WYT3,
IT_WYT3 TYPE TABLE OF TY_WYT3,
ST_TAB1 TYPE TY_EKKO.
*IT_TAB1 TYPE TABLE OF TY_EKKO.
S E L E C T O P T I O N S.
SELECT-OPTIONS:
SMINDK FOR ST_LFB1-MINDK,
SAEDAT FOR ST_EKKO-AEDAT,
SEKGRP FOR ST_EKKO-EKGRP,
SLIFNR FOR ST_EKKO-LIFNR.
data:
begin of fs_itab1,
ekgrp type EKKO-EKGRP ,
aedat type EKKO-AEDAT ,
ebeln type EKKO-EBELN ,
submi type EKKO-SUBMI ,
bsart type EKKO-BSART ,
ktwrt type EKKO-KTWRT ,
lifnr type EKKO-LIFNR,
ktokk type LFA1-KTOKK ,
name1 type LFA1-NAME1 ,
mindk type LFB1-MINDK ,
house_num1 type ADRC-HOUSE_NUM1 ,
street type ADRC-STREET ,
po_box type ADRC-PO_BOX ,
smtp_addr type ADR6-SMTP_ADDR ,
lifn2 type WYT3-LIFN2,
end of fs_itab1.
data: it_itab1 like standard table of fs_itab1.
SELECT EKKOEKGRP EKKOAEDAT EKKOEBELN EKKOSUBMI EKKOBSART EKKOKTWRT
EKKO~LIFNR
LFA1KTOKK LFA1NAME1 LFB1MINDK ADRCHOUSE_NUM1 ADRCSTREET ADRCPO_BOX
ADR6SMTP_ADDR WYT3LIFN2 INTO TABLE IT_ITAB1
FROM EKKO INNER JOIN LFA1 ON EKKOLIFNR EQ LFA1LIFNR
JOIN LFB1 ON LFA1LIFNR EQ LFB1LIFNR
JOIN WYT3 ON LFA1LIFNR EQ WYT3LIFNR
JOIN ADRC ON LFA1ADRNR EQ ADRCADDRNUMBER
JOIN ADR6 ON ADRCADDRNUMBER EQ ADR6ADDRNUMBER
WHERE LFB1~MINDK IN SMINDK AND
EKKO~AEDAT IN SAEDAT AND
EKKO~EKGRP IN SEKGRP AND
EKKO~LIFNR IN SLIFNR.
IF SY-SUBRC EQ 0.
LOOP AT IT_ITAB1 INTO fs_itab1.
WRITE:/ fs_itab1-EKGRP,fs_itab1-AEDAT,fs_itab1-EBELN,fs_itab1-SUBMI,
fs_itab1-BSART,fs_itab1-KTWRT,fs_itab1-LIFNR,fs_itab1-KTOKK,
fs_itab1-NAME1,fs_itab1-MINDK,fs_itab1-HOUSE_NUM1,fs_itab1-STREET,
fs_itab1-PO_BOX,fs_itab1-SMTP_ADDR,fs_itab1-LIFN2.
ENDLOOP.
ELSE.
WRITE:/ 'NO RECORDS FOUND'.
ENDIF.
Regards,
Pavan.
2007 Jul 27 10:02 AM
First u have types like below and refer this to some itab...
and store the data which u are getting from select statement in to this internal table...and use write statement.
<b>Types: BEGIN OF TY_Final,
EKGRP TYPE EKKO-EKGRP,
AEDAT TYPE EKKO-AEDAT,
EBELN TYPE EKKO-EBELN,
SUBMI TYPE EKKO-SUBMI,
BSART TYPE EKKO-BSART,
KTWRT TYPE EKKO-KTWRT,
LIFNR TYPE EKKO-LIFNR,
KTOKK type lfa1-KTOKK,
NAME1 type lfa1-NAME1,
MINDK type lfa1-MINDK,
HOUSE_NUM1 type adrc-HOUSE_NUM1 ,
STREET type adrc-STREET,
PO_BOX type adrc-PO_BOX ,
SMTP_ADDR type adr6-SMTP_ADDR ,
LIFN2 type wyt3-LIFN2,
END OF TY_final,</b>
TYPES:
BEGIN OF TY_LFB1,
MINDK TYPE LFB1-MINDK,
END OF TY_LFB1,
BEGIN OF TY_EKKO,
EKGRP TYPE EKKO-EKGRP,
AEDAT TYPE EKKO-AEDAT,
EBELN TYPE EKKO-EBELN,
SUBMI TYPE EKKO-SUBMI,
BSART TYPE EKKO-BSART,
KTWRT TYPE EKKO-KTWRT,
LIFNR TYPE EKKO-LIFNR,
END OF TY_EKKO,
BEGIN OF TY_LFA1,
KTOKK TYPE LFA1-KTOKK,
NAME1 TYPE LFA1-NAME1,
ORT01 TYPE LFA1-ORT01,
REGIO TYPE LFA1-REGIO,
PSTLZ TYPE LFA1-PSTLZ,
TELF1 TYPE LFA1-TELF1,
TELFX TYPE LFA1-TELFX,
END OF TY_LFA1,
BEGIN OF TY_ADRC,
HOUSE_NUM1 TYPE ADRC-HOUSE_NUM1,
STREET TYPE ADRC-STREET,
PO_BOX TYPE ADRC-PO_BOX,
END OF TY_ADRC,
BEGIN OF TY_ADR6,
SMTP_ADDR TYPE ADR6-SMTP_ADDR,
END OF TY_ADR6,
BEGIN OF TY_WYT3,
LIFN2 TYPE WYT3-LIFN2,
END OF TY_WYT3.
D A T A
DATA:
ST_LFB1 TYPE TY_LFB1,
IT_LFB1 TYPE TABLE OF TY_LFB1,
ST_EKKO TYPE TY_EKKO,
IT_EKKO TYPE TABLE OF TY_EKKO,
ST_LFA1 TYPE TY_LFA1,
IT_LFA1 TYPE TABLE OF TY_LFA1,
ST_ADRC TYPE TY_ADRC,
IT_ADRC TYPE TABLE OF TY_ADRC,
ST_ADR6 TYPE TY_ADR6,
IT_ADR6 TYPE TABLE OF TY_ADR6,
ST_WYT3 TYPE TY_WYT3,
IT_WYT3 TYPE TABLE OF TY_WYT3,
<b>
Data: ST_TAB1 TYPE TY_Final,
IT_TAB1 TYPE TABLE OF TY_Final.</b>
S E L E C T O P T I O N S.
SELECT-OPTIONS:
SMINDK FOR ST_LFB1-MINDK,
SAEDAT FOR ST_EKKO-AEDAT,
SEKGRP FOR ST_EKKO-EKGRP,
SLIFNR FOR ST_EKKO-LIFNR.
A T S E L E C T I O N S C R E E N
AT SELECTION-SCREEN.
PERFORM VALIDATE_MINDK.
PERFORM VALIDATE_EKGRP.
PERFORM VALIDATE_LIFNR.
S T A R T O F S E L E C T I O N.
START-OF-SELECTION.
PERFORM GETDATA_EKKO.
PERFORM GETMIND_LFB1.
PERFORM GET_VENDORMASTERDATA.
PERFORM GET_VENDORADDRESS.
PERFORM GET_VENDOREMAIL.
PERFORM GET_INVOICEPARTY.
SELECT EKKOEKGRP EKKOAEDAT EKKOEBELN EKKOSUBMI EKKOBSART EKKOKTWRT EKKO~LIFNR
LFA1KTOKK LFA1NAME1 LFB1MINDK ADRCHOUSE_NUM1 ADRCSTREET ADRCPO_BOX ADR6SMTP_ADDR WYT3LIFN2 INTO TABLE IT_TAB1
FROM EKKO INNER JOIN LFA1 ON EKKOLIFNR EQ LFA1LIFNR
JOIN LFB1 ON LFA1LIFNR EQ LFB1LIFNR
JOIN WYT3 ON LFA1LIFNR EQ WYT3LIFNR
JOIN ADRC ON LFA1ADRNR EQ ADRCADDRNUMBER
JOIN ADR6 ON ADRCADDRNUMBER EQ ADR6ADDRNUMBER
WHERE LFB1~MINDK IN SMINDK AND
EKKO~AEDAT IN SAEDAT AND
EKKO~EKGRP IN SEKGRP AND
EKKO~LIFNR IN SLIFNR.
IF SY-SUBRC EQ 0.
LOOP AT IT_TAB1 INTO ST_TAB1.
WRITE:/ ST_TAB1-EKGRP,ST_TAB1-AEDAT,ST_TAB1-EBELN,ST_TAB1-SUBMI,ST_TAB1-BSART,ST_TAB1-KTWRT,ST_TAB1-LIFNR,ST_TAB1-KTOKK,
ST_TAB1-NAME1,ST_TAB1-MINDK,ST_TAB1-HOUSE_NUM1,ST_TAB1-STREET,ST_TAB1-PO_BOX,ST_TAB1-SMTP_ADDR,ST_TAB1-LIFN2.
ENDLOOP.
ELSE.
WRITE:/ 'NO RECORDS FOUND'.
ENDIF.
Message was edited by:
Sumi Vasu