[sap-dev] Problem with SELECT statement and JOIN into internal table
Posted by
Admin at
Share this post:
|
0 Comments
Posted by Chekker on Aug 25 at 7:39 PM |
Dear all,
I am trying to program a follow-up action (function module) in a service notification, that should update the service order header status.
However, I have a problem with a SELECT statement: Nothing is read into the internal table ITAB_STAT_UPDATE. Communication structure I_VIQMEL brings data across.
Could someone please let me know what the problem is?
Thanks,
Chris
TABLES: AUFK, JEST.
DATA: WA_STAT_UPDATE LIKE JEST,
ITAB_STAT_UPDATE LIKE SORTED TABLE OF JEST WITH NON-UNIQUE KEY OBJNR WITH HEADER LINE.
SELECT B~STAT
B~INACT
B~OBJNR
INTO CORRESPONDING FIELDS OF TABLE ITAB_STAT_UPDATE
FROM AUFK AS A
INNER JOIN JEST AS B
ON A~OBJNR = B~OBJNR
WHERE A~AUFNR = I_VIQMEL-AUFNR AND
B~INACT = '' AND
B~STAT = 'E*'.
LOOP AT ITAB_STAT_UPDATE INTO WA_STAT_UPDATE.
CALL FUNCTION 'I_CHANGE_STATUS'
EXPORTING OBJNR = WA_STAT_UPDATE-OBJNR
ESTAT_INACTIVE = WA_STAT_UPDATE-INACT
ESTAT_ACTIVE = 'E0011'.
ENDLOOP.
__.____._ I am trying to program a follow-up action (function module) in a service notification, that should update the service order header status.
However, I have a problem with a SELECT statement: Nothing is read into the internal table ITAB_STAT_UPDATE. Communication structure I_VIQMEL brings data across.
Could someone please let me know what the problem is?
Thanks,
Chris
TABLES: AUFK, JEST.
DATA: WA_STAT_UPDATE LIKE JEST,
ITAB_STAT_UPDATE LIKE SORTED TABLE OF JEST WITH NON-UNIQUE KEY OBJNR WITH HEADER LINE.
SELECT B~STAT
B~INACT
B~OBJNR
INTO CORRESPONDING FIELDS OF TABLE ITAB_STAT_UPDATE
FROM AUFK AS A
INNER JOIN JEST AS B
ON A~OBJNR = B~OBJNR
WHERE A~AUFNR = I_VIQMEL-AUFNR AND
B~INACT = '' AND
B~STAT = 'E*'.
LOOP AT ITAB_STAT_UPDATE INTO WA_STAT_UPDATE.
CALL FUNCTION 'I_CHANGE_STATUS'
EXPORTING OBJNR = WA_STAT_UPDATE-OBJNR
ESTAT_INACTIVE = WA_STAT_UPDATE-INACT
ESTAT_ACTIVE = 'E0011'.
ENDLOOP.
Copyright © 2009 CEB Toolbox, Inc. and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
Related Content
In the Spotlight
_.____.__ White Papers
In the Spotlight
How Can Predictive Analytics Drive Competitive Advantage? Find out here