2012 Sep 24 10:24 PM
Hi ,
To get Open POs, I have used ME2N. Which is giving the data I required. My requirement is to write a pipe delimited file onto Application server. To do it I used the statement SUBMIT ... EXPORT TO MEMORY ... RETURN . Only problem with this is not able to load the result data into my internal table.
I don't find any proper code to find OPEN POs in this fourm. Does anyone have code for this?
Thank you,
Sasi Manthena
2012 Sep 24 10:28 PM
Try this example:
Submit the report ROIADELSTA and export output list to memory
SUBMIT roiadelsta WITH SELECTION-TABLE
t_select_tab EXPORTING LIST TO MEMORY
AND RETURN.
2012 Sep 24 10:55 PM
Hi Sashi,
To find out the open POs you can use the table EKET, checking the schedule quantity and the Quantity of Goods Received, fields MENGE and WEMNG, respectively. But this rule only is not enough. You have to consider other things like: PO itens blocked/deleted (EKPO-LOEKZ) , PO released (EKKO-FRGKE) (check if needed), etc.
There is also the field EKPO-EREKZ (Final Invoice Indicator) .
You can also check the post http://scn.sap.com/thread/218844
2012 Sep 25 2:09 AM
Hi Sashi,
This will work, textlines will contain the list:
Submit RM06EN00 AND RETURN EXPORTING LIST TO MEMORY
WITH EN_EBELN-LOW = '115669'
WITH LISTU = 'BEST'.
check sy-subrc eq 0.
DATA: ABAPLIST LIKE ABAPLIST OCCURS 0.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = ABAPLIST
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
DATA textlines(1024) TYPE C OCCURS 0 WITH HEADER LINE.
call function 'LIST_TO_ASCI'
tables
listobject = ABAPLIST
listasci = textlines
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
See these links for more info:
<link to blocked site removed by moderator>
http://saplab.blogspot.co.il/2007/10/sample-abap-program-to-export-list-to_18.html
Let know how that worked for you,
Best,
Iftah
Message was edited by: Thomas Zloch
2012 Sep 25 11:53 AM
I done related to Open PO LisT with out using standard.
Please Check Below Code :
SELECT ebeln bedat
FROM ekko
INTO TABLE i_ekko
WHERE bstyp = 'F'
AND bsart IN ('EL' ,'ER')
AND lifnr IN s_lifnr.
sort i_ekko by ebeln.
IF i_ekko[] IS NOT INITIAL.
SELECT ebeln ebelp matnr werks infnr mtart menge
INTO CORRESPONDING FIELDS OF TABLE i_order
FROM ekpo
FOR ALL ENTRIES IN i_ekko
WHERE ebeln = i_ekko-ebeln
AND werks in s_werks
AND loekz = ' '
AND elikz <> 'X'
AND mtart = 'PART'.
ENDIF.
Regards,
S.Chandrakumar
2012 Sep 25 2:18 PM
I tried using
call function 'LIST_TO_ASCI'
tables
listobject = ABAPLIST
listasci = textlines
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
This does not help me as I can not get the required data from the 'textlines' table to my internal table. The row data for 'textlines' is a character string and some data like list header need to be removed.
My requirement is to write a pipe delimited file to the Application Server. The data type that need to be in the file is :
types : begin of ty_output
, pur_name type ernam
, leg_entiry type bukrs
, po_num type ebeln
, currency type waers
, status_po type char20
, vendor_id type elifn
, taxcode type mwskz
, end of ty_output
.
select statement used is :
select a~ernam a~bukrs
a~ebeln a~waers
a~statu a~lifnr
b~mwskz
into table lt_output
from ekko as a
inner join ekpo as b on a~ebeln = b~ebeln
where a~ebeln in s_ebeln and
a~ekorg in s_ekorg and
a~bsart in s_bsart and
a~aedat in s_aedat and
a~bstyp eq 'F' and
a~loekz eq space and
a~frgrl eq space and
b~loekz eq space and
b~elikz eq space
.
sort lt_output.
delete adjacent duplicates from lt_output.
2012 Sep 25 8:12 PM
I am able to match the data with ME2N by modifying the above query with the following. Its working fine.
SELECT a~ernam a~bukrs
a~ebeln a~waers
a~statu a~lifnr
b~mwskz
INTO TABLE lt_output
FROM ekko AS a
INNER JOIN ekpo AS b ON a~ebeln = b~ebeln
INNER JOIN eket AS c ON b~ebeln = c~ebeln AND
b~ebelp = c~ebelp
WHERE a~ebeln IN s_ebeln AND "pur. doc.
a~ekorg IN s_ekorg AND "pur. org.
a~bsart IN s_bsart AND "document type
a~aedat IN s_aedat AND "created on
a~bstyp EQ 'F' AND "doc. category
a~loekz EQ space AND "delition indicator
* a~frgrl EQ space AND "subj. to release
b~loekz EQ space AND "deletion indicator
b~elikz EQ space AND "delivery complete
( ( b~eglkz EQ 'X' AND "final delivery
c~wamng NE space ) OR "
b~repos = 'X' ) "invoice receipt
.