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: 

Change Shipping Condition and Incoterm using Excel Upload

0 Kudos

Hi All,

I have a requirement to update Shipping Condition VSBED ( inturn all relevant Fields like Route etc ) and Incoterms INCO1 using Excel Upload and Change Purchase Order Items. I have seen multiple Posts relevant to BADI : ME_PROCESS_PO_CUST --> Method :PROCESS_ITEM.

But since i want to upload from an Excel sheet, help me pick the best way to update above fields.

Regards,

Anand R 

23 REPLIES 23

Sandra_Rossi
Active Contributor
0 Kudos

I think you're making confusion, but I'm not expert in the field. This BAdI is to do checks, change the display attributes of fields and add your own custom fields and tables. The user still have to enter data manually.

Instead, you should create an interface: first part to upload the Excel sheet (CSV?), and second part to call the BAPI (not BAdI) to update the shipping conditions. There won't be any screen. Search the forum/documentation to achieve both parts.

0 Kudos

Hi Sandra,

Yes. I want the suitable BAPI to Update. As of now for other fields i am using BAPI_PO_CHANGE. But not sure if i can pass these fields to that?

Regards,

Anand R

Former Member
0 Kudos

Hi,

Did you check POSHIPPING/POSHIPPINGX table in BAPI_PO_CHANGE for Shipping point and route and BAPIMEPOHEADER / BAPIMEPOHEADERX for Incoterms?

R

0 Kudos

Hi Rudra,

I have seen that.But Will it automatically update other fields when i update Shipping Point through this BAPI?

0 Kudos

Hi Rudra,

I have tried passing value to POSHIPPING/POSHIPPINGX table. Not working!!

Regards,

Anand R

0 Kudos

Be factual please, which fields did you fill out, and which message do you get from the BAPI? Did you commit?

As methodology for using update BAPIs, I advise you to first use BAPI_PO_GETDETAIL1 for making sure in which parameters are located the data you want to change (Shipping Condition and Incoterm). When found, use the corresponding parameter (usually the same name) in the update BAPI, and try.

0 Kudos

Hi Sandra,

Apologies. I did the exact same thing mentioned by you. I am using BAPI_PO_GETDETAIL1 to get details but it is not returning any POSHIPPING related fields in that. Still i populated values in the code and tried to update using BAPI_PO_CHANGE passing Shipping Condition. ( Yet to try Incoterms).The BAPI is not returning any error. But update dint happen.

Regards,

Anand R

0 Kudos

I am using BAPI_PO_GETDETAIL1 to get details but it is not returning any POSHIPPING related fields in that.

Correct! Bad point for me 🙂


Still i populated values in the code and tried to update using BAPI_PO_CHANGE passing Shipping Condition. ( Yet to try Incoterms).The BAPI is not returning any error. But update dint happen.

Sorry to ask obvious questions, but as you don't talk about it, did you set POSHIPPINGX-SHIP_COND = 'X' so that to take into account POSHIPPING-SHIP_COND? Did you also set PO_ITEM for both parameters? Did you use BAPI_TRANSACTION_COMMIT?

0 Kudos

Hi Sandra,

I have done everything you have mentioned since there are other PO fields which are getting updated in similar way. Only This is not getting updated. May be i should more values or use some other Function Module??

Regards,

Anand R 

0 Kudos

Then maybe this field is calculated automatically because of the customizing... Otherwise, it could be a bug, post a message at SAP support.

JL23
Active Contributor
0 Kudos

Why not trying it manually in ME22N to see if it accepts a change and how a change affects the other fields, and of course you will see whether the fields are open for change

0 Kudos

Hi Sandra,

Whenever i change Shipping Condition, Other fields ( Route,Delivery Datee)  should get updated automatically.Which i hope you are aware. But none of them changes. Possibly something is missing in customizing or in the coding. I will check with Functional On that.

Regards,

Anand R

0 Kudos

Hi Jurgen,

I have tested in ME22N already. Any change in Shipping Condition affects other fields which gets automatically changes. But not sure if i can expect the same in Coding also. Need to check in debugging.

Jelena
Active Contributor
0 Kudos

But do you at least receive some message from BAPI? You've just mentioned "not updated", but what happens exactly?

0 Kudos

Hi Jelena,

I get Message like " PO Updated" along with some warning messages. But its not updating that field.

Regards,

Anand R

JL23
Active Contributor
0 Kudos

for sure you can do it better, you have exact messages from SAP with message numbers,. just copy and paste it if you want help. Are they secret Z and special for your environment only?

And if the message is updated and it is not updated then I would usually check in SM13, or even check if the commit is missing

0 Kudos

Hi Jurgen,

Here is the attachment with SAP messages. I have done whatever was told by Sandra and got this. Let me know if you want any other details.

JL23
Active Contributor
0 Kudos

The important information is in line 3 and 4.

If you do not have the fields marked with a X in the X-structures then they will not be changed.

Just try it yourself in MEMASSPO, enter a new value but do not select the header of the column, then you get the same success message but the value is not changed.

0 Kudos

But that warning message was coming for other fields too.But those fields were getting updated without any issue?

JL23
Active Contributor
0 Kudos

You can just try whether it makes a difference

Sandra_Rossi
Active Contributor
0 Kudos

I think (not sure) that message ME658 is produced when the number of lines in POITEM is greater than the number of lines of POITEMX. That's an abnormal situation. Could you check that in your program? Could you paste the contents of POITEM/POITEMS here?

Jelena
Active Contributor
0 Kudos

I also don't like that message ME658, something is definitely off, it should not be appearing. There is long text available for this message, make sure to read it. Double-check your code, make sure all the references between all the tables involved and the respective ...X tables are correct.

If you have done all that and still get no result then, as suggested (twice) above, open an incident with SAP. Include a code sample that works (for other field) and that doesn't (for the field in question), if there are no other differences then either it's a bug or "design" in BAPI.

0 Kudos

Hi All,

The issue is resolved. I was passing the data wrongly to Shipping Structures while there are structured related to AFS AFS_POITEM and AFS_POITEMX where same fields are available which changes the Route, Delivery Condition and Delivery date. I have asked the functional to test and confirm. Will close the thread if there are no further issues.

Thanks Sandra, Jurgen and others who helped nail down the issue.

Regards,

Anand R