Skip to Content
avatar image
Former Member

problem in uploading the data

Hi,

I am working on a report on which i have to update a table in which i am uploading the on the basis of the 1st date and last date of the month. Its basically functionality is similar to the MSEG table as i am storing the data on last of the months by taking the BLDAT date form the MKPF table.

For many entries it is saving the data and some of them are not coming right . here's d code:-

LOOP AT ITMSEG WHERE WERKS = ITPLANT-WERKS AND LGORT = ITSTLOC-LGORT AND MATNR = ITMATNR-MATNR AND BLDAT BETWEEN ITMON-FDATE AND ITMON-LDATE.

R_FOUND = 1.

IF ITMSEG-SHKZG = 'S'.

V_DEBIT = V_DEBIT + ITMSEG-MENGE.

ELSE.

V_CREDIT = V_CREDIT + ITMSEG-MENGE.

ENDIF.

ENDLOOP.

In this code the last where condition is taking the Document date from MKPF and it will check the value b/w 1st date and last date.

ex, if bldat is 12.08.2008 then the last date would be 31.08.2008 and first date is 01.08.2008.

some of the data is coming right some of it is not.plzz provide me guidelines for solving this problem.

Edited by: ricx .s on Oct 17, 2008 10:59 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 17, 2008 at 09:06 AM

    Hello

    data: bldat like mkpf-bldat,
         firstd like mkpf-bldat,
         lastd like mkpf-bldat.
    ranges: r_bldat for mkpf-bldat.
    
    bldat = '20080812'.
    r_bldat-sign = 'I'.
    r_bldat-option = 'BT'.
    move bldat to firstd.
    firstd+6(2) = '01'.
    
    call function 'LAST_DAY_OF_MONTHS'
         exporting day_in = bldat
         importing last_day_of_month = lastd.
    
    r_bldat-low = firstd.
    r_bldat-high = lastd.
    append r_bldat.
    
    .....
    loop ... where ... and bldat in r_bldat.
    
    

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ricx ,

      i dont understand y its missing few records , any how u can also try by using offset lengths

      where

      BLDAT0(6) eq ITMON-FDATE0(6).ie 200808

      regards

      Prabhu

  • Oct 17, 2008 at 09:15 AM

    use this for the first day of the current month

    RS_VARI_V_1_ACTUAL_MONTH

    this is for the last day of month'

    BKK_GET_MONTH_LASTDAY

    RE_LAST_DAY_OF_MONTH

    HR_HCP_GET_LAST_DAY_OF_MONTH

    HRVE_LAST_DAY_OF_MONTH

    Add comment
    10|10000 characters needed characters exceeded