2014 May 12 6:37 AM
Hi Experts,
please check my code below
DATA: BEGIN OF ibsis OCCURS 100,
ebeln LIKE bseg-ebeln,
ebelp LIKE bseg-ebelp,
bsis LIKE bsis,
ldgrp TYPE fagl_ldgrp.
DATA: END OF ibsis.
TYPES : BEGIN OF TY_ZFINITEMCAT,
pstyv TYPE vbap-pstyv,
END OF TY_ZFINITEMCAT.
DATA : GT_ZFINITEMCAT TYPE STANDARD TABLE OF TY_ZFINITEMCAT.
FIELD-SYMBOLS : <fs_ZFINITEMCAT> TYPE TY_ZFINITEMCAT.
DATA: l_item_catecory TYPE pstyv.
SELECT VALFROM
INTO TABLE GT_ZFINITEMCAT
FROM SETLEAF
WHERE SETNAME EQ 'ZFIN_ITEMCAT'.
LOOP AT ct_ibsis[] ASSIGNING <ibsis>.
"Check if we can find one item of the wrong category, if so then we remove the documents.
SELECT SINGLE pstyv INTO l_item_catecory
FROM vbap
WHERE vbeln = <ibsis>-bsis-zuonr
AND pstyv NOT IN GT_ZFINITEMCAT. "getting error here (The line structure of the table "GT_ZFINITEMCAT" is incorrect.)
IF sy-subrc = 0.
DELETE ct_ibsis[] WHERE bsis-zuonr = <ibsis>-bsis-zuonr.
ENDIF.
ENDLOOP.
fetching data from SET(GS01) but while activating i am getting error in another select query(The line structure of the table "GT_ZFINITEMCAT" is incorrect.),
please provide your valuable suggestion.
Regards,
Subhanshu Shrivastava
Hi Experts,
please check my code below
DATA: BEGIN OF ibsis OCCURS 100,
ebeln LIKE bseg-ebeln,
ebelp LIKE bseg-ebelp,
bsis LIKE bsis,
ldgrp TYPE fagl_ldgrp.
DATA: END OF ibsis.
TYPES : BEGIN OF TY_ZFINITEMCAT,
pstyv TYPE vbap-pstyv,
END OF TY_ZFINITEMCAT.
DATA : GT_ZFINITEMCAT TYPE STANDARD TABLE OF TY_ZFINITEMCAT.
FIELD-SYMBOLS : <fs_ZFINITEMCAT> TYPE TY_ZFINITEMCAT.
DATA: l_item_catecory TYPE pstyv.
SELECT VALFROM
INTO TABLE GT_ZFINITEMCAT
FROM SETLEAF
WHERE SETNAME EQ 'ZFIN_ITEMCAT'.
LOOP AT ct_ibsis[] ASSIGNING <ibsis>.
"Check if we can find one item of the wrong category, if so then we remove the documents.
SELECT SINGLE pstyv INTO l_item_catecory
FROM vbap
WHERE vbeln = <ibsis>-bsis-zuonr
AND pstyv NOT IN GT_ZFINITEMCAT. "getting error here (The line structure of the table "GT_ZFINITEMCAT" is incorrect.)
IF sy-subrc = 0.
DELETE ct_ibsis[] WHERE bsis-zuonr = <ibsis>-bsis-zuonr.
ENDIF.
ENDLOOP.
fetching data from SET(GS01) but while activating i am getting error in another select query(The line structure of the table "GT_ZFINITEMCAT" is incorrect.),
please provide your valuable suggestion.
Regards,
Subhanshu Shrivastava
2014 May 12 7:07 AM
hi Subhanshu Shivastava,
The internal table that u have mentioned in the select query inside the loop needs to be inside the breakets .
Replace the select Query mentioned below.
SELECT SINGLE pstyv INTO l_item_catecory
FROM vbap
WHERE vbeln = <ibsis>-bsis-zuonr
AND pstyv NOT IN (GT_ZFINITEMCAT).
Kindly try this and meet your requirement.
2014 May 12 7:27 AM
When using IN you must use a range table afterwards.
Try this :
DATA: BEGIN OF ibsis OCCURS 100,
ebeln LIKE bseg-ebeln,
ebelp LIKE bseg-ebelp,
bsis LIKE bsis,
ldgrp TYPE fagl_ldgrp.
DATA: END OF ibsis.
DATA: gt_zfinitemcat type range of vbap-pstyv,
FIELD-SYMBOLS : <fs_ZFINITEMCAT> TYPE any.
DATA: l_item_catecory TYPE pstyv.
SELECT VALFROM AS LOW
INTO CORRESPONDING FIELDS OF TABLE GT_ZFINITEMCAT
FROM SETLEAF
WHERE SETNAME EQ 'ZFIN_ITEMCAT'.
LOOP AT GT_ZFINITEMCAT ASSIGNING <fs_ZFINITEMCAT>.
<fs_ZFINITEMCAT>-SIGN = 'I'.
<fs_ZFINITEMCAT>-OPTION = 'EQ'.
ENDLOOP.
LOOP AT ct_ibsis[] ASSIGNING <ibsis>.
"Check if we can find one item of the wrong category, if so then we remove the documents.
SELECT SINGLE pstyv INTO l_item_catecory
FROM vbap
WHERE vbeln = <ibsis>-bsis-zuonr
AND pstyv NOT IN GT_ZFINITEMCAT. "getting error here (The line structure of the table "GT_ZFINITEMCAT" is incorrect.)
IF sy-subrc = 0.
DELETE ct_ibsis[] WHERE bsis-zuonr = <ibsis>-bsis-zuonr.
ENDIF.
ENDLOOP.
2014 May 12 7:35 AM
2014 May 12 7:45 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |