on 08-09-2010 7:45 AM
hi ,
SELECT BANFN BADAT MATNR WERKS FROM EBAN INTO CORRESPONDING FIELDS OF TABLE gt_LASTPR
FOR ALL ENTRIES IN GT_EBAN " GT_EBAN is First Internal table.
WHERE BANFN LT GT_EBAN-BANFN
AND MATNR = GT_EBAN-MATNR
AND WERKS = GT_EBAN-WERKS.
READ TABLE GT_LASTPR INTO WA_LASTPR INDEX 1.
SORT GT_LASTPR BY matnr werks ASCENDING.
DELETE ADJACENT DUPLICATES FROM GT_LASTPR COMPARING matnr werks.
LOOP AT gt_LASTPR INTO WA_LASTPR.
ENDLOOP.
READ TABLE GT_LASTPR INTO WA_LASTPR INDEX 1.
see the above coding , I have different material and plant , against this material and plant combination i have different
last / Past
PR No , in my current PR I want to display last PR no. date against material and plant combination .
But here using this above coding same date is displaying for all against material and plant combination
how to display different last PR date in this form against material and plant combination ?
Ans rec...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check below logic
data : m_matnr type matnr,
m_werks type werks_d,
m_banfn type eban-banfn.
SELECT BANFN BADAT MATNR WERKS FROM EBAN INTO CORRESPONDING FIELDS OF TABLE gt_LASTPR
FOR ALL ENTRIES IN GT_EBAN " GT_EBAN is First Internal table.
WHERE BANFN LT GT_EBAN-BANFN
AND MATNR = GT_EBAN-MATNR
AND WERKS = GT_EBAN-WERKS.
SORT GT_LASTPR BY matnr werks badat ASCENDING.
clear : m_matnr, m_werks, m_banfn.
loop at gt_lastpr into wa_lastpr.
if ( m_matnr ne wa_lastpr-matnr and
m_werks ne wa_lastpr-werks and
m_matnr is not initial and
m_werks is not initial ).
write 😕 m_matnr, m_werks,'last pr no', m_banfn.
endif.
move wa_lastpr-matnr to m_matnr.
move wa_lastpr-werks to m_werks.
move wa_lastpr-banfn to m_banfn
endloop.
write 😕 m_matnr, m_werks,'last pr no', m_banfn.
Regards
Vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK the data is displaying like
MATNR WERKS BANFN BADAT
1. 1946 1000 10014129 17.06.2010
2. 1938 1000 10014129 17.06.2010
3. 253-200 3000 10014129 17.06.2010
But i have three different material (MATNR) where only 1964 have last PR no like
MATNR WERKS BANFN BADAT
1. 1946 1000 10014129 17.06.2010
2. 1938 1000 - -
3 253-200 3000 - -
but in smartforms
I want in my smartfforms to display like
MATNR WERKS BANFN BADAT
1. 1946 1000 10014129 17.06.2010
2. 1938 1000 - -
3 253-200 3000 - -
If there are no PR no there should be blank.
In selection screen I using current PR no 10014151 this created on date 18.08.2010, and the last PR no for
material 1964 is 10014129 date 17.06.2010,
But for 1938 or 253-200 Don't have any last PR like :-
MATNR WERKS BANFN BADAT
1946 1000 10014129 17.06.2010
1938 1000 - -
253-200 3000 - -
also for this
READ TABLE GT_LASTPO INTO WA_LASTPO INDEX 1.
is this is correct or not?
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.