cancel
Showing results for 
Search instead for 
Did you mean: 

How to code multiple orders from Get List BAPI wrapper

Former Member
0 Kudos

Hi,

I am working on Work Order Application. For a given date I need to pull all the work Orders(header Data) along with their operations (item data). The 'GetList' BAPI Wrapper will fetch all the header records. And the 'Get Detail' BAPI Wrapper will only return all the items of one header record. But I need the list for multiple orders. How can I code it? i.e Can I call the Get List BAPI wrapper by looping the Get List header data? please guide me.

Accepted Solutions (0)

Answers (1)

Answers (1)

kishorg
Advisor
Advisor
0 Kudos

Hi Sudhakar,

You can populate the entire header data in one of the GETDETAIL table.

In GETDETAIL u have to include one more table parameter ,which is equivalent to that of the TABLE parameter of GETLIST .

1)Here first u have to populate the entire Header data in the TABLE corresponding to ur header data.

2)Then loop throgh this Header data and populate corresponding ITEM data for each entry.

If u have any selection criteria for ur GETLIST Wrapper (i meant filter or default value), then in the TABLE parameter of GETLIST , u can populate this filter data in the TABLE param of getlist.

Use this filter as key for ur GETDETAIL Wrapper.

Then in one GETLIST , GETDETAIL execution , u will get the entire data.

But this has one limitation.

It is recommended that ,for one header data, its corresponding line items must not exceed 10000 line items.That u have to keep in mind.

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi Kishor,

Thanks for your inputs. I still have couple of doubts, when we use this approach. The 'Get Detail' BAPI Wrapper expects one Importing Parameter, which is the key for fetching the item records and it also Exports (Returns) the corresponding Header Record. Now my question is can we ignore these two parameters i.e. can i delete them (import parameter and export header record paramters ) from the BAPI wrapper definition? if not, it looks odd to import a key field and returning one header record.

Awaiting your inputs.

Regards,

Sudh.

kishorg
Advisor
Advisor
0 Kudos

Hi Sudhakar,

For example ,

if ur GETLIST wrapper has one default value or filter value(suppose one user id.)Based on this filter u are selecting the header data in the table param of ur GETLIST Wrapper.

if this is the condition , then in the GETLIST Wrapper just fill this user id only in the TABLE param(U have to create a Structure for handling this change. so right now , we have only one field in the structure.This number of fields depends upon ur filter parameters . u have to handle this change appropriately).

As a result, after the execution of GETLIST in the TABLE param , we have only the filter values(in this case user id only).

U have to map this as key for your GETDETAIL.

Based on this key , u have to do the fetch the relevant data regarding this key and fill this data in one of the ITEM table of GETDETAIL(right now this is ur HEADER data).

Then loop through this TABLE(in the GETDETAIL). for each entry, u have to populate the corresponding items in their respective tables.

one more thing.. just imagine u dont have any key for your GETDETAIL Wrapper. In this case what u have to do is , in the GETDETAIL do as mentioned above.just collect the header data and then fetch the proper item data.

Hope u got it!.

Regards

Kishor Gopinathan