Hello Gurus,
I have an issue with the routine level values Below is values in DSO level where 0transtype is ***, PLN and 230. When I have
transtype 230 ( can be any number) I need to delete the *** and PLN. When I do not have 230 I need to delete PLN and
display only ***. The below code works fine for single records but when I load them in bulk it does not work. If *** (2007)
and 230 (2007) for transtype are in the same year both are displayed. In this case only 230 needs to be displayed. I am unable to
figure out the issue within the below code. I request you to let me know your suggestions on this.
DSO
Cube
data : ls_tab type _ty_s_SC_1,
ls_srs type _ty_s_SC_1,
lt_tab TYPE STANDARD TABLE OF _ty_s_SC_1.
refresh lt_tab .
sort SOURCE_PACKAGE by COMP_CODE ASSET_MAIN ASSET transtype.
append LINES OF SOURCE_PACKAGE to lt_tab.
LOOP AT lt_tab into ls_tab.
LOOP at SOURCE_PACKAGE into ls_srs
where COMP_CODE = ls_tab-COMP_CODE and
ASSET_MAIN = ls_tab-ASSET_MAIN and
ASSET = ls_tab-ASSET and
TRANSTYPE ca '0123456789'.
exit.
endloop.
IF sy-subrc = 0.
delete SOURCE_PACKAGE
where COMP_CODE = ls_tab-COMP_CODE and
ASSET_MAIN = ls_tab-ASSET_MAIN and
ASSET = ls_tab-ASSET and
( transtype = '***' or transtype = 'PLN' )
.
else.
delete SOURCE_PACKAGE
where COMP_CODE = ls_tab-COMP_CODE and
ASSET_MAIN = ls_tab-ASSET_MAIN and
ASSET = ls_tab-ASSET and
transtype = 'PLN' .
ENDIF.
DELETE lt_tab WHERE COMP_CODE = ls_tab-COMP_CODE and
ASSET_MAIN = ls_tab-ASSET_MAIN and
ASSET = ls_tab-ASSET.
ENDLOOP.