Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3273

Issue with the code in record display

$
0
0

Hello Gurus,

 

I have an issue with the records display in the table. The requirement is that a record is displayed in the table in 3 transfer types.

for example : ***, PLN and number 230 for asset 100000. When there is a number displaying in transtype then *** and PLN

recordsshould be deleted. If there is no number diplsaying in Trasntype the '***' should be picked and displayed PLN must

be deleted. The below code is right as per knowledge but it does not give the exact result. In example 1 *** is also showing

up along with the number 230. I request you to let me know if I can make any changes in the code below.

 

 

Example 1

abap asset 1.png

    Example 2

 

abap asset3.png

 

 

  abap asset2.png

 

 

 

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 .

 

     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 = '***'   .

 

   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' .

                         .

       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.

ENDLOOP.


Viewing all articles
Browse latest Browse all 3273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>