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: 

SELECTING EKPO, EKKO AND T160T-SELPA?

Former Member
0 Kudos

Hi All,

I´m writing a report that show PO information. As a requirement they need to filter using the Selection parameters(T160T-SELPA) used in tcode ME2L, but I don´t know how to do it, I have read that that the values are in a pool table but I dont know what is the relation with table EKKO. Anybody knows?, how can I filter it?

The code:

SELECT BEBELN BMATNR BMENGE BNETWR

INTO CORRESPONDING FIELDS OF TABLE IMAT

FROM EKKO AS A INNER JOIN EKPO AS B

ON AEBELN = BEBELN

WHERE A~LIFNR EQ LIFNR.

(I would like to write also)

AND SELECTION_PARAMETER EQ ='XXXX0'

...

Any ideas?

Gabriel P.

5 REPLIES 5

Former Member
0 Kudos

Hi,

Table T160T has no relation with EKKO & EKPO. So you will not be able to us Join for it.

Better check in next step.

Thanks & Regards

Mahendra

Former Member
0 Kudos

Hi Mahendra,

Thanks for answering, but what I wonder is why in tcode ME2L it is used and in some way it filters the consult reponse...do you know how is it done?

Gabriel

Former Member
0 Kudos

Try mapping EKKO-EBELN with T160T-SELPA.

Former Member
0 Kudos

In the program <b>RM06EL00</b> look under the event

<b>AT SELECTION-SCREEN ON selpa</b>.

There will be a routine call:

<b>PERFORM selpa_analyse(sapfm06l).</b>

Also look at form <b>selpa_check_pos</b> in the include <b>FM06LFSL_SELPA_CHECK_POS</b>.

Former Member
0 Kudos

Hello Gabriel,

T160T is actually the text table for T160S which stores the "Selection Parameters for Purchasing Lists". Now based on what selection parameter, user chooses, your output and may be the select will change. This is not a field that you can use in your select statement. It will more likely be as follows.


SELECT * FROM T160S
        WHERE SELPA = P_SELPA.
*-- Assuming P_SELPA is your selection screen parameter
CASE T160S-WE000.
  WHEN '<>'.
*-- do something in the where clause of EKKO/EKPO select
*   and/or do something to the output
  WHEN '='.
*-- do something in the where clause of EKKO/EKPO select
*   and/or do something to the output
ENDCASE.

IF T160-WE00E = 'X'.
*-- do something in the where clause of EKKO/EKPO select
*   and/or do something to the output
ELSE.
*-- do something in the where clause of EKKO/EKPO select
*   and/or do something to the output
ENDIF.

-


-


.....

---.....

and so on and so forth for all the T160S fields.

Hope this helps,

Srinivas