2008 Oct 24 2:52 PM
Dear all,
I need to modify the field ABGRU.
I'm try to used the program MV45AFZZ and the exit USEREXIT_SAVE_DOCUMENT_PREPARE .
I can set the field but I cannot clear the field.
My code:
LOOP AT xvbap INTO ls_xvbap.
CLEAR indice.
MOVE sy-tabix TO indice.
READ TABLE popup_table WITH KEY matkl = ls_xvbap-matkl
posnr = ls_xvbap-posnr
INTO ln_popup.
IF sy-subrc EQ 0.
MOVE 'ZT' TO ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice.
ELSE.
if ls_xvbap-abgru eq 'ZT'.
move ' ' to ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice.
endif.
ENDIF.
CLEAR ls_xvbap.
CLEAR ln_popup.
ENDLOOP.
I can set 'ZT' to vbap-abgru but i cannot clear abgru in effect If I check the VBAP table I see the value in ABGRU field.
Have you any idea ?
Dear all,
I need to modify the field ABGRU.
I'm try to used the program MV45AFZZ and the exit USEREXIT_SAVE_DOCUMENT_PREPARE .
I can set the field but I cannot clear the field.
My code:
LOOP AT xvbap INTO ls_xvbap.
CLEAR indice.
MOVE sy-tabix TO indice.
READ TABLE popup_table WITH KEY matkl = ls_xvbap-matkl
posnr = ls_xvbap-posnr
INTO ln_popup.
IF sy-subrc EQ 0.
MOVE 'ZT' TO ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice.
ELSE.
if ls_xvbap-abgru eq 'ZT'.
move ' ' to ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice.
endif.
ENDIF.
CLEAR ls_xvbap.
CLEAR ln_popup.
ENDLOOP.
I can set 'ZT' to vbap-abgru but i cannot clear abgru in effect If I check the VBAP table I see the value in ABGRU field.
Have you any idea ?
2008 Oct 24 2:58 PM
use code marker to post code, it is better readable that way. Try the code below
LOOP AT xvbap
READ TABLE popup_table WITH KEY matkl = xvbap-matkl
posnr = xvbap-posnr
INTO ln_popup.
IF sy-subrc EQ 0.
MOVE 'ZT' TO xvbap-abgru.
MODIFY xvbap.
ELSE.
if xvbap-abgru eq 'ZT'.
move ' ' to xvbap-abgru.
MODIFY xvbap.
endif.
ENDIF.
CLEAR xvbap.
CLEAR ln_popup.
ENDLOOP.
2008 Oct 24 3:00 PM
Hi ,
MODIFY xvbap FROM ls_xvbap TRANSPORTING ABGRU.
Try this one.
Regards,
Bharani
2008 Oct 24 5:10 PM
2008 Oct 24 5:11 PM
2008 Oct 24 5:14 PM
what doesnt work? XVBAP is filled by SAP so i am guessing it should be the issue with the other internal table you have in the code.
Can you paste your modified code again , with the definition for the other table, and the data it would have
2008 Oct 27 9:10 AM
DATA: ls_xvbap LIKE xvbap.
DATA BEGIN OF popup_table OCCURS 0.
DATA posnr LIKE xvbap-posnr.
DATA matkl LIKE xvbap-matkl.
DATA END OF popup_table.
DATA ln_popup LIKE popup_table.
LOOP AT xvbap INTO ls_xvbap.
IF ls_xvbap-mvgr1 EQ 'SI' AND
ls_xvbap-pstyv EQ 'ZTAN'.
CLEAR indice.
MOVE sy-tabix TO indice.
READ TABLE popup_table WITH KEY matkl = ls_xvbap-matkl
posnr = ls_xvbap-posnr
INTO ln_popup.
IF sy-subrc EQ 0.
MOVE 'ZT' TO ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice.
ELSE.
IF ls_xvbap-abgru EQ 'ZT'.
MOVE ' ' TO ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice TRANSPORTING ABGRU.
ENDIF.
ENDIF.
CLEAR ls_xvbap.
CLEAR ln_popup.
ENDIF.
ENDLOOP.
2011 Mar 30 6:14 PM
Hi,
Instead of MOVE ' ' TO ls_xvbap-abgru
.* why don't you just do the following and try..
clear: ls_xvbap-abgru.
2011 Mar 30 7:05 PM
Have you run this thing in debug?
LOOP AT xvbap INTO ls_xvbap.
IF ls_xvbap-mvgr1 EQ 'SI' AND
ls_xvbap-pstyv EQ 'ZTAN'.
CLEAR indice.
MOVE sy-tabix TO indice.
READ TABLE popup_table WITH KEY matkl = ls_xvbap-matkl
posnr = ls_xvbap-posnr
INTO ln_popup.
IF sy-subrc EQ 0.
MOVE 'ZT' TO ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice.
ELSE. """"""'we get here if read table fails.
IF ls_xvbap-abgru EQ 'ZT'. "only get here if read table fails!
MOVE ' ' TO ls_xvbap-abgru.
MODIFY xvbap FROM ls_xvbap INDEX indice TRANSPORTING ABGRU.
ENDIF.
ENDIF.
CLEAR ls_xvbap.
CLEAR ln_popup.
ENDIF.
ENDLOOP.Did you mean? (let's speed this clunker up!)
LOOP AT xvbap assigning <fs_vbap>. "define field symbol as same type as xvbap.
if <fs_vbap> is assigned.
if <fs_vbap>-abgru eq 'ZT'. "if ZT flip to no reason
clear <fs_vbap>-abgru.
else. " Not ZT, does it need to be?
IF<fs_vbap>-mvgr1 EQ 'SI' AND <fs_vbap>-pstyv EQ 'ZTAN'.
READ TABLE popup_table transporting no fields
WITH KEY matkl = <fs_vbap>-matkl
posnr = <fs_vbap>-posnr
binary search." (if popup_table is properly sorted by matkl posnr).
IF sy-subrc EQ 0.
<fs_vbap>-abgru = 'ZT'.
endif. "table read successful?
endif. " SI with ZTAN?
endif. "ZT or ??
endif. "<fs> assigned
ENDLOOP.
2011 Mar 31 6:54 PM
Hi,
Instead of MOVE ' ' TO ls_xvbap-abgru
.* why don't you just do the following and try..
clear: ls_xvbap-abgru.
Well, you got your first post in but digging up a 3 year old thread isn't likely to be helpful .
2011 Mar 31 5:41 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |