Skip to Content
author's profile photo
Former Member

can't retrieve data from mkpf

hi guys,

I have defined the correct parameters and ranges. But how come I cann't retrieve the data? Kindly check thanks! here's my code and I already simplfied it.

defined param:

so_mblnr = I EQ '59000010'

p_mjahr = 2006

so_postd = '00000000'

 data: begin of lt_mkpf occurs 0,    
 mblnr like mkpf-mblnr,              
 usnam like mkpf-usnam,              
 bldat like mkpf-bldat,              
 budat like mkpf-budat,              
 xblnr like mkpf-xblnr,              
 end of lt_mkpf.                     

selection-screen skip.                                        
*SELECTION-SCREEN BEGIN OF BLOCK singleval WITH FRAME.        
parameters: p_mvtype like mseg-bwart obligatory,              
            p_mdocyr like mseg-mjahr obligatory.              
*SELECTION-SCREEN END OF BLOCK singleval.                                                                                
selection-screen skip.                                        
selection-screen begin of block multival with frame.          
select-options: so_matdn for lt_header-matdn,                 
                so_postd for lt_header-postd,                 
                so_plant for lt_header-plant.                 
selection-screen end of block multival.                       


 select mblnr               
        usnam              
        bldat              
        budat              
        xblnr              
into table lt_mkpf        
from mkpf                  
 where mblnr in so_mblnr    
   and mjahr eq p_mjahr    
   and budat eq so_postd.   

i still get sy-subrc = 4.

null

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 10:25 AM

    Hi Maui,

    Please check it now

    select mblnr

    usnam

    bldat

    budat

    xblnr

    into table lt_mkpf

    from mkpf

    where mblnr in so_mblnr

    and mjahr eq p_mjahr

    and budat <b>in</b> so_postd.

    Thanks

    Sikha

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 10:22 AM

    Hi,

    First check the table contents for the combination given in the where clause.

    i.e..

    so_mblnr = I EQ '59000010'

    p_mjahr = 2006

    so_postd = '00000000'

    problem may be due to no data in the database for that selection criteria.

    Regards,

    Sankar

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you,

      I got the material number defined in so_mblnr from the DEV database mkpf.. It has 30 entries.

      Still aint working... Anything else missing in my code?

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 10:23 AM

    Hi,

    You have put EQ in so_mblnr = I EQ '59000010'. So it will check for the same value only.

    just check the table mkpf ..it has the data meeting the follwing values.

    mblnr = '59000010'

    and mjahr = '2006'

    and budat = '00000000'.

    Regards

    Azad.

    Reward if helpful.

    ne problem reply me back.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 21, 2007 at 10:58 AM

    Hi..

    Change the Select like this:

    In the WHERE Clause

    To compare SELECT-OPTIONS Use IN

    To compare PARAMETERS Use EQ

    select mblnr

    usnam

    bldat

    budat

    xblnr

    into table lt_mkpf

    from mkpf

    where mblnr in so_mblnr

    and mjahr eq p_mjahr

    <b> and budat IN so_postd. </b>

    <b>Reward if Helpful</b>

    Add comment
    10|10000 characters needed characters exceeded