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: 

Searching for Sales Order for the given Customer PO Number Pattern in BAPI

Former Member
0 Kudos

Hi,

I have developed a BAPI which retrieves all the Sales Orders for a given Customer (Sold-To). The Following are the Input Parameters given in the Function Module (RFC).

Customer Number (Mandatory)

From Date (Optional)

To Date (Optional)

Sales Order Number(Optional)

Customer PO Number(Optional)

Now, when the Customer PO Number is populated, it will come as a Pattern, say 9ab* and I need to retrieve all the Sales Orders with PO Number starting with 9ab.

When I am trying to retrieve, it is giving different set of output based on the Case specified in the Customer PO Number Pattern. Lets say, if I give 9ab, I get 200 Records but if I give 9AB, I get only 5 to 6 Records.

As I have understood from the Standard Transaction VA03, it has a Search Help VMVAA which retrieves all the Sales Orders for the given PO Number pattern irrespective of the Case, that is Lower Case, Upper Case or Mix of Upper and Lower Case.

I can see the Code in the Search Help Exit but couldn't find useful piece of code which I can implement in my BAPI to simulate the same.

Can somebody help me on this?

Thanks,

Venkat.

5 REPLIES 5

Former Member
0 Kudos

You can query on the view M_VMVAA which stores the purchase order field as match code field.

The po number should always be passed as caps so that it will return all the sales orders.

Regards,

Sudhir Atluru

0 Kudos

Thanks for the reply. But, what my requirement is that, if I give the PO Number in format, lets say, 9ab, then also it should include all the Sales Orders with PO number starting from 9AB and if I give 9AB, it should include all the Sales Orders with PO Numbers starting from 9ab.

Please let me know.

Thanks,

Venkat.

0 Kudos

When the user enters 9ab* then convert it to upper case 9AB*

and then pass it to the query and the view will return all the sales orders having 9ab* and 9AB*.

All the po numbers are returned in upper case in this view for match code purpose.

Regards,

Sudhir Atluru

0 Kudos

Hi Sudhir,

I think you did not understand what my problem is. What I mean to say is, for Customer X, the PO Number could be 9abc and for Customer Y, the PO Number Could be 9ABC.

So, according to your logic, if I translate it to Upper Case, it will give the Sales Order details of Customer Y to Customer X.

And more over, SAP stores the PO Number as it is entered in the Sales Order Screen (VA01).

What if the Customer PO Number for Customer X is 9aBcDeFgH? and the PO Number for Customer Y is 9AbCdEf?

Hope you've understood my question.

Thanks,

Venkat.

0 Kudos

Match code do not care about the case of the text entered.

If PO Number for Customer X is 9aBcDeFgH and PO Number for Customer Y is 9AbCdEf then enter any one of them in the match code and see, the match code will return both the order numbers in SAP. The match code will check for 9ABCDEF in the view.

You need to add another filter after sales order list is returned at customer level to get orders specific to the sold to entered

Hope you get it.

Regards

Sudhir Atluru.