Application Development and Automation 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: 
Read only

Movement types

Former Member
0 Likes
705

Hi,

I need to extract from SAP all 551/552 movement types from jan 09 to date that have not been done through the upload process i.e MB10 and MB11 are not on the document.

Please assist with the code to so?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
591

Hello Mpangib,

Try this code.


SELECT *
    FROM mbew
    INTO CORRESPONDING FIELDS OF TABLE i_mbew
   WHERE bwkey = <variable>
*       AND bwtar = ' '.   "Valuation Type.

  IF sy-subrc = 0.

    SELECT *
      FROM mseg
      INTO CORRESPONDING FIELDS OF TABLE i_mseg
       FOR ALL ENTRIES IN i_mbew
     WHERE MJAHR = '2009'
*         AND shkzg = 'S'.   "Only Debit Account Will be Picked with 'S'.
          AND bwart BETWEEN '551' and '552'.
*         AND BWTAR = ' '.   "Valuation Type.

Hope this helps.

Cheers,

Suvendu

3 REPLIES 3
Read only

Former Member
0 Likes
591

Hi

I need to extract from SAP all 551/552 movement types from jan 09 to date that have not been done through the upload process i.e MB10 and MB11 are not on the document.

Use table join between MKPF and MSEG. Provide date as input and movement type as input to the select query.

E.g.

Select matnr bwart budat ..

from mseg as a inner join mkpf on aMBLNR = bMBLNR

where ( bwart = 551 or bwart = 552 )

and budat in s_budat

Hope this will help to solve your problem.

Regards,

Vijay

Read only

Former Member
0 Likes
592

Hello Mpangib,

Try this code.


SELECT *
    FROM mbew
    INTO CORRESPONDING FIELDS OF TABLE i_mbew
   WHERE bwkey = <variable>
*       AND bwtar = ' '.   "Valuation Type.

  IF sy-subrc = 0.

    SELECT *
      FROM mseg
      INTO CORRESPONDING FIELDS OF TABLE i_mseg
       FOR ALL ENTRIES IN i_mbew
     WHERE MJAHR = '2009'
*         AND shkzg = 'S'.   "Only Debit Account Will be Picked with 'S'.
          AND bwart BETWEEN '551' and '552'.
*         AND BWTAR = ' '.   "Valuation Type.

Hope this helps.

Cheers,

Suvendu

Read only

Former Member
0 Likes
591

Hi,

I still need assistance with this question, anyone to assist?