Application Development 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: 

calling BAPI_ALM_ORDERHEAD_GET_LIST from VB

Former Member
0 Kudos

I am trying to call this BAPI from Visual Basic. The DISPLAY_PARAMETER input is driving me crazy. It has 3 inputs PAGELENGTH, SHOW_PAGE_NUMBER, FORCE REFRESH. I can't work out what data to feed into these fields. If anyone has had success with this BAPI then please could you enlighten me.

Thanks

Owen Williams

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Actually, I think you have to make an entry to the table IT_RANGES.

I tried:

FIELD_NAME           S OP LOW_VALUE     HIGH_VALUE  
SHOW_OPEN_DOCUMENTS  I EQ X                           

The parameters you can use for selection are returned in the table ET_TEMPLATE even when you get the error.

Rob

Message was edited by: Rob Burbank

12 REPLIES 12

Former Member
0 Kudos

Forgot to mention in my original post.

The Return Sructure/table fills and the error data is

Type E

Id IW0_BAPI2

Number 801

Message Enter at least one selection criteria

Hope you can help

Owen

Former Member
0 Kudos

Actually, I think you have to make an entry to the table IT_RANGES.

I tried:

FIELD_NAME           S OP LOW_VALUE     HIGH_VALUE  
SHOW_OPEN_DOCUMENTS  I EQ X                           

The parameters you can use for selection are returned in the table ET_TEMPLATE even when you get the error.

Rob

Message was edited by: Rob Burbank

0 Kudos

ROB

Thanks mate, that was great

Unfortunately it looks like now i've run into authorization issues. I get VB error telling me I don't have authorization for all the selected objects. When I run BAPI_ALM_ORDER_GET_DETAIL the Components and the Operations Table return OK but the Es_Header comes back Error 0, So I guess it's the same thing (No auth. for Header Data). Do you know any other way of getting Prod order header Data from BAPI's/RFC into VB. I can get Confirmations/Reservations, Planned orders, Sales Orders etc., but this is a stumbling block for me.

Thanks

Owen

0 Kudos

If it's an error being returned from the BAPI, then your basis people should be able to grant you the authorizations you need.

Rob

0 Kudos

I'm a covert operation. The "rather large global cellphone cCompany" that I work for, doesn't want to go near Bapi or RFC development. Everything is IDOC /EDI that takes 6 months to get done. So I'm trying to fly under the radar. If I request auth. I blow my cover. I really appreciate you help though.

Have a good weekend

Owen

0 Kudos

OK - then close the thread please.

Rob

0 Kudos

Rob , i've been investigating this some more and it appears it may not be all Authorizations.

If I fill the It_Ranges table like so

FIELD_NAME S OP LOW_VALUE HIGH_VALUE

OPTIONS_FOR_SALESORG I EQ US01

The Return table says

Type E

Id IH

Number 47

Message No objects were selected

If i change the sales org to "US02" it fails for authorizations. So I am still wondering what I need to put in the DISPLAY_PARAMETERS. It definately needs data adding or it wont run at all. I have just been putting a number in there like 100000000

Any more ideas

0 Kudos

Owen - I think the display parameters are just that. They determine how and how many lines to display. DISPLAY_PARAMETERS-PAGELENGTH controls how many values are returned. I don't know what the others do.

In your selection, if it returns no data, then authorizations won't be an issue. It's only when data is returned that authorizations are checked. Is the error on the sales organization due to you not having authorization to look at that org? Or is it due to not having authorization to view the records. (I.E. What error are you getting?)

Rob

0 Kudos

If I use "BT" as the option and I put in a range of Salesorgs that I know I have no Authorizations for I fails inside visual basic with error " You do not have Authorization for all the selected objects". If I use "EQ" as an option and use a salesorg that I know is good then it makes the call OK but returns no records. However if use "EQ" and put in a salesorg that I know I do not have authorization for it also makes the call OK and returns no records. The Message in the return table is "No objects were selected". Objects not records , so I don't know if this means I'm not asking fir things in the right way or not. The same this happens whatever I put in the "FIELD_NAME parameter.

Owen

0 Kudos

Owen - if you try something like:


FIELD_NAME           S OP LOW_VALUE HIGH_VALUE 
OPTIONS_FOR_SALESORG E EQ XXXX 

and you still get nothing, I'd say it's an authorization issue. Here, you're trying to select records excluding Sales Org. 'XXXX' and so should try to retrieve everything (assuming you don't have a sales org. 'XXXX').

Rob

0 Kudos

If I run as you described it fails inside VB for Authorization. If I put in "US01" and "I" it runs but errors in the return table, with "No objects were selected". I guess that we should let it go , but finally ,Is there a way of running it inside SAP where I could use Transaction SU53 to see what authorizations it checks. I know that I won't have authorization to run it inside SAP but I might know someone who does.

Thanks again for all your effort

0 Kudos

I've just been running it under SE37 (Function Builder).

Rob