cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI BAPI_ALM_ORDERHEAD_GET_LIST not fetching all the Service Orders

Former Member
0 Kudos

Hi guys,

My requirement was to fetch all the service Orders based on the user who has created the Service Order. to accomplish the task I used BAPI BAPI_ALM_ORDERHEAD_GET_LIST to fetch all the Service Orders.

Following were the fields populated to test the BAPI:

I kept DISPLAY_PARAMETERS import parameter blank.

In the IT_RANGES table following data was provided:

FIELD_NAME = OPTIONS_FOR_ENTERED_BY.

SIGN             = I .

OPTION          = LOW.

LOW_VALUE  = user_name.

After executing, I am able to fetch some of the entries but not all of them, were getting populated in the ET_RESULT table.

Please let me know what possible data I could be missing in the BAPI which needs to be provided before executing the BAPI.

Thanks,

Manish Verma

Accepted Solutions (1)

Accepted Solutions (1)

peter_atkin
Active Contributor
0 Kudos

Go to SE37 and read the function module documentation for BAPI_ALM_ORDERHEAD_GET_LIST

Have a look at the documentation for IT_RANGES under the default section.

PeteA

Former Member
0 Kudos

Hi Peter,

I have tested the BAPI taking its documentation into consideration.

I am able to fetch few entries but not all of the entries.

Regards,

Manish Verma

peter_atkin
Active Contributor
0 Kudos

Did you specify the dates?

If no specifications for the parameters SHOW_DOCS_WITH_FROM_DATE and SHOW_DOCS_WITH_TO_DATE are copied, then only orders from the last 90 days are displayed.

PeteA

Former Member
0 Kudos

Hi Peter,

Appreciate your quick help .

I did what you mentioned in your earlier reply. The ET_RESULT table is getting more data than the previous data being fetched but still not all of the data is getting fetched.

Moreover, I saw that it is showing me first 50 records even if it is containing more data. How can I fetch all of the data at once.

Thanks,

Manish Verma

peter_atkin
Active Contributor
0 Kudos

Ah - I remember this limit now...

Try changing the DISPLAY_PARAMETERS-PAGELENGTH parameter to 10000

PeteA

Former Member
0 Kudos

Thanks Peter .

I provided 10000 to DISPLAY_PARAMETERS-PAGELENGTH and it gave me a list on first page only.

But the problem of fetching all the Service Orders still persists. Can you please tell me why it is not fetching all the service Orders against a username when I am providing  SHOW_DOCS_WITH_FROM_DATE as '00010101' and SHOW_DOCS_WITH_TO_DATE as my current date.

Regards,

Manish Verma

peter_atkin
Active Contributor
0 Kudos

Manish Verma

Can you determine which orders are not being selected?

For example, are there orders with certain dates, plants, statuses, or order types not being selected??

Also try this: in SE37 put a start-date after the end-date to force the program into error. You should now see the IW38/9 selection screen when testing the function module. Check the the selection screen data and make the necessary changes to you IT_RANGES selection.

PeteA

Former Member
0 Kudos

Peter,

Looking at the list and comparing with the data coming from the standard table AUFK, one thing is sure that BAPI does not fetch data where deletion indicator LOEKZ = 'X'.

Other than this field, I have checked for Order Type, Plants and Work Center as well but getting mixed results.

Regards,

Manish Verma

peter_atkin
Active Contributor
0 Kudos

Also try this: in SE37 put a start-date after the end-date to force the program into error. You should now see the IW38/9 selection screen when testing the function module. Check the the selection screen data and make the necessary changes to your IT_RANGES selection.

Former Member
0 Kudos

Peter,

No breakthrough.

peter_atkin
Active Contributor
0 Kudos

Did you get the IW38/9 selection-screen to display?

Please post the exact data you are entering in the BAPI.

PeteA

Former Member
0 Kudos

Peter,

I could not get the selection screen if IW38/39 for display.

All I am doing is populating the IT_RANGES table with following data:

SHOW_DOCS_WITH_FROM_DATE     'I'     'EQ'     '00010101'

SHOW_DOCS_WITH_TO_DATE          'I'     'EQ'     '99991231'

OPTIONS_FOR_ENTERED_BY           'I'     'EQ'     'username'.

The list which comes contain only the orders which are either Created or Released. How can I fetch orders which are in TECO or CLSD status ?

Please suggest.

Thanks,

Manish Verma

peter_atkin
Active Contributor
0 Kudos

You need to set SHOW_COMPLETED_DOCUMENTS

Tip: Once you've run the BAPI in SE37 you will see that there are values in the ET_TEMPLATE table. These are all the possible settings you can use in this BAPI.

PeteA

Former Member
0 Kudos

Here is the final answer to my question:

SHOW_DOCS_WITH_FROM_DATE     'I'     'EQ'     '00010101'

SHOW_DOCS_WITH_TO_DATE          'I'     'EQ'     '99991231'

SHOW_OPEN_DOCUMENTS              'I'     'EQ'     X

SHOW_DOCUMENTS_IN_PROCESS  'I'      'EQ'     X

SHOW_COMPLETED_DOCUMENTS   'I'      'EQ'     X

SHOW_HISTORICAL_DOCUMENTS     'I'     'EQ'     X

OPTIONS_FOR_ENTERED_BY            'I'     'EQ'     username

The above statements will retrieve all the Service Orders.

Thanks a lot Peter .

Regards,

Manish Verma

Former Member
0 Kudos

I did set the following parameters and was successful

DISPLAY Parameters

Page Length-1000

Show Page Number-1000

FORCE_REFRES=X

This will resolve the issue

Answers (1)

Answers (1)

william_eastman
Advisor
Advisor
0 Kudos

Manish:

Questions about details for using CS functions should be posted in the      forum.

regards,

bill.

Former Member
0 Kudos

Posted in SAP EAM forum as well. Hoping to get reply soon .