Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ME23n service report?

Former Member
0 Kudos

In my service item report, i am having a problem

1,first item check the movment type then append it ,

2,then move on to next item it wont check the movement type directly go to first endloop ,

3, then again go to loop esll directly move on to clear_mseg , endloop,

4 , loop esll write netwr, menge .... but value is change in bwart mblnr erfmg dmbtr value is change

5 llop at esln read second item move on to endloop

6,move on to first loop then go end endloop .

    IF it_mseg[] IS NOT INITIAL.
            LOOP AT it_mseg INTO wa_mseg WHERE ebeln = it_ekpo-ebeln AND ebelp = it_ekpo-ebelp.
              flag = 'X'.
              sort it_esll1 by packno.
LOOP AT it_esll1 WHERE packno = it_esll-sub_packno.

        wa_output-netwr = it_esll1-netwr.
        wa_output-menge = it_esll1-menge.
        wa_output-meins = it_esll1-meins.
READ TABLE it_t006a WITH KEY msehi = it_esll1-meins.
        IF sy-subrc = 0.
          wa_output-mseh3 = it_t006a-mseh3.
          wa_output-msehl = it_t006a-msehl.
        ENDIF.


        AT NEW packno.  "extrow.

*
              CASE wa_mseg-bwart.

                WHEN '101'.
                  wa_output-mblnr = wa_mseg-mblnr.

                  wa_output-act_menge = wa_mseg-erfmg.

                  wa_output-act_wert = wa_mseg-dmbtr.
                WHEN '102'.
                  wa_output-mblnr = wa_mseg-mblnr.
                  wa_output-act_menge = wa_mseg-erfmg * ( -1 ).

                  wa_output-act_wert = wa_mseg-dmbtr * ( -1 ).
                WHEN '122'.
                  wa_output-mblnr = wa_mseg-mblnr.
                  wa_output-act_menge = wa_mseg-erfmg * ( -1 ).
                  wa_output-act_wert = wa_mseg-dmbtr * ( -1 ).
                WHEN OTHERS.

              ENDCASE.

              APPEND wa_output TO it_output.
              CLEAR: wa_mseg, WA_output,IT_ESLL1.
              ENDAT.
              clear:wa_output.
              ENDLOOP.
              clear: wa_mseg.
            ENDLOOP.
            clear : wa_output.
          ENDIF.

1 REPLY 1

Former Member
0 Kudos

Hi, test this way,

sort it_mseg[] by mblnr .

use if statement insted of case statement. like this

if wa_bwart = '101'.

wa_output-mblnr = wa_mseg-mblnr.

elseif wa_bwart = '102'.

.

.

endif.

...

at final itab also sort by keyfield

if it is useful please give me reward points.

Thank

Nagaraju.T