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

Data From MLHD

Former Member
0 Likes
1,092

Hi All,

How to retrieve data from MLHD when Input is a date range. Is there any Function Module for that.

Atul

4 REPLIES 4
Read only

Former Member
0 Likes
757

Hi,

I dont think there is a FM for your requirement...

Below are some of the FMs' on MLHD...

CKML_F_DOCUMENT_READ_MLHD

CONVERT_CKML2_TO_CKMLHD_PR

CONVERT_CKMLHD_PR_TO_CKML2

CKMT_POST_MATERIAL_LEDGER_DATA

CKMT_PROCESS_MATERIAL_LEDGER

Try directly querying the table MLHD for the input date range...

Reward if useful

Regards

Shiva

Read only

Former Member
0 Likes
757

Select * from MLHD into it_mlhd where BLDAT in so_bldate

Regarsd

rajesh

Read only

former_member182371
Active Contributor
0 Likes
757

Hi,

if you do a simple "where used" search from se11 you´ll find manu fm´s.

e.g.

CKML_F_DOCUMENT_READ_MLHD

Just as a sample, within fm CKML_F_DOCUMENT_REPORT

you can find how date range is treated:


          SELECT mlhd~cpudt mlhd~cputm mlit~xabrerr
                 mlhd~belnr mlhd~kjahr
                 INTO CORRESPONDING FIELDS OF TABLE lt_mserror
                 FROM mlhd
                 JOIN mlit
                 ON   mlhd~belnr = mlit~belnr
                 AND  mlhd~kjahr = mlit~kjahr
                 JOIN mlpp
                 ON   mlhd~belnr = mlpp~belnr
                 AND  mlhd~kjahr = mlpp~kjahr
                 AND  mlit~posnr = mlpp~posnr
                 WHERE vgart = y_vgart_abrechnung_einst
                 AND   ( cpudt > t_mlhd-cpudt OR
                         ( cpudt = t_mlhd-cpudt AND
                           cputm >= t_mlhd-cputm ) )
                 AND   kalnr = t_doc_report-kalnr
                 AND   psart = y_vgart_abrechnung_einst
                 AND   NOT ( xabrerr = space OR
                             xabrerr IS NULL )
                 AND   bdatj = t_doc_report-bdatj
                 AND   poper = t_doc_report-poper.

Best regards.

Read only

Former Member
0 Likes
757

Hi,

If i writting select * from MLHD where MLHD~CPUDT BETWEEN SO_DATE-LOW AND SO_DATE-HIGH.

It is taking too much time.

Can you tell me how to to do performance tunning to this select statement..

Atul