cancel
Showing results for 
Search instead for 
Did you mean: 

smartforms data retrive from ekpo table

Former Member
0 Kudos

in Smartforms I have declare in Form Interface -> Import -> " wa_lastpo " type ekpo,

Now in main window create table, I have use -> Text - and in text (for PO display) -> &WA_LASTPO-EBELN&

ALSO in another text (TO DISPLAY Net price)-> &WA_LASTPO-NETPR&

see the coding :

DATA : GT_LASTPO LIKE EKPO OCCURS 0,

WA_LASTPO TYPE EKPO.

SELECT * FROM EKPO INTO TABLE GT_LASTPO

FOR ALL ENTRIES IN GT_EBAN

WHERE BANFN LE GT_EBAN-BANFN

                • AND NETPR = GT_EBAN-NETPR

AND MATNR = GT_EBAN-MATNR

AND WERKS = GT_EBAN-werks.

SORT GT_LASTPO BY BANFN NETPR DESCENDING.

DELETE ADJACENT DUPLICATES FROM GT_LASTPO COMPARING EBELN NETPR.

READ TABLE GT_LASTPO INTO WA_LASTPO INDEX 1.

see the above coding the last PO is displaying properly.

Now I have to retrieve Netpr from EKPO Table , how to retrieve please tell me .

Also the PO no is displaying through driver program I have to check in EKKO Table -> BSTYP = F.

How to do this ?

Regards

S J Akhtar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Answer rec own...

Former Member
0 Kudos

Hi,

Actually, I am confused.

Reason -

1. sorting the table on banfn & netpr and deleting adjacent duplucates on vbeln & NETPR. It's wrong.

2. what is the purpose to sort & delete on netpr?

3. Even, it is not understood why you are facing issues with displaying the netpr.

Please be more specific so that you will get a better solution.

Regards,

Selva K.

Former Member
0 Kudos

I declare "&WA_LASTPO-NETPR&" in main window -> table -> text (display po rate).

now using above coding in se38

the error is coming

" The reference field "&WA_LASTPO-NETPR&" is unknown in form"

and no any data display in smartforms

Former Member
0 Kudos

Hi

In smartforms, for CURR and QUAN fields , you need to give their Reference fields in the Global Definitions-->Curr/Quant Fields Tab.

Here, give the internal table and field which is a currency/quantity and next to it give a variable which is declared type its reference field. For Eg. MEINS for MENGE.

Hope this solves.

Regards,

Karthik

Former Member
0 Kudos

If I am using PREIS Fields (Table - EBAN) the data is coming but if I am using NETPR (Table -EKPO) the above message is coming.

in EBAN table there are no any fields like NETPR, but there are similar Fields PREIS .

Regards

Akhtar

Former Member
0 Kudos

Hi..

It could be that when you re using EBAN internal table then you might have included the reference field in the internal table itself however in case of EKPO's table, the reference field might not be included in internal table structure. In such cases you will have to declare the reference field as I had mentioned above.

Regards,

Karthik

Former Member
0 Kudos

Hi,

READ TABLE GT_LASTPO INTO WA_LASTPO INDEX 1.

This above mentioned statement itself will give both the ebeln(PO number) and NETPR (net proce value).

Suppose if you want to check whether the available PO number is of type BSTYP = 'F'.

Then write the select statement as follows.

select single ebeln from ekko into wc_ebeln where ebeln = wa_lastpo-ebeln and bstyp = 'F'.

Otherwise using join statements you can retrieve the PO data from single statement by using both the tables EKKO and EKPO.

Let me know if incase of any issues in the above points.

Regards,

prabu