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: 

wage type

Former Member
0 Kudos

i need to search for a particular wage type from table p0008 like basic salary say code '1000'. there r 40 fileds for wage type like lga01, lga02 etc..can i use a loop that can chk all the 40 fields to capture a particular wage type ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

u have to loop like this.

loop at pernr.
    loop at itab_p8 where       pernr  = pernr-pernr  and
                                endda  = pernr-endda  and
                                begda  = pernr-begda.
      tab1-abkrs = pernr-abkrs.
      tab1-werks = pernr-werks.
      tab1-btrtl = pernr-btrtl.
      tab1-persg = pernr-persg.
      tab1-persk = pernr-persk.
      tab1-pernr = pernr-pernr.
      tab1-endda = pernr-endda.
      tab1-begda = pernr-begda.
      tab1-ename = pernr-ename.
      tab1-aedtm = pernr-aedtm.
<b>      do 20 times varying lgart from itab_p8-lga01
                                next itab_p8-lga02
                  varying betrg from itab_p8-bet01
                                next itab_p8-bet02.
        if betrg eq 0.
          refresh i0008.
          clear i0008.
          i0008 = itab_p8.
          append i0008.</b>          perform calc_amt using itab_p8-begda itab_p8-endda betrg lgart pernr-pernr.
        endif.
        TAB1-lgart  = lgart.
        TAB1-betrg  = betrg.
        collect TAB1.
      enddo.
    endloop.

by using do-enddo , u can get all 20 or 40 wege type values into another internal tables.

Regards

Prabhu

1 REPLY 1

Former Member
0 Kudos

u have to loop like this.

loop at pernr.
    loop at itab_p8 where       pernr  = pernr-pernr  and
                                endda  = pernr-endda  and
                                begda  = pernr-begda.
      tab1-abkrs = pernr-abkrs.
      tab1-werks = pernr-werks.
      tab1-btrtl = pernr-btrtl.
      tab1-persg = pernr-persg.
      tab1-persk = pernr-persk.
      tab1-pernr = pernr-pernr.
      tab1-endda = pernr-endda.
      tab1-begda = pernr-begda.
      tab1-ename = pernr-ename.
      tab1-aedtm = pernr-aedtm.
<b>      do 20 times varying lgart from itab_p8-lga01
                                next itab_p8-lga02
                  varying betrg from itab_p8-bet01
                                next itab_p8-bet02.
        if betrg eq 0.
          refresh i0008.
          clear i0008.
          i0008 = itab_p8.
          append i0008.</b>          perform calc_amt using itab_p8-begda itab_p8-endda betrg lgart pernr-pernr.
        endif.
        TAB1-lgart  = lgart.
        TAB1-betrg  = betrg.
        collect TAB1.
      enddo.
    endloop.

by using do-enddo , u can get all 20 or 40 wege type values into another internal tables.

Regards

Prabhu